3.275 \(\int (\sec (x)+\tan (x))^3 \, dx\)

Optimal. Leaf size=18 \[ \frac{2}{1-\sin (x)}+\log (1-\sin (x)) \]

[Out]

Log[1 - Sin[x]] + 2/(1 - Sin[x])

________________________________________________________________________________________

Rubi [A]  time = 0.0438103, antiderivative size = 18, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 7, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.429, Rules used = {4391, 2667, 43} \[ \frac{2}{1-\sin (x)}+\log (1-\sin (x)) \]

Antiderivative was successfully verified.

[In]

Int[(Sec[x] + Tan[x])^3,x]

[Out]

Log[1 - Sin[x]] + 2/(1 - Sin[x])

Rule 4391

Int[(u_.)*((b_.)*sec[(c_.) + (d_.)*(x_)]^(n_.) + (a_.)*tan[(c_.) + (d_.)*(x_)]^(n_.))^(p_), x_Symbol] :> Int[A
ctivateTrig[u]*Sec[c + d*x]^(n*p)*(b + a*Sin[c + d*x]^n)^p, x] /; FreeQ[{a, b, c, d}, x] && IntegersQ[n, p]

Rule 2667

Int[cos[(e_.) + (f_.)*(x_)]^(p_.)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.), x_Symbol] :> Dist[1/(b^p*f), S
ubst[Int[(a + x)^(m + (p - 1)/2)*(a - x)^((p - 1)/2), x], x, b*Sin[e + f*x]], x] /; FreeQ[{a, b, e, f, m}, x]
&& IntegerQ[(p - 1)/2] && EqQ[a^2 - b^2, 0] && (GeQ[p, -1] ||  !IntegerQ[m + 1/2])

Rule 43

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d
*x)^n, x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[m, 0] && ( !IntegerQ[n] || (EqQ[c, 0]
&& LeQ[7*m + 4*n + 4, 0]) || LtQ[9*m + 5*(n + 1), 0] || GtQ[m + n + 2, 0])

Rubi steps

\begin{align*} \int (\sec (x)+\tan (x))^3 \, dx &=\int \sec ^3(x) (1+\sin (x))^3 \, dx\\ &=\operatorname{Subst}\left (\int \frac{1+x}{(1-x)^2} \, dx,x,\sin (x)\right )\\ &=\operatorname{Subst}\left (\int \left (\frac{2}{(-1+x)^2}+\frac{1}{-1+x}\right ) \, dx,x,\sin (x)\right )\\ &=\log (1-\sin (x))+\frac{2}{1-\sin (x)}\\ \end{align*}

Mathematica [A]  time = 0.0259234, size = 31, normalized size = 1.72 \[ \frac{\tan ^2(x)}{2}+\frac{3 \sec ^2(x)}{2}-\tanh ^{-1}(\sin (x))+\log (\cos (x))+2 \tan (x) \sec (x) \]

Antiderivative was successfully verified.

[In]

Integrate[(Sec[x] + Tan[x])^3,x]

[Out]

-ArcTanh[Sin[x]] + Log[Cos[x]] + (3*Sec[x]^2)/2 + 2*Sec[x]*Tan[x] + Tan[x]^2/2

________________________________________________________________________________________

Maple [B]  time = 0.051, size = 45, normalized size = 2.5 \begin{align*}{\frac{\sec \left ( x \right ) \tan \left ( x \right ) }{2}}-\ln \left ( \sec \left ( x \right ) +\tan \left ( x \right ) \right ) +{\frac{3}{2\, \left ( \cos \left ( x \right ) \right ) ^{2}}}+{\frac{3\, \left ( \sin \left ( x \right ) \right ) ^{3}}{2\, \left ( \cos \left ( x \right ) \right ) ^{2}}}+{\frac{3\,\sin \left ( x \right ) }{2}}+{\frac{ \left ( \tan \left ( x \right ) \right ) ^{2}}{2}}+\ln \left ( \cos \left ( x \right ) \right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((sec(x)+tan(x))^3,x)

[Out]

1/2*sec(x)*tan(x)-ln(sec(x)+tan(x))+3/2/cos(x)^2+3/2*sin(x)^3/cos(x)^2+3/2*sin(x)+1/2*tan(x)^2+ln(cos(x))

________________________________________________________________________________________

Maxima [B]  time = 0.982467, size = 70, normalized size = 3.89 \begin{align*} \frac{3}{2} \, \tan \left (x\right )^{2} - \frac{2 \, \sin \left (x\right )}{\sin \left (x\right )^{2} - 1} - \frac{1}{2 \,{\left (\sin \left (x\right )^{2} - 1\right )}} + \frac{1}{2} \, \log \left (\sin \left (x\right )^{2} - 1\right ) - \frac{1}{2} \, \log \left (\sin \left (x\right ) + 1\right ) + \frac{1}{2} \, \log \left (\sin \left (x\right ) - 1\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((sec(x)+tan(x))^3,x, algorithm="maxima")

[Out]

3/2*tan(x)^2 - 2*sin(x)/(sin(x)^2 - 1) - 1/2/(sin(x)^2 - 1) + 1/2*log(sin(x)^2 - 1) - 1/2*log(sin(x) + 1) + 1/
2*log(sin(x) - 1)

________________________________________________________________________________________

Fricas [A]  time = 2.03005, size = 68, normalized size = 3.78 \begin{align*} \frac{{\left (\sin \left (x\right ) - 1\right )} \log \left (-\sin \left (x\right ) + 1\right ) - 2}{\sin \left (x\right ) - 1} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((sec(x)+tan(x))^3,x, algorithm="fricas")

[Out]

((sin(x) - 1)*log(-sin(x) + 1) - 2)/(sin(x) - 1)

________________________________________________________________________________________

Sympy [B]  time = 5.04155, size = 44, normalized size = 2.44 \begin{align*} \frac{\log{\left (\sin{\left (x \right )} - 1 \right )}}{2} - \frac{\log{\left (\sin{\left (x \right )} + 1 \right )}}{2} - \frac{\log{\left (\sec ^{2}{\left (x \right )} \right )}}{2} + 2 \sec ^{2}{\left (x \right )} - \frac{4 \sin{\left (x \right )}}{2 \sin ^{2}{\left (x \right )} - 2} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((sec(x)+tan(x))**3,x)

[Out]

log(sin(x) - 1)/2 - log(sin(x) + 1)/2 - log(sec(x)**2)/2 + 2*sec(x)**2 - 4*sin(x)/(2*sin(x)**2 - 2)

________________________________________________________________________________________

Giac [B]  time = 1.18844, size = 65, normalized size = 3.61 \begin{align*} -\frac{3 \, \tan \left (\frac{1}{2} \, x\right )^{2} - 10 \, \tan \left (\frac{1}{2} \, x\right ) + 3}{{\left (\tan \left (\frac{1}{2} \, x\right ) - 1\right )}^{2}} - \log \left (\tan \left (\frac{1}{2} \, x\right )^{2} + 1\right ) + 2 \, \log \left ({\left | \tan \left (\frac{1}{2} \, x\right ) - 1 \right |}\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((sec(x)+tan(x))^3,x, algorithm="giac")

[Out]

-(3*tan(1/2*x)^2 - 10*tan(1/2*x) + 3)/(tan(1/2*x) - 1)^2 - log(tan(1/2*x)^2 + 1) + 2*log(abs(tan(1/2*x) - 1))