3.3.39 \(\int \frac {\cos (x)}{\sin (x)+\sin ^2(x)} \, dx\) [239]

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

[Out]

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

________________________________________________________________________________________

Rubi [A]
time = 0.01, 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 = {3339, 629} \begin {gather*} \log (\sin (x))-\log (\sin (x)+1) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

Rule 629

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 3339

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 &=\text {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 \begin {gather*} \log (\sin (x))-\log (1+\sin (x)) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

Mathics [A]
time = 1.80, size = 11, normalized size = 1.00 \begin {gather*} \text {Log}\left [\text {Sin}\left [x\right ]\right ]-\text {Log}\left [1+\text {Sin}\left [x\right ]\right ] \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [A]
time = 0.06, size = 12, normalized size = 1.09

method result size
derivativedivides \(\ln \left (\sin \left (x \right )\right )-\ln \left (\sin \left (x \right )+1\right )\) \(12\)
default \(\ln \left (\sin \left (x \right )\right )-\ln \left (\sin \left (x \right )+1\right )\) \(12\)
norman \(-2 \ln \left (1+\tan \left (\frac {x}{2}\right )\right )+\ln \left (\tan \left (\frac {x}{2}\right )\right )\) \(16\)
risch \(-2 \ln \left ({\mathrm e}^{i x}+i\right )+\ln \left ({\mathrm e}^{2 i x}-1\right )\) \(21\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(x)/(sin(x)+sin(x)^2),x,method=_RETURNVERBOSE)

[Out]

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

________________________________________________________________________________________

Maxima [A]
time = 0.26, size = 11, normalized size = 1.00 \begin {gather*} -\log \left (\sin \left (x\right ) + 1\right ) + \log \left (\sin \left (x\right )\right ) \end {gather*}

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 = 0.35, size = 13, normalized size = 1.18 \begin {gather*} \log \left (\frac {1}{2} \, \sin \left (x\right )\right ) - \log \left (\sin \left (x\right ) + 1\right ) \end {gather*}

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.08, size = 10, normalized size = 0.91 \begin {gather*} - \log {\left (\sin {\left (x \right )} + 1 \right )} + \log {\left (\sin {\left (x \right )} \right )} \end {gather*}

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 = 0.00, size = 11, normalized size = 1.00 \begin {gather*} \ln \left |\sin x\right |-\ln \left (\sin x+1\right ) \end {gather*}

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(abs(sin(x)))

________________________________________________________________________________________

Mupad [B]
time = 0.14, size = 9, normalized size = 0.82 \begin {gather*} -2\,\mathrm {atanh}\left (2\,\sin \left (x\right )+1\right ) \end {gather*}

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)

________________________________________________________________________________________