\(\int \tan ^4(x) \, dx\) [43]

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

Optimal result

Integrand size = 4, antiderivative size = 14 \[ \int \tan ^4(x) \, dx=x-\tan (x)+\frac {\tan ^3(x)}{3} \]

[Out]

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

Rubi [A] (verified)

Time = 0.01 (sec) , antiderivative size = 14, 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.500, Rules used = {3554, 8} \[ \int \tan ^4(x) \, dx=x+\frac {\tan ^3(x)}{3}-\tan (x) \]

[In]

Int[Tan[x]^4,x]

[Out]

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

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 3554

Int[((b_.)*tan[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[b*((b*Tan[c + d*x])^(n - 1)/(d*(n - 1))), x] - Dis
t[b^2, Int[(b*Tan[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1]

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

Mathematica [A] (verified)

Time = 0.00 (sec) , antiderivative size = 16, normalized size of antiderivative = 1.14 \[ \int \tan ^4(x) \, dx=\arctan (\tan (x))-\tan (x)+\frac {\tan ^3(x)}{3} \]

[In]

Integrate[Tan[x]^4,x]

[Out]

ArcTan[Tan[x]] - Tan[x] + Tan[x]^3/3

Maple [A] (verified)

Time = 0.02 (sec) , antiderivative size = 13, normalized size of antiderivative = 0.93

method result size
norman \(x -\tan \left (x \right )+\frac {\left (\tan ^{3}\left (x \right )\right )}{3}\) \(13\)
parallelrisch \(x -\tan \left (x \right )+\frac {\left (\tan ^{3}\left (x \right )\right )}{3}\) \(13\)
derivativedivides \(\frac {\left (\tan ^{3}\left (x \right )\right )}{3}-\tan \left (x \right )+\arctan \left (\tan \left (x \right )\right )\) \(15\)
default \(\frac {\left (\tan ^{3}\left (x \right )\right )}{3}-\tan \left (x \right )+\arctan \left (\tan \left (x \right )\right )\) \(15\)
risch \(x -\frac {4 i \left (3 \,{\mathrm e}^{4 i x}+3 \,{\mathrm e}^{2 i x}+2\right )}{3 \left ({\mathrm e}^{2 i x}+1\right )^{3}}\) \(31\)

[In]

int(tan(x)^4,x,method=_RETURNVERBOSE)

[Out]

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

Fricas [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 12, normalized size of antiderivative = 0.86 \[ \int \tan ^4(x) \, dx=\frac {1}{3} \, \tan \left (x\right )^{3} + x - \tan \left (x\right ) \]

[In]

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

[Out]

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

Sympy [A] (verification not implemented)

Time = 0.03 (sec) , antiderivative size = 19, normalized size of antiderivative = 1.36 \[ \int \tan ^4(x) \, dx=x + \frac {\sin ^{3}{\left (x \right )}}{3 \cos ^{3}{\left (x \right )}} - \frac {\sin {\left (x \right )}}{\cos {\left (x \right )}} \]

[In]

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

[Out]

x + sin(x)**3/(3*cos(x)**3) - sin(x)/cos(x)

Maxima [A] (verification not implemented)

none

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

[In]

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

[Out]

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

Giac [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 12, normalized size of antiderivative = 0.86 \[ \int \tan ^4(x) \, dx=\frac {1}{3} \, \tan \left (x\right )^{3} + x - \tan \left (x\right ) \]

[In]

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

[Out]

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

Mupad [B] (verification not implemented)

Time = 0.03 (sec) , antiderivative size = 12, normalized size of antiderivative = 0.86 \[ \int \tan ^4(x) \, dx=\frac {{\mathrm {tan}\left (x\right )}^3}{3}-\mathrm {tan}\left (x\right )+x \]

[In]

int(tan(x)^4,x)

[Out]

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