3.82 \(\int \tan ^2(x) \, dx\)

Optimal. Leaf size=6 \[ \tan (x)-x \]

[Out]

-x + Tan[x]

________________________________________________________________________________________

Rubi [A]  time = 0.004091, antiderivative size = 6, normalized size of antiderivative = 1., number of steps used = 2, number of rules used = 2, integrand size = 4, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.5, Rules used = {3473, 8} \[ \tan (x)-x \]

Antiderivative was successfully verified.

[In]

Int[Tan[x]^2,x]

[Out]

-x + Tan[x]

Rule 3473

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]

Rule 8

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

Rubi steps

\begin{align*} \int \tan ^2(x) \, dx &=\tan (x)-\int 1 \, dx\\ &=-x+\tan (x)\\ \end{align*}

Mathematica [A]  time = 0.0020183, size = 6, normalized size = 1. \[ \tan (x)-x \]

Antiderivative was successfully verified.

[In]

Integrate[Tan[x]^2,x]

[Out]

-x + Tan[x]

________________________________________________________________________________________

Maple [A]  time = 0.002, size = 7, normalized size = 1.2 \begin{align*} -x+\tan \left ( x \right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(x)^2,x)

[Out]

-x+tan(x)

________________________________________________________________________________________

Maxima [A]  time = 1.40741, size = 8, normalized size = 1.33 \begin{align*} -x + \tan \left (x\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-x + tan(x)

________________________________________________________________________________________

Fricas [A]  time = 1.97729, size = 18, normalized size = 3. \begin{align*} -x + \tan \left (x\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-x + tan(x)

________________________________________________________________________________________

Sympy [B]  time = 0.061568, size = 7, normalized size = 1.17 \begin{align*} - x + \frac{\sin{\left (x \right )}}{\cos{\left (x \right )}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Giac [A]  time = 1.06425, size = 8, normalized size = 1.33 \begin{align*} -x + \tan \left (x\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-x + tan(x)