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

Optimal. Leaf size=25 \[ \frac{\log (a+b \sin (x))}{b}-\frac{x \cos (x)}{a+b \sin (x)} \]

[Out]

Log[a + b*Sin[x]]/b - (x*Cos[x])/(a + b*Sin[x])

________________________________________________________________________________________

Rubi [A]  time = 0.0531446, antiderivative size = 25, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 3, integrand size = 16, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.188, Rules used = {4592, 2668, 31} \[ \frac{\log (a+b \sin (x))}{b}-\frac{x \cos (x)}{a+b \sin (x)} \]

Antiderivative was successfully verified.

[In]

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

[Out]

Log[a + b*Sin[x]]/b - (x*Cos[x])/(a + b*Sin[x])

Rule 4592

Int[(((e_.) + (f_.)*(x_))*((A_) + (B_.)*Sin[(c_.) + (d_.)*(x_)]))/((a_) + (b_.)*Sin[(c_.) + (d_.)*(x_)])^2, x_
Symbol] :> -Simp[(B*(e + f*x)*Cos[c + d*x])/(a*d*(a + b*Sin[c + d*x])), x] + Dist[(B*f)/(a*d), Int[Cos[c + d*x
]/(a + b*Sin[c + d*x]), x], x] /; FreeQ[{a, b, c, d, e, f, A, B}, x] && EqQ[a*A - b*B, 0]

Rule 2668

Int[cos[(e_.) + (f_.)*(x_)]^(p_.)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.), x_Symbol] :> Dist[1/(b^p*f), S
ubst[Int[(a + x)^m*(b^2 - x^2)^((p - 1)/2), x], x, b*Sin[e + f*x]], x] /; FreeQ[{a, b, e, f, m}, x] && Integer
Q[(p - 1)/2] && NeQ[a^2 - b^2, 0]

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{x (b+a \sin (x))}{(a+b \sin (x))^2} \, dx &=-\frac{x \cos (x)}{a+b \sin (x)}+\int \frac{\cos (x)}{a+b \sin (x)} \, dx\\ &=-\frac{x \cos (x)}{a+b \sin (x)}+\frac{\operatorname{Subst}\left (\int \frac{1}{a+x} \, dx,x,b \sin (x)\right )}{b}\\ &=\frac{\log (a+b \sin (x))}{b}-\frac{x \cos (x)}{a+b \sin (x)}\\ \end{align*}

Mathematica [A]  time = 0.196906, size = 25, normalized size = 1. \[ \frac{\log (a+b \sin (x))}{b}-\frac{x \cos (x)}{a+b \sin (x)} \]

Antiderivative was successfully verified.

[In]

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

[Out]

Log[a + b*Sin[x]]/b - (x*Cos[x])/(a + b*Sin[x])

________________________________________________________________________________________

Maple [B]  time = 0.337, size = 80, normalized size = 3.2 \begin{align*}{ \left ( x \left ( \tan \left ({\frac{x}{2}} \right ) \right ) ^{4}-x \right ) \left ( 1+ \left ( \tan \left ({\frac{x}{2}} \right ) \right ) ^{2} \right ) ^{-1} \left ( a \left ( \tan \left ({\frac{x}{2}} \right ) \right ) ^{2}+2\,b\tan \left ( x/2 \right ) +a \right ) ^{-1}}+{\frac{1}{b}\ln \left ( a \left ( \tan \left ({\frac{x}{2}} \right ) \right ) ^{2}+2\,b\tan \left ( x/2 \right ) +a \right ) }-{\frac{1}{b}\ln \left ( 1+ \left ( \tan \left ({\frac{x}{2}} \right ) \right ) ^{2} \right ) } \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

(x*tan(1/2*x)^4-x)/(1+tan(1/2*x)^2)/(a*tan(1/2*x)^2+2*b*tan(1/2*x)+a)+1/b*ln(a*tan(1/2*x)^2+2*b*tan(1/2*x)+a)-
1/b*ln(1+tan(1/2*x)^2)

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

Exception raised: ValueError

________________________________________________________________________________________

Fricas [A]  time = 2.53441, size = 93, normalized size = 3.72 \begin{align*} -\frac{b x \cos \left (x\right ) -{\left (b \sin \left (x\right ) + a\right )} \log \left (b \sin \left (x\right ) + a\right )}{b^{2} \sin \left (x\right ) + a b} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-(b*x*cos(x) - (b*sin(x) + a)*log(b*sin(x) + a))/(b^2*sin(x) + a*b)

________________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

Timed out

________________________________________________________________________________________

Giac [B]  time = 1.29717, size = 382, normalized size = 15.28 \begin{align*} \frac{4 \, b x \tan \left (\frac{1}{2} \, x\right )^{2} + a \log \left (\frac{4 \,{\left (a^{2} \tan \left (\frac{1}{2} \, x\right )^{4} + 4 \, a b \tan \left (\frac{1}{2} \, x\right )^{3} + 2 \, a^{2} \tan \left (\frac{1}{2} \, x\right )^{2} + 4 \, b^{2} \tan \left (\frac{1}{2} \, x\right )^{2} + 4 \, a b \tan \left (\frac{1}{2} \, x\right ) + a^{2}\right )}}{\tan \left (\frac{1}{2} \, x\right )^{4} + 2 \, \tan \left (\frac{1}{2} \, x\right )^{2} + 1}\right ) \tan \left (\frac{1}{2} \, x\right )^{2} + 2 \, b \log \left (\frac{4 \,{\left (a^{2} \tan \left (\frac{1}{2} \, x\right )^{4} + 4 \, a b \tan \left (\frac{1}{2} \, x\right )^{3} + 2 \, a^{2} \tan \left (\frac{1}{2} \, x\right )^{2} + 4 \, b^{2} \tan \left (\frac{1}{2} \, x\right )^{2} + 4 \, a b \tan \left (\frac{1}{2} \, x\right ) + a^{2}\right )}}{\tan \left (\frac{1}{2} \, x\right )^{4} + 2 \, \tan \left (\frac{1}{2} \, x\right )^{2} + 1}\right ) \tan \left (\frac{1}{2} \, x\right ) - 4 \, b x + a \log \left (\frac{4 \,{\left (a^{2} \tan \left (\frac{1}{2} \, x\right )^{4} + 4 \, a b \tan \left (\frac{1}{2} \, x\right )^{3} + 2 \, a^{2} \tan \left (\frac{1}{2} \, x\right )^{2} + 4 \, b^{2} \tan \left (\frac{1}{2} \, x\right )^{2} + 4 \, a b \tan \left (\frac{1}{2} \, x\right ) + a^{2}\right )}}{\tan \left (\frac{1}{2} \, x\right )^{4} + 2 \, \tan \left (\frac{1}{2} \, x\right )^{2} + 1}\right )}{2 \,{\left (a b \tan \left (\frac{1}{2} \, x\right )^{2} + 2 \, b^{2} \tan \left (\frac{1}{2} \, x\right ) + a b\right )}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/2*(4*b*x*tan(1/2*x)^2 + a*log(4*(a^2*tan(1/2*x)^4 + 4*a*b*tan(1/2*x)^3 + 2*a^2*tan(1/2*x)^2 + 4*b^2*tan(1/2*
x)^2 + 4*a*b*tan(1/2*x) + a^2)/(tan(1/2*x)^4 + 2*tan(1/2*x)^2 + 1))*tan(1/2*x)^2 + 2*b*log(4*(a^2*tan(1/2*x)^4
 + 4*a*b*tan(1/2*x)^3 + 2*a^2*tan(1/2*x)^2 + 4*b^2*tan(1/2*x)^2 + 4*a*b*tan(1/2*x) + a^2)/(tan(1/2*x)^4 + 2*ta
n(1/2*x)^2 + 1))*tan(1/2*x) - 4*b*x + a*log(4*(a^2*tan(1/2*x)^4 + 4*a*b*tan(1/2*x)^3 + 2*a^2*tan(1/2*x)^2 + 4*
b^2*tan(1/2*x)^2 + 4*a*b*tan(1/2*x) + a^2)/(tan(1/2*x)^4 + 2*tan(1/2*x)^2 + 1)))/(a*b*tan(1/2*x)^2 + 2*b^2*tan
(1/2*x) + a*b)