Integrand size = 30, antiderivative size = 73 \[ \int \frac {-2+3 x+x^2}{\left (-1-2 x+x^2\right ) \sqrt {-x+x^3}} \, dx=\frac {1}{4} \left (-6+\sqrt {2}\right ) \text {arctanh}\left (\frac {-1+x}{\left (-1+\sqrt {2}\right ) \sqrt {-x+x^3}}\right )+\frac {1}{4} \left (6+\sqrt {2}\right ) \text {arctanh}\left (\frac {-1+x}{\left (1+\sqrt {2}\right ) \sqrt {-x+x^3}}\right ) \]
[Out]
Result contains higher order function than in optimal. Order 4 vs. order 3 in optimal.
Time = 0.82 (sec) , antiderivative size = 180, normalized size of antiderivative = 2.47, number of steps used = 13, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.233, Rules used = {2081, 6860, 335, 228, 947, 174, 551} \[ \int \frac {-2+3 x+x^2}{\left (-1-2 x+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 (5+2 \sqrt {2}\right ) \sqrt {x} \sqrt {1-x^2} \operatorname {EllipticPi}\left (-\frac {1}{\sqrt {2}},\arcsin \left (\sqrt {1-x}\right ),\frac {1}{2}\right )}{2 \sqrt {x^3-x}}-\frac {\left (5-2 \sqrt {2}\right ) \sqrt {x} \sqrt {1-x^2} \operatorname {EllipticPi}\left (\frac {1}{\sqrt {2}},\arcsin \left (\sqrt {1-x}\right ),\frac {1}{2}\right )}{2 \sqrt {x^3-x}} \]
[In]
[Out]
Rule 174
Rule 228
Rule 335
Rule 551
Rule 947
Rule 2081
Rule 6860
Rubi steps \begin{align*} \text {integral}& = \frac {\left (\sqrt {x} \sqrt {-1+x^2}\right ) \int \frac {-2+3 x+x^2}{\sqrt {x} \sqrt {-1+x^2} \left (-1-2 x+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 {1-5 x}{\sqrt {x} \sqrt {-1+x^2} \left (-1-2 x+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 {1-5 x}{\sqrt {x} \sqrt {-1+x^2} \left (-1-2 x+x^2\right )} \, dx}{\sqrt {-x+x^3}} \\ & = -\frac {\left (\sqrt {x} \sqrt {-1+x^2}\right ) \int \left (\frac {-5-2 \sqrt {2}}{\sqrt {x} \left (-2-2 \sqrt {2}+2 x\right ) \sqrt {-1+x^2}}+\frac {-5+2 \sqrt {2}}{\sqrt {x} \left (-2+2 \sqrt {2}+2 x\right ) \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 (-5-2 \sqrt {2}\right ) \sqrt {x} \sqrt {-1+x^2}\right ) \int \frac {1}{\sqrt {x} \left (-2-2 \sqrt {2}+2 x\right ) \sqrt {-1+x^2}} \, dx}{\sqrt {-x+x^3}}-\frac {\left (\left (-5+2 \sqrt {2}\right ) \sqrt {x} \sqrt {-1+x^2}\right ) \int \frac {1}{\sqrt {x} \left (-2+2 \sqrt {2}+2 x\right ) \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 (-5-2 \sqrt {2}\right ) \sqrt {x} \sqrt {1-x^2}\right ) \int \frac {1}{\sqrt {1-x} \sqrt {x} \sqrt {1+x} \left (-2-2 \sqrt {2}+2 x\right )} \, dx}{\sqrt {-x+x^3}}-\frac {\left (\left (-5+2 \sqrt {2}\right ) \sqrt {x} \sqrt {1-x^2}\right ) \int \frac {1}{\sqrt {1-x} \sqrt {x} \sqrt {1+x} \left (-2+2 \sqrt {2}+2 x\right )} \, 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 (2 \left (-5-2 \sqrt {2}\right ) \sqrt {x} \sqrt {1-x^2}\right ) \text {Subst}\left (\int \frac {1}{\left (-2 \sqrt {2}-2 x^2\right ) \sqrt {1-x^2} \sqrt {2-x^2}} \, dx,x,\sqrt {1-x}\right )}{\sqrt {-x+x^3}}+\frac {\left (2 \left (-5+2 \sqrt {2}\right ) \sqrt {x} \sqrt {1-x^2}\right ) \text {Subst}\left (\int \frac {1}{\left (2 \sqrt {2}-2 x^2\right ) \sqrt {1-x^2} \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 (5+2 \sqrt {2}\right ) \sqrt {x} \sqrt {1-x^2} \operatorname {EllipticPi}\left (-\frac {1}{\sqrt {2}},\arcsin \left (\sqrt {1-x}\right ),\frac {1}{2}\right )}{2 \sqrt {-x+x^3}}-\frac {\left (5-2 \sqrt {2}\right ) \sqrt {x} \sqrt {1-x^2} \operatorname {EllipticPi}\left (\frac {1}{\sqrt {2}},\arcsin \left (\sqrt {1-x}\right ),\frac {1}{2}\right )}{2 \sqrt {-x+x^3}} \\ \end{align*}
Time = 11.19 (sec) , antiderivative size = 67, normalized size of antiderivative = 0.92 \[ \int \frac {-2+3 x+x^2}{\left (-1-2 x+x^2\right ) \sqrt {-x+x^3}} \, dx=\frac {1}{4} \left (\left (6+\sqrt {2}\right ) \text {arctanh}\left (\frac {\left (-1+\sqrt {2}\right ) (-1+x)}{\sqrt {x \left (-1+x^2\right )}}\right )+\left (-6+\sqrt {2}\right ) \text {arctanh}\left (\frac {\left (1+\sqrt {2}\right ) (-1+x)}{\sqrt {x \left (-1+x^2\right )}}\right )\right ) \]
[In]
[Out]
Result contains higher order function than in optimal. Order 4 vs. order 3.
Time = 3.28 (sec) , antiderivative size = 273, normalized size of antiderivative = 3.74
method | result | size |
default | \(\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 {\sqrt {2}\, \sqrt {1+x}\, \sqrt {2-2 x}\, \sqrt {-x}\, \operatorname {EllipticPi}\left (\sqrt {1+x}, -\frac {1}{-2-\sqrt {2}}, \frac {\sqrt {2}}{2}\right )}{\sqrt {x^{3}-x}\, \left (-2-\sqrt {2}\right )}+\frac {5 \sqrt {1+x}\, \sqrt {2-2 x}\, \sqrt {-x}\, \operatorname {EllipticPi}\left (\sqrt {1+x}, -\frac {1}{-2-\sqrt {2}}, \frac {\sqrt {2}}{2}\right )}{2 \sqrt {x^{3}-x}\, \left (-2-\sqrt {2}\right )}-\frac {\sqrt {2}\, \sqrt {1+x}\, \sqrt {2-2 x}\, \sqrt {-x}\, \operatorname {EllipticPi}\left (\sqrt {1+x}, -\frac {1}{-2+\sqrt {2}}, \frac {\sqrt {2}}{2}\right )}{\sqrt {x^{3}-x}\, \left (-2+\sqrt {2}\right )}+\frac {5 \sqrt {1+x}\, \sqrt {2-2 x}\, \sqrt {-x}\, \operatorname {EllipticPi}\left (\sqrt {1+x}, -\frac {1}{-2+\sqrt {2}}, \frac {\sqrt {2}}{2}\right )}{2 \sqrt {x^{3}-x}\, \left (-2+\sqrt {2}\right )}\) | \(273\) |
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 {\sqrt {2}\, \sqrt {1+x}\, \sqrt {2-2 x}\, \sqrt {-x}\, \operatorname {EllipticPi}\left (\sqrt {1+x}, -\frac {1}{-2-\sqrt {2}}, \frac {\sqrt {2}}{2}\right )}{\sqrt {x^{3}-x}\, \left (-2-\sqrt {2}\right )}+\frac {5 \sqrt {1+x}\, \sqrt {2-2 x}\, \sqrt {-x}\, \operatorname {EllipticPi}\left (\sqrt {1+x}, -\frac {1}{-2-\sqrt {2}}, \frac {\sqrt {2}}{2}\right )}{2 \sqrt {x^{3}-x}\, \left (-2-\sqrt {2}\right )}-\frac {\sqrt {2}\, \sqrt {1+x}\, \sqrt {2-2 x}\, \sqrt {-x}\, \operatorname {EllipticPi}\left (\sqrt {1+x}, -\frac {1}{-2+\sqrt {2}}, \frac {\sqrt {2}}{2}\right )}{\sqrt {x^{3}-x}\, \left (-2+\sqrt {2}\right )}+\frac {5 \sqrt {1+x}\, \sqrt {2-2 x}\, \sqrt {-x}\, \operatorname {EllipticPi}\left (\sqrt {1+x}, -\frac {1}{-2+\sqrt {2}}, \frac {\sqrt {2}}{2}\right )}{2 \sqrt {x^{3}-x}\, \left (-2+\sqrt {2}\right )}\) | \(273\) |
trager | \(\frac {\operatorname {RootOf}\left (8 \textit {\_Z}^{2}+24 \textit {\_Z} +17\right ) \ln \left (\frac {-278808 \operatorname {RootOf}\left (8 \textit {\_Z}^{2}+24 \textit {\_Z} +17\right )^{2} x^{2}+1394040 \operatorname {RootOf}\left (8 \textit {\_Z}^{2}+24 \textit {\_Z} +17\right )^{2} x -621337 \operatorname {RootOf}\left (8 \textit {\_Z}^{2}+24 \textit {\_Z} +17\right ) x^{2}+1038514 \sqrt {x^{3}-x}\, \operatorname {RootOf}\left (8 \textit {\_Z}^{2}+24 \textit {\_Z} +17\right )-1672848 \operatorname {RootOf}\left (8 \textit {\_Z}^{2}+24 \textit {\_Z} +17\right )^{2}+5650808 \operatorname {RootOf}\left (8 \textit {\_Z}^{2}+24 \textit {\_Z} +17\right ) x -193794 x^{2}+1924943 \sqrt {x^{3}-x}-6272145 \operatorname {RootOf}\left (8 \textit {\_Z}^{2}+24 \textit {\_Z} +17\right )+5684624 x -5878418}{{\left (4 \operatorname {RootOf}\left (8 \textit {\_Z}^{2}+24 \textit {\_Z} +17\right ) x -8 \operatorname {RootOf}\left (8 \textit {\_Z}^{2}+24 \textit {\_Z} +17\right )+7 x -15\right )}^{2}}\right )}{2}-\frac {\ln \left (-\frac {278808 \operatorname {RootOf}\left (8 \textit {\_Z}^{2}+24 \textit {\_Z} +17\right )^{2} x^{2}-1394040 \operatorname {RootOf}\left (8 \textit {\_Z}^{2}+24 \textit {\_Z} +17\right )^{2} x +1051511 \operatorname {RootOf}\left (8 \textit {\_Z}^{2}+24 \textit {\_Z} +17\right ) x^{2}+1038514 \sqrt {x^{3}-x}\, \operatorname {RootOf}\left (8 \textit {\_Z}^{2}+24 \textit {\_Z} +17\right )+1672848 \operatorname {RootOf}\left (8 \textit {\_Z}^{2}+24 \textit {\_Z} +17\right )^{2}-2713432 \operatorname {RootOf}\left (8 \textit {\_Z}^{2}+24 \textit {\_Z} +17\right ) x +839055 x^{2}+1190599 \sqrt {x^{3}-x}+3764943 \operatorname {RootOf}\left (8 \textit {\_Z}^{2}+24 \textit {\_Z} +17\right )-1278560 x +2117615}{{\left (4 \operatorname {RootOf}\left (8 \textit {\_Z}^{2}+24 \textit {\_Z} +17\right ) x -8 \operatorname {RootOf}\left (8 \textit {\_Z}^{2}+24 \textit {\_Z} +17\right )+5 x -9\right )}^{2}}\right ) \operatorname {RootOf}\left (8 \textit {\_Z}^{2}+24 \textit {\_Z} +17\right )}{2}-\frac {3 \ln \left (-\frac {278808 \operatorname {RootOf}\left (8 \textit {\_Z}^{2}+24 \textit {\_Z} +17\right )^{2} x^{2}-1394040 \operatorname {RootOf}\left (8 \textit {\_Z}^{2}+24 \textit {\_Z} +17\right )^{2} x +1051511 \operatorname {RootOf}\left (8 \textit {\_Z}^{2}+24 \textit {\_Z} +17\right ) x^{2}+1038514 \sqrt {x^{3}-x}\, \operatorname {RootOf}\left (8 \textit {\_Z}^{2}+24 \textit {\_Z} +17\right )+1672848 \operatorname {RootOf}\left (8 \textit {\_Z}^{2}+24 \textit {\_Z} +17\right )^{2}-2713432 \operatorname {RootOf}\left (8 \textit {\_Z}^{2}+24 \textit {\_Z} +17\right ) x +839055 x^{2}+1190599 \sqrt {x^{3}-x}+3764943 \operatorname {RootOf}\left (8 \textit {\_Z}^{2}+24 \textit {\_Z} +17\right )-1278560 x +2117615}{{\left (4 \operatorname {RootOf}\left (8 \textit {\_Z}^{2}+24 \textit {\_Z} +17\right ) x -8 \operatorname {RootOf}\left (8 \textit {\_Z}^{2}+24 \textit {\_Z} +17\right )+5 x -9\right )}^{2}}\right )}{2}\) | \(545\) |
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 126 vs. \(2 (57) = 114\).
Time = 0.30 (sec) , antiderivative size = 126, normalized size of antiderivative = 1.73 \[ \int \frac {-2+3 x+x^2}{\left (-1-2 x+x^2\right ) \sqrt {-x+x^3}} \, dx=\frac {1}{8} \, \sqrt {2} \log \left (\frac {x^{4} + 12 \, x^{3} + 4 \, \sqrt {2} \sqrt {x^{3} - x} {\left (x^{2} + 2 \, x - 1\right )} + 2 \, x^{2} - 12 \, x + 1}{x^{4} - 4 \, x^{3} + 2 \, x^{2} + 4 \, x + 1}\right ) + \frac {3}{4} \, \log \left (\frac {x^{4} + 4 \, x^{3} + 2 \, x^{2} - 4 \, \sqrt {x^{3} - x} {\left (x^{2} + 1\right )} - 4 \, x + 1}{x^{4} - 4 \, x^{3} + 2 \, x^{2} + 4 \, x + 1}\right ) \]
[In]
[Out]
\[ \int \frac {-2+3 x+x^2}{\left (-1-2 x+x^2\right ) \sqrt {-x+x^3}} \, dx=\int \frac {x^{2} + 3 x - 2}{\sqrt {x \left (x - 1\right ) \left (x + 1\right )} \left (x^{2} - 2 x - 1\right )}\, dx \]
[In]
[Out]
\[ \int \frac {-2+3 x+x^2}{\left (-1-2 x+x^2\right ) \sqrt {-x+x^3}} \, dx=\int { \frac {x^{2} + 3 \, x - 2}{\sqrt {x^{3} - x} {\left (x^{2} - 2 \, x - 1\right )}} \,d x } \]
[In]
[Out]
\[ \int \frac {-2+3 x+x^2}{\left (-1-2 x+x^2\right ) \sqrt {-x+x^3}} \, dx=\int { \frac {x^{2} + 3 \, x - 2}{\sqrt {x^{3} - x} {\left (x^{2} - 2 \, x - 1\right )}} \,d x } \]
[In]
[Out]
Time = 0.08 (sec) , antiderivative size = 159, normalized size of antiderivative = 2.18 \[ \int \frac {-2+3 x+x^2}{\left (-1-2 x+x^2\right ) \sqrt {-x+x^3}} \, dx=\frac {\sqrt {2}\,\sqrt {-x}\,\left (5\,\sqrt {2}+4\right )\,\sqrt {1-x}\,\sqrt {x+1}\,\Pi \left (-\frac {1}{\sqrt {2}+1};\mathrm {asin}\left (\sqrt {-x}\right )\middle |-1\right )}{2\,\sqrt {x^3-x}\,\left (\sqrt {2}+1\right )}-\frac {\sqrt {2}\,\sqrt {-x}\,\left (5\,\sqrt {2}-4\right )\,\sqrt {1-x}\,\sqrt {x+1}\,\Pi \left (\frac {1}{\sqrt {2}-1};\mathrm {asin}\left (\sqrt {-x}\right )\middle |-1\right )}{2\,\sqrt {x^3-x}\,\left (\sqrt {2}-1\right )}-\frac {2\,\sqrt {-x}\,\sqrt {1-x}\,\sqrt {x+1}\,\mathrm {F}\left (\mathrm {asin}\left (\sqrt {-x}\right )\middle |-1\right )}{\sqrt {x^3-x}} \]
[In]
[Out]