Integrand size = 25, antiderivative size = 58 \[ \int \frac {-1+x+x^2}{\left (1+x^2\right ) \sqrt {-x+x^3}} \, dx=-\frac {3}{4} \arctan \left (\frac {2 \sqrt {-x+x^3}}{-1-2 x+x^2}\right )-\frac {1}{4} \text {arctanh}\left (\frac {-\frac {1}{2}+x+\frac {x^2}{2}}{\sqrt {-x+x^3}}\right ) \]
[Out]
Result contains higher order function than in optimal. Order 4 vs. order 3 in optimal.
Time = 0.46 (sec) , antiderivative size = 182, normalized size of antiderivative = 3.14, number of steps used = 13, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.280, Rules used = {2081, 6857, 335, 228, 947, 174, 551} \[ \int \frac {-1+x+x^2}{\left (1+x^2\right ) \sqrt {-x+x^3}} \, dx=\frac {\sqrt {2} \sqrt {x-1} \sqrt {x} \sqrt {x+1} \operatorname {EllipticF}\left (\arcsin \left (\frac {\sqrt {2} \sqrt {x}}{\sqrt {x-1}}\right ),\frac {1}{2}\right )}{\sqrt {x^3-x}}+\frac {\left (\frac {1}{2}+\frac {3 i}{2}\right ) \sqrt {x} \sqrt {1-x^2} \operatorname {EllipticPi}\left (\frac {1}{2}-\frac {i}{2},\arcsin \left (\sqrt {1-x}\right ),\frac {1}{2}\right )}{\sqrt {2} \sqrt {x^3-x}}+\frac {\left (\frac {1}{2}-\frac {3 i}{2}\right ) \sqrt {x} \sqrt {1-x^2} \operatorname {EllipticPi}\left (\frac {1}{2}+\frac {i}{2},\arcsin \left (\sqrt {1-x}\right ),\frac {1}{2}\right )}{\sqrt {2} \sqrt {x^3-x}} \]
[In]
[Out]
Rule 174
Rule 228
Rule 335
Rule 551
Rule 947
Rule 2081
Rule 6857
Rubi steps \begin{align*} \text {integral}& = \frac {\left (\sqrt {x} \sqrt {-1+x^2}\right ) \int \frac {-1+x+x^2}{\sqrt {x} \sqrt {-1+x^2} \left (1+x^2\right )} \, dx}{\sqrt {-x+x^3}} \\ & = \frac {\left (\sqrt {x} \sqrt {-1+x^2}\right ) \int \left (\frac {1}{\sqrt {x} \sqrt {-1+x^2}}-\frac {2-x}{\sqrt {x} \sqrt {-1+x^2} \left (1+x^2\right )}\right ) \, dx}{\sqrt {-x+x^3}} \\ & = \frac {\left (\sqrt {x} \sqrt {-1+x^2}\right ) \int \frac {1}{\sqrt {x} \sqrt {-1+x^2}} \, dx}{\sqrt {-x+x^3}}-\frac {\left (\sqrt {x} \sqrt {-1+x^2}\right ) \int \frac {2-x}{\sqrt {x} \sqrt {-1+x^2} \left (1+x^2\right )} \, dx}{\sqrt {-x+x^3}} \\ & = -\frac {\left (\sqrt {x} \sqrt {-1+x^2}\right ) \int \left (\frac {\frac {1}{2}+i}{(i-x) \sqrt {x} \sqrt {-1+x^2}}-\frac {\frac {1}{2}-i}{\sqrt {x} (i+x) \sqrt {-1+x^2}}\right ) \, dx}{\sqrt {-x+x^3}}+\frac {\left (2 \sqrt {x} \sqrt {-1+x^2}\right ) \text {Subst}\left (\int \frac {1}{\sqrt {-1+x^4}} \, dx,x,\sqrt {x}\right )}{\sqrt {-x+x^3}} \\ & = \frac {\sqrt {2} \sqrt {-1+x} \sqrt {x} \sqrt {1+x} \operatorname {EllipticF}\left (\arcsin \left (\frac {\sqrt {2} \sqrt {x}}{\sqrt {-1+x}}\right ),\frac {1}{2}\right )}{\sqrt {-x+x^3}}--\frac {\left (\left (\frac {1}{2}-i\right ) \sqrt {x} \sqrt {-1+x^2}\right ) \int \frac {1}{\sqrt {x} (i+x) \sqrt {-1+x^2}} \, dx}{\sqrt {-x+x^3}}-\frac {\left (\left (\frac {1}{2}+i\right ) \sqrt {x} \sqrt {-1+x^2}\right ) \int \frac {1}{(i-x) \sqrt {x} \sqrt {-1+x^2}} \, dx}{\sqrt {-x+x^3}} \\ & = \frac {\sqrt {2} \sqrt {-1+x} \sqrt {x} \sqrt {1+x} \operatorname {EllipticF}\left (\arcsin \left (\frac {\sqrt {2} \sqrt {x}}{\sqrt {-1+x}}\right ),\frac {1}{2}\right )}{\sqrt {-x+x^3}}--\frac {\left (\left (\frac {1}{2}-i\right ) \sqrt {x} \sqrt {1-x^2}\right ) \int \frac {1}{\sqrt {1-x} \sqrt {x} (i+x) \sqrt {1+x}} \, dx}{\sqrt {-x+x^3}}-\frac {\left (\left (\frac {1}{2}+i\right ) \sqrt {x} \sqrt {1-x^2}\right ) \int \frac {1}{(i-x) \sqrt {1-x} \sqrt {x} \sqrt {1+x}} \, dx}{\sqrt {-x+x^3}} \\ & = \frac {\sqrt {2} \sqrt {-1+x} \sqrt {x} \sqrt {1+x} \operatorname {EllipticF}\left (\arcsin \left (\frac {\sqrt {2} \sqrt {x}}{\sqrt {-1+x}}\right ),\frac {1}{2}\right )}{\sqrt {-x+x^3}}--\frac {\left ((1+2 i) \sqrt {x} \sqrt {1-x^2}\right ) \text {Subst}\left (\int \frac {1}{\sqrt {1-x^2} \sqrt {2-x^2} \left ((-1+i)+x^2\right )} \, dx,x,\sqrt {1-x}\right )}{\sqrt {-x+x^3}}-\frac {\left ((1-2 i) \sqrt {x} \sqrt {1-x^2}\right ) \text {Subst}\left (\int \frac {1}{\sqrt {1-x^2} \left ((1+i)-x^2\right ) \sqrt {2-x^2}} \, dx,x,\sqrt {1-x}\right )}{\sqrt {-x+x^3}} \\ & = \frac {\sqrt {2} \sqrt {-1+x} \sqrt {x} \sqrt {1+x} \operatorname {EllipticF}\left (\arcsin \left (\frac {\sqrt {2} \sqrt {x}}{\sqrt {-1+x}}\right ),\frac {1}{2}\right )}{\sqrt {-x+x^3}}+\frac {\left (\frac {1}{2}+\frac {3 i}{2}\right ) \sqrt {x} \sqrt {1-x^2} \operatorname {EllipticPi}\left (\frac {1}{2}-\frac {i}{2},\arcsin \left (\sqrt {1-x}\right ),\frac {1}{2}\right )}{\sqrt {2} \sqrt {-x+x^3}}+\frac {\left (\frac {1}{2}-\frac {3 i}{2}\right ) \sqrt {x} \sqrt {1-x^2} \operatorname {EllipticPi}\left (\frac {1}{2}+\frac {i}{2},\arcsin \left (\sqrt {1-x}\right ),\frac {1}{2}\right )}{\sqrt {2} \sqrt {-x+x^3}} \\ \end{align*}
Result contains complex when optimal does not.
Time = 0.47 (sec) , antiderivative size = 84, normalized size of antiderivative = 1.45 \[ \int \frac {-1+x+x^2}{\left (1+x^2\right ) \sqrt {-x+x^3}} \, dx=\frac {\left (\frac {1}{4}+\frac {i}{4}\right ) \sqrt {x} \sqrt {-1+x^2} \left ((-1+2 i) \arctan \left (\frac {(1+i) \sqrt {x}}{\sqrt {-1+x^2}}\right )+(2-i) \arctan \left (\frac {\left (\frac {1}{2}+\frac {i}{2}\right ) \sqrt {-1+x^2}}{\sqrt {x}}\right )\right )}{\sqrt {x \left (-1+x^2\right )}} \]
[In]
[Out]
Time = 3.65 (sec) , antiderivative size = 92, normalized size of antiderivative = 1.59
method | result | size |
default | \(-\frac {\ln \left (\frac {x^{2}+2 \sqrt {x^{3}-x}+2 x -1}{x}\right )}{8}+\frac {3 \arctan \left (\frac {\sqrt {x^{3}-x}+x}{x}\right )}{4}+\frac {\ln \left (\frac {x^{2}-2 \sqrt {x^{3}-x}+2 x -1}{x}\right )}{8}+\frac {3 \arctan \left (\frac {\sqrt {x^{3}-x}-x}{x}\right )}{4}\) | \(92\) |
pseudoelliptic | \(-\frac {\ln \left (\frac {x^{2}+2 \sqrt {x^{3}-x}+2 x -1}{x}\right )}{8}+\frac {3 \arctan \left (\frac {\sqrt {x^{3}-x}+x}{x}\right )}{4}+\frac {\ln \left (\frac {x^{2}-2 \sqrt {x^{3}-x}+2 x -1}{x}\right )}{8}+\frac {3 \arctan \left (\frac {\sqrt {x^{3}-x}-x}{x}\right )}{4}\) | \(92\) |
elliptic | \(\frac {\sqrt {1+x}\, \sqrt {2-2 x}\, \sqrt {-x}\, \operatorname {EllipticF}\left (\sqrt {1+x}, \frac {\sqrt {2}}{2}\right )}{\sqrt {x^{3}-x}}-\frac {3 \sqrt {1+x}\, \sqrt {2-2 x}\, \sqrt {-x}\, \operatorname {EllipticPi}\left (\sqrt {1+x}, \frac {1}{2}-\frac {i}{2}, \frac {\sqrt {2}}{2}\right )}{4 \sqrt {x^{3}-x}}-\frac {i \sqrt {1+x}\, \sqrt {2-2 x}\, \sqrt {-x}\, \operatorname {EllipticPi}\left (\sqrt {1+x}, \frac {1}{2}-\frac {i}{2}, \frac {\sqrt {2}}{2}\right )}{4 \sqrt {x^{3}-x}}-\frac {3 \sqrt {1+x}\, \sqrt {2-2 x}\, \sqrt {-x}\, \operatorname {EllipticPi}\left (\sqrt {1+x}, \frac {1}{2}+\frac {i}{2}, \frac {\sqrt {2}}{2}\right )}{4 \sqrt {x^{3}-x}}+\frac {i \sqrt {1+x}\, \sqrt {2-2 x}\, \sqrt {-x}\, \operatorname {EllipticPi}\left (\sqrt {1+x}, \frac {1}{2}+\frac {i}{2}, \frac {\sqrt {2}}{2}\right )}{4 \sqrt {x^{3}-x}}\) | \(210\) |
trager | \(\frac {\operatorname {RootOf}\left (8 \textit {\_Z}^{2}+4 \textit {\_Z} +5\right ) \ln \left (-\frac {-928 \operatorname {RootOf}\left (8 \textit {\_Z}^{2}+4 \textit {\_Z} +5\right )^{2} x^{2}+1392 \operatorname {RootOf}\left (8 \textit {\_Z}^{2}+4 \textit {\_Z} +5\right )^{2} x -14 \operatorname {RootOf}\left (8 \textit {\_Z}^{2}+4 \textit {\_Z} +5\right ) x^{2}+2400 \sqrt {x^{3}-x}\, \operatorname {RootOf}\left (8 \textit {\_Z}^{2}+4 \textit {\_Z} +5\right )+928 \operatorname {RootOf}\left (8 \textit {\_Z}^{2}+4 \textit {\_Z} +5\right )^{2}+2196 \operatorname {RootOf}\left (8 \textit {\_Z}^{2}+4 \textit {\_Z} +5\right ) x +95 x^{2}+1050 \sqrt {x^{3}-x}+14 \operatorname {RootOf}\left (8 \textit {\_Z}^{2}+4 \textit {\_Z} +5\right )+570 x -95}{{\left (4 \operatorname {RootOf}\left (8 \textit {\_Z}^{2}+4 \textit {\_Z} +5\right ) x -8 \operatorname {RootOf}\left (8 \textit {\_Z}^{2}+4 \textit {\_Z} +5\right )+7 x +1\right )}^{2}}\right )}{2}-\frac {\ln \left (\frac {464 \operatorname {RootOf}\left (8 \textit {\_Z}^{2}+4 \textit {\_Z} +5\right )^{2} x^{2}-696 \operatorname {RootOf}\left (8 \textit {\_Z}^{2}+4 \textit {\_Z} +5\right )^{2} x +457 \operatorname {RootOf}\left (8 \textit {\_Z}^{2}+4 \textit {\_Z} +5\right ) x^{2}+1200 \sqrt {x^{3}-x}\, \operatorname {RootOf}\left (8 \textit {\_Z}^{2}+4 \textit {\_Z} +5\right )-464 \operatorname {RootOf}\left (8 \textit {\_Z}^{2}+4 \textit {\_Z} +5\right )^{2}+402 \operatorname {RootOf}\left (8 \textit {\_Z}^{2}+4 \textit {\_Z} +5\right ) x +65 x^{2}+75 \sqrt {x^{3}-x}-457 \operatorname {RootOf}\left (8 \textit {\_Z}^{2}+4 \textit {\_Z} +5\right )+90 x -65}{{\left (4 \operatorname {RootOf}\left (8 \textit {\_Z}^{2}+4 \textit {\_Z} +5\right ) x -8 \operatorname {RootOf}\left (8 \textit {\_Z}^{2}+4 \textit {\_Z} +5\right )-5 x -5\right )}^{2}}\right )}{4}-\frac {\ln \left (\frac {464 \operatorname {RootOf}\left (8 \textit {\_Z}^{2}+4 \textit {\_Z} +5\right )^{2} x^{2}-696 \operatorname {RootOf}\left (8 \textit {\_Z}^{2}+4 \textit {\_Z} +5\right )^{2} x +457 \operatorname {RootOf}\left (8 \textit {\_Z}^{2}+4 \textit {\_Z} +5\right ) x^{2}+1200 \sqrt {x^{3}-x}\, \operatorname {RootOf}\left (8 \textit {\_Z}^{2}+4 \textit {\_Z} +5\right )-464 \operatorname {RootOf}\left (8 \textit {\_Z}^{2}+4 \textit {\_Z} +5\right )^{2}+402 \operatorname {RootOf}\left (8 \textit {\_Z}^{2}+4 \textit {\_Z} +5\right ) x +65 x^{2}+75 \sqrt {x^{3}-x}-457 \operatorname {RootOf}\left (8 \textit {\_Z}^{2}+4 \textit {\_Z} +5\right )+90 x -65}{{\left (4 \operatorname {RootOf}\left (8 \textit {\_Z}^{2}+4 \textit {\_Z} +5\right ) x -8 \operatorname {RootOf}\left (8 \textit {\_Z}^{2}+4 \textit {\_Z} +5\right )-5 x -5\right )}^{2}}\right ) \operatorname {RootOf}\left (8 \textit {\_Z}^{2}+4 \textit {\_Z} +5\right )}{2}\) | \(544\) |
[In]
[Out]
none
Time = 0.30 (sec) , antiderivative size = 76, normalized size of antiderivative = 1.31 \[ \int \frac {-1+x+x^2}{\left (1+x^2\right ) \sqrt {-x+x^3}} \, dx=\frac {3}{4} \, \arctan \left (\frac {x^{2} - 2 \, x - 1}{2 \, \sqrt {x^{3} - x}}\right ) + \frac {1}{8} \, \log \left (\frac {x^{4} + 8 \, x^{3} + 2 \, x^{2} - 4 \, \sqrt {x^{3} - x} {\left (x^{2} + 2 \, x - 1\right )} - 8 \, x + 1}{x^{4} + 2 \, x^{2} + 1}\right ) \]
[In]
[Out]
\[ \int \frac {-1+x+x^2}{\left (1+x^2\right ) \sqrt {-x+x^3}} \, dx=\int \frac {x^{2} + x - 1}{\sqrt {x \left (x - 1\right ) \left (x + 1\right )} \left (x^{2} + 1\right )}\, dx \]
[In]
[Out]
\[ \int \frac {-1+x+x^2}{\left (1+x^2\right ) \sqrt {-x+x^3}} \, dx=\int { \frac {x^{2} + x - 1}{\sqrt {x^{3} - x} {\left (x^{2} + 1\right )}} \,d x } \]
[In]
[Out]
\[ \int \frac {-1+x+x^2}{\left (1+x^2\right ) \sqrt {-x+x^3}} \, dx=\int { \frac {x^{2} + x - 1}{\sqrt {x^{3} - x} {\left (x^{2} + 1\right )}} \,d x } \]
[In]
[Out]
Time = 5.70 (sec) , antiderivative size = 100, normalized size of antiderivative = 1.72 \[ \int \frac {-1+x+x^2}{\left (1+x^2\right ) \sqrt {-x+x^3}} \, dx=\frac {-2\,\sqrt {-x}\,\sqrt {1-x}\,\sqrt {x+1}\,\mathrm {F}\left (\mathrm {asin}\left (\sqrt {-x}\right )\middle |-1\right )+\sqrt {-x}\,\sqrt {1-x}\,\sqrt {x+1}\,\Pi \left (-\mathrm {i};\mathrm {asin}\left (\sqrt {-x}\right )\middle |-1\right )\,\left (2+1{}\mathrm {i}\right )+\sqrt {-x}\,\sqrt {1-x}\,\sqrt {x+1}\,\Pi \left (1{}\mathrm {i};\mathrm {asin}\left (\sqrt {-x}\right )\middle |-1\right )\,\left (2-\mathrm {i}\right )}{\sqrt {x^3-x}} \]
[In]
[Out]