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

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

[Out]

ln(a+b*cos(x))/b+x*sin(x)/(a+b*cos(x))

________________________________________________________________________________________

Rubi [A]  time = 0.06, antiderivative size = 24, normalized size of antiderivative = 1.00, 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 = {4593, 2668, 31} \[ \frac {\log (a+b \cos (x))}{b}+\frac {x \sin (x)}{a+b \cos (x)} \]

Antiderivative was successfully verified.

[In]

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

[Out]

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

Rule 31

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

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 4593

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

Rubi steps

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

________________________________________________________________________________________

Mathematica [A]  time = 0.13, size = 24, normalized size = 1.00 \[ \frac {\log (a+b \cos (x))}{b}+\frac {x \sin (x)}{a+b \cos (x)} \]

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

fricas [A]  time = 0.74, size = 36, normalized size = 1.50 \[ \frac {b x \sin \relax (x) + {\left (b \cos \relax (x) + a\right )} \log \left (-b \cos \relax (x) - a\right )}{b^{2} \cos \relax (x) + a b} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

giac [B]  time = 0.32, size = 397, normalized size = 16.54 \[ \frac {a \log \left (\frac {4 \, {\left (a^{2} \tan \left (\frac {1}{2} \, x\right )^{4} - 2 \, a b \tan \left (\frac {1}{2} \, x\right )^{4} + b^{2} \tan \left (\frac {1}{2} \, x\right )^{4} + 2 \, a^{2} \tan \left (\frac {1}{2} \, x\right )^{2} - 2 \, b^{2} \tan \left (\frac {1}{2} \, x\right )^{2} + a^{2} + 2 \, a b + b^{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} - b \log \left (\frac {4 \, {\left (a^{2} \tan \left (\frac {1}{2} \, x\right )^{4} - 2 \, a b \tan \left (\frac {1}{2} \, x\right )^{4} + b^{2} \tan \left (\frac {1}{2} \, x\right )^{4} + 2 \, a^{2} \tan \left (\frac {1}{2} \, x\right )^{2} - 2 \, b^{2} \tan \left (\frac {1}{2} \, x\right )^{2} + a^{2} + 2 \, a b + b^{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} + 8 \, b x \tan \left (\frac {1}{2} \, x\right ) + a \log \left (\frac {4 \, {\left (a^{2} \tan \left (\frac {1}{2} \, x\right )^{4} - 2 \, a b \tan \left (\frac {1}{2} \, x\right )^{4} + b^{2} \tan \left (\frac {1}{2} \, x\right )^{4} + 2 \, a^{2} \tan \left (\frac {1}{2} \, x\right )^{2} - 2 \, b^{2} \tan \left (\frac {1}{2} \, x\right )^{2} + a^{2} + 2 \, a b + b^{2}\right )}}{\tan \left (\frac {1}{2} \, x\right )^{4} + 2 \, \tan \left (\frac {1}{2} \, x\right )^{2} + 1}\right ) + b \log \left (\frac {4 \, {\left (a^{2} \tan \left (\frac {1}{2} \, x\right )^{4} - 2 \, a b \tan \left (\frac {1}{2} \, x\right )^{4} + b^{2} \tan \left (\frac {1}{2} \, x\right )^{4} + 2 \, a^{2} \tan \left (\frac {1}{2} \, x\right )^{2} - 2 \, b^{2} \tan \left (\frac {1}{2} \, x\right )^{2} + a^{2} + 2 \, a b + b^{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} - b^{2} \tan \left (\frac {1}{2} \, x\right )^{2} + a b + b^{2}\right )}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/2*(a*log(4*(a^2*tan(1/2*x)^4 - 2*a*b*tan(1/2*x)^4 + b^2*tan(1/2*x)^4 + 2*a^2*tan(1/2*x)^2 - 2*b^2*tan(1/2*x)
^2 + a^2 + 2*a*b + b^2)/(tan(1/2*x)^4 + 2*tan(1/2*x)^2 + 1))*tan(1/2*x)^2 - b*log(4*(a^2*tan(1/2*x)^4 - 2*a*b*
tan(1/2*x)^4 + b^2*tan(1/2*x)^4 + 2*a^2*tan(1/2*x)^2 - 2*b^2*tan(1/2*x)^2 + a^2 + 2*a*b + b^2)/(tan(1/2*x)^4 +
 2*tan(1/2*x)^2 + 1))*tan(1/2*x)^2 + 8*b*x*tan(1/2*x) + a*log(4*(a^2*tan(1/2*x)^4 - 2*a*b*tan(1/2*x)^4 + b^2*t
an(1/2*x)^4 + 2*a^2*tan(1/2*x)^2 - 2*b^2*tan(1/2*x)^2 + a^2 + 2*a*b + b^2)/(tan(1/2*x)^4 + 2*tan(1/2*x)^2 + 1)
) + b*log(4*(a^2*tan(1/2*x)^4 - 2*a*b*tan(1/2*x)^4 + b^2*tan(1/2*x)^4 + 2*a^2*tan(1/2*x)^2 - 2*b^2*tan(1/2*x)^
2 + a^2 + 2*a*b + b^2)/(tan(1/2*x)^4 + 2*tan(1/2*x)^2 + 1)))/(a*b*tan(1/2*x)^2 - b^2*tan(1/2*x)^2 + a*b + b^2)

________________________________________________________________________________________

maple [B]  time = 0.41, size = 91, normalized size = 3.79 \[ \frac {2 x \tan \left (\frac {x}{2}\right )+2 x \left (\tan ^{3}\left (\frac {x}{2}\right )\right )}{\left (1+\tan ^{2}\left (\frac {x}{2}\right )\right ) \left (a \left (\tan ^{2}\left (\frac {x}{2}\right )\right )-b \left (\tan ^{2}\left (\frac {x}{2}\right )\right )+a +b \right )}+\frac {\ln \left (a \left (\tan ^{2}\left (\frac {x}{2}\right )\right )-b \left (\tan ^{2}\left (\frac {x}{2}\right )\right )+a +b \right )}{b}-\frac {\ln \left (1+\tan ^{2}\left (\frac {x}{2}\right )\right )}{b} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

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*(b+a*cos(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 = 2.74, size = 68, normalized size = 2.83 \[ \frac {\ln \left (b+2\,a\,{\mathrm {e}}^{x\,1{}\mathrm {i}}+b\,{\mathrm {e}}^{x\,2{}\mathrm {i}}\right )}{b}-\frac {x\,2{}\mathrm {i}}{b}+\frac {x\,2{}\mathrm {i}+\frac {a\,x\,{\mathrm {e}}^{x\,1{}\mathrm {i}}\,2{}\mathrm {i}}{b}}{b+2\,a\,{\mathrm {e}}^{x\,1{}\mathrm {i}}+b\,{\mathrm {e}}^{x\,2{}\mathrm {i}}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

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*(b+a*cos(x))/(a+b*cos(x))**2,x)

[Out]

Timed out

________________________________________________________________________________________