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

Optimal. Leaf size=36 $\frac{2-\cos (x)}{18 \left (\cos ^2(x)-4 \cos (x)+13\right )}-\frac{1}{54} \tan ^{-1}\left (\frac{1}{3} (\cos (x)-2)\right )$

[Out]

-ArcTan[(-2 + Cos[x])/3]/54 + (2 - Cos[x])/(18*(13 - 4*Cos[x] + Cos[x]^2))

________________________________________________________________________________________

Rubi [A]  time = 0.033036, antiderivative size = 36, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 4, integrand size = 15, $$\frac{\text{number of rules}}{\text{integrand size}}$$ = 0.267, Rules used = {3259, 614, 618, 204} $\frac{2-\cos (x)}{18 \left (\cos ^2(x)-4 \cos (x)+13\right )}-\frac{1}{54} \tan ^{-1}\left (\frac{1}{3} (\cos (x)-2)\right )$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

-ArcTan[(-2 + Cos[x])/3]/54 + (2 - Cos[x])/(18*(13 - 4*Cos[x] + Cos[x]^2))

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 614

Int[((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> Simp[((b + 2*c*x)*(a + b*x + c*x^2)^(p + 1))/((p +
1)*(b^2 - 4*a*c)), x] - Dist[(2*c*(2*p + 3))/((p + 1)*(b^2 - 4*a*c)), Int[(a + b*x + c*x^2)^(p + 1), x], x] /;
FreeQ[{a, b, c}, x] && NeQ[b^2 - 4*a*c, 0] && LtQ[p, -1] && NeQ[p, -3/2] && IntegerQ[4*p]

Rule 618

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

Rule 204

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> -Simp[ArcTan[(Rt[-b, 2]*x)/Rt[-a, 2]]/(Rt[-a, 2]*Rt[-b, 2]), x] /
; FreeQ[{a, b}, x] && PosQ[a/b] && (LtQ[a, 0] || LtQ[b, 0])

Rubi steps

\begin{align*} \int \frac{\sin (x)}{\left (13-4 \cos (x)+\cos ^2(x)\right )^2} \, dx &=-\operatorname{Subst}\left (\int \frac{1}{\left (13-4 x+x^2\right )^2} \, dx,x,\cos (x)\right )\\ &=\frac{2-\cos (x)}{18 \left (13-4 \cos (x)+\cos ^2(x)\right )}-\frac{1}{18} \operatorname{Subst}\left (\int \frac{1}{13-4 x+x^2} \, dx,x,\cos (x)\right )\\ &=\frac{2-\cos (x)}{18 \left (13-4 \cos (x)+\cos ^2(x)\right )}+\frac{1}{9} \operatorname{Subst}\left (\int \frac{1}{-36-x^2} \, dx,x,-4+2 \cos (x)\right )\\ &=-\frac{1}{54} \tan ^{-1}\left (\frac{1}{3} (-2+\cos (x))\right )+\frac{2-\cos (x)}{18 \left (13-4 \cos (x)+\cos ^2(x)\right )}\\ \end{align*}

Mathematica [A]  time = 0.0734964, size = 34, normalized size = 0.94 $-\frac{\cos (x)-2}{18 \left (\cos ^2(x)-4 \cos (x)+13\right )}-\frac{1}{54} \tan ^{-1}\left (\frac{1}{3} (\cos (x)-2)\right )$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

-ArcTan[(-2 + Cos[x])/3]/54 - (-2 + Cos[x])/(18*(13 - 4*Cos[x] + Cos[x]^2))

________________________________________________________________________________________

Maple [A]  time = 0.025, size = 31, normalized size = 0.9 \begin{align*} -{\frac{2\,\cos \left ( x \right ) -4}{468-144\,\cos \left ( x \right ) +36\, \left ( \cos \left ( x \right ) \right ) ^{2}}}-{\frac{1}{54}\arctan \left ( -{\frac{2}{3}}+{\frac{\cos \left ( x \right ) }{3}} \right ) } \end{align*}

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

[In]

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

[Out]

-1/36*(2*cos(x)-4)/(13-4*cos(x)+cos(x)^2)-1/54*arctan(-2/3+1/3*cos(x))

________________________________________________________________________________________

Maxima [A]  time = 1.44273, size = 38, normalized size = 1.06 \begin{align*} -\frac{\cos \left (x\right ) - 2}{18 \,{\left (\cos \left (x\right )^{2} - 4 \, \cos \left (x\right ) + 13\right )}} - \frac{1}{54} \, \arctan \left (\frac{1}{3} \, \cos \left (x\right ) - \frac{2}{3}\right ) \end{align*}

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

[In]

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

[Out]

-1/18*(cos(x) - 2)/(cos(x)^2 - 4*cos(x) + 13) - 1/54*arctan(1/3*cos(x) - 2/3)

________________________________________________________________________________________

Fricas [A]  time = 1.40479, size = 139, normalized size = 3.86 \begin{align*} -\frac{{\left (\cos \left (x\right )^{2} - 4 \, \cos \left (x\right ) + 13\right )} \arctan \left (\frac{1}{3} \, \cos \left (x\right ) - \frac{2}{3}\right ) + 3 \, \cos \left (x\right ) - 6}{54 \,{\left (\cos \left (x\right )^{2} - 4 \, \cos \left (x\right ) + 13\right )}} \end{align*}

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

[In]

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

[Out]

-1/54*((cos(x)^2 - 4*cos(x) + 13)*arctan(1/3*cos(x) - 2/3) + 3*cos(x) - 6)/(cos(x)^2 - 4*cos(x) + 13)

________________________________________________________________________________________

Sympy [B]  time = 1.9846, size = 119, normalized size = 3.31 \begin{align*} - \frac{4 \cos ^{2}{\left (x \right )} \operatorname{atan}{\left (\frac{\cos{\left (x \right )}}{3} - \frac{2}{3} \right )}}{216 \cos ^{2}{\left (x \right )} - 864 \cos{\left (x \right )} + 2808} - \frac{3 \cos ^{2}{\left (x \right )}}{216 \cos ^{2}{\left (x \right )} - 864 \cos{\left (x \right )} + 2808} + \frac{16 \cos{\left (x \right )} \operatorname{atan}{\left (\frac{\cos{\left (x \right )}}{3} - \frac{2}{3} \right )}}{216 \cos ^{2}{\left (x \right )} - 864 \cos{\left (x \right )} + 2808} - \frac{52 \operatorname{atan}{\left (\frac{\cos{\left (x \right )}}{3} - \frac{2}{3} \right )}}{216 \cos ^{2}{\left (x \right )} - 864 \cos{\left (x \right )} + 2808} - \frac{15}{216 \cos ^{2}{\left (x \right )} - 864 \cos{\left (x \right )} + 2808} \end{align*}

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

[In]

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

[Out]

-4*cos(x)**2*atan(cos(x)/3 - 2/3)/(216*cos(x)**2 - 864*cos(x) + 2808) - 3*cos(x)**2/(216*cos(x)**2 - 864*cos(x
) + 2808) + 16*cos(x)*atan(cos(x)/3 - 2/3)/(216*cos(x)**2 - 864*cos(x) + 2808) - 52*atan(cos(x)/3 - 2/3)/(216*
cos(x)**2 - 864*cos(x) + 2808) - 15/(216*cos(x)**2 - 864*cos(x) + 2808)

________________________________________________________________________________________

Giac [A]  time = 1.47588, size = 38, normalized size = 1.06 \begin{align*} -\frac{\cos \left (x\right ) - 2}{18 \,{\left (\cos \left (x\right )^{2} - 4 \, \cos \left (x\right ) + 13\right )}} - \frac{1}{54} \, \arctan \left (\frac{1}{3} \, \cos \left (x\right ) - \frac{2}{3}\right ) \end{align*}

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

[In]

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

[Out]

-1/18*(cos(x) - 2)/(cos(x)^2 - 4*cos(x) + 13) - 1/54*arctan(1/3*cos(x) - 2/3)