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]
________________________________________________________________________________________
Rubi [A] time = 0.0592501, antiderivative size = 59, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 3, integrand size = 12, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.25, 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]
[Out]
Rule 4423
Rule 2659
Rule 205
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.103584, 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]
[Out]
________________________________________________________________________________________
Maple [C] time = 0.125, size = 154, normalized size = 2.6 \begin{align*} 2\,{\frac{x{{\rm e}^{ix}}}{b \left ( b{{\rm e}^{2\,ix}}+2\,a{{\rm e}^{ix}}+b \right ) }}-{\frac{i}{b}\ln \left ({{\rm e}^{ix}}+{\frac{1}{b} \left ( a\sqrt{{a}^{2}-{b}^{2}}+{a}^{2}-{b}^{2} \right ){\frac{1}{\sqrt{{a}^{2}-{b}^{2}}}}} \right ){\frac{1}{\sqrt{{a}^{2}-{b}^{2}}}}}+{\frac{i}{b}\ln \left ({{\rm e}^{ix}}+{\frac{1}{b} \left ( a\sqrt{{a}^{2}-{b}^{2}}-{a}^{2}+{b}^{2} \right ){\frac{1}{\sqrt{{a}^{2}-{b}^{2}}}}} \right ){\frac{1}{\sqrt{{a}^{2}-{b}^{2}}}}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
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]
[Out]
________________________________________________________________________________________
Fricas [A] time = 2.52556, size = 516, normalized size = 8.75 \begin{align*} \left [-\frac{\sqrt{-a^{2} + b^{2}}{\left (b \cos \left (x\right ) + a\right )} \log \left (\frac{2 \, a b \cos \left (x\right ) +{\left (2 \, a^{2} - b^{2}\right )} \cos \left (x\right )^{2} - 2 \, \sqrt{-a^{2} + b^{2}}{\left (a \cos \left (x\right ) + b\right )} \sin \left (x\right ) - a^{2} + 2 \, b^{2}}{b^{2} \cos \left (x\right )^{2} + 2 \, a b \cos \left (x\right ) + 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 \left (x\right )\right )}}, -\frac{\sqrt{a^{2} - b^{2}}{\left (b \cos \left (x\right ) + a\right )} \arctan \left (-\frac{a \cos \left (x\right ) + b}{\sqrt{a^{2} - b^{2}} \sin \left (x\right )}\right ) -{\left (a^{2} - b^{2}\right )} x}{a^{3} b - a b^{3} +{\left (a^{2} b^{2} - b^{4}\right )} \cos \left (x\right )}\right ] \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
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]
[Out]
________________________________________________________________________________________
Giac [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{x \sin \left (x\right )}{{\left (b \cos \left (x\right ) + a\right )}^{2}}\,{d x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]