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.10, antiderivative size = 114, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, integrand size = 19, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.210, 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 204
Rule 618
Rule 3124
Rule 3154
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.39, 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]
________________________________________________________________________________________
fricas [B] time = 1.24, size = 1301, normalized size = 11.41 \[ \text {result too large to display} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.20, size = 206, normalized size = 1.81 \[ -\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 )}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [B] time = 0.18, size = 255, normalized size = 2.24 \[ \frac {-\frac {2 \left (a A b -A \,b^{2}-A \,c^{2}+a c C -C b c \right ) \tan \left (\frac {x}{2}\right )}{a^{3}-a^{2} b -a \,b^{2}-a \,c^{2}+b^{3}+c^{2} b}+\frac {2 \left (a A c -a^{2} C +b^{2} C \right )}{a^{3}-a^{2} b -a \,b^{2}-a \,c^{2}+b^{3}+c^{2} b}}{a \left (\tan ^{2}\left (\frac {x}{2}\right )\right )-b \left (\tan ^{2}\left (\frac {x}{2}\right )\right )+2 c \tan \left (\frac {x}{2}\right )+a +b}+\frac {2 \arctan \left (\frac {2 \left (a -b \right ) \tan \left (\frac {x}{2}\right )+2 c}{2 \sqrt {a^{2}-b^{2}-c^{2}}}\right ) a A}{\left (a^{2}-b^{2}-c^{2}\right )^{\frac {3}{2}}}-\frac {2 \arctan \left (\frac {2 \left (a -b \right ) \tan \left (\frac {x}{2}\right )+2 c}{2 \sqrt {a^{2}-b^{2}-c^{2}}}\right ) C c}{\left (a^{2}-b^{2}-c^{2}\right )^{\frac {3}{2}}} \]
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.19, size = 204, normalized size = 1.79 \[ \frac {2\,\mathrm {atanh}\left (\frac {\mathrm {tan}\left (\frac {x}{2}\right )\,\left (2\,a-2\,b\right )+\frac {2\,\left (-a^2\,c+b^2\,c+c^3\right )}{-a^2+b^2+c^2}}{2\,\sqrt {-a^2+b^2+c^2}}\right )\,\left (A\,a-C\,c\right )}{{\left (-a^2+b^2+c^2\right )}^{3/2}}-\frac {\frac {2\,\left (-C\,a^2+A\,c\,a+C\,b^2\right )}{\left (a-b\right )\,\left (-a^2+b^2+c^2\right )}+\frac {2\,\mathrm {tan}\left (\frac {x}{2}\right )\,\left (A\,b^2+C\,b\,c-A\,a\,b+A\,c^2-C\,a\,c\right )}{\left (a-b\right )\,\left (-a^2+b^2+c^2\right )}}{\left (a-b\right )\,{\mathrm {tan}\left (\frac {x}{2}\right )}^2+2\,c\,\mathrm {tan}\left (\frac {x}{2}\right )+a+b} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F(-1)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Timed out} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________