### 3.10 $$\int \frac{\sin (x)}{4-5 \cos (x)+\cos ^2(x)} \, dx$$

Optimal. Leaf size=23 $\frac{1}{3} \log (1-\cos (x))-\frac{1}{3} \log (4-\cos (x))$

[Out]

Log[1 - Cos[x]]/3 - Log[4 - Cos[x]]/3

________________________________________________________________________________________

Rubi [A]  time = 0.0275162, antiderivative size = 23, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 15, $$\frac{\text{number of rules}}{\text{integrand size}}$$ = 0.2, Rules used = {3259, 616, 31} $\frac{1}{3} \log (1-\cos (x))-\frac{1}{3} \log (4-\cos (x))$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

Log[1 - Cos[x]]/3 - Log[4 - Cos[x]]/3

Rule 3259

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

Rule 616

Int[((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(-1), x_Symbol] :> With[{q = Rt[b^2 - 4*a*c, 2]}, Dist[c/q, Int[1/Simp
[b/2 - q/2 + c*x, x], x], x] - Dist[c/q, Int[1/Simp[b/2 + q/2 + c*x, x], x], x]] /; FreeQ[{a, b, c}, x] && NeQ
[b^2 - 4*a*c, 0] && PosQ[b^2 - 4*a*c] && PerfectSquareQ[b^2 - 4*a*c]

Rule 31

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

Rubi steps

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

Mathematica [A]  time = 0.0136105, size = 29, normalized size = 1.26 $\frac{2}{3} \log \left (\sin \left (\frac{x}{2}\right )\right )-\frac{1}{3} \log \left (2 \sin ^2\left (\frac{x}{2}\right )+3\right )$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

(2*Log[Sin[x/2]])/3 - Log[3 + 2*Sin[x/2]^2]/3

________________________________________________________________________________________

Maple [A]  time = 0.028, size = 16, normalized size = 0.7 \begin{align*} -{\frac{\ln \left ( \cos \left ( x \right ) -4 \right ) }{3}}+{\frac{\ln \left ( \cos \left ( x \right ) -1 \right ) }{3}} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-1/3*ln(cos(x)-4)+1/3*ln(cos(x)-1)

________________________________________________________________________________________

Maxima [A]  time = 0.951829, size = 20, normalized size = 0.87 \begin{align*} \frac{1}{3} \, \log \left (\cos \left (x\right ) - 1\right ) - \frac{1}{3} \, \log \left (\cos \left (x\right ) - 4\right ) \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/3*log(cos(x) - 1) - 1/3*log(cos(x) - 4)

________________________________________________________________________________________

Fricas [A]  time = 1.2977, size = 69, normalized size = 3. \begin{align*} \frac{1}{3} \, \log \left (-\frac{1}{2} \, \cos \left (x\right ) + \frac{1}{2}\right ) - \frac{1}{3} \, \log \left (-\cos \left (x\right ) + 4\right ) \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(x)/(4-5*cos(x)+cos(x)^2),x, algorithm="fricas")

[Out]

1/3*log(-1/2*cos(x) + 1/2) - 1/3*log(-cos(x) + 4)

________________________________________________________________________________________

Sympy [A]  time = 0.3244, size = 15, normalized size = 0.65 \begin{align*} - \frac{\log{\left (\cos{\left (x \right )} - 4 \right )}}{3} + \frac{\log{\left (\cos{\left (x \right )} - 1 \right )}}{3} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(x)/(4-5*cos(x)+cos(x)**2),x)

[Out]

-log(cos(x) - 4)/3 + log(cos(x) - 1)/3

________________________________________________________________________________________

Giac [A]  time = 1.40409, size = 26, normalized size = 1.13 \begin{align*} -\frac{1}{3} \, \log \left (-\cos \left (x\right ) + 4\right ) + \frac{1}{3} \, \log \left (-\cos \left (x\right ) + 1\right ) \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(x)/(4-5*cos(x)+cos(x)^2),x, algorithm="giac")

[Out]

-1/3*log(-cos(x) + 4) + 1/3*log(-cos(x) + 1)