\(\int \sin ^2(x) \tan (x) \, dx\) [78]

   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 = 7, antiderivative size = 14 \[ \int \sin ^2(x) \tan (x) \, dx=\frac {\cos ^2(x)}{2}-\log (\cos (x)) \]

[Out]

1/2*cos(x)^2-ln(cos(x))

Rubi [A] (verified)

Time = 0.02 (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.286, Rules used = {2670, 14} \[ \int \sin ^2(x) \tan (x) \, dx=\frac {\cos ^2(x)}{2}-\log (\cos (x)) \]

[In]

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

[Out]

Cos[x]^2/2 - Log[Cos[x]]

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 2670

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]

Rubi steps \begin{align*} \text {integral}& = -\text {Subst}\left (\int \frac {1-x^2}{x} \, dx,x,\cos (x)\right ) \\ & = -\text {Subst}\left (\int \left (\frac {1}{x}-x\right ) \, dx,x,\cos (x)\right ) \\ & = \frac {\cos ^2(x)}{2}-\log (\cos (x)) \\ \end{align*}

Mathematica [A] (verified)

Time = 0.01 (sec) , antiderivative size = 14, normalized size of antiderivative = 1.00 \[ \int \sin ^2(x) \tan (x) \, dx=\frac {\cos ^2(x)}{2}-\log (\cos (x)) \]

[In]

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

[Out]

Cos[x]^2/2 - Log[Cos[x]]

Maple [A] (verified)

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

method result size
default \(-\frac {\left (\sin ^{2}\left (x \right )\right )}{2}-\ln \left (\cos \left (x \right )\right )\) \(13\)
risch \(i x +\frac {{\mathrm e}^{2 i x}}{8}+\frac {{\mathrm e}^{-2 i x}}{8}-\ln \left ({\mathrm e}^{2 i x}+1\right )\) \(30\)

[In]

int(cos(x)^2*tan(x)^3,x,method=_RETURNVERBOSE)

[Out]

-1/2*sin(x)^2-ln(cos(x))

Fricas [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 14, normalized size of antiderivative = 1.00 \[ \int \sin ^2(x) \tan (x) \, dx=\frac {1}{2} \, \cos \left (x\right )^{2} - \log \left (-\cos \left (x\right )\right ) \]

[In]

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

[Out]

1/2*cos(x)^2 - log(-cos(x))

Sympy [A] (verification not implemented)

Time = 0.04 (sec) , antiderivative size = 10, normalized size of antiderivative = 0.71 \[ \int \sin ^2(x) \tan (x) \, dx=- \log {\left (\cos {\left (x \right )} \right )} + \frac {\cos ^{2}{\left (x \right )}}{2} \]

[In]

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

[Out]

-log(cos(x)) + cos(x)**2/2

Maxima [A] (verification not implemented)

none

Time = 0.20 (sec) , antiderivative size = 16, normalized size of antiderivative = 1.14 \[ \int \sin ^2(x) \tan (x) \, dx=-\frac {1}{2} \, \sin \left (x\right )^{2} - \frac {1}{2} \, \log \left (\sin \left (x\right )^{2} - 1\right ) \]

[In]

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

[Out]

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

Giac [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 13, normalized size of antiderivative = 0.93 \[ \int \sin ^2(x) \tan (x) \, dx=\frac {1}{2} \, \cos \left (x\right )^{2} - \log \left ({\left | \cos \left (x\right ) \right |}\right ) \]

[In]

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

[Out]

1/2*cos(x)^2 - log(abs(cos(x)))

Mupad [B] (verification not implemented)

Time = 0.23 (sec) , antiderivative size = 16, normalized size of antiderivative = 1.14 \[ \int \sin ^2(x) \tan (x) \, dx=\frac {{\cos \left (x\right )}^2}{2}+\frac {\ln \left ({\mathrm {tan}\left (x\right )}^2+1\right )}{2} \]

[In]

int(cos(x)^2*tan(x)^3,x)

[Out]

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