Optimal. Leaf size=116 \[ -\frac{-A b \sin (x)+A c \cos (x)+B c}{2 \left (b^2+c^2\right ) (b \cos (x)+c \sin (x))^2}-\frac{A \tanh ^{-1}\left (\frac{c \cos (x)-b \sin (x)}{\sqrt{b^2+c^2}}\right )}{2 \left (b^2+c^2\right )^{3/2}}-\frac{b B c \cos (x)-b^2 B \sin (x)}{\left (b^2+c^2\right )^2 (b \cos (x)+c \sin (x))} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.10807, antiderivative size = 116, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 4, integrand size = 18, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.222, Rules used = {3158, 3153, 3074, 206} \[ -\frac{-A b \sin (x)+A c \cos (x)+B c}{2 \left (b^2+c^2\right ) (b \cos (x)+c \sin (x))^2}-\frac{A \tanh ^{-1}\left (\frac{c \cos (x)-b \sin (x)}{\sqrt{b^2+c^2}}\right )}{2 \left (b^2+c^2\right )^{3/2}}-\frac{b B c \cos (x)-b^2 B \sin (x)}{\left (b^2+c^2\right )^2 (b \cos (x)+c \sin (x))} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3158
Rule 3153
Rule 3074
Rule 206
Rubi steps
\begin{align*} \int \frac{A+B \cos (x)}{(b \cos (x)+c \sin (x))^3} \, dx &=-\frac{B c+A c \cos (x)-A b \sin (x)}{2 \left (b^2+c^2\right ) (b \cos (x)+c \sin (x))^2}+\frac{\int \frac{2 b B+A b \cos (x)+A c \sin (x)}{(b \cos (x)+c \sin (x))^2} \, dx}{2 \left (b^2+c^2\right )}\\ &=-\frac{B c+A c \cos (x)-A b \sin (x)}{2 \left (b^2+c^2\right ) (b \cos (x)+c \sin (x))^2}-\frac{b B c \cos (x)-b^2 B \sin (x)}{\left (b^2+c^2\right )^2 (b \cos (x)+c \sin (x))}+\frac{A \int \frac{1}{b \cos (x)+c \sin (x)} \, dx}{2 \left (b^2+c^2\right )}\\ &=-\frac{B c+A c \cos (x)-A b \sin (x)}{2 \left (b^2+c^2\right ) (b \cos (x)+c \sin (x))^2}-\frac{b B c \cos (x)-b^2 B \sin (x)}{\left (b^2+c^2\right )^2 (b \cos (x)+c \sin (x))}-\frac{A \operatorname{Subst}\left (\int \frac{1}{b^2+c^2-x^2} \, dx,x,c \cos (x)-b \sin (x)\right )}{2 \left (b^2+c^2\right )}\\ &=-\frac{A \tanh ^{-1}\left (\frac{c \cos (x)-b \sin (x)}{\sqrt{b^2+c^2}}\right )}{2 \left (b^2+c^2\right )^{3/2}}-\frac{B c+A c \cos (x)-A b \sin (x)}{2 \left (b^2+c^2\right ) (b \cos (x)+c \sin (x))^2}-\frac{b B c \cos (x)-b^2 B \sin (x)}{\left (b^2+c^2\right )^2 (b \cos (x)+c \sin (x))}\\ \end{align*}
Mathematica [C] time = 0.313424, size = 118, normalized size = 1.02 \[ \frac{\left (b^2+c^2\right ) (b \sin (x) (A+2 B \cos (x))-A c \cos (x)-B c \cos (2 x))+2 A \sqrt{b^2+c^2} (b \cos (x)+c \sin (x))^2 \tanh ^{-1}\left (\frac{b \tan \left (\frac{x}{2}\right )-c}{\sqrt{b^2+c^2}}\right )}{2 (b-i c)^2 (b+i c)^2 (b \cos (x)+c \sin (x))^2} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.099, size = 204, normalized size = 1.8 \begin{align*} -2\,{\frac{1}{ \left ( b \left ( \tan \left ( x/2 \right ) \right ) ^{2}-2\,c\tan \left ( x/2 \right ) -b \right ) ^{2}} \left ( -1/2\,{\frac{ \left ( A{b}^{2}+2\,A{c}^{2}-2\,B{b}^{2}-2\,B{c}^{2} \right ) \left ( \tan \left ( x/2 \right ) \right ) ^{3}}{ \left ({b}^{2}+{c}^{2} \right ) b}}-1/2\,{\frac{c \left ( A{b}^{2}-2\,A{c}^{2}+2\,B{b}^{2}+2\,B{c}^{2} \right ) \left ( \tan \left ( x/2 \right ) \right ) ^{2}}{ \left ({b}^{2}+{c}^{2} \right ){b}^{2}}}-1/2\,{\frac{ \left ( A{b}^{2}-2\,A{c}^{2}+2\,B{b}^{2}+2\,B{c}^{2} \right ) \tan \left ( x/2 \right ) }{ \left ({b}^{2}+{c}^{2} \right ) b}}+1/2\,{\frac{Ac}{{b}^{2}+{c}^{2}}} \right ) }+{A{\it Artanh} \left ({\frac{1}{2} \left ( 2\,b\tan \left ( x/2 \right ) -2\,c \right ){\frac{1}{\sqrt{{b}^{2}+{c}^{2}}}}} \right ) \left ({b}^{2}+{c}^{2} \right ) ^{-{\frac{3}{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 [B] time = 2.43362, size = 659, normalized size = 5.68 \begin{align*} -\frac{8 \, B b^{2} c \cos \left (x\right )^{2} - 2 \, B b^{2} c + 2 \, B c^{3} -{\left (2 \, A b c \cos \left (x\right ) \sin \left (x\right ) + A c^{2} +{\left (A b^{2} - A c^{2}\right )} \cos \left (x\right )^{2}\right )} \sqrt{b^{2} + c^{2}} \log \left (-\frac{2 \, b c \cos \left (x\right ) \sin \left (x\right ) +{\left (b^{2} - c^{2}\right )} \cos \left (x\right )^{2} - 2 \, b^{2} - c^{2} + 2 \, \sqrt{b^{2} + c^{2}}{\left (c \cos \left (x\right ) - b \sin \left (x\right )\right )}}{2 \, b c \cos \left (x\right ) \sin \left (x\right ) +{\left (b^{2} - c^{2}\right )} \cos \left (x\right )^{2} + c^{2}}\right ) + 2 \,{\left (A b^{2} c + A c^{3}\right )} \cos \left (x\right ) - 2 \,{\left (A b^{3} + A b c^{2} + 2 \,{\left (B b^{3} - B b c^{2}\right )} \cos \left (x\right )\right )} \sin \left (x\right )}{4 \,{\left (b^{4} c^{2} + 2 \, b^{2} c^{4} + c^{6} +{\left (b^{6} + b^{4} c^{2} - b^{2} c^{4} - c^{6}\right )} \cos \left (x\right )^{2} + 2 \,{\left (b^{5} c + 2 \, b^{3} c^{3} + b c^{5}\right )} \cos \left (x\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 [B] time = 1.39639, size = 331, normalized size = 2.85 \begin{align*} \frac{A \log \left (\frac{{\left | -2 \, b \tan \left (\frac{1}{2} \, x\right ) + 2 \, c - 2 \, \sqrt{b^{2} + c^{2}} \right |}}{{\left | -2 \, b \tan \left (\frac{1}{2} \, x\right ) + 2 \, c + 2 \, \sqrt{b^{2} + c^{2}} \right |}}\right )}{2 \,{\left (b^{2} + c^{2}\right )}^{\frac{3}{2}}} + \frac{A b^{3} \tan \left (\frac{1}{2} \, x\right )^{3} - 2 \, B b^{3} \tan \left (\frac{1}{2} \, x\right )^{3} + 2 \, A b c^{2} \tan \left (\frac{1}{2} \, x\right )^{3} - 2 \, B b c^{2} \tan \left (\frac{1}{2} \, x\right )^{3} + A b^{2} c \tan \left (\frac{1}{2} \, x\right )^{2} + 2 \, B b^{2} c \tan \left (\frac{1}{2} \, x\right )^{2} - 2 \, A c^{3} \tan \left (\frac{1}{2} \, x\right )^{2} + 2 \, B c^{3} \tan \left (\frac{1}{2} \, x\right )^{2} + A b^{3} \tan \left (\frac{1}{2} \, x\right ) + 2 \, B b^{3} \tan \left (\frac{1}{2} \, x\right ) - 2 \, A b c^{2} \tan \left (\frac{1}{2} \, x\right ) + 2 \, B b c^{2} \tan \left (\frac{1}{2} \, x\right ) - A b^{2} c}{{\left (b^{4} + b^{2} c^{2}\right )}{\left (b \tan \left (\frac{1}{2} \, x\right )^{2} - 2 \, c \tan \left (\frac{1}{2} \, x\right ) - b\right )}^{2}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]