Integrand size = 22, antiderivative size = 84 \[ \int \frac {A+B \cos (x)+C \sin (x)}{b \cos (x)+c \sin (x)} \, dx=\frac {(b B+c C) x}{b^2+c^2}-\frac {A \text {arctanh}\left (\frac {c \cos (x)-b \sin (x)}{\sqrt {b^2+c^2}}\right )}{\sqrt {b^2+c^2}}+\frac {(B c-b C) \log (b \cos (x)+c \sin (x))}{b^2+c^2} \]
[Out]
Time = 0.07 (sec) , antiderivative size = 84, 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 = {3215, 3153, 212} \[ \int \frac {A+B \cos (x)+C \sin (x)}{b \cos (x)+c \sin (x)} \, dx=-\frac {A \text {arctanh}\left (\frac {c \cos (x)-b \sin (x)}{\sqrt {b^2+c^2}}\right )}{\sqrt {b^2+c^2}}+\frac {x (b B+c C)}{b^2+c^2}+\frac {(B c-b C) \log (b \cos (x)+c \sin (x))}{b^2+c^2} \]
[In]
[Out]
Rule 212
Rule 3153
Rule 3215
Rubi steps \begin{align*} \text {integral}& = \frac {(b B+c C) x}{b^2+c^2}+\frac {(B c-b C) \log (b \cos (x)+c \sin (x))}{b^2+c^2}+A \int \frac {1}{b \cos (x)+c \sin (x)} \, dx \\ & = \frac {(b B+c C) x}{b^2+c^2}+\frac {(B c-b C) \log (b \cos (x)+c \sin (x))}{b^2+c^2}-A \text {Subst}\left (\int \frac {1}{b^2+c^2-x^2} \, dx,x,c \cos (x)-b \sin (x)\right ) \\ & = \frac {(b B+c C) x}{b^2+c^2}-\frac {A \text {arctanh}\left (\frac {c \cos (x)-b \sin (x)}{\sqrt {b^2+c^2}}\right )}{\sqrt {b^2+c^2}}+\frac {(B c-b C) \log (b \cos (x)+c \sin (x))}{b^2+c^2} \\ \end{align*}
Time = 0.39 (sec) , antiderivative size = 78, normalized size of antiderivative = 0.93 \[ \int \frac {A+B \cos (x)+C \sin (x)}{b \cos (x)+c \sin (x)} \, dx=\frac {(b B+c C) x+2 A \sqrt {b^2+c^2} \text {arctanh}\left (\frac {-c+b \tan \left (\frac {x}{2}\right )}{\sqrt {b^2+c^2}}\right )+(B c-b C) \log (b \cos (x)+c \sin (x))}{b^2+c^2} \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. \(166\) vs. \(2(80)=160\).
Time = 0.89 (sec) , antiderivative size = 167, normalized size of antiderivative = 1.99
method | result | size |
default | \(\frac {\left (-B c +b C \right ) \ln \left (1+\tan \left (\frac {x}{2}\right )^{2}\right )+2 \left (B b +C c \right ) \arctan \left (\tan \left (\frac {x}{2}\right )\right )}{b^{2}+c^{2}}+\frac {\frac {\left (b B c -b^{2} C \right ) \ln \left (\tan \left (\frac {x}{2}\right )^{2} b -2 c \tan \left (\frac {x}{2}\right )-b \right )}{b}-\frac {2 \left (-A \,b^{2}-A \,c^{2}-B \,c^{2}+C b c +\frac {\left (b B c -b^{2} C \right ) c}{b}\right ) \operatorname {arctanh}\left (\frac {2 b \tan \left (\frac {x}{2}\right )-2 c}{2 \sqrt {b^{2}+c^{2}}}\right )}{\sqrt {b^{2}+c^{2}}}}{b^{2}+c^{2}}\) | \(167\) |
risch | \(\frac {i x C}{i c -b}-\frac {B x}{i c -b}-\frac {2 i x B \,b^{2} c}{b^{4}+2 b^{2} c^{2}+c^{4}}-\frac {2 i x B \,c^{3}}{b^{4}+2 b^{2} c^{2}+c^{4}}+\frac {2 i C x \,b^{3}}{b^{4}+2 b^{2} c^{2}+c^{4}}+\frac {2 i C x \,c^{2} b}{b^{4}+2 b^{2} c^{2}+c^{4}}+\frac {\ln \left ({\mathrm e}^{i x}+\frac {\left (i b -c \right ) \sqrt {A^{2} b^{2}+A^{2} c^{2}}}{A \left (b^{2}+c^{2}\right )}\right ) B c}{b^{2}+c^{2}}-\frac {\ln \left ({\mathrm e}^{i x}+\frac {\left (i b -c \right ) \sqrt {A^{2} b^{2}+A^{2} c^{2}}}{A \left (b^{2}+c^{2}\right )}\right ) b C}{b^{2}+c^{2}}+\frac {\ln \left ({\mathrm e}^{i x}+\frac {\left (i b -c \right ) \sqrt {A^{2} b^{2}+A^{2} c^{2}}}{A \left (b^{2}+c^{2}\right )}\right ) \sqrt {A^{2} b^{2}+A^{2} c^{2}}}{b^{2}+c^{2}}+\frac {\ln \left ({\mathrm e}^{i x}-\frac {\left (i b -c \right ) \sqrt {A^{2} b^{2}+A^{2} c^{2}}}{A \left (b^{2}+c^{2}\right )}\right ) B c}{b^{2}+c^{2}}-\frac {\ln \left ({\mathrm e}^{i x}-\frac {\left (i b -c \right ) \sqrt {A^{2} b^{2}+A^{2} c^{2}}}{A \left (b^{2}+c^{2}\right )}\right ) b C}{b^{2}+c^{2}}-\frac {\ln \left ({\mathrm e}^{i x}-\frac {\left (i b -c \right ) \sqrt {A^{2} b^{2}+A^{2} c^{2}}}{A \left (b^{2}+c^{2}\right )}\right ) \sqrt {A^{2} b^{2}+A^{2} c^{2}}}{b^{2}+c^{2}}\) | \(511\) |
[In]
[Out]
none
Time = 0.27 (sec) , antiderivative size = 155, normalized size of antiderivative = 1.85 \[ \int \frac {A+B \cos (x)+C \sin (x)}{b \cos (x)+c \sin (x)} \, dx=\frac {\sqrt {b^{2} + c^{2}} A \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 (B b + C c\right )} x - {\left (C b - B c\right )} \log \left (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 (b^{2} + c^{2}\right )}} \]
[In]
[Out]
Result contains complex when optimal does not.
Time = 10.95 (sec) , antiderivative size = 1030, normalized size of antiderivative = 12.26 \[ \int \frac {A+B \cos (x)+C \sin (x)}{b \cos (x)+c \sin (x)} \, dx=\text {Too large to display} \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 243 vs. \(2 (81) = 162\).
Time = 0.35 (sec) , antiderivative size = 243, normalized size of antiderivative = 2.89 \[ \int \frac {A+B \cos (x)+C \sin (x)}{b \cos (x)+c \sin (x)} \, dx=B {\left (\frac {2 \, b \arctan \left (\frac {\sin \left (x\right )}{\cos \left (x\right ) + 1}\right )}{b^{2} + c^{2}} + \frac {c \log \left (-b - \frac {2 \, c \sin \left (x\right )}{\cos \left (x\right ) + 1} + \frac {b \sin \left (x\right )^{2}}{{\left (\cos \left (x\right ) + 1\right )}^{2}}\right )}{b^{2} + c^{2}} - \frac {c \log \left (\frac {\sin \left (x\right )^{2}}{{\left (\cos \left (x\right ) + 1\right )}^{2}} + 1\right )}{b^{2} + c^{2}}\right )} + C {\left (\frac {2 \, c \arctan \left (\frac {\sin \left (x\right )}{\cos \left (x\right ) + 1}\right )}{b^{2} + c^{2}} - \frac {b \log \left (-b - \frac {2 \, c \sin \left (x\right )}{\cos \left (x\right ) + 1} + \frac {b \sin \left (x\right )^{2}}{{\left (\cos \left (x\right ) + 1\right )}^{2}}\right )}{b^{2} + c^{2}} + \frac {b \log \left (\frac {\sin \left (x\right )^{2}}{{\left (\cos \left (x\right ) + 1\right )}^{2}} + 1\right )}{b^{2} + c^{2}}\right )} - \frac {A \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 )}{\sqrt {b^{2} + c^{2}}} \]
[In]
[Out]
none
Time = 0.31 (sec) , antiderivative size = 148, normalized size of antiderivative = 1.76 \[ \int \frac {A+B \cos (x)+C \sin (x)}{b \cos (x)+c \sin (x)} \, dx=-\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 )}{\sqrt {b^{2} + c^{2}}} + \frac {{\left (B b + C c\right )} x}{b^{2} + c^{2}} + \frac {{\left (C b - B c\right )} \log \left (\tan \left (\frac {1}{2} \, x\right )^{2} + 1\right )}{b^{2} + c^{2}} - \frac {{\left (C b - B c\right )} \log \left ({\left | b \tan \left (\frac {1}{2} \, x\right )^{2} - 2 \, c \tan \left (\frac {1}{2} \, x\right ) - b \right |}\right )}{b^{2} + c^{2}} \]
[In]
[Out]
Time = 34.61 (sec) , antiderivative size = 1099, normalized size of antiderivative = 13.08 \[ \int \frac {A+B \cos (x)+C \sin (x)}{b \cos (x)+c \sin (x)} \, dx=\ln \left (32\,A^2\,B\,b^2-32\,A\,B^2\,b^2-32\,A\,C^2\,b^2-32\,B\,C^2\,b^2+32\,b\,\mathrm {tan}\left (\frac {x}{2}\right )\,\left (c\,A^2\,B+b\,A^2\,C-2\,c\,A\,B^2-2\,c\,A\,C^2+c\,B^3-b\,B^2\,C+2\,c\,B\,C^2-2\,b\,C^3\right )-\frac {\left (A\,\sqrt {{\left (b^2+c^2\right )}^3}+B\,c^3-C\,b^3+B\,b^2\,c-C\,b\,c^2\right )\,\left (32\,b\,\mathrm {tan}\left (\frac {x}{2}\right )\,\left (A^2\,b^2-A^2\,c^2+4\,A\,B\,c^2-4\,A\,C\,b\,c+B^2\,b^2-3\,B^2\,c^2+6\,B\,C\,b\,c+2\,C^2\,c^2\right )-32\,B^2\,b^2\,c-32\,C^2\,b^2\,c-64\,A^2\,b^2\,c-64\,A\,C\,b^3+64\,B\,C\,b^3+\frac {\left (A\,\sqrt {{\left (b^2+c^2\right )}^3}+B\,c^3-C\,b^3+B\,b^2\,c-C\,b\,c^2\right )\,\left (32\,A\,b^4+32\,B\,b^4+32\,A\,b^2\,c^2-64\,B\,b^2\,c^2-32\,C\,b\,c^3+64\,C\,b^3\,c+32\,b\,\mathrm {tan}\left (\frac {x}{2}\right )\,\left (2\,A\,c^3+B\,c^3-2\,C\,b^3+2\,A\,b^2\,c+4\,B\,b^2\,c+C\,b\,c^2\right )+\frac {96\,b\,c\,\left (b+c\,\mathrm {tan}\left (\frac {x}{2}\right )\right )\,\left (A\,\sqrt {{\left (b^2+c^2\right )}^3}+B\,c^3-C\,b^3+B\,b^2\,c-C\,b\,c^2\right )}{b^2+c^2}\right )}{{\left (b^2+c^2\right )}^2}+64\,A\,B\,b^2\,c+64\,B\,C\,b\,c^2\right )}{{\left (b^2+c^2\right )}^2}-32\,A^2\,C\,b\,c+32\,B^2\,C\,b\,c\right )\,\left (\frac {B\,c-C\,b}{b^2+c^2}+\frac {A\,\sqrt {{\left (b^2+c^2\right )}^3}}{{\left (b^2+c^2\right )}^2}\right )+\ln \left (32\,A^2\,B\,b^2-32\,A\,B^2\,b^2-32\,A\,C^2\,b^2-32\,B\,C^2\,b^2+32\,b\,\mathrm {tan}\left (\frac {x}{2}\right )\,\left (c\,A^2\,B+b\,A^2\,C-2\,c\,A\,B^2-2\,c\,A\,C^2+c\,B^3-b\,B^2\,C+2\,c\,B\,C^2-2\,b\,C^3\right )-\frac {\left (A\,\sqrt {{\left (b^2+c^2\right )}^3}-B\,c^3+C\,b^3-B\,b^2\,c+C\,b\,c^2\right )\,\left (64\,A^2\,b^2\,c+32\,B^2\,b^2\,c+32\,C^2\,b^2\,c-32\,b\,\mathrm {tan}\left (\frac {x}{2}\right )\,\left (A^2\,b^2-A^2\,c^2+4\,A\,B\,c^2-4\,A\,C\,b\,c+B^2\,b^2-3\,B^2\,c^2+6\,B\,C\,b\,c+2\,C^2\,c^2\right )+64\,A\,C\,b^3-64\,B\,C\,b^3+\frac {\left (A\,\sqrt {{\left (b^2+c^2\right )}^3}-B\,c^3+C\,b^3-B\,b^2\,c+C\,b\,c^2\right )\,\left (32\,A\,b^4+32\,B\,b^4+32\,A\,b^2\,c^2-64\,B\,b^2\,c^2-32\,C\,b\,c^3+64\,C\,b^3\,c+32\,b\,\mathrm {tan}\left (\frac {x}{2}\right )\,\left (2\,A\,c^3+B\,c^3-2\,C\,b^3+2\,A\,b^2\,c+4\,B\,b^2\,c+C\,b\,c^2\right )-\frac {96\,b\,c\,\left (b+c\,\mathrm {tan}\left (\frac {x}{2}\right )\right )\,\left (A\,\sqrt {{\left (b^2+c^2\right )}^3}-B\,c^3+C\,b^3-B\,b^2\,c+C\,b\,c^2\right )}{b^2+c^2}\right )}{{\left (b^2+c^2\right )}^2}-64\,A\,B\,b^2\,c-64\,B\,C\,b\,c^2\right )}{{\left (b^2+c^2\right )}^2}-32\,A^2\,C\,b\,c+32\,B^2\,C\,b\,c\right )\,\left (\frac {B\,c-C\,b}{b^2+c^2}-\frac {A\,\sqrt {{\left (b^2+c^2\right )}^3}}{{\left (b^2+c^2\right )}^2}\right )-\frac {\ln \left (\mathrm {tan}\left (\frac {x}{2}\right )+1{}\mathrm {i}\right )\,\left (B-C\,1{}\mathrm {i}\right )}{c+b\,1{}\mathrm {i}}+\frac {\ln \left (\mathrm {tan}\left (\frac {x}{2}\right )-\mathrm {i}\right )\,\left (B+C\,1{}\mathrm {i}\right )}{-c+b\,1{}\mathrm {i}} \]
[In]
[Out]