Optimal. Leaf size=46 \[ \frac {2 \sqrt {x^4+x^2+1}}{x^2+1}-2 \tan ^{-1}\left (\frac {x}{x^2+\sqrt {x^4+x^2+1}+1}\right ) \]
________________________________________________________________________________________
Rubi [A] time = 0.20, antiderivative size = 39, normalized size of antiderivative = 0.85, number of steps used = 6, number of rules used = 6, integrand size = 28, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.214, Rules used = {1687, 1586, 1698, 203, 1685, 802} \begin {gather*} \frac {2 \sqrt {x^4+x^2+1}}{x^2+1}-\tan ^{-1}\left (\frac {x}{\sqrt {x^4+x^2+1}}\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 203
Rule 802
Rule 1586
Rule 1685
Rule 1687
Rule 1698
Rubi steps
\begin {align*} \int \frac {(-1+x) (1+x)^3}{\left (1+x^2\right )^2 \sqrt {1+x^2+x^4}} \, dx &=\int \frac {x \left (-2+2 x^2\right )}{\left (1+x^2\right )^2 \sqrt {1+x^2+x^4}} \, dx+\int \frac {-1+x^4}{\left (1+x^2\right )^2 \sqrt {1+x^2+x^4}} \, dx\\ &=\frac {1}{2} \operatorname {Subst}\left (\int \frac {-2+2 x}{(1+x)^2 \sqrt {1+x+x^2}} \, dx,x,x^2\right )+\int \frac {-1+x^2}{\left (1+x^2\right ) \sqrt {1+x^2+x^4}} \, dx\\ &=\frac {2 \sqrt {1+x^2+x^4}}{1+x^2}-\operatorname {Subst}\left (\int \frac {1}{1+x^2} \, dx,x,\frac {x}{\sqrt {1+x^2+x^4}}\right )\\ &=\frac {2 \sqrt {1+x^2+x^4}}{1+x^2}-\tan ^{-1}\left (\frac {x}{\sqrt {1+x^2+x^4}}\right )\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] time = 5.04, size = 709, normalized size = 15.41 \begin {gather*} \frac {2 \left (\frac {x^4+x^2+1}{x^2+1}-\frac {\sqrt [6]{-1} \sqrt {\frac {\left (\sqrt {3}-i\right ) \left (x-\sqrt [3]{-1}+1\right ) \left (2 x-i \sqrt {3}-1\right )}{\left (x+(-1)^{2/3}+1\right )^2}} \sqrt {\frac {2 \sqrt {3} x-\sqrt {3}+3 i}{2 \left (\sqrt {3}+i\right ) x+4 i}} \left (x+(-1)^{2/3}+1\right )^2 F\left (\sin ^{-1}\left (\sqrt {\frac {i \sqrt {3} x+x+2}{x+(-1)^{2/3}+1}}\right )|\frac {1}{4}\right )}{2 \sqrt {2} \sqrt [4]{3}}+\frac {\sqrt [6]{-1} \sqrt {\frac {-2 \sqrt {3} x+\sqrt {3}+3 i}{-2 i x+\sqrt {3}-i}} \sqrt {\frac {i \sqrt {3} x+x+2}{x+(-1)^{2/3}+1}} \sqrt {\frac {2 \sqrt {3} x-\sqrt {3}+3 i}{\left (\sqrt {3}+i\right ) x+2 i}} \left (x+(-1)^{2/3}+1\right )^2 \left (\left ((1+2 i)-i \sqrt {3}\right ) F\left (\sin ^{-1}\left (\sqrt {\frac {2 \left (-i+\sqrt {3}\right ) x-4 i}{-2 i x+\sqrt {3}-i}}\right )|\frac {1}{4}\right )+2 i \sqrt {3} \Pi \left (\frac {(1+2 i)+i \sqrt {3}}{(4+2 i)-2 \sqrt {3}};\sin ^{-1}\left (\sqrt {\frac {2 \left (-i+\sqrt {3}\right ) x-4 i}{-2 i x+\sqrt {3}-i}}\right )|\frac {1}{4}\right )\right )}{4 \sqrt {6}}-\frac {(-1)^{2/3} \sqrt {\frac {-2 \sqrt {3} x+\sqrt {3}+3 i}{-2 i x+\sqrt {3}-i}} \sqrt {\frac {i \sqrt {3} x+x+2}{x+(-1)^{2/3}+1}} \sqrt {\frac {2 \sqrt {3} x-\sqrt {3}+3 i}{\left (\sqrt {3}+i\right ) x+2 i}} \left (x+(-1)^{2/3}+1\right )^2 \left (\left (\sqrt {3}+(2+i)\right ) F\left (\sin ^{-1}\left (\sqrt {\frac {2 \left (-i+\sqrt {3}\right ) x-4 i}{-2 i x+\sqrt {3}-i}}\right )|\frac {1}{4}\right )-2 \sqrt {3} \Pi \left (\frac {(1-2 i)+i \sqrt {3}}{(4-2 i)+2 \sqrt {3}};\sin ^{-1}\left (\sqrt {\frac {2 \left (-i+\sqrt {3}\right ) x-4 i}{-2 i x+\sqrt {3}-i}}\right )|\frac {1}{4}\right )\right )}{4 \sqrt {6}}\right )}{\sqrt {x^4+x^2+1}} \end {gather*}
Warning: Unable to verify antiderivative.
[In]
[Out]
________________________________________________________________________________________
IntegrateAlgebraic [A] time = 0.58, size = 46, normalized size = 1.00 \begin {gather*} \frac {2 \sqrt {1+x^2+x^4}}{1+x^2}-2 \tan ^{-1}\left (\frac {x}{1+x^2+\sqrt {1+x^2+x^4}}\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.50, size = 41, normalized size = 0.89 \begin {gather*} -\frac {{\left (x^{2} + 1\right )} \arctan \left (\frac {x}{\sqrt {x^{4} + x^{2} + 1}}\right ) - 2 \, \sqrt {x^{4} + x^{2} + 1}}{x^{2} + 1} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [F] time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {{\left (x + 1\right )}^{3} {\left (x - 1\right )}}{\sqrt {x^{4} + x^{2} + 1} {\left (x^{2} + 1\right )}^{2}}\,{d x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.34, size = 36, normalized size = 0.78
method | result | size |
elliptic | \(\frac {2 \sqrt {x^{4}+x^{2}+1}}{x^{2}+1}+\arctan \left (\frac {\sqrt {x^{4}+x^{2}+1}}{x}\right )\) | \(36\) |
trager | \(\frac {2 \sqrt {x^{4}+x^{2}+1}}{x^{2}+1}+\RootOf \left (\textit {\_Z}^{2}+1\right ) \ln \left (\frac {\RootOf \left (\textit {\_Z}^{2}+1\right ) x +\sqrt {x^{4}+x^{2}+1}}{x^{2}+1}\right )\) | \(56\) |
risch | \(\frac {2 \sqrt {x^{4}+x^{2}+1}}{x^{2}+1}+\frac {2 \sqrt {1-\left (-\frac {1}{2}+\frac {i \sqrt {3}}{2}\right ) x^{2}}\, \sqrt {1-\left (-\frac {1}{2}-\frac {i \sqrt {3}}{2}\right ) x^{2}}\, \EllipticF \left (\frac {x \sqrt {-2+2 i \sqrt {3}}}{2}, \frac {\sqrt {-2+2 i \sqrt {3}}}{2}\right )}{\sqrt {-2+2 i \sqrt {3}}\, \sqrt {x^{4}+x^{2}+1}}-\frac {2 \sqrt {1+\frac {x^{2}}{2}-\frac {i \sqrt {3}\, x^{2}}{2}}\, \sqrt {1+\frac {x^{2}}{2}+\frac {i \sqrt {3}\, x^{2}}{2}}\, \EllipticPi \left (\sqrt {-\frac {1}{2}+\frac {i \sqrt {3}}{2}}\, x , -\frac {1}{-\frac {1}{2}+\frac {i \sqrt {3}}{2}}, \frac {\sqrt {-\frac {1}{2}-\frac {i \sqrt {3}}{2}}}{\sqrt {-\frac {1}{2}+\frac {i \sqrt {3}}{2}}}\right )}{\sqrt {-\frac {1}{2}+\frac {i \sqrt {3}}{2}}\, \sqrt {x^{4}+x^{2}+1}}\) | \(207\) |
default | \(\frac {2 \sqrt {1-\left (-\frac {1}{2}+\frac {i \sqrt {3}}{2}\right ) x^{2}}\, \sqrt {1-\left (-\frac {1}{2}-\frac {i \sqrt {3}}{2}\right ) x^{2}}\, \EllipticF \left (\frac {x \sqrt {-2+2 i \sqrt {3}}}{2}, \frac {\sqrt {-2+2 i \sqrt {3}}}{2}\right )}{\sqrt {-2+2 i \sqrt {3}}\, \sqrt {x^{4}+x^{2}+1}}+\arctanh \left (\frac {x^{2}}{2 \sqrt {x^{4}+x^{2}+1}}-\frac {1}{2 \sqrt {x^{4}+x^{2}+1}}\right )-\frac {2 \sqrt {1+\frac {x^{2}}{2}-\frac {i \sqrt {3}\, x^{2}}{2}}\, \sqrt {1+\frac {x^{2}}{2}+\frac {i \sqrt {3}\, x^{2}}{2}}\, \EllipticPi \left (\sqrt {-\frac {1}{2}+\frac {i \sqrt {3}}{2}}\, x , -\frac {1}{-\frac {1}{2}+\frac {i \sqrt {3}}{2}}, \frac {\sqrt {-\frac {1}{2}-\frac {i \sqrt {3}}{2}}}{\sqrt {-\frac {1}{2}+\frac {i \sqrt {3}}{2}}}\right )}{\sqrt {-\frac {1}{2}+\frac {i \sqrt {3}}{2}}\, \sqrt {x^{4}+x^{2}+1}}+\frac {2 \sqrt {\left (x^{2}+1\right )^{2}-x^{2}}}{x^{2}+1}+\arctanh \left (\frac {-x^{2}+1}{2 \sqrt {\left (x^{2}+1\right )^{2}-x^{2}}}\right )\) | \(266\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [F] time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {{\left (x + 1\right )}^{3} {\left (x - 1\right )}}{\sqrt {x^{4} + x^{2} + 1} {\left (x^{2} + 1\right )}^{2}}\,{d x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [F] time = 0.00, size = -1, normalized size = -0.02 \begin {gather*} \int \frac {\left (x-1\right )\,{\left (x+1\right )}^3}{{\left (x^2+1\right )}^2\,\sqrt {x^4+x^2+1}} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\left (x - 1\right ) \left (x + 1\right )^{3}}{\sqrt {\left (x^{2} - x + 1\right ) \left (x^{2} + x + 1\right )} \left (x^{2} + 1\right )^{2}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________