Integrand size = 20, antiderivative size = 43 \[ \int \frac {\sin ^2(x)}{a \cos ^2(x)+b \sin ^2(x)} \, dx=-\frac {x}{a-b}+\frac {\sqrt {a} \arctan \left (\frac {\sqrt {b} \tan (x)}{\sqrt {a}}\right )}{(a-b) \sqrt {b}} \]
[Out]
Time = 0.18 (sec) , antiderivative size = 43, 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.150, Rules used = {492, 209, 211} \[ \int \frac {\sin ^2(x)}{a \cos ^2(x)+b \sin ^2(x)} \, dx=\frac {\sqrt {a} \arctan \left (\frac {\sqrt {b} \tan (x)}{\sqrt {a}}\right )}{\sqrt {b} (a-b)}-\frac {x}{a-b} \]
[In]
[Out]
Rule 209
Rule 211
Rule 492
Rubi steps \begin{align*} \text {integral}& = \text {Subst}\left (\int \frac {x^2}{\left (1+x^2\right ) \left (a+b x^2\right )} \, dx,x,\tan (x)\right ) \\ & = -\frac {\text {Subst}\left (\int \frac {1}{1+x^2} \, dx,x,\tan (x)\right )}{a-b}+\frac {a \text {Subst}\left (\int \frac {1}{a+b x^2} \, dx,x,\tan (x)\right )}{a-b} \\ & = -\frac {x}{a-b}+\frac {\sqrt {a} \arctan \left (\frac {\sqrt {b} \tan (x)}{\sqrt {a}}\right )}{(a-b) \sqrt {b}} \\ \end{align*}
Time = 0.30 (sec) , antiderivative size = 36, normalized size of antiderivative = 0.84 \[ \int \frac {\sin ^2(x)}{a \cos ^2(x)+b \sin ^2(x)} \, dx=\frac {x-\frac {\sqrt {a} \arctan \left (\frac {\sqrt {b} \tan (x)}{\sqrt {a}}\right )}{\sqrt {b}}}{-a+b} \]
[In]
[Out]
Time = 0.53 (sec) , antiderivative size = 38, normalized size of antiderivative = 0.88
method | result | size |
default | \(\frac {a \arctan \left (\frac {b \tan \left (x \right )}{\sqrt {a b}}\right )}{\left (a -b \right ) \sqrt {a b}}-\frac {\arctan \left (\tan \left (x \right )\right )}{a -b}\) | \(38\) |
risch | \(-\frac {x}{a -b}-\frac {\sqrt {-a b}\, \ln \left ({\mathrm e}^{2 i x}+\frac {2 i \sqrt {-a b}+a +b}{a -b}\right )}{2 b \left (a -b \right )}+\frac {\sqrt {-a b}\, \ln \left ({\mathrm e}^{2 i x}-\frac {2 i \sqrt {-a b}-a -b}{a -b}\right )}{2 b \left (a -b \right )}\) | \(107\) |
[In]
[Out]
none
Time = 0.28 (sec) , antiderivative size = 182, normalized size of antiderivative = 4.23 \[ \int \frac {\sin ^2(x)}{a \cos ^2(x)+b \sin ^2(x)} \, dx=\left [-\frac {\sqrt {-\frac {a}{b}} \log \left (\frac {{\left (a^{2} + 6 \, a b + b^{2}\right )} \cos \left (x\right )^{4} - 2 \, {\left (3 \, a b + b^{2}\right )} \cos \left (x\right )^{2} + 4 \, {\left ({\left (a b + b^{2}\right )} \cos \left (x\right )^{3} - b^{2} \cos \left (x\right )\right )} \sqrt {-\frac {a}{b}} \sin \left (x\right ) + b^{2}}{{\left (a^{2} - 2 \, a b + b^{2}\right )} \cos \left (x\right )^{4} + 2 \, {\left (a b - b^{2}\right )} \cos \left (x\right )^{2} + b^{2}}\right ) + 4 \, x}{4 \, {\left (a - b\right )}}, -\frac {\sqrt {\frac {a}{b}} \arctan \left (\frac {{\left ({\left (a + b\right )} \cos \left (x\right )^{2} - b\right )} \sqrt {\frac {a}{b}}}{2 \, a \cos \left (x\right ) \sin \left (x\right )}\right ) + 2 \, x}{2 \, {\left (a - b\right )}}\right ] \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 216 vs. \(2 (32) = 64\).
Time = 0.58 (sec) , antiderivative size = 216, normalized size of antiderivative = 5.02 \[ \int \frac {\sin ^2(x)}{a \cos ^2(x)+b \sin ^2(x)} \, dx=\begin {cases} \tilde {\infty } x & \text {for}\: a = 0 \wedge b = 0 \\\frac {- x + \frac {\sin {\left (x \right )}}{\cos {\left (x \right )}}}{a} & \text {for}\: b = 0 \\\frac {x}{b} & \text {for}\: a = 0 \\\frac {x \sin ^{2}{\left (x \right )}}{2 b \sin ^{2}{\left (x \right )} + 2 b \cos ^{2}{\left (x \right )}} + \frac {x \cos ^{2}{\left (x \right )}}{2 b \sin ^{2}{\left (x \right )} + 2 b \cos ^{2}{\left (x \right )}} - \frac {\sin {\left (x \right )} \cos {\left (x \right )}}{2 b \sin ^{2}{\left (x \right )} + 2 b \cos ^{2}{\left (x \right )}} & \text {for}\: a = b \\\frac {a \log {\left (- \sqrt {- \frac {a}{b}} \cos {\left (x \right )} + \sin {\left (x \right )} \right )}}{2 a b \sqrt {- \frac {a}{b}} - 2 b^{2} \sqrt {- \frac {a}{b}}} - \frac {a \log {\left (\sqrt {- \frac {a}{b}} \cos {\left (x \right )} + \sin {\left (x \right )} \right )}}{2 a b \sqrt {- \frac {a}{b}} - 2 b^{2} \sqrt {- \frac {a}{b}}} - \frac {2 b x \sqrt {- \frac {a}{b}}}{2 a b \sqrt {- \frac {a}{b}} - 2 b^{2} \sqrt {- \frac {a}{b}}} & \text {otherwise} \end {cases} \]
[In]
[Out]
none
Time = 0.30 (sec) , antiderivative size = 35, normalized size of antiderivative = 0.81 \[ \int \frac {\sin ^2(x)}{a \cos ^2(x)+b \sin ^2(x)} \, dx=\frac {a \arctan \left (\frac {b \tan \left (x\right )}{\sqrt {a b}}\right )}{\sqrt {a b} {\left (a - b\right )}} - \frac {x}{a - b} \]
[In]
[Out]
none
Time = 0.28 (sec) , antiderivative size = 48, normalized size of antiderivative = 1.12 \[ \int \frac {\sin ^2(x)}{a \cos ^2(x)+b \sin ^2(x)} \, dx=\frac {{\left (\pi \left \lfloor \frac {x}{\pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (b\right ) + \arctan \left (\frac {b \tan \left (x\right )}{\sqrt {a b}}\right )\right )} a}{\sqrt {a b} {\left (a - b\right )}} - \frac {x}{a - b} \]
[In]
[Out]
Time = 27.92 (sec) , antiderivative size = 51, normalized size of antiderivative = 1.19 \[ \int \frac {\sin ^2(x)}{a \cos ^2(x)+b \sin ^2(x)} \, dx=\left \{\begin {array}{cl} \frac {2\,x-\sin \left (2\,x\right )}{4\,b} & \text {\ if\ \ }a=b\\ -\frac {x-\frac {\sqrt {a}\,\mathrm {atan}\left (\frac {\sqrt {b}\,\mathrm {tan}\left (x\right )}{\sqrt {a}}\right )}{\sqrt {b}}}{a-b} & \text {\ if\ \ }a\neq b \end {array}\right . \]
[In]
[Out]