Integrand size = 25, antiderivative size = 24 \[ \int \frac {-1+x^2}{\left (1+x^2\right ) \sqrt {x+x^2+x^3}} \, dx=-2 \text {arctanh}\left (\frac {\sqrt {x+x^2+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.72 (sec) , antiderivative size = 320, normalized size of antiderivative = 13.33, number of steps used = 17, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.320, Rules used = {2081, 6857, 730, 1117, 948, 175, 552, 551} \[ \int \frac {-1+x^2}{\left (1+x^2\right ) \sqrt {x+x^2+x^3}} \, dx=-\frac {4 \sqrt {x} \sqrt {1+\frac {2 x}{1-i \sqrt {3}}} \sqrt {1+\frac {2 x}{1+i \sqrt {3}}} \operatorname {EllipticPi}\left (\frac {1}{2} \left (-i-\sqrt {3}\right ),\arcsin \left (\frac {1}{2} \left (1-i \sqrt {3}\right ) \sqrt {x}\right ),\frac {i+\sqrt {3}}{i-\sqrt {3}}\right )}{\left (1-i \sqrt {3}\right ) \sqrt {x^3+x^2+x}}-\frac {4 \sqrt {x} \sqrt {1+\frac {2 x}{1-i \sqrt {3}}} \sqrt {1+\frac {2 x}{1+i \sqrt {3}}} \operatorname {EllipticPi}\left (\frac {1}{2} \left (i+\sqrt {3}\right ),\arcsin \left (\frac {1}{2} \left (1-i \sqrt {3}\right ) \sqrt {x}\right ),\frac {i+\sqrt {3}}{i-\sqrt {3}}\right )}{\left (1-i \sqrt {3}\right ) \sqrt {x^3+x^2+x}}+\frac {\sqrt {x} (x+1) \sqrt {\frac {x^2+x+1}{(x+1)^2}} \operatorname {EllipticF}\left (2 \arctan \left (\sqrt {x}\right ),\frac {1}{4}\right )}{\sqrt {x^3+x^2+x}} \]
[In]
[Out]
Rule 175
Rule 551
Rule 552
Rule 730
Rule 948
Rule 1117
Rule 2081
Rule 6857
Rubi steps \begin{align*} \text {integral}& = \frac {\left (\sqrt {x} \sqrt {1+x+x^2}\right ) \int \frac {-1+x^2}{\sqrt {x} \left (1+x^2\right ) \sqrt {1+x+x^2}} \, dx}{\sqrt {x+x^2+x^3}} \\ & = \frac {\left (\sqrt {x} \sqrt {1+x+x^2}\right ) \int \left (\frac {1}{\sqrt {x} \sqrt {1+x+x^2}}-\frac {2}{\sqrt {x} \left (1+x^2\right ) \sqrt {1+x+x^2}}\right ) \, dx}{\sqrt {x+x^2+x^3}} \\ & = \frac {\left (\sqrt {x} \sqrt {1+x+x^2}\right ) \int \frac {1}{\sqrt {x} \sqrt {1+x+x^2}} \, dx}{\sqrt {x+x^2+x^3}}-\frac {\left (2 \sqrt {x} \sqrt {1+x+x^2}\right ) \int \frac {1}{\sqrt {x} \left (1+x^2\right ) \sqrt {1+x+x^2}} \, dx}{\sqrt {x+x^2+x^3}} \\ & = -\frac {\left (2 \sqrt {x} \sqrt {1+x+x^2}\right ) \int \left (\frac {i}{2 (i-x) \sqrt {x} \sqrt {1+x+x^2}}+\frac {i}{2 \sqrt {x} (i+x) \sqrt {1+x+x^2}}\right ) \, dx}{\sqrt {x+x^2+x^3}}+\frac {\left (2 \sqrt {x} \sqrt {1+x+x^2}\right ) \text {Subst}\left (\int \frac {1}{\sqrt {1+x^2+x^4}} \, dx,x,\sqrt {x}\right )}{\sqrt {x+x^2+x^3}} \\ & = \frac {\sqrt {x} (1+x) \sqrt {\frac {1+x+x^2}{(1+x)^2}} \operatorname {EllipticF}\left (2 \arctan \left (\sqrt {x}\right ),\frac {1}{4}\right )}{\sqrt {x+x^2+x^3}}-\frac {\left (i \sqrt {x} \sqrt {1+x+x^2}\right ) \int \frac {1}{(i-x) \sqrt {x} \sqrt {1+x+x^2}} \, dx}{\sqrt {x+x^2+x^3}}-\frac {\left (i \sqrt {x} \sqrt {1+x+x^2}\right ) \int \frac {1}{\sqrt {x} (i+x) \sqrt {1+x+x^2}} \, dx}{\sqrt {x+x^2+x^3}} \\ & = \frac {\sqrt {x} (1+x) \sqrt {\frac {1+x+x^2}{(1+x)^2}} \operatorname {EllipticF}\left (2 \arctan \left (\sqrt {x}\right ),\frac {1}{4}\right )}{\sqrt {x+x^2+x^3}}-\frac {\left (i \sqrt {x} \sqrt {1-i \sqrt {3}+2 x} \sqrt {1+i \sqrt {3}+2 x}\right ) \int \frac {1}{(i-x) \sqrt {x} \sqrt {1-i \sqrt {3}+2 x} \sqrt {1+i \sqrt {3}+2 x}} \, dx}{\sqrt {x+x^2+x^3}}-\frac {\left (i \sqrt {x} \sqrt {1-i \sqrt {3}+2 x} \sqrt {1+i \sqrt {3}+2 x}\right ) \int \frac {1}{\sqrt {x} (i+x) \sqrt {1-i \sqrt {3}+2 x} \sqrt {1+i \sqrt {3}+2 x}} \, dx}{\sqrt {x+x^2+x^3}} \\ & = \frac {\sqrt {x} (1+x) \sqrt {\frac {1+x+x^2}{(1+x)^2}} \operatorname {EllipticF}\left (2 \arctan \left (\sqrt {x}\right ),\frac {1}{4}\right )}{\sqrt {x+x^2+x^3}}+\frac {\left (2 i \sqrt {x} \sqrt {1-i \sqrt {3}+2 x} \sqrt {1+i \sqrt {3}+2 x}\right ) \text {Subst}\left (\int \frac {1}{\left (-i-x^2\right ) \sqrt {1-i \sqrt {3}+2 x^2} \sqrt {1+i \sqrt {3}+2 x^2}} \, dx,x,\sqrt {x}\right )}{\sqrt {x+x^2+x^3}}+\frac {\left (2 i \sqrt {x} \sqrt {1-i \sqrt {3}+2 x} \sqrt {1+i \sqrt {3}+2 x}\right ) \text {Subst}\left (\int \frac {1}{\left (-i+x^2\right ) \sqrt {1-i \sqrt {3}+2 x^2} \sqrt {1+i \sqrt {3}+2 x^2}} \, dx,x,\sqrt {x}\right )}{\sqrt {x+x^2+x^3}} \\ & = \frac {\sqrt {x} (1+x) \sqrt {\frac {1+x+x^2}{(1+x)^2}} \operatorname {EllipticF}\left (2 \arctan \left (\sqrt {x}\right ),\frac {1}{4}\right )}{\sqrt {x+x^2+x^3}}+\frac {\left (2 i \sqrt {x} \sqrt {1+i \sqrt {3}+2 x} \sqrt {1+\frac {2 x}{1-i \sqrt {3}}}\right ) \text {Subst}\left (\int \frac {1}{\left (-i-x^2\right ) \sqrt {1+i \sqrt {3}+2 x^2} \sqrt {1+\frac {2 x^2}{1-i \sqrt {3}}}} \, dx,x,\sqrt {x}\right )}{\sqrt {x+x^2+x^3}}+\frac {\left (2 i \sqrt {x} \sqrt {1+i \sqrt {3}+2 x} \sqrt {1+\frac {2 x}{1-i \sqrt {3}}}\right ) \text {Subst}\left (\int \frac {1}{\left (-i+x^2\right ) \sqrt {1+i \sqrt {3}+2 x^2} \sqrt {1+\frac {2 x^2}{1-i \sqrt {3}}}} \, dx,x,\sqrt {x}\right )}{\sqrt {x+x^2+x^3}} \\ & = \frac {\sqrt {x} (1+x) \sqrt {\frac {1+x+x^2}{(1+x)^2}} \operatorname {EllipticF}\left (2 \arctan \left (\sqrt {x}\right ),\frac {1}{4}\right )}{\sqrt {x+x^2+x^3}}+\frac {\left (2 i \sqrt {x} \sqrt {1+\frac {2 x}{1-i \sqrt {3}}} \sqrt {1+\frac {2 x}{1+i \sqrt {3}}}\right ) \text {Subst}\left (\int \frac {1}{\left (-i-x^2\right ) \sqrt {1+\frac {2 x^2}{1-i \sqrt {3}}} \sqrt {1+\frac {2 x^2}{1+i \sqrt {3}}}} \, dx,x,\sqrt {x}\right )}{\sqrt {x+x^2+x^3}}+\frac {\left (2 i \sqrt {x} \sqrt {1+\frac {2 x}{1-i \sqrt {3}}} \sqrt {1+\frac {2 x}{1+i \sqrt {3}}}\right ) \text {Subst}\left (\int \frac {1}{\left (-i+x^2\right ) \sqrt {1+\frac {2 x^2}{1-i \sqrt {3}}} \sqrt {1+\frac {2 x^2}{1+i \sqrt {3}}}} \, dx,x,\sqrt {x}\right )}{\sqrt {x+x^2+x^3}} \\ & = \frac {\sqrt {x} (1+x) \sqrt {\frac {1+x+x^2}{(1+x)^2}} \operatorname {EllipticF}\left (2 \arctan \left (\sqrt {x}\right ),\frac {1}{4}\right )}{\sqrt {x+x^2+x^3}}-\frac {4 \sqrt {x} \sqrt {1+\frac {2 x}{1-i \sqrt {3}}} \sqrt {1+\frac {2 x}{1+i \sqrt {3}}} \operatorname {EllipticPi}\left (\frac {1}{2} \left (-i-\sqrt {3}\right ),\arcsin \left (\frac {1}{2} \left (1-i \sqrt {3}\right ) \sqrt {x}\right ),\frac {i+\sqrt {3}}{i-\sqrt {3}}\right )}{\left (1-i \sqrt {3}\right ) \sqrt {x+x^2+x^3}}-\frac {4 \sqrt {x} \sqrt {1+\frac {2 x}{1-i \sqrt {3}}} \sqrt {1+\frac {2 x}{1+i \sqrt {3}}} \operatorname {EllipticPi}\left (\frac {1}{2} \left (i+\sqrt {3}\right ),\arcsin \left (\frac {1}{2} \left (1-i \sqrt {3}\right ) \sqrt {x}\right ),\frac {i+\sqrt {3}}{i-\sqrt {3}}\right )}{\left (1-i \sqrt {3}\right ) \sqrt {x+x^2+x^3}} \\ \end{align*}
Time = 0.24 (sec) , antiderivative size = 46, normalized size of antiderivative = 1.92 \[ \int \frac {-1+x^2}{\left (1+x^2\right ) \sqrt {x+x^2+x^3}} \, dx=-\frac {2 \sqrt {x} \sqrt {1+x+x^2} \text {arctanh}\left (\frac {\sqrt {x}}{\sqrt {1+x+x^2}}\right )}{\sqrt {x \left (1+x+x^2\right )}} \]
[In]
[Out]
Time = 1.64 (sec) , antiderivative size = 18, normalized size of antiderivative = 0.75
method | result | size |
default | \(-2 \,\operatorname {arctanh}\left (\frac {\sqrt {x \left (x^{2}+x +1\right )}}{x}\right )\) | \(18\) |
pseudoelliptic | \(-2 \,\operatorname {arctanh}\left (\frac {\sqrt {x \left (x^{2}+x +1\right )}}{x}\right )\) | \(18\) |
trager | \(-\ln \left (\frac {x^{2}+2 \sqrt {x^{3}+x^{2}+x}+2 x +1}{x^{2}+1}\right )\) | \(32\) |
elliptic | \(\text {Expression too large to display}\) | \(925\) |
[In]
[Out]
none
Time = 0.25 (sec) , antiderivative size = 29, normalized size of antiderivative = 1.21 \[ \int \frac {-1+x^2}{\left (1+x^2\right ) \sqrt {x+x^2+x^3}} \, dx=\log \left (\frac {x^{2} + 2 \, x - 2 \, \sqrt {x^{3} + x^{2} + x} + 1}{x^{2} + 1}\right ) \]
[In]
[Out]
\[ \int \frac {-1+x^2}{\left (1+x^2\right ) \sqrt {x+x^2+x^3}} \, dx=\int \frac {\left (x - 1\right ) \left (x + 1\right )}{\sqrt {x \left (x^{2} + x + 1\right )} \left (x^{2} + 1\right )}\, dx \]
[In]
[Out]
\[ \int \frac {-1+x^2}{\left (1+x^2\right ) \sqrt {x+x^2+x^3}} \, dx=\int { \frac {x^{2} - 1}{\sqrt {x^{3} + x^{2} + x} {\left (x^{2} + 1\right )}} \,d x } \]
[In]
[Out]
\[ \int \frac {-1+x^2}{\left (1+x^2\right ) \sqrt {x+x^2+x^3}} \, dx=\int { \frac {x^{2} - 1}{\sqrt {x^{3} + x^{2} + x} {\left (x^{2} + 1\right )}} \,d x } \]
[In]
[Out]
Time = 5.50 (sec) , antiderivative size = 223, normalized size of antiderivative = 9.29 \[ \int \frac {-1+x^2}{\left (1+x^2\right ) \sqrt {x+x^2+x^3}} \, dx=-\frac {\sqrt {\frac {x}{-\frac {1}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}}}\,\sqrt {-\frac {x+\frac {1}{2}-\frac {\sqrt {3}\,1{}\mathrm {i}}{2}}{-\frac {1}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}}}\,\sqrt {\frac {x+\frac {1}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}}{\frac {1}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}}}\,\left (\sqrt {3}+1{}\mathrm {i}\right )\,\left (-\mathrm {F}\left (\mathrm {asin}\left (\sqrt {\frac {x}{-\frac {1}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}}}\right )\middle |-\frac {-\frac {1}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}}{\frac {1}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}}\right )+\Pi \left (-\frac {\sqrt {3}}{2}-\frac {1}{2}{}\mathrm {i};\mathrm {asin}\left (\sqrt {\frac {x}{-\frac {1}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}}}\right )\middle |-\frac {-\frac {1}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}}{\frac {1}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}}\right )+\Pi \left (\frac {\sqrt {3}}{2}+\frac {1}{2}{}\mathrm {i};\mathrm {asin}\left (\sqrt {\frac {x}{-\frac {1}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}}}\right )\middle |-\frac {-\frac {1}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}}{\frac {1}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}}\right )\right )\,1{}\mathrm {i}}{\sqrt {x^3+x^2-\left (-\frac {1}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}\right )\,\left (\frac {1}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}\right )\,x}} \]
[In]
[Out]