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.06, antiderivative size = 59, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, integrand size = 12, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.250, 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 205
Rule 2659
Rule 4423
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.10, 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]
________________________________________________________________________________________
fricas [A] time = 0.57, size = 227, normalized size = 3.85 \[ \left [-\frac {\sqrt {-a^{2} + b^{2}} {\left (b \cos \relax (x) + a\right )} \log \left (\frac {2 \, a b \cos \relax (x) + {\left (2 \, a^{2} - b^{2}\right )} \cos \relax (x)^{2} - 2 \, \sqrt {-a^{2} + b^{2}} {\left (a \cos \relax (x) + b\right )} \sin \relax (x) - a^{2} + 2 \, b^{2}}{b^{2} \cos \relax (x)^{2} + 2 \, a b \cos \relax (x) + 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 \relax (x)\right )}}, -\frac {\sqrt {a^{2} - b^{2}} {\left (b \cos \relax (x) + a\right )} \arctan \left (-\frac {a \cos \relax (x) + b}{\sqrt {a^{2} - b^{2}} \sin \relax (x)}\right ) - {\left (a^{2} - b^{2}\right )} x}{a^{3} b - a b^{3} + {\left (a^{2} b^{2} - b^{4}\right )} \cos \relax (x)}\right ] \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {x \sin \relax (x)}{{\left (b \cos \relax (x) + a\right )}^{2}}\,{d x} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [C] time = 0.26, size = 154, normalized size = 2.61 \[ \frac {2 x \,{\mathrm e}^{i x}}{b \left (b \,{\mathrm e}^{2 i x}+2 a \,{\mathrm e}^{i x}+b \right )}-\frac {i \ln \left ({\mathrm e}^{i x}+\frac {a \sqrt {a^{2}-b^{2}}+a^{2}-b^{2}}{\sqrt {a^{2}-b^{2}}\, b}\right )}{\sqrt {a^{2}-b^{2}}\, b}+\frac {i \ln \left ({\mathrm e}^{i x}+\frac {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]
[Out]
________________________________________________________________________________________
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]
[Out]
________________________________________________________________________________________
mupad [B] time = 3.29, size = 132, normalized size = 2.24 \[ \frac {2\,x\,{\mathrm {e}}^{x\,1{}\mathrm {i}}}{b\,\left (2\,a\,{\mathrm {e}}^{x\,1{}\mathrm {i}}+2\,b\,{\mathrm {e}}^{x\,1{}\mathrm {i}}\,\cos \relax (x)\right )}+\frac {\ln \left (2\,{\mathrm {e}}^{x\,1{}\mathrm {i}}-\frac {\left (b+a\,{\mathrm {e}}^{x\,1{}\mathrm {i}}\right )\,2{}\mathrm {i}}{\sqrt {a+b}\,\sqrt {b-a}}\right )}{b\,\sqrt {a+b}\,\sqrt {b-a}}-\frac {\ln \left (2\,{\mathrm {e}}^{x\,1{}\mathrm {i}}+\frac {\left (b+a\,{\mathrm {e}}^{x\,1{}\mathrm {i}}\right )\,2{}\mathrm {i}}{\sqrt {a+b}\,\sqrt {b-a}}\right )}{b\,\sqrt {a+b}\,\sqrt {b-a}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {x \sin {\relax (x )}}{\left (a + b \cos {\relax (x )}\right )^{2}}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________