Integrand size = 22, antiderivative size = 85 \[ \int \frac {A+B \cos (x)+C \sin (x)}{(b \cos (x)+c \sin (x))^2} \, dx=-\frac {(b B+c C) \text {arctanh}\left (\frac {c \cos (x)-b \sin (x)}{\sqrt {b^2+c^2}}\right )}{\left (b^2+c^2\right )^{3/2}}-\frac {B c-b C+A c \cos (x)-A b \sin (x)}{\left (b^2+c^2\right ) (b \cos (x)+c \sin (x))} \]
[Out]
Time = 0.07 (sec) , antiderivative size = 85, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.136, Rules used = {3232, 3153, 212} \[ \int \frac {A+B \cos (x)+C \sin (x)}{(b \cos (x)+c \sin (x))^2} \, dx=-\frac {-A b \sin (x)+A c \cos (x)-b C+B c}{\left (b^2+c^2\right ) (b \cos (x)+c \sin (x))}-\frac {(b B+c C) \text {arctanh}\left (\frac {c \cos (x)-b \sin (x)}{\sqrt {b^2+c^2}}\right )}{\left (b^2+c^2\right )^{3/2}} \]
[In]
[Out]
Rule 212
Rule 3153
Rule 3232
Rubi steps \begin{align*} \text {integral}& = -\frac {B c-b C+A c \cos (x)-A b \sin (x)}{\left (b^2+c^2\right ) (b \cos (x)+c \sin (x))}+\frac {(b B+c C) \int \frac {1}{b \cos (x)+c \sin (x)} \, dx}{b^2+c^2} \\ & = -\frac {B c-b C+A c \cos (x)-A b \sin (x)}{\left (b^2+c^2\right ) (b \cos (x)+c \sin (x))}-\frac {(b B+c C) \text {Subst}\left (\int \frac {1}{b^2+c^2-x^2} \, dx,x,c \cos (x)-b \sin (x)\right )}{b^2+c^2} \\ & = -\frac {(b B+c C) \text {arctanh}\left (\frac {c \cos (x)-b \sin (x)}{\sqrt {b^2+c^2}}\right )}{\left (b^2+c^2\right )^{3/2}}-\frac {B c-b C+A c \cos (x)-A b \sin (x)}{\left (b^2+c^2\right ) (b \cos (x)+c \sin (x))} \\ \end{align*}
Time = 0.41 (sec) , antiderivative size = 92, normalized size of antiderivative = 1.08 \[ \int \frac {A+B \cos (x)+C \sin (x)}{(b \cos (x)+c \sin (x))^2} \, dx=\frac {2 (b B+c C) \text {arctanh}\left (\frac {-c+b \tan \left (\frac {x}{2}\right )}{\sqrt {b^2+c^2}}\right )}{\left (b^2+c^2\right )^{3/2}}+\frac {b (-B c+b C)+A \left (b^2+c^2\right ) \sin (x)}{b \left (b^2+c^2\right ) (b \cos (x)+c \sin (x))} \]
[In]
[Out]
Time = 0.76 (sec) , antiderivative size = 124, normalized size of antiderivative = 1.46
method | result | size |
default | \(\frac {-\frac {2 \left (A \,b^{2}+A \,c^{2}-B \,c^{2}+C b c \right ) \tan \left (\frac {x}{2}\right )}{b \left (b^{2}+c^{2}\right )}+\frac {2 \left (B c -b C \right )}{b^{2}+c^{2}}}{\tan \left (\frac {x}{2}\right )^{2} b -2 c \tan \left (\frac {x}{2}\right )-b}+\frac {2 \left (B b +C c \right ) \operatorname {arctanh}\left (\frac {2 b \tan \left (\frac {x}{2}\right )-2 c}{2 \sqrt {b^{2}+c^{2}}}\right )}{\left (b^{2}+c^{2}\right )^{\frac {3}{2}}}\) | \(124\) |
risch | \(-\frac {2 i \left (c A -i A b +B c \,{\mathrm e}^{i x}-C b \,{\mathrm e}^{i x}\right )}{\left (-i b +c \right ) \left (i b +c \right ) \left (c \,{\mathrm e}^{2 i x}+i b \,{\mathrm e}^{2 i x}-c +i b \right )}+\frac {b B \ln \left ({\mathrm e}^{i x}+\frac {i b^{3}+i b \,c^{2}-b^{2} c -c^{3}}{\left (b^{2}+c^{2}\right )^{\frac {3}{2}}}\right )}{\left (b^{2}+c^{2}\right )^{\frac {3}{2}}}+\frac {c C \ln \left ({\mathrm e}^{i x}+\frac {i b^{3}+i b \,c^{2}-b^{2} c -c^{3}}{\left (b^{2}+c^{2}\right )^{\frac {3}{2}}}\right )}{\left (b^{2}+c^{2}\right )^{\frac {3}{2}}}-\frac {b B \ln \left ({\mathrm e}^{i x}-\frac {i b^{3}+i b \,c^{2}-b^{2} c -c^{3}}{\left (b^{2}+c^{2}\right )^{\frac {3}{2}}}\right )}{\left (b^{2}+c^{2}\right )^{\frac {3}{2}}}-\frac {c C \ln \left ({\mathrm e}^{i x}-\frac {i b^{3}+i b \,c^{2}-b^{2} c -c^{3}}{\left (b^{2}+c^{2}\right )^{\frac {3}{2}}}\right )}{\left (b^{2}+c^{2}\right )^{\frac {3}{2}}}\) | \(293\) |
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 226 vs. \(2 (81) = 162\).
Time = 0.27 (sec) , antiderivative size = 226, normalized size of antiderivative = 2.66 \[ \int \frac {A+B \cos (x)+C \sin (x)}{(b \cos (x)+c \sin (x))^2} \, dx=\frac {2 \, C b^{3} - 2 \, B b^{2} c + 2 \, C b c^{2} - 2 \, B c^{3} + \sqrt {b^{2} + c^{2}} {\left ({\left (B b^{2} + C b c\right )} \cos \left (x\right ) + {\left (B b c + C c^{2}\right )} \sin \left (x\right )\right )} \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}\right )} \sin \left (x\right )}{2 \, {\left ({\left (b^{5} + 2 \, b^{3} c^{2} + b c^{4}\right )} \cos \left (x\right ) + {\left (b^{4} c + 2 \, b^{2} c^{3} + c^{5}\right )} \sin \left (x\right )\right )}} \]
[In]
[Out]
Exception generated. \[ \int \frac {A+B \cos (x)+C \sin (x)}{(b \cos (x)+c \sin (x))^2} \, dx=\text {Exception raised: AttributeError} \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 286 vs. \(2 (81) = 162\).
Time = 0.32 (sec) , antiderivative size = 286, normalized size of antiderivative = 3.36 \[ \int \frac {A+B \cos (x)+C \sin (x)}{(b \cos (x)+c \sin (x))^2} \, dx=-B {\left (\frac {b \log \left (\frac {c - \frac {b \sin \left (x\right )}{\cos \left (x\right ) + 1} + \sqrt {b^{2} + c^{2}}}{c - \frac {b \sin \left (x\right )}{\cos \left (x\right ) + 1} - \sqrt {b^{2} + c^{2}}}\right )}{{\left (b^{2} + c^{2}\right )}^{\frac {3}{2}}} + \frac {2 \, {\left (b c + \frac {c^{2} \sin \left (x\right )}{\cos \left (x\right ) + 1}\right )}}{b^{4} + b^{2} c^{2} + \frac {2 \, {\left (b^{3} c + b c^{3}\right )} \sin \left (x\right )}{\cos \left (x\right ) + 1} - \frac {{\left (b^{4} + b^{2} c^{2}\right )} \sin \left (x\right )^{2}}{{\left (\cos \left (x\right ) + 1\right )}^{2}}}\right )} - C {\left (\frac {c \log \left (\frac {c - \frac {b \sin \left (x\right )}{\cos \left (x\right ) + 1} + \sqrt {b^{2} + c^{2}}}{c - \frac {b \sin \left (x\right )}{\cos \left (x\right ) + 1} - \sqrt {b^{2} + c^{2}}}\right )}{{\left (b^{2} + c^{2}\right )}^{\frac {3}{2}}} - \frac {2 \, {\left (b + \frac {c \sin \left (x\right )}{\cos \left (x\right ) + 1}\right )}}{b^{3} + b c^{2} + \frac {2 \, {\left (b^{2} c + c^{3}\right )} \sin \left (x\right )}{\cos \left (x\right ) + 1} - \frac {{\left (b^{3} + b c^{2}\right )} \sin \left (x\right )^{2}}{{\left (\cos \left (x\right ) + 1\right )}^{2}}}\right )} - \frac {A}{c^{2} \tan \left (x\right ) + b c} \]
[In]
[Out]
none
Time = 0.29 (sec) , antiderivative size = 150, normalized size of antiderivative = 1.76 \[ \int \frac {A+B \cos (x)+C \sin (x)}{(b \cos (x)+c \sin (x))^2} \, dx=-\frac {{\left (B b + C c\right )} \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 )}{{\left (b^{2} + c^{2}\right )}^{\frac {3}{2}}} - \frac {2 \, {\left (A b^{2} \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 ) - B c^{2} \tan \left (\frac {1}{2} \, x\right ) + C b^{2} - B b c\right )}}{{\left (b^{3} + b c^{2}\right )} {\left (b \tan \left (\frac {1}{2} \, x\right )^{2} - 2 \, c \tan \left (\frac {1}{2} \, x\right ) - b\right )}} \]
[In]
[Out]
Time = 27.60 (sec) , antiderivative size = 141, normalized size of antiderivative = 1.66 \[ \int \frac {A+B \cos (x)+C \sin (x)}{(b \cos (x)+c \sin (x))^2} \, dx=-\frac {\frac {2\,\left (B\,c-C\,b\right )}{b^2+c^2}-\frac {2\,\mathrm {tan}\left (\frac {x}{2}\right )\,\left (A\,b^2+A\,c^2-B\,c^2+C\,b\,c\right )}{b\,\left (b^2+c^2\right )}}{-b\,{\mathrm {tan}\left (\frac {x}{2}\right )}^2+2\,c\,\mathrm {tan}\left (\frac {x}{2}\right )+b}+\frac {\mathrm {atan}\left (\frac {b^2\,c\,1{}\mathrm {i}+c^3\,1{}\mathrm {i}-b\,\mathrm {tan}\left (\frac {x}{2}\right )\,\left (b^2+c^2\right )\,1{}\mathrm {i}}{{\left (b^2+c^2\right )}^{3/2}}\right )\,\left (B\,b+C\,c\right )\,2{}\mathrm {i}}{{\left (b^2+c^2\right )}^{3/2}} \]
[In]
[Out]