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

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

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.047502, antiderivative size = 11, normalized size of antiderivative = 1., 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 = {4334, 628} \[ \log \left (\sin ^2(x)-3 \sin (x)+2\right ) \]

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

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]

Rubi steps

\begin{align*} \int \frac{\cos (x) (-3+2 \sin (x))}{2-3 \sin (x)+\sin ^2(x)} \, dx &=\operatorname{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]  time = 0.08709, size = 26, normalized size = 2.36 \[ \log (2-\sin (x))+2 \log \left (\cos \left (\frac{x}{2}\right )-\sin \left (\frac{x}{2}\right )\right ) \]

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.026, size = 12, normalized size = 1.1 \begin{align*} \ln \left ( 2-3\,\sin \left ( x \right ) + \left ( \sin \left ( x \right ) \right ) ^{2} \right ) \end{align*}

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)

[Out]

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

________________________________________________________________________________________

Maxima [A]  time = 0.93726, size = 15, normalized size = 1.36 \begin{align*} \log \left (\sin \left (x\right )^{2} - 3 \, \sin \left (x\right ) + 2\right ) \end{align*}

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 = 2.11957, size = 55, normalized size = 5. \begin{align*} \log \left (-\frac{1}{2} \, \sin \left (x\right ) + 1\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)*(-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.215164, size = 12, normalized size = 1.09 \begin{align*} \log{\left (\sin{\left (x \right )} - 2 \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)*(-3+2*sin(x))/(2-3*sin(x)+sin(x)**2),x)

[Out]

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

________________________________________________________________________________________

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

[Out]

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