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

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

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.08, antiderivative size = 58, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, integrand size = 12, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.333, Rules used = {4422, 2660, 618, 204} \[ \frac {2 \tan ^{-1}\left (\frac {a \tan \left (\frac {x}{2}\right )+b}{\sqrt {a^2-b^2}}\right )}{b \sqrt {a^2-b^2}}-\frac {x}{b (a+b \sin (x))} \]

Antiderivative was successfully verified.

[In]

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

[Out]

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

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

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 2660

Int[((a_) + (b_.)*sin[(c_.) + (d_.)*(x_)])^(-1), x_Symbol] :> With[{e = FreeFactors[Tan[(c + d*x)/2], x]}, Dis
t[(2*e)/d, Subst[Int[1/(a + 2*b*e*x + a*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 4422

Int[Cos[(c_.) + (d_.)*(x_)]*((e_.) + (f_.)*(x_))^(m_.)*((a_) + (b_.)*Sin[(c_.) + (d_.)*(x_)])^(n_.), x_Symbol]
 :> Simp[((e + f*x)^m*(a + b*Sin[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*Sin[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 \cos (x)}{(a+b \sin (x))^2} \, dx &=-\frac {x}{b (a+b \sin (x))}+\frac {\int \frac {1}{a+b \sin (x)} \, dx}{b}\\ &=-\frac {x}{b (a+b \sin (x))}+\frac {2 \operatorname {Subst}\left (\int \frac {1}{a+2 b x+a x^2} \, dx,x,\tan \left (\frac {x}{2}\right )\right )}{b}\\ &=-\frac {x}{b (a+b \sin (x))}-\frac {4 \operatorname {Subst}\left (\int \frac {1}{-4 \left (a^2-b^2\right )-x^2} \, dx,x,2 b+2 a \tan \left (\frac {x}{2}\right )\right )}{b}\\ &=\frac {2 \tan ^{-1}\left (\frac {b+a \tan \left (\frac {x}{2}\right )}{\sqrt {a^2-b^2}}\right )}{b \sqrt {a^2-b^2}}-\frac {x}{b (a+b \sin (x))}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.14, size = 56, normalized size = 0.97 \[ \frac {\frac {2 \tan ^{-1}\left (\frac {a \tan \left (\frac {x}{2}\right )+b}{\sqrt {a^2-b^2}}\right )}{\sqrt {a^2-b^2}}-\frac {x}{a+b \sin (x)}}{b} \]

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

fricas [A]  time = 1.56, size = 236, normalized size = 4.07 \[ \left [-\frac {\sqrt {-a^{2} + b^{2}} {\left (b \sin \relax (x) + a\right )} \log \left (\frac {{\left (2 \, a^{2} - b^{2}\right )} \cos \relax (x)^{2} - 2 \, a b \sin \relax (x) - a^{2} - b^{2} + 2 \, {\left (a \cos \relax (x) \sin \relax (x) + b \cos \relax (x)\right )} \sqrt {-a^{2} + b^{2}}}{b^{2} \cos \relax (x)^{2} - 2 \, a b \sin \relax (x) - a^{2} - b^{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 )} \sin \relax (x)\right )}}, -\frac {\sqrt {a^{2} - b^{2}} {\left (b \sin \relax (x) + a\right )} \arctan \left (-\frac {a \sin \relax (x) + b}{\sqrt {a^{2} - b^{2}} \cos \relax (x)}\right ) + {\left (a^{2} - b^{2}\right )} x}{a^{3} b - a b^{3} + {\left (a^{2} b^{2} - b^{4}\right )} \sin \relax (x)}\right ] \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maple [C]  time = 0.52, size = 159, normalized size = 2.74 \[ -\frac {2 i x \,{\mathrm e}^{i x}}{b \left (b \,{\mathrm e}^{2 i x}-b +2 i a \,{\mathrm e}^{i x}\right )}-\frac {\ln \left ({\mathrm e}^{i x}+\frac {i a \sqrt {-a^{2}+b^{2}}-a^{2}+b^{2}}{\sqrt {-a^{2}+b^{2}}\, b}\right )}{\sqrt {-a^{2}+b^{2}}\, b}+\frac {\ln \left ({\mathrm e}^{i x}+\frac {i 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*cos(x)/(a+b*sin(x))^2,x)

[Out]

-2*I*x*exp(I*x)/b/(b*exp(2*I*x)-b+2*I*a*exp(I*x))-1/(-a^2+b^2)^(1/2)/b*ln(exp(I*x)+(I*a*(-a^2+b^2)^(1/2)-a^2+b
^2)/(-a^2+b^2)^(1/2)/b)+1/(-a^2+b^2)^(1/2)/b*ln(exp(I*x)+(I*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*cos(x)/(a+b*sin(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*b^2-4*a^2>0)', see `assume?`
 for more details)Is 4*b^2-4*a^2 positive or negative?

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

sympy [F(-1)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Timed out} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

Timed out

________________________________________________________________________________________