Integrand size = 19, antiderivative size = 49 \[ \int \frac {a+b \cos ^2(x)}{c+d \sin ^2(x)} \, dx=-\frac {b x}{d}+\frac {(a d+b (c+d)) \arctan \left (\frac {\sqrt {c+d} \tan (x)}{\sqrt {c}}\right )}{\sqrt {c} d \sqrt {c+d}} \]
[Out]
Time = 0.19 (sec) , antiderivative size = 49, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.158, Rules used = {536, 209, 211} \[ \int \frac {a+b \cos ^2(x)}{c+d \sin ^2(x)} \, dx=\frac {(a d+b (c+d)) \arctan \left (\frac {\sqrt {c+d} \tan (x)}{\sqrt {c}}\right )}{\sqrt {c} d \sqrt {c+d}}-\frac {b x}{d} \]
[In]
[Out]
Rule 209
Rule 211
Rule 536
Rubi steps \begin{align*} \text {integral}& = \text {Subst}\left (\int \frac {a+b+a x^2}{\left (1+x^2\right ) \left (c+(c+d) x^2\right )} \, dx,x,\tan (x)\right ) \\ & = -\frac {b \text {Subst}\left (\int \frac {1}{1+x^2} \, dx,x,\tan (x)\right )}{d}+\frac {(-a c+(a+b) (c+d)) \text {Subst}\left (\int \frac {1}{c+(c+d) x^2} \, dx,x,\tan (x)\right )}{d} \\ & = -\frac {b x}{d}+\frac {(a d+b (c+d)) \arctan \left (\frac {\sqrt {c+d} \tan (x)}{\sqrt {c}}\right )}{\sqrt {c} d \sqrt {c+d}} \\ \end{align*}
Time = 0.57 (sec) , antiderivative size = 47, normalized size of antiderivative = 0.96 \[ \int \frac {a+b \cos ^2(x)}{c+d \sin ^2(x)} \, dx=\frac {-b x+\frac {(a d+b (c+d)) \arctan \left (\frac {\sqrt {c+d} \tan (x)}{\sqrt {c}}\right )}{\sqrt {c} \sqrt {c+d}}}{d} \]
[In]
[Out]
Time = 0.88 (sec) , antiderivative size = 46, normalized size of antiderivative = 0.94
method | result | size |
default | \(\frac {\left (a d +c b +b d \right ) \arctan \left (\frac {\left (c +d \right ) \tan \left (x \right )}{\sqrt {\left (c +d \right ) c}}\right )}{d \sqrt {\left (c +d \right ) c}}-\frac {b \arctan \left (\tan \left (x \right )\right )}{d}\) | \(46\) |
parts | \(\frac {a \arctan \left (\frac {\left (c +d \right ) \tan \left (x \right )}{\sqrt {\left (c +d \right ) c}}\right )}{\sqrt {\left (c +d \right ) c}}+b \left (\frac {\left (c +d \right ) \arctan \left (\frac {\left (c +d \right ) \tan \left (x \right )}{\sqrt {\left (c +d \right ) c}}\right )}{d \sqrt {\left (c +d \right ) c}}-\frac {\arctan \left (\tan \left (x \right )\right )}{d}\right )\) | \(64\) |
risch | \(-\frac {b x}{d}-\frac {\ln \left ({\mathrm e}^{2 i x}-\frac {2 i c^{2}+2 i d c +2 \sqrt {-c^{2}-c d}\, c +\sqrt {-c^{2}-c d}\, d}{\sqrt {-c^{2}-c d}\, d}\right ) a}{2 \sqrt {-c^{2}-c d}}-\frac {\ln \left ({\mathrm e}^{2 i x}-\frac {2 i c^{2}+2 i d c +2 \sqrt {-c^{2}-c d}\, c +\sqrt {-c^{2}-c d}\, d}{\sqrt {-c^{2}-c d}\, d}\right ) c b}{2 \sqrt {-c^{2}-c d}\, d}-\frac {\ln \left ({\mathrm e}^{2 i x}-\frac {2 i c^{2}+2 i d c +2 \sqrt {-c^{2}-c d}\, c +\sqrt {-c^{2}-c d}\, d}{\sqrt {-c^{2}-c d}\, d}\right ) b}{2 \sqrt {-c^{2}-c d}}+\frac {\ln \left ({\mathrm e}^{2 i x}-\frac {-2 i c^{2}-2 i d c +2 \sqrt {-c^{2}-c d}\, c +\sqrt {-c^{2}-c d}\, d}{\sqrt {-c^{2}-c d}\, d}\right ) a}{2 \sqrt {-c^{2}-c d}}+\frac {\ln \left ({\mathrm e}^{2 i x}-\frac {-2 i c^{2}-2 i d c +2 \sqrt {-c^{2}-c d}\, c +\sqrt {-c^{2}-c d}\, d}{\sqrt {-c^{2}-c d}\, d}\right ) c b}{2 \sqrt {-c^{2}-c d}\, d}+\frac {\ln \left ({\mathrm e}^{2 i x}-\frac {-2 i c^{2}-2 i d c +2 \sqrt {-c^{2}-c d}\, c +\sqrt {-c^{2}-c d}\, d}{\sqrt {-c^{2}-c d}\, d}\right ) b}{2 \sqrt {-c^{2}-c d}}\) | \(497\) |
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 85 vs. \(2 (41) = 82\).
Time = 0.27 (sec) , antiderivative size = 255, normalized size of antiderivative = 5.20 \[ \int \frac {a+b \cos ^2(x)}{c+d \sin ^2(x)} \, dx=\left [-\frac {{\left (b c + {\left (a + b\right )} d\right )} \sqrt {-c^{2} - c d} \log \left (\frac {{\left (8 \, c^{2} + 8 \, c d + d^{2}\right )} \cos \left (x\right )^{4} - 2 \, {\left (4 \, c^{2} + 5 \, c d + d^{2}\right )} \cos \left (x\right )^{2} + 4 \, {\left ({\left (2 \, c + d\right )} \cos \left (x\right )^{3} - {\left (c + d\right )} \cos \left (x\right )\right )} \sqrt {-c^{2} - c d} \sin \left (x\right ) + c^{2} + 2 \, c d + d^{2}}{d^{2} \cos \left (x\right )^{4} - 2 \, {\left (c d + d^{2}\right )} \cos \left (x\right )^{2} + c^{2} + 2 \, c d + d^{2}}\right ) + 4 \, {\left (b c^{2} + b c d\right )} x}{4 \, {\left (c^{2} d + c d^{2}\right )}}, -\frac {{\left (b c + {\left (a + b\right )} d\right )} \sqrt {c^{2} + c d} \arctan \left (\frac {{\left (2 \, c + d\right )} \cos \left (x\right )^{2} - c - d}{2 \, \sqrt {c^{2} + c d} \cos \left (x\right ) \sin \left (x\right )}\right ) + 2 \, {\left (b c^{2} + b c d\right )} x}{2 \, {\left (c^{2} d + c d^{2}\right )}}\right ] \]
[In]
[Out]
Timed out. \[ \int \frac {a+b \cos ^2(x)}{c+d \sin ^2(x)} \, dx=\text {Timed out} \]
[In]
[Out]
none
Time = 0.30 (sec) , antiderivative size = 42, normalized size of antiderivative = 0.86 \[ \int \frac {a+b \cos ^2(x)}{c+d \sin ^2(x)} \, dx=-\frac {b x}{d} + \frac {{\left (b c + {\left (a + b\right )} d\right )} \arctan \left (\frac {{\left (c + d\right )} \tan \left (x\right )}{\sqrt {{\left (c + d\right )} c}}\right )}{\sqrt {{\left (c + d\right )} c} d} \]
[In]
[Out]
none
Time = 0.28 (sec) , antiderivative size = 70, normalized size of antiderivative = 1.43 \[ \int \frac {a+b \cos ^2(x)}{c+d \sin ^2(x)} \, dx=-\frac {b x}{d} + \frac {{\left (\pi \left \lfloor \frac {x}{\pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (2 \, c + 2 \, d\right ) + \arctan \left (\frac {c \tan \left (x\right ) + d \tan \left (x\right )}{\sqrt {c^{2} + c d}}\right )\right )} {\left (b c + a d + b d\right )}}{\sqrt {c^{2} + c d} d} \]
[In]
[Out]
Time = 28.67 (sec) , antiderivative size = 1774, normalized size of antiderivative = 36.20 \[ \int \frac {a+b \cos ^2(x)}{c+d \sin ^2(x)} \, dx=\text {Too large to display} \]
[In]
[Out]