Optimal. Leaf size=58 \[ \frac{2 \tan ^{-1}\left (\frac{a \tan \left (\frac{x}{2}\right )+b}{\sqrt{a^2-b^2}}\right )}{b \sqrt{a^2-b^2}}-\frac{x}{b (a+b \sin (x))} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0776166, antiderivative size = 58, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 4, integrand size = 12, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.333, Rules used = {4422, 2660, 618, 204} \[ \frac{2 \tan ^{-1}\left (\frac{a \tan \left (\frac{x}{2}\right )+b}{\sqrt{a^2-b^2}}\right )}{b \sqrt{a^2-b^2}}-\frac{x}{b (a+b \sin (x))} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 4422
Rule 2660
Rule 618
Rule 204
Rubi steps
\begin{align*} \int \frac{x \cos (x)}{(a+b \sin (x))^2} \, dx &=-\frac{x}{b (a+b \sin (x))}+\frac{\int \frac{1}{a+b \sin (x)} \, dx}{b}\\ &=-\frac{x}{b (a+b \sin (x))}+\frac{2 \operatorname{Subst}\left (\int \frac{1}{a+2 b x+a x^2} \, dx,x,\tan \left (\frac{x}{2}\right )\right )}{b}\\ &=-\frac{x}{b (a+b \sin (x))}-\frac{4 \operatorname{Subst}\left (\int \frac{1}{-4 \left (a^2-b^2\right )-x^2} \, dx,x,2 b+2 a \tan \left (\frac{x}{2}\right )\right )}{b}\\ &=\frac{2 \tan ^{-1}\left (\frac{b+a \tan \left (\frac{x}{2}\right )}{\sqrt{a^2-b^2}}\right )}{b \sqrt{a^2-b^2}}-\frac{x}{b (a+b \sin (x))}\\ \end{align*}
Mathematica [A] time = 0.140019, size = 56, normalized size = 0.97 \[ \frac{\frac{2 \tan ^{-1}\left (\frac{a \tan \left (\frac{x}{2}\right )+b}{\sqrt{a^2-b^2}}\right )}{\sqrt{a^2-b^2}}-\frac{x}{a+b \sin (x)}}{b} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [C] time = 0.247, size = 159, normalized size = 2.7 \begin{align*}{\frac{-2\,ix{{\rm e}^{ix}}}{b \left ( b{{\rm e}^{2\,ix}}-b+2\,ia{{\rm e}^{ix}} \right ) }}-{\frac{1}{b}\ln \left ({{\rm e}^{ix}}+{\frac{1}{b} \left ( ia\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{1}{b}\ln \left ({{\rm e}^{ix}}+{\frac{1}{b} \left ( ia\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.58181, size = 531, normalized size = 9.16 \begin{align*} \left [-\frac{\sqrt{-a^{2} + b^{2}}{\left (b \sin \left (x\right ) + a\right )} \log \left (\frac{{\left (2 \, a^{2} - b^{2}\right )} \cos \left (x\right )^{2} - 2 \, a b \sin \left (x\right ) - a^{2} - b^{2} + 2 \,{\left (a \cos \left (x\right ) \sin \left (x\right ) + b \cos \left (x\right )\right )} \sqrt{-a^{2} + b^{2}}}{b^{2} \cos \left (x\right )^{2} - 2 \, a b \sin \left (x\right ) - a^{2} - b^{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 )} \sin \left (x\right )\right )}}, -\frac{\sqrt{a^{2} - b^{2}}{\left (b \sin \left (x\right ) + a\right )} \arctan \left (-\frac{a \sin \left (x\right ) + b}{\sqrt{a^{2} - b^{2}} \cos \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 )} \sin \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 \cos \left (x\right )}{{\left (b \sin \left (x\right ) + a\right )}^{2}}\,{d x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]