Optimal. Leaf size=114 \[ \frac{2 (a A-c C) \tan ^{-1}\left (\frac{(a-b) \tan \left (\frac{x}{2}\right )+c}{\sqrt{a^2-b^2-c^2}}\right )}{\left (a^2-b^2-c^2\right )^{3/2}}-\frac{-\cos (x) (A c-a C)+A b \sin (x)+b C}{\left (a^2-b^2-c^2\right ) (a+b \cos (x)+c \sin (x))} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.100546, antiderivative size = 114, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 4, integrand size = 19, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.21, Rules used = {3154, 3124, 618, 204} \[ \frac{2 (a A-c C) \tan ^{-1}\left (\frac{(a-b) \tan \left (\frac{x}{2}\right )+c}{\sqrt{a^2-b^2-c^2}}\right )}{\left (a^2-b^2-c^2\right )^{3/2}}-\frac{-\cos (x) (A c-a C)+A b \sin (x)+b C}{\left (a^2-b^2-c^2\right ) (a+b \cos (x)+c \sin (x))} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3154
Rule 3124
Rule 618
Rule 204
Rubi steps
\begin{align*} \int \frac{A+C \sin (x)}{(a+b \cos (x)+c \sin (x))^2} \, dx &=-\frac{b C-(A c-a C) \cos (x)+A b \sin (x)}{\left (a^2-b^2-c^2\right ) (a+b \cos (x)+c \sin (x))}+\frac{(a A-c C) \int \frac{1}{a+b \cos (x)+c \sin (x)} \, dx}{a^2-b^2-c^2}\\ &=-\frac{b C-(A c-a C) \cos (x)+A b \sin (x)}{\left (a^2-b^2-c^2\right ) (a+b \cos (x)+c \sin (x))}+\frac{(2 (a A-c C)) \operatorname{Subst}\left (\int \frac{1}{a+b+2 c x+(a-b) x^2} \, dx,x,\tan \left (\frac{x}{2}\right )\right )}{a^2-b^2-c^2}\\ &=-\frac{b C-(A c-a C) \cos (x)+A b \sin (x)}{\left (a^2-b^2-c^2\right ) (a+b \cos (x)+c \sin (x))}-\frac{(4 (a A-c C)) \operatorname{Subst}\left (\int \frac{1}{-4 \left (a^2-b^2-c^2\right )-x^2} \, dx,x,2 c+2 (a-b) \tan \left (\frac{x}{2}\right )\right )}{a^2-b^2-c^2}\\ &=\frac{2 (a A-c C) \tan ^{-1}\left (\frac{c+(a-b) \tan \left (\frac{x}{2}\right )}{\sqrt{a^2-b^2-c^2}}\right )}{\left (a^2-b^2-c^2\right )^{3/2}}-\frac{b C-(A c-a C) \cos (x)+A b \sin (x)}{\left (a^2-b^2-c^2\right ) (a+b \cos (x)+c \sin (x))}\\ \end{align*}
Mathematica [A] time = 0.342689, size = 123, normalized size = 1.08 \[ \frac{a^2 (-C)+\sin (x) \left (A \left (b^2+c^2\right )-a c C\right )+a A c+b^2 C}{b \left (-a^2+b^2+c^2\right ) (a+b \cos (x)+c \sin (x))}+\frac{2 (a A-c C) \tanh ^{-1}\left (\frac{(a-b) \tan \left (\frac{x}{2}\right )+c}{\sqrt{-a^2+b^2+c^2}}\right )}{\left (-a^2+b^2+c^2\right )^{3/2}} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] time = 0.091, size = 255, normalized size = 2.2 \begin{align*} 2\,{\frac{1}{a \left ( \tan \left ( x/2 \right ) \right ) ^{2}-b \left ( \tan \left ( x/2 \right ) \right ) ^{2}+2\,c\tan \left ( x/2 \right ) +a+b} \left ( -{\frac{ \left ( aAb-A{b}^{2}-A{c}^{2}+acC-Cbc \right ) \tan \left ( x/2 \right ) }{{a}^{3}-{a}^{2}b-a{b}^{2}-a{c}^{2}+{b}^{3}+b{c}^{2}}}+{\frac{aAc-{a}^{2}C+{b}^{2}C}{{a}^{3}-{a}^{2}b-a{b}^{2}-a{c}^{2}+{b}^{3}+b{c}^{2}}} \right ) }+2\,{\frac{aA}{ \left ({a}^{2}-{b}^{2}-{c}^{2} \right ) ^{3/2}}\arctan \left ( 1/2\,{\frac{2\, \left ( a-b \right ) \tan \left ( x/2 \right ) +2\,c}{\sqrt{{a}^{2}-{b}^{2}-{c}^{2}}}} \right ) }-2\,{\frac{Cc}{ \left ({a}^{2}-{b}^{2}-{c}^{2} \right ) ^{3/2}}\arctan \left ( 1/2\,{\frac{2\, \left ( a-b \right ) \tan \left ( x/2 \right ) +2\,c}{\sqrt{{a}^{2}-{b}^{2}-{c}^{2}}}} \right ) } \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 [B] time = 2.94021, size = 2739, normalized size = 24.03 \begin{align*} \text{result too large to display} \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 [A] time = 1.16627, size = 278, normalized size = 2.44 \begin{align*} -\frac{2 \,{\left (\pi \left \lfloor \frac{x}{2 \, \pi } + \frac{1}{2} \right \rfloor \mathrm{sgn}\left (-2 \, a + 2 \, b\right ) + \arctan \left (-\frac{a \tan \left (\frac{1}{2} \, x\right ) - b \tan \left (\frac{1}{2} \, x\right ) + c}{\sqrt{a^{2} - b^{2} - c^{2}}}\right )\right )}{\left (A a - C c\right )}}{{\left (a^{2} - b^{2} - c^{2}\right )}^{\frac{3}{2}}} - \frac{2 \,{\left (A a b \tan \left (\frac{1}{2} \, x\right ) - A b^{2} \tan \left (\frac{1}{2} \, x\right ) + C a c \tan \left (\frac{1}{2} \, x\right ) - C b c \tan \left (\frac{1}{2} \, x\right ) - A c^{2} \tan \left (\frac{1}{2} \, x\right ) + C a^{2} - C b^{2} - A a c\right )}}{{\left (a^{3} - a^{2} b - a b^{2} + b^{3} - a c^{2} + b c^{2}\right )}{\left (a \tan \left (\frac{1}{2} \, x\right )^{2} - b \tan \left (\frac{1}{2} \, x\right )^{2} + 2 \, c \tan \left (\frac{1}{2} \, x\right ) + a + b\right )}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]