3.888 \(\int \frac{\sin (x)}{\cos ^3(x)-\cos ^5(x)} \, dx\)

Optimal. Leaf size=12 \[ \frac{\tan ^2(x)}{2}+\log (\tan (x)) \]

[Out]

Log[Tan[x]] + Tan[x]^2/2

________________________________________________________________________________________

Rubi [A]  time = 0.0390701, antiderivative size = 17, normalized size of antiderivative = 1.42, number of steps used = 4, number of rules used = 3, integrand size = 16, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.188, Rules used = {4335, 266, 44} \[ \frac{\sec ^2(x)}{2}+\log (\sin (x))-\log (\cos (x)) \]

Antiderivative was successfully verified.

[In]

Int[Sin[x]/(Cos[x]^3 - Cos[x]^5),x]

[Out]

-Log[Cos[x]] + Log[Sin[x]] + Sec[x]^2/2

Rule 4335

Int[(u_)*(F_)[(c_.)*((a_.) + (b_.)*(x_))], x_Symbol] :> With[{d = FreeFactors[Cos[c*(a + b*x)], x]}, -Dist[d/(
b*c), Subst[Int[SubstFor[1, Cos[c*(a + b*x)]/d, u, x], x], x, Cos[c*(a + b*x)]/d], x] /; FunctionOfQ[Cos[c*(a
+ b*x)]/d, u, x, True]] /; FreeQ[{a, b, c}, x] && (EqQ[F, Sin] || EqQ[F, sin])

Rule 266

Int[(x_)^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Dist[1/n, Subst[Int[x^(Simplify[(m + 1)/n] - 1)*(a
+ b*x)^p, x], x, x^n], x] /; FreeQ[{a, b, m, n, p}, x] && IntegerQ[Simplify[(m + 1)/n]]

Rule 44

Int[((a_) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d*
x)^n, x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0] && ILtQ[m, 0] && IntegerQ[n] &&  !(IGtQ[n, 0] && L
tQ[m + n + 2, 0])

Rubi steps

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

Mathematica [A]  time = 0.0150483, size = 17, normalized size = 1.42 \[ \frac{\sec ^2(x)}{2}+\log (\sin (x))-\log (\cos (x)) \]

Antiderivative was successfully verified.

[In]

Integrate[Sin[x]/(Cos[x]^3 - Cos[x]^5),x]

[Out]

-Log[Cos[x]] + Log[Sin[x]] + Sec[x]^2/2

________________________________________________________________________________________

Maple [B]  time = 0.024, size = 27, normalized size = 2.3 \begin{align*}{\frac{1}{2\, \left ( \cos \left ( x \right ) \right ) ^{2}}}-\ln \left ( \cos \left ( x \right ) \right ) +{\frac{\ln \left ( 1+\cos \left ( x \right ) \right ) }{2}}+{\frac{\ln \left ( -1+\cos \left ( x \right ) \right ) }{2}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sin(x)/(cos(x)^3-cos(x)^5),x)

[Out]

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

________________________________________________________________________________________

Maxima [B]  time = 0.950405, size = 35, normalized size = 2.92 \begin{align*} \frac{1}{2 \, \cos \left (x\right )^{2}} + \frac{1}{2} \, \log \left (\cos \left (x\right ) + 1\right ) + \frac{1}{2} \, \log \left (\cos \left (x\right ) - 1\right ) - \log \left (\cos \left (x\right )\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(x)/(cos(x)^3-cos(x)^5),x, algorithm="maxima")

[Out]

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

________________________________________________________________________________________

Fricas [B]  time = 2.31086, size = 108, normalized size = 9. \begin{align*} -\frac{\cos \left (x\right )^{2} \log \left (\cos \left (x\right )^{2}\right ) - \cos \left (x\right )^{2} \log \left (-\frac{1}{4} \, \cos \left (x\right )^{2} + \frac{1}{4}\right ) - 1}{2 \, \cos \left (x\right )^{2}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(x)/(cos(x)^3-cos(x)^5),x, algorithm="fricas")

[Out]

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

________________________________________________________________________________________

Sympy [B]  time = 1.64249, size = 29, normalized size = 2.42 \begin{align*} \frac{\log{\left (\cos{\left (x \right )} - 1 \right )}}{2} + \frac{\log{\left (\cos{\left (x \right )} + 1 \right )}}{2} - \log{\left (\cos{\left (x \right )} \right )} + \frac{1}{2 \cos ^{2}{\left (x \right )}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(x)/(cos(x)**3-cos(x)**5),x)

[Out]

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

________________________________________________________________________________________

Giac [B]  time = 1.0692, size = 42, normalized size = 3.5 \begin{align*} \frac{\cos \left (x\right )^{2} + 1}{2 \, \cos \left (x\right )^{2}} - \frac{1}{2} \, \log \left (\cos \left (x\right )^{2}\right ) + \frac{1}{2} \, \log \left (-\cos \left (x\right )^{2} + 1\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(x)/(cos(x)^3-cos(x)^5),x, algorithm="giac")

[Out]

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