Integrand size = 27, antiderivative size = 21 \[ \int \frac {-2-2 x+x^2}{\left (2 x+x^2\right ) \sqrt {-1+x^3}} \, dx=-2 \arctan \left (\frac {\sqrt {-1+x^3}}{1+x+x^2}\right ) \]
[Out]
Result contains higher order function than in optimal. Order 4 vs. order 3 in optimal.
Time = 0.41 (sec) , antiderivative size = 402, normalized size of antiderivative = 19.14, number of steps used = 13, number of rules used = 9, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.333, Rules used = {1607, 6874, 225, 272, 65, 209, 2161, 2164, 2163} \[ \int \frac {-2-2 x+x^2}{\left (2 x+x^2\right ) \sqrt {-1+x^3}} \, dx=-\frac {2 \sqrt {2-\sqrt {3}} (1-x) \sqrt {\frac {x^2+x+1}{\left (-x-\sqrt {3}+1\right )^2}} \operatorname {EllipticF}\left (\arcsin \left (\frac {-x+\sqrt {3}+1}{-x-\sqrt {3}+1}\right ),-7+4 \sqrt {3}\right )}{\sqrt [4]{3} \sqrt {-\frac {1-x}{\left (-x-\sqrt {3}+1\right )^2}} \sqrt {x^3-1}}+\frac {\sqrt [4]{3} \sqrt {2 \left (7-4 \sqrt {3}\right )} (1-x) \sqrt {\frac {x^2+x+1}{\left (-x-\sqrt {3}+1\right )^2}} \operatorname {EllipticF}\left (\arcsin \left (\frac {-x+\sqrt {3}+1}{-x-\sqrt {3}+1}\right ),-7+4 \sqrt {3}\right )}{\sqrt {-\frac {1-x}{\left (-x-\sqrt {3}+1\right )^2}} \sqrt {x^3-1}}+\frac {\sqrt {2 \left (7-4 \sqrt {3}\right )} (1-x) \sqrt {\frac {x^2+x+1}{\left (-x-\sqrt {3}+1\right )^2}} \operatorname {EllipticF}\left (\arcsin \left (\frac {-x+\sqrt {3}+1}{-x-\sqrt {3}+1}\right ),-7+4 \sqrt {3}\right )}{\sqrt [4]{3} \sqrt {-\frac {1-x}{\left (-x-\sqrt {3}+1\right )^2}} \sqrt {x^3-1}}+\frac {2}{3} \arctan \left (\frac {(1-x)^2}{3 \sqrt {x^3-1}}\right )-\frac {2}{3} \arctan \left (\sqrt {x^3-1}\right ) \]
[In]
[Out]
Rule 65
Rule 209
Rule 225
Rule 272
Rule 1607
Rule 2161
Rule 2163
Rule 2164
Rule 6874
Rubi steps \begin{align*} \text {integral}& = \int \frac {-2-2 x+x^2}{x (2+x) \sqrt {-1+x^3}} \, dx \\ & = \int \left (\frac {1}{\sqrt {-1+x^3}}-\frac {1}{x \sqrt {-1+x^3}}-\frac {3}{(2+x) \sqrt {-1+x^3}}\right ) \, dx \\ & = -\left (3 \int \frac {1}{(2+x) \sqrt {-1+x^3}} \, dx\right )+\int \frac {1}{\sqrt {-1+x^3}} \, dx-\int \frac {1}{x \sqrt {-1+x^3}} \, dx \\ & = -\frac {2 \sqrt {2-\sqrt {3}} (1-x) \sqrt {\frac {1+x+x^2}{\left (1-\sqrt {3}-x\right )^2}} \operatorname {EllipticF}\left (\arcsin \left (\frac {1+\sqrt {3}-x}{1-\sqrt {3}-x}\right ),-7+4 \sqrt {3}\right )}{\sqrt [4]{3} \sqrt {-\frac {1-x}{\left (1-\sqrt {3}-x\right )^2}} \sqrt {-1+x^3}}-\frac {1}{3} \text {Subst}\left (\int \frac {1}{\sqrt {-1+x} x} \, dx,x,x^3\right )-\frac {3 \int \frac {1}{\sqrt {-1+x^3}} \, dx}{3+\sqrt {3}}-\frac {3 \int \frac {1+\sqrt {3}-x}{(2+x) \sqrt {-1+x^3}} \, dx}{3+\sqrt {3}} \\ & = \frac {2\ 3^{3/4} \sqrt {\frac {7}{6}-\frac {2}{\sqrt {3}}} (1-x) \sqrt {\frac {1+x+x^2}{\left (1-\sqrt {3}-x\right )^2}} \operatorname {EllipticF}\left (\arcsin \left (\frac {1+\sqrt {3}-x}{1-\sqrt {3}-x}\right ),-7+4 \sqrt {3}\right )}{\sqrt {-\frac {1-x}{\left (1-\sqrt {3}-x\right )^2}} \sqrt {-1+x^3}}-\frac {2 \sqrt {2-\sqrt {3}} (1-x) \sqrt {\frac {1+x+x^2}{\left (1-\sqrt {3}-x\right )^2}} \operatorname {EllipticF}\left (\arcsin \left (\frac {1+\sqrt {3}-x}{1-\sqrt {3}-x}\right ),-7+4 \sqrt {3}\right )}{\sqrt [4]{3} \sqrt {-\frac {1-x}{\left (1-\sqrt {3}-x\right )^2}} \sqrt {-1+x^3}}-\frac {1}{2} \int \frac {2-2 x}{(2+x) \sqrt {-1+x^3}} \, dx-\frac {2}{3} \text {Subst}\left (\int \frac {1}{1+x^2} \, dx,x,\sqrt {-1+x^3}\right )-\frac {\sqrt {3} \int \frac {1}{\sqrt {-1+x^3}} \, dx}{3+\sqrt {3}} \\ & = -\frac {2}{3} \arctan \left (\sqrt {-1+x^3}\right )+\frac {2 \sqrt [4]{3} \sqrt {\frac {7}{6}-\frac {2}{\sqrt {3}}} (1-x) \sqrt {\frac {1+x+x^2}{\left (1-\sqrt {3}-x\right )^2}} \operatorname {EllipticF}\left (\arcsin \left (\frac {1+\sqrt {3}-x}{1-\sqrt {3}-x}\right ),-7+4 \sqrt {3}\right )}{\sqrt {-\frac {1-x}{\left (1-\sqrt {3}-x\right )^2}} \sqrt {-1+x^3}}+\frac {2\ 3^{3/4} \sqrt {\frac {7}{6}-\frac {2}{\sqrt {3}}} (1-x) \sqrt {\frac {1+x+x^2}{\left (1-\sqrt {3}-x\right )^2}} \operatorname {EllipticF}\left (\arcsin \left (\frac {1+\sqrt {3}-x}{1-\sqrt {3}-x}\right ),-7+4 \sqrt {3}\right )}{\sqrt {-\frac {1-x}{\left (1-\sqrt {3}-x\right )^2}} \sqrt {-1+x^3}}-\frac {2 \sqrt {2-\sqrt {3}} (1-x) \sqrt {\frac {1+x+x^2}{\left (1-\sqrt {3}-x\right )^2}} \operatorname {EllipticF}\left (\arcsin \left (\frac {1+\sqrt {3}-x}{1-\sqrt {3}-x}\right ),-7+4 \sqrt {3}\right )}{\sqrt [4]{3} \sqrt {-\frac {1-x}{\left (1-\sqrt {3}-x\right )^2}} \sqrt {-1+x^3}}+2 \text {Subst}\left (\int \frac {1}{9+x^2} \, dx,x,\frac {(1-x)^2}{\sqrt {-1+x^3}}\right ) \\ & = \frac {2}{3} \arctan \left (\frac {(1-x)^2}{3 \sqrt {-1+x^3}}\right )-\frac {2}{3} \arctan \left (\sqrt {-1+x^3}\right )+\frac {2 \sqrt [4]{3} \sqrt {\frac {7}{6}-\frac {2}{\sqrt {3}}} (1-x) \sqrt {\frac {1+x+x^2}{\left (1-\sqrt {3}-x\right )^2}} \operatorname {EllipticF}\left (\arcsin \left (\frac {1+\sqrt {3}-x}{1-\sqrt {3}-x}\right ),-7+4 \sqrt {3}\right )}{\sqrt {-\frac {1-x}{\left (1-\sqrt {3}-x\right )^2}} \sqrt {-1+x^3}}+\frac {2\ 3^{3/4} \sqrt {\frac {7}{6}-\frac {2}{\sqrt {3}}} (1-x) \sqrt {\frac {1+x+x^2}{\left (1-\sqrt {3}-x\right )^2}} \operatorname {EllipticF}\left (\arcsin \left (\frac {1+\sqrt {3}-x}{1-\sqrt {3}-x}\right ),-7+4 \sqrt {3}\right )}{\sqrt {-\frac {1-x}{\left (1-\sqrt {3}-x\right )^2}} \sqrt {-1+x^3}}-\frac {2 \sqrt {2-\sqrt {3}} (1-x) \sqrt {\frac {1+x+x^2}{\left (1-\sqrt {3}-x\right )^2}} \operatorname {EllipticF}\left (\arcsin \left (\frac {1+\sqrt {3}-x}{1-\sqrt {3}-x}\right ),-7+4 \sqrt {3}\right )}{\sqrt [4]{3} \sqrt {-\frac {1-x}{\left (1-\sqrt {3}-x\right )^2}} \sqrt {-1+x^3}} \\ \end{align*}
Time = 1.10 (sec) , antiderivative size = 21, normalized size of antiderivative = 1.00 \[ \int \frac {-2-2 x+x^2}{\left (2 x+x^2\right ) \sqrt {-1+x^3}} \, dx=-2 \arctan \left (\frac {\sqrt {-1+x^3}}{1+x+x^2}\right ) \]
[In]
[Out]
Result contains higher order function than in optimal. Order 9 vs. order 3.
Time = 2.57 (sec) , antiderivative size = 47, normalized size of antiderivative = 2.24
method | result | size |
trager | \(\operatorname {RootOf}\left (\textit {\_Z}^{2}+1\right ) \ln \left (-\frac {\operatorname {RootOf}\left (\textit {\_Z}^{2}+1\right ) x^{2}+2 \operatorname {RootOf}\left (\textit {\_Z}^{2}+1\right )-2 \sqrt {x^{3}-1}}{x \left (x +2\right )}\right )\) | \(47\) |
default | \(\frac {2 \left (-\frac {3}{2}-\frac {i \sqrt {3}}{2}\right ) \sqrt {\frac {x -1}{-\frac {3}{2}-\frac {i \sqrt {3}}{2}}}\, \sqrt {\frac {x +\frac {1}{2}-\frac {i \sqrt {3}}{2}}{\frac {3}{2}-\frac {i \sqrt {3}}{2}}}\, \sqrt {\frac {x +\frac {1}{2}+\frac {i \sqrt {3}}{2}}{\frac {3}{2}+\frac {i \sqrt {3}}{2}}}\, \operatorname {EllipticF}\left (\sqrt {\frac {x -1}{-\frac {3}{2}-\frac {i \sqrt {3}}{2}}}, \sqrt {\frac {\frac {3}{2}+\frac {i \sqrt {3}}{2}}{\frac {3}{2}-\frac {i \sqrt {3}}{2}}}\right )}{\sqrt {x^{3}-1}}-\frac {2 \arctan \left (\sqrt {x^{3}-1}\right )}{3}-\frac {2 \left (-\frac {3}{2}-\frac {i \sqrt {3}}{2}\right ) \sqrt {\frac {x -1}{-\frac {3}{2}-\frac {i \sqrt {3}}{2}}}\, \sqrt {\frac {x +\frac {1}{2}-\frac {i \sqrt {3}}{2}}{\frac {3}{2}-\frac {i \sqrt {3}}{2}}}\, \sqrt {\frac {x +\frac {1}{2}+\frac {i \sqrt {3}}{2}}{\frac {3}{2}+\frac {i \sqrt {3}}{2}}}\, \operatorname {EllipticPi}\left (\sqrt {\frac {x -1}{-\frac {3}{2}-\frac {i \sqrt {3}}{2}}}, \frac {i \sqrt {3}}{6}+\frac {1}{2}, \sqrt {\frac {\frac {3}{2}+\frac {i \sqrt {3}}{2}}{\frac {3}{2}-\frac {i \sqrt {3}}{2}}}\right )}{\sqrt {x^{3}-1}}\) | \(250\) |
elliptic | \(-\frac {3 \sqrt {\frac {x}{-\frac {3}{2}-\frac {i \sqrt {3}}{2}}-\frac {1}{-\frac {3}{2}-\frac {i \sqrt {3}}{2}}}\, \sqrt {\frac {x}{\frac {3}{2}-\frac {i \sqrt {3}}{2}}+\frac {1}{3-i \sqrt {3}}-\frac {i \sqrt {3}}{2 \left (\frac {3}{2}-\frac {i \sqrt {3}}{2}\right )}}\, \sqrt {\frac {x}{\frac {3}{2}+\frac {i \sqrt {3}}{2}}+\frac {1}{3+i \sqrt {3}}+\frac {i \sqrt {3}}{3+i \sqrt {3}}}\, \operatorname {EllipticF}\left (\sqrt {\frac {x -1}{-\frac {3}{2}-\frac {i \sqrt {3}}{2}}}, \sqrt {\frac {\frac {3}{2}+\frac {i \sqrt {3}}{2}}{\frac {3}{2}-\frac {i \sqrt {3}}{2}}}\right )}{\sqrt {x^{3}-1}}-\frac {i \sqrt {\frac {x}{-\frac {3}{2}-\frac {i \sqrt {3}}{2}}-\frac {1}{-\frac {3}{2}-\frac {i \sqrt {3}}{2}}}\, \sqrt {\frac {x}{\frac {3}{2}-\frac {i \sqrt {3}}{2}}+\frac {1}{3-i \sqrt {3}}-\frac {i \sqrt {3}}{2 \left (\frac {3}{2}-\frac {i \sqrt {3}}{2}\right )}}\, \sqrt {\frac {x}{\frac {3}{2}+\frac {i \sqrt {3}}{2}}+\frac {1}{3+i \sqrt {3}}+\frac {i \sqrt {3}}{3+i \sqrt {3}}}\, \operatorname {EllipticF}\left (\sqrt {\frac {x -1}{-\frac {3}{2}-\frac {i \sqrt {3}}{2}}}, \sqrt {\frac {\frac {3}{2}+\frac {i \sqrt {3}}{2}}{\frac {3}{2}-\frac {i \sqrt {3}}{2}}}\right ) \sqrt {3}}{\sqrt {x^{3}-1}}-\frac {2 \arctan \left (\sqrt {x^{3}-1}\right )}{3}+\frac {3 \sqrt {\frac {x}{-\frac {3}{2}-\frac {i \sqrt {3}}{2}}-\frac {1}{-\frac {3}{2}-\frac {i \sqrt {3}}{2}}}\, \sqrt {\frac {x}{\frac {3}{2}-\frac {i \sqrt {3}}{2}}+\frac {1}{3-i \sqrt {3}}-\frac {i \sqrt {3}}{2 \left (\frac {3}{2}-\frac {i \sqrt {3}}{2}\right )}}\, \sqrt {\frac {x}{\frac {3}{2}+\frac {i \sqrt {3}}{2}}+\frac {1}{3+i \sqrt {3}}+\frac {i \sqrt {3}}{3+i \sqrt {3}}}\, \operatorname {EllipticPi}\left (\sqrt {\frac {x -1}{-\frac {3}{2}-\frac {i \sqrt {3}}{2}}}, \frac {i \sqrt {3}}{6}+\frac {1}{2}, \sqrt {\frac {\frac {3}{2}+\frac {i \sqrt {3}}{2}}{\frac {3}{2}-\frac {i \sqrt {3}}{2}}}\right )}{\sqrt {x^{3}-1}}+\frac {i \sqrt {\frac {x}{-\frac {3}{2}-\frac {i \sqrt {3}}{2}}-\frac {1}{-\frac {3}{2}-\frac {i \sqrt {3}}{2}}}\, \sqrt {\frac {x}{\frac {3}{2}-\frac {i \sqrt {3}}{2}}+\frac {1}{3-i \sqrt {3}}-\frac {i \sqrt {3}}{2 \left (\frac {3}{2}-\frac {i \sqrt {3}}{2}\right )}}\, \sqrt {\frac {x}{\frac {3}{2}+\frac {i \sqrt {3}}{2}}+\frac {1}{3+i \sqrt {3}}+\frac {i \sqrt {3}}{3+i \sqrt {3}}}\, \operatorname {EllipticPi}\left (\sqrt {\frac {x -1}{-\frac {3}{2}-\frac {i \sqrt {3}}{2}}}, \frac {i \sqrt {3}}{6}+\frac {1}{2}, \sqrt {\frac {\frac {3}{2}+\frac {i \sqrt {3}}{2}}{\frac {3}{2}-\frac {i \sqrt {3}}{2}}}\right ) \sqrt {3}}{\sqrt {x^{3}-1}}\) | \(676\) |
[In]
[Out]
none
Time = 0.26 (sec) , antiderivative size = 15, normalized size of antiderivative = 0.71 \[ \int \frac {-2-2 x+x^2}{\left (2 x+x^2\right ) \sqrt {-1+x^3}} \, dx=\arctan \left (\frac {x^{2} + 2}{2 \, \sqrt {x^{3} - 1}}\right ) \]
[In]
[Out]
\[ \int \frac {-2-2 x+x^2}{\left (2 x+x^2\right ) \sqrt {-1+x^3}} \, dx=\int \frac {x^{2} - 2 x - 2}{x \sqrt {\left (x - 1\right ) \left (x^{2} + x + 1\right )} \left (x + 2\right )}\, dx \]
[In]
[Out]
\[ \int \frac {-2-2 x+x^2}{\left (2 x+x^2\right ) \sqrt {-1+x^3}} \, dx=\int { \frac {x^{2} - 2 \, x - 2}{\sqrt {x^{3} - 1} {\left (x^{2} + 2 \, x\right )}} \,d x } \]
[In]
[Out]
\[ \int \frac {-2-2 x+x^2}{\left (2 x+x^2\right ) \sqrt {-1+x^3}} \, dx=\int { \frac {x^{2} - 2 \, x - 2}{\sqrt {x^{3} - 1} {\left (x^{2} + 2 \, x\right )}} \,d x } \]
[In]
[Out]
Time = 5.34 (sec) , antiderivative size = 252, normalized size of antiderivative = 12.00 \[ \int \frac {-2-2 x+x^2}{\left (2 x+x^2\right ) \sqrt {-1+x^3}} \, dx=\frac {\left (3+\sqrt {3}\,1{}\mathrm {i}\right )\,\sqrt {-\frac {x+\frac {1}{2}-\frac {\sqrt {3}\,1{}\mathrm {i}}{2}}{-\frac {3}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}}}\,\sqrt {\frac {x+\frac {1}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}}{\frac {3}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}}}\,\sqrt {-\frac {x-1}{\frac {3}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}}}\,\left (-\mathrm {F}\left (\mathrm {asin}\left (\sqrt {-\frac {x-1}{\frac {3}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}}}\right )\middle |-\frac {\frac {3}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}}{-\frac {3}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}}\right )+\Pi \left (\frac {3}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2};\mathrm {asin}\left (\sqrt {-\frac {x-1}{\frac {3}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}}}\right )\middle |-\frac {\frac {3}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}}{-\frac {3}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}}\right )+\Pi \left (\frac {1}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{6};\mathrm {asin}\left (\sqrt {-\frac {x-1}{\frac {3}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}}}\right )\middle |-\frac {\frac {3}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}}{-\frac {3}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}}\right )\right )}{\sqrt {x^3+\left (-\left (-\frac {1}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}\right )\,\left (\frac {1}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}\right )-1\right )\,x+\left (-\frac {1}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}\right )\,\left (\frac {1}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}\right )}} \]
[In]
[Out]