Optimal. Leaf size=43 \[ \tanh ^{-1}\left (\frac {x}{\sqrt {x^4+x^2+1}}\right )-\sqrt {2} \tanh ^{-1}\left (\frac {\sqrt {2} x}{\sqrt {x^4+x^2+1}}\right ) \]
________________________________________________________________________________________
Rubi [C] time = 1.43, antiderivative size = 350, normalized size of antiderivative = 8.14, number of steps used = 34, number of rules used = 8, integrand size = 37, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.216, Rules used = {6725, 1208, 1197, 1103, 1195, 1216, 1706, 6728} \begin {gather*} \tanh ^{-1}\left (\frac {x}{\sqrt {x^4+x^2+1}}\right )-\sqrt {2} \tanh ^{-1}\left (\frac {\sqrt {2} x}{\sqrt {x^4+x^2+1}}\right )-\frac {\left (\sqrt {3}+i\right ) \left (x^2+1\right ) \sqrt {\frac {x^4+x^2+1}{\left (x^2+1\right )^2}} F\left (2 \tan ^{-1}(x)|\frac {1}{4}\right )}{\left (\sqrt {3}+3 i\right ) \sqrt {x^4+x^2+1}}+\frac {\left (5+i \sqrt {3}\right ) \left (x^2+1\right ) \sqrt {\frac {x^4+x^2+1}{\left (x^2+1\right )^2}} F\left (2 \tan ^{-1}(x)|\frac {1}{4}\right )}{4 \sqrt {x^4+x^2+1}}+\frac {\left (5-i \sqrt {3}\right ) \left (x^2+1\right ) \sqrt {\frac {x^4+x^2+1}{\left (x^2+1\right )^2}} F\left (2 \tan ^{-1}(x)|\frac {1}{4}\right )}{4 \sqrt {x^4+x^2+1}}-\frac {\left (-\sqrt {3}+i\right ) \left (x^2+1\right ) \sqrt {\frac {x^4+x^2+1}{\left (x^2+1\right )^2}} F\left (2 \tan ^{-1}(x)|\frac {1}{4}\right )}{\left (-\sqrt {3}+3 i\right ) \sqrt {x^4+x^2+1}}-\frac {3 \left (x^2+1\right ) \sqrt {\frac {x^4+x^2+1}{\left (x^2+1\right )^2}} F\left (2 \tan ^{-1}(x)|\frac {1}{4}\right )}{2 \sqrt {x^4+x^2+1}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 1103
Rule 1195
Rule 1197
Rule 1208
Rule 1216
Rule 1706
Rule 6725
Rule 6728
Rubi steps
\begin {align*} \int \frac {\left (-1+x^4\right ) \sqrt {1+x^2+x^4}}{\left (1+x^4\right ) \left (1-x^2+x^4\right )} \, dx &=\int \left (-\frac {2 x^2 \sqrt {1+x^2+x^4}}{1+x^4}+\frac {\left (-1+2 x^2\right ) \sqrt {1+x^2+x^4}}{1-x^2+x^4}\right ) \, dx\\ &=-\left (2 \int \frac {x^2 \sqrt {1+x^2+x^4}}{1+x^4} \, dx\right )+\int \frac {\left (-1+2 x^2\right ) \sqrt {1+x^2+x^4}}{1-x^2+x^4} \, dx\\ &=-\left (2 \int \left (-\frac {\sqrt {1+x^2+x^4}}{2 \left (i-x^2\right )}+\frac {\sqrt {1+x^2+x^4}}{2 \left (i+x^2\right )}\right ) \, dx\right )+\int \left (\frac {2 \sqrt {1+x^2+x^4}}{-1-i \sqrt {3}+2 x^2}+\frac {2 \sqrt {1+x^2+x^4}}{-1+i \sqrt {3}+2 x^2}\right ) \, dx\\ &=2 \int \frac {\sqrt {1+x^2+x^4}}{-1-i \sqrt {3}+2 x^2} \, dx+2 \int \frac {\sqrt {1+x^2+x^4}}{-1+i \sqrt {3}+2 x^2} \, dx+\int \frac {\sqrt {1+x^2+x^4}}{i-x^2} \, dx-\int \frac {\sqrt {1+x^2+x^4}}{i+x^2} \, dx\\ &=i \int \frac {1}{\left (i-x^2\right ) \sqrt {1+x^2+x^4}} \, dx+i \int \frac {1}{\left (i+x^2\right ) \sqrt {1+x^2+x^4}} \, dx-\frac {1}{2} \int \frac {-3-i \sqrt {3}-2 x^2}{\sqrt {1+x^2+x^4}} \, dx-\frac {1}{2} \int \frac {-3+i \sqrt {3}-2 x^2}{\sqrt {1+x^2+x^4}} \, dx+\left (2 \left (1-i \sqrt {3}\right )\right ) \int \frac {1}{\left (-1+i \sqrt {3}+2 x^2\right ) \sqrt {1+x^2+x^4}} \, dx+\left (2 \left (1+i \sqrt {3}\right )\right ) \int \frac {1}{\left (-1-i \sqrt {3}+2 x^2\right ) \sqrt {1+x^2+x^4}} \, dx+\int \frac {(-1+i)-x^2}{\sqrt {1+x^2+x^4}} \, dx-\int \frac {(1+i)+x^2}{\sqrt {1+x^2+x^4}} \, dx\\ &=(-2+i) \int \frac {1}{\sqrt {1+x^2+x^4}} \, dx+\left (-\frac {1}{2}+\frac {i}{2}\right ) \int \frac {1+x^2}{\left (i+x^2\right ) \sqrt {1+x^2+x^4}} \, dx+\left (\frac {1}{2}-\frac {i}{2}\right ) \int \frac {1}{\sqrt {1+x^2+x^4}} \, dx+\left (\frac {1}{2}+\frac {i}{2}\right ) \int \frac {1}{\sqrt {1+x^2+x^4}} \, dx+\left (\frac {1}{2}+\frac {i}{2}\right ) \int \frac {1+x^2}{\left (i-x^2\right ) \sqrt {1+x^2+x^4}} \, dx-(2+i) \int \frac {1}{\sqrt {1+x^2+x^4}} \, dx-\frac {\left (2 \left (i-\sqrt {3}\right )\right ) \int \frac {1}{\sqrt {1+x^2+x^4}} \, dx}{3 i-\sqrt {3}}+\frac {\left (4 \left (i-\sqrt {3}\right )\right ) \int \frac {1+x^2}{\left (-1-i \sqrt {3}+2 x^2\right ) \sqrt {1+x^2+x^4}} \, dx}{3 i-\sqrt {3}}-\frac {1}{2} \left (-5-i \sqrt {3}\right ) \int \frac {1}{\sqrt {1+x^2+x^4}} \, dx-\frac {1}{2} \left (-5+i \sqrt {3}\right ) \int \frac {1}{\sqrt {1+x^2+x^4}} \, dx-\frac {\left (2 \left (i+\sqrt {3}\right )\right ) \int \frac {1}{\sqrt {1+x^2+x^4}} \, dx}{3 i+\sqrt {3}}+\frac {\left (4 \left (i+\sqrt {3}\right )\right ) \int \frac {1+x^2}{\left (-1+i \sqrt {3}+2 x^2\right ) \sqrt {1+x^2+x^4}} \, dx}{3 i+\sqrt {3}}\\ &=\tanh ^{-1}\left (\frac {x}{\sqrt {1+x^2+x^4}}\right )+\frac {\sqrt {\frac {3}{2}} \left (1-i \sqrt {3}\right ) \tanh ^{-1}\left (\frac {\sqrt {2} x}{\sqrt {1+x^2+x^4}}\right )}{3 i-\sqrt {3}}+\frac {\sqrt {\frac {3}{2}} \left (i-\sqrt {3}\right ) \tanh ^{-1}\left (\frac {\sqrt {2} x}{\sqrt {1+x^2+x^4}}\right )}{3-i \sqrt {3}}-\frac {3 \left (1+x^2\right ) \sqrt {\frac {1+x^2+x^4}{\left (1+x^2\right )^2}} F\left (2 \tan ^{-1}(x)|\frac {1}{4}\right )}{2 \sqrt {1+x^2+x^4}}-\frac {\left (i-\sqrt {3}\right ) \left (1+x^2\right ) \sqrt {\frac {1+x^2+x^4}{\left (1+x^2\right )^2}} F\left (2 \tan ^{-1}(x)|\frac {1}{4}\right )}{\left (3 i-\sqrt {3}\right ) \sqrt {1+x^2+x^4}}+\frac {\left (5-i \sqrt {3}\right ) \left (1+x^2\right ) \sqrt {\frac {1+x^2+x^4}{\left (1+x^2\right )^2}} F\left (2 \tan ^{-1}(x)|\frac {1}{4}\right )}{4 \sqrt {1+x^2+x^4}}+\frac {\left (5+i \sqrt {3}\right ) \left (1+x^2\right ) \sqrt {\frac {1+x^2+x^4}{\left (1+x^2\right )^2}} F\left (2 \tan ^{-1}(x)|\frac {1}{4}\right )}{4 \sqrt {1+x^2+x^4}}-\frac {\left (i+\sqrt {3}\right ) \left (1+x^2\right ) \sqrt {\frac {1+x^2+x^4}{\left (1+x^2\right )^2}} F\left (2 \tan ^{-1}(x)|\frac {1}{4}\right )}{\left (3 i+\sqrt {3}\right ) \sqrt {1+x^2+x^4}}-\frac {\left (i+\sqrt {3}\right ) \left (1+x^2\right ) \sqrt {\frac {1+x^2+x^4}{\left (1+x^2\right )^2}} \Pi \left (\frac {3}{4};2 \tan ^{-1}(x)|\frac {1}{4}\right )}{2 \left (3 i-\sqrt {3}\right ) \sqrt {1+x^2+x^4}}-\frac {\left (i-\sqrt {3}\right ) \left (1+x^2\right ) \sqrt {\frac {1+x^2+x^4}{\left (1+x^2\right )^2}} \Pi \left (\frac {3}{4};2 \tan ^{-1}(x)|\frac {1}{4}\right )}{2 \left (3 i+\sqrt {3}\right ) \sqrt {1+x^2+x^4}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] time = 0.79, size = 284, normalized size = 6.60 \begin {gather*} \frac {\sqrt {\sqrt [3]{-1} x^2+1} \sqrt {1-(-1)^{2/3} x^2} \left (\left ((-1)^{2/3}-1\right ) F\left (i \sinh ^{-1}\left ((-1)^{5/6} x\right )|(-1)^{2/3}\right )-2 \left (\sqrt [3]{-1}-2\right ) \Pi \left (-1;i \sinh ^{-1}\left ((-1)^{5/6} x\right )|(-1)^{2/3}\right )-4 (-1)^{2/3} \Pi \left (-(-1)^{2/3};i \sinh ^{-1}\left ((-1)^{5/6} x\right )|(-1)^{2/3}\right )+2 \sqrt [3]{-1} \Pi \left (-(-1)^{2/3};i \sinh ^{-1}\left ((-1)^{5/6} x\right )|(-1)^{2/3}\right )+(-1)^{2/3} \Pi \left (-(-1)^{5/6};i \sinh ^{-1}\left ((-1)^{5/6} x\right )|(-1)^{2/3}\right )-\Pi \left (-(-1)^{5/6};i \sinh ^{-1}\left ((-1)^{5/6} x\right )|(-1)^{2/3}\right )+(-1)^{2/3} \Pi \left ((-1)^{5/6};i \sinh ^{-1}\left ((-1)^{5/6} x\right )|(-1)^{2/3}\right )-\Pi \left ((-1)^{5/6};i \sinh ^{-1}\left ((-1)^{5/6} x\right )|(-1)^{2/3}\right )\right )}{\left (1+\sqrt [3]{-1}\right ) \sqrt {x^4+x^2+1}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
IntegrateAlgebraic [A] time = 0.36, size = 43, normalized size = 1.00 \begin {gather*} \tanh ^{-1}\left (\frac {x}{\sqrt {1+x^2+x^4}}\right )-\sqrt {2} \tanh ^{-1}\left (\frac {\sqrt {2} x}{\sqrt {1+x^2+x^4}}\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [B] time = 0.57, size = 111, normalized size = 2.58 \begin {gather*} \frac {1}{4} \, \sqrt {2} \log \left (-\frac {x^{8} + 14 \, x^{6} + 19 \, x^{4} - 4 \, \sqrt {2} {\left (x^{5} + 3 \, x^{3} + x\right )} \sqrt {x^{4} + x^{2} + 1} + 14 \, x^{2} + 1}{x^{8} - 2 \, x^{6} + 3 \, x^{4} - 2 \, x^{2} + 1}\right ) + \frac {1}{2} \, \log \left (-\frac {x^{4} + 2 \, x^{2} + 2 \, \sqrt {x^{4} + x^{2} + 1} x + 1}{x^{4} + 1}\right ) \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 {\sqrt {x^{4} + x^{2} + 1} {\left (x^{4} - 1\right )}}{{\left (x^{4} - x^{2} + 1\right )} {\left (x^{4} + 1\right )}}\,{d x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.50, size = 70, normalized size = 1.63
method | result | size |
elliptic | \(\frac {\left (-\ln \left (1+\frac {\sqrt {x^{4}+x^{2}+1}\, \sqrt {2}}{2 x}\right )+\sqrt {2}\, \arctanh \left (\frac {\sqrt {x^{4}+x^{2}+1}}{x}\right )+\ln \left (-1+\frac {\sqrt {x^{4}+x^{2}+1}\, \sqrt {2}}{2 x}\right )\right ) \sqrt {2}}{2}\) | \(70\) |
trager | \(-\frac {\RootOf \left (\textit {\_Z}^{2}-2\right ) \ln \left (-\frac {\RootOf \left (\textit {\_Z}^{2}-2\right ) x^{4}+3 \RootOf \left (\textit {\_Z}^{2}-2\right ) x^{2}+4 \sqrt {x^{4}+x^{2}+1}\, x +\RootOf \left (\textit {\_Z}^{2}-2\right )}{x^{4}-x^{2}+1}\right )}{2}-\frac {\ln \left (-\frac {-x^{4}+2 \sqrt {x^{4}+x^{2}+1}\, x -2 x^{2}-1}{x^{4}+1}\right )}{2}\) | \(103\) |
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}}+\frac {\sqrt {2}\, \left (\munderset {\underline {\hspace {1.25 ex}}\alpha =\RootOf \left (\textit {\_Z}^{4}-\textit {\_Z}^{2}+1\right )}{\sum }\underline {\hspace {1.25 ex}}\alpha \left (-\frac {\arctanh \left (\frac {\left (2 \underline {\hspace {1.25 ex}}\alpha ^{2}+1\right ) \left (-3 \underline {\hspace {1.25 ex}}\alpha ^{2}+7 x^{2}+8\right ) \sqrt {2}}{28 \sqrt {\underline {\hspace {1.25 ex}}\alpha ^{2}}\, \sqrt {x^{4}+x^{2}+1}}\right )}{\sqrt {\underline {\hspace {1.25 ex}}\alpha ^{2}}}-\frac {2 \left (-\underline {\hspace {1.25 ex}}\alpha ^{3}+\underline {\hspace {1.25 ex}}\alpha \right ) \sqrt {x^{2}+2-i \sqrt {3}\, x^{2}}\, \sqrt {x^{2}+2+i \sqrt {3}\, x^{2}}\, \EllipticPi \left (\sqrt {-\frac {1}{2}+\frac {i \sqrt {3}}{2}}\, x , \frac {i \underline {\hspace {1.25 ex}}\alpha ^{2} \sqrt {3}}{2}+\frac {\underline {\hspace {1.25 ex}}\alpha ^{2}}{2}-\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 {i \sqrt {3}-1}\, \sqrt {x^{4}+x^{2}+1}}\right )\right )}{4}-\frac {\left (\munderset {\underline {\hspace {1.25 ex}}\alpha =\RootOf \left (\textit {\_Z}^{4}+1\right )}{\sum }\underline {\hspace {1.25 ex}}\alpha \left (-\frac {\arctanh \left (\frac {\left (2 \underline {\hspace {1.25 ex}}\alpha ^{2}+1\right ) \left (-3 \underline {\hspace {1.25 ex}}\alpha ^{2}+5 x^{2}+4\right )}{10 \sqrt {\underline {\hspace {1.25 ex}}\alpha ^{2}}\, \sqrt {x^{4}+x^{2}+1}}\right )}{\sqrt {\underline {\hspace {1.25 ex}}\alpha ^{2}}}+\frac {\sqrt {2}\, \underline {\hspace {1.25 ex}}\alpha ^{3} \sqrt {x^{2}+2-i \sqrt {3}\, x^{2}}\, \sqrt {x^{2}+2+i \sqrt {3}\, x^{2}}\, \EllipticPi \left (\sqrt {-\frac {1}{2}+\frac {i \sqrt {3}}{2}}\, x , \frac {i \underline {\hspace {1.25 ex}}\alpha ^{2} \sqrt {3}}{2}+\frac {\underline {\hspace {1.25 ex}}\alpha ^{2}}{2}, \frac {\sqrt {-\frac {1}{2}-\frac {i \sqrt {3}}{2}}}{\sqrt {-\frac {1}{2}+\frac {i \sqrt {3}}{2}}}\right )}{\sqrt {i \sqrt {3}-1}\, \sqrt {x^{4}+x^{2}+1}}\right )\right )}{4}\) | \(436\) |
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 {\sqrt {x^{4} + x^{2} + 1} {\left (x^{4} - 1\right )}}{{\left (x^{4} - x^{2} + 1\right )} {\left (x^{4} + 1\right )}}\,{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^4-1\right )\,\sqrt {x^4+x^2+1}}{\left (x^4+1\right )\,\left (x^4-x^2+1\right )} \,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 {\sqrt {\left (x^{2} - x + 1\right ) \left (x^{2} + x + 1\right )} \left (x - 1\right ) \left (x + 1\right ) \left (x^{2} + 1\right )}{\left (x^{4} + 1\right ) \left (x^{4} - x^{2} + 1\right )}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________