3.239 \(\int \frac{\cos (x)}{\sin (x)+\sin ^2(x)} \, dx\)

Optimal. Leaf size=11 \[ \log (\sin (x))-\log (\sin (x)+1) \]

[Out]

Log[Sin[x]] - Log[1 + Sin[x]]

________________________________________________________________________________________

Rubi [A]  time = 0.0208168, antiderivative size = 11, normalized size of antiderivative = 1., number of steps used = 2, number of rules used = 2, integrand size = 12, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.167, Rules used = {3258, 615} \[ \log (\sin (x))-\log (\sin (x)+1) \]

Antiderivative was successfully verified.

[In]

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

[Out]

Log[Sin[x]] - Log[1 + Sin[x]]

Rule 3258

Int[cos[(d_.) + (e_.)*(x_)]^(m_.)*((a_.) + (b_.)*((f_.)*sin[(d_.) + (e_.)*(x_)])^(n_.) + (c_.)*((f_.)*sin[(d_.
) + (e_.)*(x_)])^(n2_.))^(p_.), x_Symbol] :> Module[{g = FreeFactors[Sin[d + e*x], x]}, Dist[g/e, Subst[Int[(1
 - g^2*x^2)^((m - 1)/2)*(a + b*(f*g*x)^n + c*(f*g*x)^(2*n))^p, x], x, Sin[d + e*x]/g], x]] /; FreeQ[{a, b, c,
d, e, f, n, p}, x] && EqQ[n2, 2*n] && IntegerQ[(m - 1)/2]

Rule 615

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

Rubi steps

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

Mathematica [A]  time = 0.0072482, size = 11, normalized size = 1. \[ \log (\sin (x))-\log (\sin (x)+1) \]

Antiderivative was successfully verified.

[In]

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

[Out]

Log[Sin[x]] - Log[1 + Sin[x]]

________________________________________________________________________________________

Maple [A]  time = 0.031, size = 12, normalized size = 1.1 \begin{align*} \ln \left ( \sin \left ( x \right ) \right ) -\ln \left ( 1+\sin \left ( x \right ) \right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(x)/(sin(x)+sin(x)^2),x)

[Out]

ln(sin(x))-ln(1+sin(x))

________________________________________________________________________________________

Maxima [A]  time = 0.938084, size = 15, normalized size = 1.36 \begin{align*} -\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)^2),x, algorithm="maxima")

[Out]

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

________________________________________________________________________________________

Fricas [A]  time = 2.33544, size = 47, normalized size = 4.27 \begin{align*} \log \left (\frac{1}{2} \, \sin \left (x\right )\right ) - \log \left (\sin \left (x\right ) + 1\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Sympy [A]  time = 0.195589, size = 10, normalized size = 0.91 \begin{align*} - \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)**2),x)

[Out]

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

________________________________________________________________________________________

Giac [A]  time = 1.05639, size = 16, normalized size = 1.45 \begin{align*} -\log \left (\sin \left (x\right ) + 1\right ) + \log \left ({\left | \sin \left (x\right ) \right |}\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-log(sin(x) + 1) + log(abs(sin(x)))