3.155 \(\int \frac {x \sin (x)}{(a+b \cos (x))^2} \, dx\)

Optimal. Leaf size=59 \[ \frac {x}{b (a+b \cos (x))}-\frac {2 \tan ^{-1}\left (\frac {\sqrt {a-b} \tan \left (\frac {x}{2}\right )}{\sqrt {a+b}}\right )}{b \sqrt {a-b} \sqrt {a+b}} \]

[Out]

x/b/(a+b*cos(x))-2*arctan((a-b)^(1/2)*tan(1/2*x)/(a+b)^(1/2))/b/(a-b)^(1/2)/(a+b)^(1/2)

________________________________________________________________________________________

Rubi [A]  time = 0.06, antiderivative size = 59, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, integrand size = 12, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.250, Rules used = {4423, 2659, 205} \[ \frac {x}{b (a+b \cos (x))}-\frac {2 \tan ^{-1}\left (\frac {\sqrt {a-b} \tan \left (\frac {x}{2}\right )}{\sqrt {a+b}}\right )}{b \sqrt {a-b} \sqrt {a+b}} \]

Antiderivative was successfully verified.

[In]

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

[Out]

(-2*ArcTan[(Sqrt[a - b]*Tan[x/2])/Sqrt[a + b]])/(Sqrt[a - b]*b*Sqrt[a + b]) + x/(b*(a + b*Cos[x]))

Rule 205

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

Rule 2659

Int[((a_) + (b_.)*sin[Pi/2 + (c_.) + (d_.)*(x_)])^(-1), x_Symbol] :> With[{e = FreeFactors[Tan[(c + d*x)/2], x
]}, Dist[(2*e)/d, Subst[Int[1/(a + b + (a - b)*e^2*x^2), x], x, Tan[(c + d*x)/2]/e], x]] /; FreeQ[{a, b, c, d}
, x] && NeQ[a^2 - b^2, 0]

Rule 4423

Int[(Cos[(c_.) + (d_.)*(x_)]*(b_.) + (a_))^(n_.)*((e_.) + (f_.)*(x_))^(m_.)*Sin[(c_.) + (d_.)*(x_)], x_Symbol]
 :> -Simp[((e + f*x)^m*(a + b*Cos[c + d*x])^(n + 1))/(b*d*(n + 1)), x] + Dist[(f*m)/(b*d*(n + 1)), Int[(e + f*
x)^(m - 1)*(a + b*Cos[c + d*x])^(n + 1), x], x] /; FreeQ[{a, b, c, d, e, f, n}, x] && IGtQ[m, 0] && NeQ[n, -1]

Rubi steps

\begin {align*} \int \frac {x \sin (x)}{(a+b \cos (x))^2} \, dx &=\frac {x}{b (a+b \cos (x))}-\frac {\int \frac {1}{a+b \cos (x)} \, dx}{b}\\ &=\frac {x}{b (a+b \cos (x))}-\frac {2 \operatorname {Subst}\left (\int \frac {1}{a+b+(a-b) x^2} \, dx,x,\tan \left (\frac {x}{2}\right )\right )}{b}\\ &=-\frac {2 \tan ^{-1}\left (\frac {\sqrt {a-b} \tan \left (\frac {x}{2}\right )}{\sqrt {a+b}}\right )}{\sqrt {a-b} b \sqrt {a+b}}+\frac {x}{b (a+b \cos (x))}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.10, size = 58, normalized size = 0.98 \[ \frac {2 \tanh ^{-1}\left (\frac {(a-b) \tan \left (\frac {x}{2}\right )}{\sqrt {b^2-a^2}}\right )}{b \sqrt {b^2-a^2}}+\frac {x}{b (a+b \cos (x))} \]

Antiderivative was successfully verified.

[In]

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

[Out]

(2*ArcTanh[((a - b)*Tan[x/2])/Sqrt[-a^2 + b^2]])/(b*Sqrt[-a^2 + b^2]) + x/(b*(a + b*Cos[x]))

________________________________________________________________________________________

fricas [A]  time = 0.57, size = 227, normalized size = 3.85 \[ \left [-\frac {\sqrt {-a^{2} + b^{2}} {\left (b \cos \relax (x) + a\right )} \log \left (\frac {2 \, a b \cos \relax (x) + {\left (2 \, a^{2} - b^{2}\right )} \cos \relax (x)^{2} - 2 \, \sqrt {-a^{2} + b^{2}} {\left (a \cos \relax (x) + b\right )} \sin \relax (x) - a^{2} + 2 \, b^{2}}{b^{2} \cos \relax (x)^{2} + 2 \, a b \cos \relax (x) + a^{2}}\right ) - 2 \, {\left (a^{2} - b^{2}\right )} x}{2 \, {\left (a^{3} b - a b^{3} + {\left (a^{2} b^{2} - b^{4}\right )} \cos \relax (x)\right )}}, -\frac {\sqrt {a^{2} - b^{2}} {\left (b \cos \relax (x) + a\right )} \arctan \left (-\frac {a \cos \relax (x) + b}{\sqrt {a^{2} - b^{2}} \sin \relax (x)}\right ) - {\left (a^{2} - b^{2}\right )} x}{a^{3} b - a b^{3} + {\left (a^{2} b^{2} - b^{4}\right )} \cos \relax (x)}\right ] \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*sin(x)/(a+b*cos(x))^2,x, algorithm="fricas")

[Out]

[-1/2*(sqrt(-a^2 + b^2)*(b*cos(x) + a)*log((2*a*b*cos(x) + (2*a^2 - b^2)*cos(x)^2 - 2*sqrt(-a^2 + b^2)*(a*cos(
x) + b)*sin(x) - a^2 + 2*b^2)/(b^2*cos(x)^2 + 2*a*b*cos(x) + a^2)) - 2*(a^2 - b^2)*x)/(a^3*b - a*b^3 + (a^2*b^
2 - b^4)*cos(x)), -(sqrt(a^2 - b^2)*(b*cos(x) + a)*arctan(-(a*cos(x) + b)/(sqrt(a^2 - b^2)*sin(x))) - (a^2 - b
^2)*x)/(a^3*b - a*b^3 + (a^2*b^2 - b^4)*cos(x))]

________________________________________________________________________________________

giac [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {x \sin \relax (x)}{{\left (b \cos \relax (x) + a\right )}^{2}}\,{d x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*sin(x)/(a+b*cos(x))^2,x, algorithm="giac")

[Out]

integrate(x*sin(x)/(b*cos(x) + a)^2, x)

________________________________________________________________________________________

maple [C]  time = 0.26, size = 154, normalized size = 2.61 \[ \frac {2 x \,{\mathrm e}^{i x}}{b \left (b \,{\mathrm e}^{2 i x}+2 a \,{\mathrm e}^{i x}+b \right )}-\frac {i \ln \left ({\mathrm e}^{i x}+\frac {a \sqrt {a^{2}-b^{2}}+a^{2}-b^{2}}{\sqrt {a^{2}-b^{2}}\, b}\right )}{\sqrt {a^{2}-b^{2}}\, b}+\frac {i \ln \left ({\mathrm e}^{i x}+\frac {a \sqrt {a^{2}-b^{2}}-a^{2}+b^{2}}{\sqrt {a^{2}-b^{2}}\, b}\right )}{\sqrt {a^{2}-b^{2}}\, b} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x*sin(x)/(a+b*cos(x))^2,x)

[Out]

2*x*exp(I*x)/b/(b*exp(2*I*x)+2*a*exp(I*x)+b)-I/(a^2-b^2)^(1/2)/b*ln(exp(I*x)+(a*(a^2-b^2)^(1/2)+a^2-b^2)/(a^2-
b^2)^(1/2)/b)+I/(a^2-b^2)^(1/2)/b*ln(exp(I*x)+(a*(a^2-b^2)^(1/2)-a^2+b^2)/(a^2-b^2)^(1/2)/b)

________________________________________________________________________________________

maxima [F(-2)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: ValueError} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

Exception raised: ValueError >> Computation failed since Maxima requested additional constraints; using the 'a
ssume' command before evaluation *may* help (example of legal syntax is 'assume(4*a^2-4*b^2>0)', see `assume?`
 for more details)Is 4*a^2-4*b^2 positive or negative?

________________________________________________________________________________________

mupad [B]  time = 3.29, size = 132, normalized size = 2.24 \[ \frac {2\,x\,{\mathrm {e}}^{x\,1{}\mathrm {i}}}{b\,\left (2\,a\,{\mathrm {e}}^{x\,1{}\mathrm {i}}+2\,b\,{\mathrm {e}}^{x\,1{}\mathrm {i}}\,\cos \relax (x)\right )}+\frac {\ln \left (2\,{\mathrm {e}}^{x\,1{}\mathrm {i}}-\frac {\left (b+a\,{\mathrm {e}}^{x\,1{}\mathrm {i}}\right )\,2{}\mathrm {i}}{\sqrt {a+b}\,\sqrt {b-a}}\right )}{b\,\sqrt {a+b}\,\sqrt {b-a}}-\frac {\ln \left (2\,{\mathrm {e}}^{x\,1{}\mathrm {i}}+\frac {\left (b+a\,{\mathrm {e}}^{x\,1{}\mathrm {i}}\right )\,2{}\mathrm {i}}{\sqrt {a+b}\,\sqrt {b-a}}\right )}{b\,\sqrt {a+b}\,\sqrt {b-a}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((x*sin(x))/(a + b*cos(x))^2,x)

[Out]

(2*x*exp(x*1i))/(b*(2*a*exp(x*1i) + 2*b*exp(x*1i)*cos(x))) + log(2*exp(x*1i) - ((b + a*exp(x*1i))*2i)/((a + b)
^(1/2)*(b - a)^(1/2)))/(b*(a + b)^(1/2)*(b - a)^(1/2)) - log(2*exp(x*1i) + ((b + a*exp(x*1i))*2i)/((a + b)^(1/
2)*(b - a)^(1/2)))/(b*(a + b)^(1/2)*(b - a)^(1/2))

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {x \sin {\relax (x )}}{\left (a + b \cos {\relax (x )}\right )^{2}}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*sin(x)/(a+b*cos(x))**2,x)

[Out]

Integral(x*sin(x)/(a + b*cos(x))**2, x)

________________________________________________________________________________________