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]

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

________________________________________________________________________________________

Rubi [A]  time = 0.0555215, antiderivative size = 24, 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 = {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 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]

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 \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.125291, size = 24, normalized size = 1. \[ \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])

________________________________________________________________________________________

Maple [B]  time = 0.166, size = 91, normalized size = 3.8 \begin{align*}{ \left ( 2\,x\tan \left ( x/2 \right ) +2\,x \left ( \tan \left ( x/2 \right ) \right ) ^{3} \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}-b \left ( \tan \left ({\frac{x}{2}} \right ) \right ) ^{2}+a+b \right ) ^{-1}}+{\frac{1}{b}\ln \left ( a \left ( \tan \left ({\frac{x}{2}} \right ) \right ) ^{2}-b \left ( \tan \left ({\frac{x}{2}} \right ) \right ) ^{2}+a+b \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*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., 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*cos(x))/(a+b*cos(x))^2,x, algorithm="maxima")

[Out]

Exception raised: ValueError

________________________________________________________________________________________

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

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)

________________________________________________________________________________________

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

[Out]

Timed out

________________________________________________________________________________________

Giac [B]  time = 1.32801, size = 536, normalized size = 22.33 \begin{align*} \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 )}} \end{align*}

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)