3.836 \(\int \frac{\cos (x)}{-\sin (x)+\sin ^3(x)} \, dx\)

Optimal. Leaf size=9 \[ \log (\cos (x))-\log (\sin (x)) \]

[Out]

Log[Cos[x]] - Log[Sin[x]]

________________________________________________________________________________________

Rubi [A]  time = 0.028245, antiderivative size = 9, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 5, integrand size = 14, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.357, Rules used = {4334, 266, 36, 31, 29} \[ \log (\cos (x))-\log (\sin (x)) \]

Antiderivative was successfully verified.

[In]

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

[Out]

Log[Cos[x]] - Log[Sin[x]]

Rule 4334

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

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 36

Int[1/(((a_.) + (b_.)*(x_))*((c_.) + (d_.)*(x_))), x_Symbol] :> Dist[b/(b*c - a*d), Int[1/(a + b*x), x], x] -
Dist[d/(b*c - a*d), Int[1/(c + d*x), x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0]

Rule 31

Int[((a_) + (b_.)*(x_))^(-1), x_Symbol] :> Simp[Log[RemoveContent[a + b*x, x]]/b, x] /; FreeQ[{a, b}, x]

Rule 29

Int[(x_)^(-1), x_Symbol] :> Simp[Log[x], x]

Rubi steps

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

Mathematica [A]  time = 0.0049069, size = 9, normalized size = 1. \[ \log (\cos (x))-\log (\sin (x)) \]

Antiderivative was successfully verified.

[In]

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

[Out]

Log[Cos[x]] - Log[Sin[x]]

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-ln(sin(x))+1/2*ln(1+sin(x))+1/2*ln(sin(x)-1)

________________________________________________________________________________________

Maxima [B]  time = 0.969199, size = 27, normalized size = 3. \begin{align*} \frac{1}{2} \, \log \left (\sin \left (x\right ) + 1\right ) + \frac{1}{2} \, \log \left (\sin \left (x\right ) - 1\right ) - \log \left (\sin \left (x\right )\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Sympy [B]  time = 0.360291, size = 20, normalized size = 2.22 \begin{align*} \frac{\log{\left (\sin{\left (x \right )} - 1 \right )}}{2} + \frac{\log{\left (\sin{\left (x \right )} + 1 \right )}}{2} - \log{\left (\sin{\left (x \right )} \right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

log(sin(x) - 1)/2 + log(sin(x) + 1)/2 - log(sin(x))

________________________________________________________________________________________

Giac [B]  time = 1.09292, size = 26, normalized size = 2.89 \begin{align*} -\frac{1}{2} \, \log \left (\sin \left (x\right )^{2}\right ) + \frac{1}{2} \, \log \left (-\sin \left (x\right )^{2} + 1\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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