3.795 \(\int \sin (x) \tan ^2(x) \, dx\)

Optimal. Leaf size=5 \[ \cos (x)+\sec (x) \]

[Out]

Cos[x] + Sec[x]

________________________________________________________________________________________

Rubi [A]  time = 0.0162149, antiderivative size = 5, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 2, integrand size = 7, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.286, Rules used = {2590, 14} \[ \cos (x)+\sec (x) \]

Antiderivative was successfully verified.

[In]

Int[Sin[x]*Tan[x]^2,x]

[Out]

Cos[x] + Sec[x]

Rule 2590

Int[sin[(e_.) + (f_.)*(x_)]^(m_.)*tan[(e_.) + (f_.)*(x_)]^(n_.), x_Symbol] :> -Dist[f^(-1), Subst[Int[(1 - x^2
)^((m + n - 1)/2)/x^n, x], x, Cos[e + f*x]], x] /; FreeQ[{e, f}, x] && IntegersQ[m, n, (m + n - 1)/2]

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]]

Rubi steps

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

Mathematica [A]  time = 0.0106083, size = 5, normalized size = 1. \[ \cos (x)+\sec (x) \]

Antiderivative was successfully verified.

[In]

Integrate[Sin[x]*Tan[x]^2,x]

[Out]

Cos[x] + Sec[x]

________________________________________________________________________________________

Maple [B]  time = 0.008, size = 20, normalized size = 4. \begin{align*}{\frac{ \left ( \sin \left ( x \right ) \right ) ^{4}}{\cos \left ( x \right ) }}+ \left ( 2+ \left ( \sin \left ( x \right ) \right ) ^{2} \right ) \cos \left ( x \right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sin(x)*tan(x)^2,x)

[Out]

sin(x)^4/cos(x)+(2+sin(x)^2)*cos(x)

________________________________________________________________________________________

Maxima [A]  time = 0.95688, size = 9, normalized size = 1.8 \begin{align*} \frac{1}{\cos \left (x\right )} + \cos \left (x\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/cos(x) + cos(x)

________________________________________________________________________________________

Fricas [B]  time = 2.18105, size = 31, normalized size = 6.2 \begin{align*} \frac{\cos \left (x\right )^{2} + 1}{\cos \left (x\right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

(cos(x)^2 + 1)/cos(x)

________________________________________________________________________________________

Sympy [A]  time = 0.076895, size = 7, normalized size = 1.4 \begin{align*} \cos{\left (x \right )} + \frac{1}{\cos{\left (x \right )}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

cos(x) + 1/cos(x)

________________________________________________________________________________________

Giac [A]  time = 1.09293, size = 9, normalized size = 1.8 \begin{align*} \frac{1}{\cos \left (x\right )} + \cos \left (x\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/cos(x) + cos(x)