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

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

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.02, antiderivative size = 11, normalized size of antiderivative = 1.00, 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 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]

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]

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.01, size = 11, normalized size = 1.00 \[ \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]]

________________________________________________________________________________________

fricas [A]  time = 0.60, size = 13, normalized size = 1.18 \[ \log \left (\frac {1}{2} \, \sin \relax (x)\right ) - \log \left (\sin \relax (x) + 1\right ) \]

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)

________________________________________________________________________________________

giac [A]  time = 0.15, size = 12, normalized size = 1.09 \[ -\log \left (\sin \relax (x) + 1\right ) + \log \left ({\left | \sin \relax (x) \right |}\right ) \]

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

________________________________________________________________________________________

maple [A]  time = 0.08, size = 12, normalized size = 1.09 \[ \ln \left (\sin \relax (x )\right )-\ln \left (1+\sin \relax (x )\right ) \]

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.31, size = 11, normalized size = 1.00 \[ -\log \left (\sin \relax (x) + 1\right ) + \log \left (\sin \relax (x)\right ) \]

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

________________________________________________________________________________________

mupad [B]  time = 2.98, size = 9, normalized size = 0.82 \[ -2\,\mathrm {atanh}\left (2\,\sin \relax (x)+1\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-2*atanh(2*sin(x) + 1)

________________________________________________________________________________________

sympy [A]  time = 0.18, size = 10, normalized size = 0.91 \[ - \log {\left (\sin {\relax (x )} + 1 \right )} + \log {\left (\sin {\relax (x )} \right )} \]

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

________________________________________________________________________________________