Integrand size = 48, antiderivative size = 66 \[ \int \frac {-a-\sqrt {1+a^2}+x}{\left (-a+\sqrt {1+a^2}+x\right ) \sqrt {(-a+x) \left (1+x^2\right )}} \, dx=-\sqrt {2} \sqrt {a+\sqrt {1+a^2}} \arctan \left (\frac {\sqrt {2} \sqrt {-a+\sqrt {1+a^2}} (-a+x)}{\sqrt {(-a+x) \left (1+x^2\right )}}\right ) \]
[Out]
Result contains higher order function than in optimal. Order 4 vs. order 3 in optimal.
Time = 0.85 (sec) , antiderivative size = 204, normalized size of antiderivative = 3.09, number of steps used = 9, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.167, Rules used = {6851, 6874, 733, 430, 946, 174, 552, 551} \[ \int \frac {-a-\sqrt {1+a^2}+x}{\left (-a+\sqrt {1+a^2}+x\right ) \sqrt {(-a+x) \left (1+x^2\right )}} \, dx=\frac {4 \sqrt {a^2+1} \sqrt {x^2+1} \sqrt {\frac {a-x}{a+i}} \operatorname {EllipticPi}\left (\frac {2}{1-i \left (a-\sqrt {a^2+1}\right )},\arcsin \left (\frac {\sqrt {1-i x}}{\sqrt {2}}\right ),\frac {2}{1-i a}\right )}{\left (1-i \left (a-\sqrt {a^2+1}\right )\right ) \sqrt {-\left (\left (x^2+1\right ) (a-x)\right )}}+\frac {2 i \sqrt {x^2+1} \sqrt {\frac {a-x}{a+i}} \operatorname {EllipticF}\left (\arcsin \left (\frac {\sqrt {1-i x}}{\sqrt {2}}\right ),\frac {2}{1-i a}\right )}{\sqrt {-\left (\left (x^2+1\right ) (a-x)\right )}} \]
[In]
[Out]
Rule 174
Rule 430
Rule 551
Rule 552
Rule 733
Rule 946
Rule 6851
Rule 6874
Rubi steps \begin{align*} \text {integral}& = \frac {\left (\sqrt {-a+x} \sqrt {1+x^2}\right ) \int \frac {-a-\sqrt {1+a^2}+x}{\sqrt {-a+x} \left (-a+\sqrt {1+a^2}+x\right ) \sqrt {1+x^2}} \, dx}{\sqrt {(-a+x) \left (1+x^2\right )}} \\ & = \frac {\left (\sqrt {-a+x} \sqrt {1+x^2}\right ) \int \left (\frac {1}{\sqrt {-a+x} \sqrt {1+x^2}}-\frac {2 \sqrt {1+a^2}}{\sqrt {-a+x} \left (-a+\sqrt {1+a^2}+x\right ) \sqrt {1+x^2}}\right ) \, dx}{\sqrt {(-a+x) \left (1+x^2\right )}} \\ & = \frac {\left (\sqrt {-a+x} \sqrt {1+x^2}\right ) \int \frac {1}{\sqrt {-a+x} \sqrt {1+x^2}} \, dx}{\sqrt {(-a+x) \left (1+x^2\right )}}-\frac {\left (2 \sqrt {1+a^2} \sqrt {-a+x} \sqrt {1+x^2}\right ) \int \frac {1}{\sqrt {-a+x} \left (-a+\sqrt {1+a^2}+x\right ) \sqrt {1+x^2}} \, dx}{\sqrt {(-a+x) \left (1+x^2\right )}} \\ & = -\frac {\left (2 \sqrt {1+a^2} \sqrt {-a+x} \sqrt {1+x^2}\right ) \int \frac {1}{\sqrt {1-i x} \sqrt {1+i x} \sqrt {-a+x} \left (-a+\sqrt {1+a^2}+x\right )} \, dx}{\sqrt {(-a+x) \left (1+x^2\right )}}+\frac {\left (2 i \sqrt {\frac {-a+x}{-i-a}} \sqrt {1+x^2}\right ) \text {Subst}\left (\int \frac {1}{\sqrt {1-x^2} \sqrt {1+\frac {2 i x^2}{-i-a}}} \, dx,x,\frac {\sqrt {1-i x}}{\sqrt {2}}\right )}{\sqrt {(-a+x) \left (1+x^2\right )}} \\ & = \frac {2 i \sqrt {\frac {a-x}{i+a}} \sqrt {1+x^2} \operatorname {EllipticF}\left (\arcsin \left (\frac {\sqrt {1-i x}}{\sqrt {2}}\right ),\frac {2}{1-i a}\right )}{\sqrt {-\left ((a-x) \left (1+x^2\right )\right )}}+\frac {\left (4 \sqrt {1+a^2} \sqrt {-a+x} \sqrt {1+x^2}\right ) \text {Subst}\left (\int \frac {1}{\sqrt {2-x^2} \left (1-i \left (a-\sqrt {1+a^2}\right )-x^2\right ) \sqrt {-i-a+i x^2}} \, dx,x,\sqrt {1-i x}\right )}{\sqrt {(-a+x) \left (1+x^2\right )}} \\ & = \frac {2 i \sqrt {\frac {a-x}{i+a}} \sqrt {1+x^2} \operatorname {EllipticF}\left (\arcsin \left (\frac {\sqrt {1-i x}}{\sqrt {2}}\right ),\frac {2}{1-i a}\right )}{\sqrt {-\left ((a-x) \left (1+x^2\right )\right )}}+\frac {\left (4 \sqrt {1+a^2} \sqrt {\frac {a-x}{i+a}} \sqrt {1+x^2}\right ) \text {Subst}\left (\int \frac {1}{\sqrt {2-x^2} \left (1-i \left (a-\sqrt {1+a^2}\right )-x^2\right ) \sqrt {1+\frac {i x^2}{-i-a}}} \, dx,x,\sqrt {1-i x}\right )}{\sqrt {(-a+x) \left (1+x^2\right )}} \\ & = \frac {2 i \sqrt {\frac {a-x}{i+a}} \sqrt {1+x^2} \operatorname {EllipticF}\left (\arcsin \left (\frac {\sqrt {1-i x}}{\sqrt {2}}\right ),\frac {2}{1-i a}\right )}{\sqrt {-\left ((a-x) \left (1+x^2\right )\right )}}+\frac {4 \sqrt {1+a^2} \sqrt {\frac {a-x}{i+a}} \sqrt {1+x^2} \operatorname {EllipticPi}\left (\frac {2}{1-i \left (a-\sqrt {1+a^2}\right )},\arcsin \left (\frac {\sqrt {1-i x}}{\sqrt {2}}\right ),\frac {2}{1-i a}\right )}{\left (1-i \left (a-\sqrt {1+a^2}\right )\right ) \sqrt {-\left ((a-x) \left (1+x^2\right )\right )}} \\ \end{align*}
Time = 2.11 (sec) , antiderivative size = 99, normalized size of antiderivative = 1.50 \[ \int \frac {-a-\sqrt {1+a^2}+x}{\left (-a+\sqrt {1+a^2}+x\right ) \sqrt {(-a+x) \left (1+x^2\right )}} \, dx=-\frac {\sqrt {2} \sqrt {-a+x} \sqrt {1+x^2} \arctan \left (\frac {\sqrt {2} \sqrt {-a+\sqrt {1+a^2}} \sqrt {-a+x}}{\sqrt {1+x^2}}\right )}{\sqrt {-a+\sqrt {1+a^2}} \sqrt {(-a+x) \left (1+x^2\right )}} \]
[In]
[Out]
Result contains higher order function than in optimal. Order 4 vs. order 3.
Time = 1.60 (sec) , antiderivative size = 787, normalized size of antiderivative = 11.92
method | result | size |
default | \(\frac {2 i \sqrt {-i \left (x +i\right )}\, \sqrt {\frac {-a +x}{-i-a}}\, \sqrt {i \left (x -i\right )}\, F\left (\frac {\sqrt {2}\, \sqrt {-i \left (x +i\right )}}{2}, \sqrt {2}\, \sqrt {-\frac {i}{-i-a}}\right )}{\sqrt {-a \,x^{2}+x^{3}-a +x}}-\frac {2 \sqrt {a^{2}+1}\, \left (2 a x -x^{2}+1\right ) \sqrt {-\left (a -x \right ) \left (x^{2}+1\right ) \left (a^{2}+1\right )}\, \left (-\frac {i \sqrt {a^{2}+1}\, \sqrt {-i x +1}\, \sqrt {-\frac {a}{-i-a}+\frac {x}{-i-a}}\, \sqrt {i x +1}\, \Pi \left (\frac {\sqrt {2}\, \sqrt {-i \left (x +i\right )}}{2}, -\frac {2 i}{-i-a -\sqrt {a^{2}+1}}, \sqrt {2}\, \sqrt {-\frac {i}{-i-a}}\right )}{\sqrt {-a^{3} x^{2}+a^{2} x^{3}-a^{3}+a^{2} x -a \,x^{2}+x^{3}-a +x}\, \left (-i-a -\sqrt {a^{2}+1}\right )}+\frac {i \sqrt {a^{2}+1}\, \sqrt {-i x +1}\, \sqrt {-\frac {a}{-i-a}+\frac {x}{-i-a}}\, \sqrt {i x +1}\, \Pi \left (\frac {\sqrt {2}\, \sqrt {-i \left (x +i\right )}}{2}, -\frac {2 i}{-i-a +\sqrt {a^{2}+1}}, \sqrt {2}\, \sqrt {-\frac {i}{-i-a}}\right )}{\sqrt {-a^{3} x^{2}+a^{2} x^{3}-a^{3}+a^{2} x -a \,x^{2}+x^{3}-a +x}\, \left (-i-a +\sqrt {a^{2}+1}\right )}+\frac {i \sqrt {-i x +1}\, \sqrt {-\frac {a}{-i-a}+\frac {x}{-i-a}}\, \sqrt {i x +1}\, \Pi \left (\frac {\sqrt {2}\, \sqrt {-i \left (x +i\right )}}{2}, -\frac {2 i}{-i-a -\sqrt {a^{2}+1}}, \sqrt {2}\, \sqrt {-\frac {i}{-i-a}}\right )}{\sqrt {-a \,x^{2}+x^{3}-a +x}\, \left (-i-a -\sqrt {a^{2}+1}\right )}+\frac {i \sqrt {-i x +1}\, \sqrt {-\frac {a}{-i-a}+\frac {x}{-i-a}}\, \sqrt {i x +1}\, \Pi \left (\frac {\sqrt {2}\, \sqrt {-i \left (x +i\right )}}{2}, -\frac {2 i}{-i-a +\sqrt {a^{2}+1}}, \sqrt {2}\, \sqrt {-\frac {i}{-i-a}}\right )}{\sqrt {-a \,x^{2}+x^{3}-a +x}\, \left (-i-a +\sqrt {a^{2}+1}\right )}\right )}{\left (-a +x +\sqrt {a^{2}+1}\right ) \left (\sqrt {-\left (a -x \right ) \left (x^{2}+1\right )}\, a^{2}+\sqrt {-\left (a -x \right ) \left (x^{2}+1\right ) \left (a^{2}+1\right )}\, a -\sqrt {-\left (a -x \right ) \left (x^{2}+1\right ) \left (a^{2}+1\right )}\, x +\sqrt {-\left (a -x \right ) \left (x^{2}+1\right )}\right )}\) | \(787\) |
elliptic | \(\text {Expression too large to display}\) | \(1463\) |
[In]
[Out]
none
Time = 0.30 (sec) , antiderivative size = 546, normalized size of antiderivative = 8.27 \[ \int \frac {-a-\sqrt {1+a^2}+x}{\left (-a+\sqrt {1+a^2}+x\right ) \sqrt {(-a+x) \left (1+x^2\right )}} \, dx=\left [\frac {1}{4} \, \sqrt {-2 \, a - 2 \, \sqrt {a^{2} + 1}} \log \left (-\frac {8 \, a x^{7} + x^{8} + 4 \, {\left (2 \, a^{2} + 15\right )} x^{6} - 8 \, {\left (4 \, a^{3} + 15 \, a\right )} x^{5} + 2 \, {\left (8 \, a^{4} + 80 \, a^{2} + 67\right )} x^{4} + 64 \, a^{4} - 8 \, {\left (20 \, a^{3} + 37 \, a\right )} x^{3} + 4 \, {\left (16 \, a^{4} + 74 \, a^{2} + 15\right )} x^{2} + 48 \, a^{2} - 4 \, {\left (a x^{6} + 2 \, {\left (2 \, a^{2} + 3\right )} x^{5} - {\left (4 \, a^{3} - a\right )} x^{4} - 8 \, a^{3} - {\left (4 \, a^{3} + 29 \, a\right )} x^{2} + 20 \, x^{3} + 2 \, {\left (10 \, a^{2} + 3\right )} x - {\left (4 \, a x^{5} + x^{6} - {\left (4 \, a^{2} - 15\right )} x^{4} - 16 \, a x^{3} + {\left (4 \, a^{2} + 15\right )} x^{2} + 8 \, a^{2} - 20 \, a x + 1\right )} \sqrt {a^{2} + 1} - 5 \, a\right )} \sqrt {-a x^{2} + x^{3} - a + x} \sqrt {-2 \, a - 2 \, \sqrt {a^{2} + 1}} - 8 \, {\left (24 \, a^{3} + 13 \, a\right )} x + 16 \, {\left (a x^{6} - x^{7} + 15 \, a x^{4} - 7 \, x^{5} - {\left (12 \, a^{2} + 7\right )} x^{3} + 4 \, a^{3} + {\left (4 \, a^{3} + 15 \, a\right )} x^{2} - {\left (12 \, a^{2} + 1\right )} x + a\right )} \sqrt {a^{2} + 1} + 1}{8 \, a x^{7} - x^{8} - 4 \, {\left (6 \, a^{2} - 1\right )} x^{6} + 8 \, {\left (4 \, a^{3} - 3 \, a\right )} x^{5} - 2 \, {\left (8 \, a^{4} - 24 \, a^{2} + 3\right )} x^{4} - 8 \, {\left (4 \, a^{3} - 3 \, a\right )} x^{3} - 4 \, {\left (6 \, a^{2} - 1\right )} x^{2} - 8 \, a x - 1}\right ), -\frac {1}{2} \, \sqrt {2 \, a + 2 \, \sqrt {a^{2} + 1}} \arctan \left (-\frac {\sqrt {-a x^{2} + x^{3} - a + x} {\left (2 \, a^{2} - 2 \, a x - x^{2} - 2 \, \sqrt {a^{2} + 1} {\left (a - x\right )} - 1\right )} \sqrt {2 \, a + 2 \, \sqrt {a^{2} + 1}}}{4 \, {\left (a x^{2} - x^{3} + a - x\right )}}\right )\right ] \]
[In]
[Out]
Timed out. \[ \int \frac {-a-\sqrt {1+a^2}+x}{\left (-a+\sqrt {1+a^2}+x\right ) \sqrt {(-a+x) \left (1+x^2\right )}} \, dx=\text {Timed out} \]
[In]
[Out]
\[ \int \frac {-a-\sqrt {1+a^2}+x}{\left (-a+\sqrt {1+a^2}+x\right ) \sqrt {(-a+x) \left (1+x^2\right )}} \, dx=\int { \frac {a - x + \sqrt {a^{2} + 1}}{\sqrt {-{\left (x^{2} + 1\right )} {\left (a - x\right )}} {\left (a - x - \sqrt {a^{2} + 1}\right )}} \,d x } \]
[In]
[Out]
\[ \int \frac {-a-\sqrt {1+a^2}+x}{\left (-a+\sqrt {1+a^2}+x\right ) \sqrt {(-a+x) \left (1+x^2\right )}} \, dx=\int { \frac {a - x + \sqrt {a^{2} + 1}}{\sqrt {-{\left (x^{2} + 1\right )} {\left (a - x\right )}} {\left (a - x - \sqrt {a^{2} + 1}\right )}} \,d x } \]
[In]
[Out]
Timed out. \[ \int \frac {-a-\sqrt {1+a^2}+x}{\left (-a+\sqrt {1+a^2}+x\right ) \sqrt {(-a+x) \left (1+x^2\right )}} \, dx=\int -\frac {a-x+\sqrt {a^2+1}}{\sqrt {-\left (x^2+1\right )\,\left (a-x\right )}\,\left (x-a+\sqrt {a^2+1}\right )} \,d x \]
[In]
[Out]