Optimal. Leaf size=110 \[ \frac{a B \sin (x)-a C \cos (x)-b C+B c}{\left (a^2-b^2-c^2\right ) (a+b \cos (x)+c \sin (x))}-\frac{2 (b B+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}} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0963721, antiderivative size = 110, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 4, integrand size = 22, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.182, Rules used = {3153, 3124, 618, 204} \[ \frac{a B \sin (x)-a C \cos (x)-b C+B c}{\left (a^2-b^2-c^2\right ) (a+b \cos (x)+c \sin (x))}-\frac{2 (b B+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}} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3153
Rule 3124
Rule 618
Rule 204
Rubi steps
\begin{align*} \int \frac{B \cos (x)+C \sin (x)}{(a+b \cos (x)+c \sin (x))^2} \, dx &=\frac{B c-b 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{(b B+c C) \int \frac{1}{a+b \cos (x)+c \sin (x)} \, dx}{a^2-b^2-c^2}\\ &=\frac{B c-b 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 (b B+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-b 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 (b B+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 (b B+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-b 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.35717, size = 116, normalized size = 1.05 \[ -\frac{a^2 C+a \sin (x) (b B+c C)-b^2 C+b B c}{b \left (-a^2+b^2+c^2\right ) (a+b \cos (x)+c \sin (x))}-\frac{2 (b B+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.1, size = 255, normalized size = 2.3 \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 ({a}^{2}B-abB-B{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{bBc+{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{bB}{ \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.79401, size = 2799, normalized size = 25.45 \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.17682, size = 277, normalized size = 2.52 \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 (B b + C c\right )}}{{\left (a^{2} - b^{2} - c^{2}\right )}^{\frac{3}{2}}} + \frac{2 \,{\left (B a^{2} \tan \left (\frac{1}{2} \, x\right ) - B a b \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 ) - B c^{2} \tan \left (\frac{1}{2} \, x\right ) - C a^{2} + C b^{2} - B b 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]