3.3.11 \(\int \frac {\cos (x) (-3+2 \sin (x))}{2-3 \sin (x)+\sin ^2(x)} \, dx\) [211]

Optimal. Leaf size=11 \[ \log \left (2-3 \sin (x)+\sin ^2(x)\right ) \]

[Out]

ln(2-3*sin(x)+sin(x)^2)

________________________________________________________________________________________

Rubi [A]
time = 0.03, antiderivative size = 11, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.095, Rules used = {4419, 642} \begin {gather*} \log \left (\sin ^2(x)-3 \sin (x)+2\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

Log[2 - 3*Sin[x] + Sin[x]^2]

Rule 642

Int[((d_) + (e_.)*(x_))/((a_.) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> Simp[d*(Log[RemoveContent[a + b*x +
c*x^2, x]]/b), x] /; FreeQ[{a, b, c, d, e}, x] && EqQ[2*c*d - b*e, 0]

Rule 4419

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

Rubi steps

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

________________________________________________________________________________________

Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(26\) vs. \(2(11)=22\).
time = 0.06, size = 26, normalized size = 2.36 \begin {gather*} 2 \log \left (\cos \left (\frac {x}{2}\right )-\sin \left (\frac {x}{2}\right )\right )+\log (2-\sin (x)) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

2*Log[Cos[x/2] - Sin[x/2]] + Log[2 - Sin[x]]

________________________________________________________________________________________

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

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

ln(2-3*sin(x)+sin(x)^2)

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

log(sin(x)^2 - 3*sin(x) + 2)

________________________________________________________________________________________

Fricas [A]
time = 0.70, size = 15, normalized size = 1.36 \begin {gather*} \log \left (-\frac {1}{2} \, \sin \left (x\right ) + 1\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)*(-3+2*sin(x))/(2-3*sin(x)+sin(x)^2),x, algorithm="fricas")

[Out]

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

________________________________________________________________________________________

Sympy [A]
time = 0.07, size = 12, normalized size = 1.09 \begin {gather*} \log {\left (\sin {\left (x \right )} - 2 \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)*(-3+2*sin(x))/(2-3*sin(x)+sin(x)**2),x)

[Out]

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

________________________________________________________________________________________

Giac [A]
time = 0.45, size = 15, normalized size = 1.36 \begin {gather*} \log \left (-\sin \left (x\right ) + 2\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)*(-3+2*sin(x))/(2-3*sin(x)+sin(x)^2),x, algorithm="giac")

[Out]

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

________________________________________________________________________________________

Mupad [B]
time = 0.09, size = 11, normalized size = 1.00 \begin {gather*} \ln \left ({\sin \left (x\right )}^2-3\,\sin \left (x\right )+2\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

log(sin(x)^2 - 3*sin(x) + 2)

________________________________________________________________________________________