\(\int \sec ^4(x) \tan ^2(x) \, dx\) [31]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [B] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 9, antiderivative size = 17 \[ \int \sec ^4(x) \tan ^2(x) \, dx=\frac {\tan ^3(x)}{3}+\frac {\tan ^5(x)}{5} \]

[Out]

1/5*tan(x)^5+1/3*tan(x)^3

Rubi [A] (verified)

Time = 0.03 (sec) , antiderivative size = 17, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.222, Rules used = {2687, 14} \[ \int \sec ^4(x) \tan ^2(x) \, dx=\frac {\tan ^5(x)}{5}+\frac {\tan ^3(x)}{3} \]

[In]

Int[Sec[x]^4*Tan[x]^2,x]

[Out]

Tan[x]^3/3 + Tan[x]^5/5

Rule 14

Int[(u_)*((c_.)*(x_))^(m_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*u, x], x] /; FreeQ[{c, m}, x] && SumQ[u]
 &&  !LinearQ[u, x] &&  !MatchQ[u, (a_) + (b_.)*(v_) /; FreeQ[{a, b}, x] && InverseFunctionQ[v]]

Rule 2687

Int[sec[(e_.) + (f_.)*(x_)]^(m_)*((b_.)*tan[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Dist[1/f, Subst[Int[(b*x)
^n*(1 + x^2)^(m/2 - 1), x], x, Tan[e + f*x]], x] /; FreeQ[{b, e, f, n}, x] && IntegerQ[m/2] &&  !(IntegerQ[(n
- 1)/2] && LtQ[0, n, m - 1])

Rubi steps \begin{align*} \text {integral}& = \text {Subst}\left (\int x^2 \left (1+x^2\right ) \, dx,x,\tan (x)\right ) \\ & = \text {Subst}\left (\int \left (x^2+x^4\right ) \, dx,x,\tan (x)\right ) \\ & = \frac {\tan ^3(x)}{3}+\frac {\tan ^5(x)}{5} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.04 (sec) , antiderivative size = 27, normalized size of antiderivative = 1.59 \[ \int \sec ^4(x) \tan ^2(x) \, dx=-\frac {2 \tan (x)}{15}-\frac {1}{15} \sec ^2(x) \tan (x)+\frac {1}{5} \sec ^4(x) \tan (x) \]

[In]

Integrate[Sec[x]^4*Tan[x]^2,x]

[Out]

(-2*Tan[x])/15 - (Sec[x]^2*Tan[x])/15 + (Sec[x]^4*Tan[x])/5

Maple [A] (verified)

Time = 1.00 (sec) , antiderivative size = 14, normalized size of antiderivative = 0.82

method result size
derivativedivides \(\frac {\tan \left (x \right )^{5}}{5}+\frac {\tan \left (x \right )^{3}}{3}\) \(14\)
default \(\frac {\tan \left (x \right )^{5}}{5}+\frac {\tan \left (x \right )^{3}}{3}\) \(14\)
risch \(-\frac {4 i \left (15 \,{\mathrm e}^{6 i x}-5 \,{\mathrm e}^{4 i x}+5 \,{\mathrm e}^{2 i x}+1\right )}{15 \left ({\mathrm e}^{2 i x}+1\right )^{5}}\) \(36\)

[In]

int(sec(x)^4*tan(x)^2,x,method=_RETURNVERBOSE)

[Out]

1/5*tan(x)^5+1/3*tan(x)^3

Fricas [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 20, normalized size of antiderivative = 1.18 \[ \int \sec ^4(x) \tan ^2(x) \, dx=-\frac {{\left (2 \, \cos \left (x\right )^{4} + \cos \left (x\right )^{2} - 3\right )} \sin \left (x\right )}{15 \, \cos \left (x\right )^{5}} \]

[In]

integrate(sec(x)^4*tan(x)^2,x, algorithm="fricas")

[Out]

-1/15*(2*cos(x)^4 + cos(x)^2 - 3)*sin(x)/cos(x)^5

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 29 vs. \(2 (12) = 24\).

Time = 0.02 (sec) , antiderivative size = 29, normalized size of antiderivative = 1.71 \[ \int \sec ^4(x) \tan ^2(x) \, dx=- \frac {2 \sin {\left (x \right )}}{15 \cos {\left (x \right )}} - \frac {\sin {\left (x \right )}}{15 \cos ^{3}{\left (x \right )}} + \frac {\sin {\left (x \right )}}{5 \cos ^{5}{\left (x \right )}} \]

[In]

integrate(sec(x)**4*tan(x)**2,x)

[Out]

-2*sin(x)/(15*cos(x)) - sin(x)/(15*cos(x)**3) + sin(x)/(5*cos(x)**5)

Maxima [A] (verification not implemented)

none

Time = 0.19 (sec) , antiderivative size = 13, normalized size of antiderivative = 0.76 \[ \int \sec ^4(x) \tan ^2(x) \, dx=\frac {1}{5} \, \tan \left (x\right )^{5} + \frac {1}{3} \, \tan \left (x\right )^{3} \]

[In]

integrate(sec(x)^4*tan(x)^2,x, algorithm="maxima")

[Out]

1/5*tan(x)^5 + 1/3*tan(x)^3

Giac [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 13, normalized size of antiderivative = 0.76 \[ \int \sec ^4(x) \tan ^2(x) \, dx=\frac {1}{5} \, \tan \left (x\right )^{5} + \frac {1}{3} \, \tan \left (x\right )^{3} \]

[In]

integrate(sec(x)^4*tan(x)^2,x, algorithm="giac")

[Out]

1/5*tan(x)^5 + 1/3*tan(x)^3

Mupad [B] (verification not implemented)

Time = 14.96 (sec) , antiderivative size = 13, normalized size of antiderivative = 0.76 \[ \int \sec ^4(x) \tan ^2(x) \, dx=\frac {{\mathrm {tan}\left (x\right )}^5}{5}+\frac {{\mathrm {tan}\left (x\right )}^3}{3} \]

[In]

int(tan(x)^2/cos(x)^4,x)

[Out]

tan(x)^3/3 + tan(x)^5/5