Optimal. Leaf size=196 \[ -\frac {1}{2} \sqrt {\frac {1}{14} \left (-1+2 \sqrt {2}\right )} \tan ^{-1}\left (\frac {\sqrt {-1+2 \sqrt {2}}-2 x}{\sqrt {1+2 \sqrt {2}}}\right )+\frac {1}{2} \sqrt {\frac {1}{14} \left (-1+2 \sqrt {2}\right )} \tan ^{-1}\left (\frac {\sqrt {-1+2 \sqrt {2}}+2 x}{\sqrt {1+2 \sqrt {2}}}\right )-\frac {\log \left (\sqrt {2}-\sqrt {-1+2 \sqrt {2}} x+x^2\right )}{4 \sqrt {2 \left (-1+2 \sqrt {2}\right )}}+\frac {\log \left (\sqrt {2}+\sqrt {-1+2 \sqrt {2}} x+x^2\right )}{4 \sqrt {2 \left (-1+2 \sqrt {2}\right )}} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.11, antiderivative size = 196, normalized size of antiderivative = 1.00, number of steps
used = 9, number of rules used = 5, integrand size = 10, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.500, Rules used = {1108, 648, 632,
210, 642} \begin {gather*} -\frac {1}{2} \sqrt {\frac {1}{14} \left (2 \sqrt {2}-1\right )} \text {ArcTan}\left (\frac {\sqrt {2 \sqrt {2}-1}-2 x}{\sqrt {1+2 \sqrt {2}}}\right )+\frac {1}{2} \sqrt {\frac {1}{14} \left (2 \sqrt {2}-1\right )} \text {ArcTan}\left (\frac {2 x+\sqrt {2 \sqrt {2}-1}}{\sqrt {1+2 \sqrt {2}}}\right )-\frac {\log \left (x^2-\sqrt {2 \sqrt {2}-1} x+\sqrt {2}\right )}{4 \sqrt {2 \left (2 \sqrt {2}-1\right )}}+\frac {\log \left (x^2+\sqrt {2 \sqrt {2}-1} x+\sqrt {2}\right )}{4 \sqrt {2 \left (2 \sqrt {2}-1\right )}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 210
Rule 632
Rule 642
Rule 648
Rule 1108
Rubi steps
\begin {align*} \int \frac {1}{2+x^2+x^4} \, dx &=\frac {\int \frac {\sqrt {-1+2 \sqrt {2}}-x}{\sqrt {2}-\sqrt {-1+2 \sqrt {2}} x+x^2} \, dx}{2 \sqrt {2 \left (-1+2 \sqrt {2}\right )}}+\frac {\int \frac {\sqrt {-1+2 \sqrt {2}}+x}{\sqrt {2}+\sqrt {-1+2 \sqrt {2}} x+x^2} \, dx}{2 \sqrt {2 \left (-1+2 \sqrt {2}\right )}}\\ &=\frac {\int \frac {1}{\sqrt {2}-\sqrt {-1+2 \sqrt {2}} x+x^2} \, dx}{4 \sqrt {2}}+\frac {\int \frac {1}{\sqrt {2}+\sqrt {-1+2 \sqrt {2}} x+x^2} \, dx}{4 \sqrt {2}}-\frac {\int \frac {-\sqrt {-1+2 \sqrt {2}}+2 x}{\sqrt {2}-\sqrt {-1+2 \sqrt {2}} x+x^2} \, dx}{4 \sqrt {2 \left (-1+2 \sqrt {2}\right )}}+\frac {\int \frac {\sqrt {-1+2 \sqrt {2}}+2 x}{\sqrt {2}+\sqrt {-1+2 \sqrt {2}} x+x^2} \, dx}{4 \sqrt {2 \left (-1+2 \sqrt {2}\right )}}\\ &=-\frac {\log \left (\sqrt {2}-\sqrt {-1+2 \sqrt {2}} x+x^2\right )}{4 \sqrt {2 \left (-1+2 \sqrt {2}\right )}}+\frac {\log \left (\sqrt {2}+\sqrt {-1+2 \sqrt {2}} x+x^2\right )}{4 \sqrt {2 \left (-1+2 \sqrt {2}\right )}}-\frac {\text {Subst}\left (\int \frac {1}{-1-2 \sqrt {2}-x^2} \, dx,x,-\sqrt {-1+2 \sqrt {2}}+2 x\right )}{2 \sqrt {2}}-\frac {\text {Subst}\left (\int \frac {1}{-1-2 \sqrt {2}-x^2} \, dx,x,\sqrt {-1+2 \sqrt {2}}+2 x\right )}{2 \sqrt {2}}\\ &=-\frac {\tan ^{-1}\left (\frac {\sqrt {-1+2 \sqrt {2}}-2 x}{\sqrt {1+2 \sqrt {2}}}\right )}{2 \sqrt {2 \left (1+2 \sqrt {2}\right )}}+\frac {\tan ^{-1}\left (\frac {\sqrt {-1+2 \sqrt {2}}+2 x}{\sqrt {1+2 \sqrt {2}}}\right )}{2 \sqrt {2 \left (1+2 \sqrt {2}\right )}}-\frac {\log \left (\sqrt {2}-\sqrt {-1+2 \sqrt {2}} x+x^2\right )}{4 \sqrt {2 \left (-1+2 \sqrt {2}\right )}}+\frac {\log \left (\sqrt {2}+\sqrt {-1+2 \sqrt {2}} x+x^2\right )}{4 \sqrt {2 \left (-1+2 \sqrt {2}\right )}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] Result contains complex when optimal does not.
time = 0.05, size = 91, normalized size = 0.46 \begin {gather*} -\frac {i \tan ^{-1}\left (\frac {x}{\sqrt {\frac {1}{2} \left (1-i \sqrt {7}\right )}}\right )}{\sqrt {\frac {7}{2} \left (1-i \sqrt {7}\right )}}+\frac {i \tan ^{-1}\left (\frac {x}{\sqrt {\frac {1}{2} \left (1+i \sqrt {7}\right )}}\right )}{\sqrt {\frac {7}{2} \left (1+i \sqrt {7}\right )}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.06, size = 251, normalized size = 1.28
method | result | size |
risch | \(\frac {\left (\munderset {\textit {\_R} =\RootOf \left (\textit {\_Z}^{4}+\textit {\_Z}^{2}+2\right )}{\sum }\frac {\ln \left (-\textit {\_R} +x \right )}{2 \textit {\_R}^{3}+\textit {\_R}}\right )}{2}\) | \(31\) |
default | \(\frac {\left (\sqrt {-1+2 \sqrt {2}}\, \sqrt {2}+4 \sqrt {-1+2 \sqrt {2}}\right ) \ln \left (x^{2}+\sqrt {2}+x \sqrt {-1+2 \sqrt {2}}\right )}{56}+\frac {\left (7 \sqrt {2}-\frac {\left (\sqrt {-1+2 \sqrt {2}}\, \sqrt {2}+4 \sqrt {-1+2 \sqrt {2}}\right ) \sqrt {-1+2 \sqrt {2}}}{2}\right ) \arctan \left (\frac {2 x +\sqrt {-1+2 \sqrt {2}}}{\sqrt {1+2 \sqrt {2}}}\right )}{14 \sqrt {1+2 \sqrt {2}}}-\frac {\left (\sqrt {-1+2 \sqrt {2}}\, \sqrt {2}+4 \sqrt {-1+2 \sqrt {2}}\right ) \ln \left (x^{2}+\sqrt {2}-x \sqrt {-1+2 \sqrt {2}}\right )}{56}-\frac {\left (-7 \sqrt {2}+\frac {\left (\sqrt {-1+2 \sqrt {2}}\, \sqrt {2}+4 \sqrt {-1+2 \sqrt {2}}\right ) \sqrt {-1+2 \sqrt {2}}}{2}\right ) \arctan \left (\frac {2 x -\sqrt {-1+2 \sqrt {2}}}{\sqrt {1+2 \sqrt {2}}}\right )}{14 \sqrt {1+2 \sqrt {2}}}\) | \(251\) |
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*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 298 vs.
\(2 (135) = 270\).
time = 0.52, size = 298, normalized size = 1.52 \begin {gather*} -\frac {1}{56} \cdot 8^{\frac {1}{4}} \sqrt {7} \sqrt {2} \sqrt {-4 \, \sqrt {2} + 16} \arctan \left (-\frac {1}{56} \cdot 8^{\frac {3}{4}} \sqrt {7} \sqrt {2} x \sqrt {-4 \, \sqrt {2} + 16} + \frac {1}{112} \cdot 8^{\frac {3}{4}} \sqrt {7} \sqrt {2} \sqrt {4 \, x^{2} + 8^{\frac {1}{4}} x \sqrt {-4 \, \sqrt {2} + 16} + 4 \, \sqrt {2}} \sqrt {-4 \, \sqrt {2} + 16} - \frac {1}{7} \, \sqrt {7} {\left (2 \, \sqrt {2} - 1\right )}\right ) - \frac {1}{56} \cdot 8^{\frac {1}{4}} \sqrt {7} \sqrt {2} \sqrt {-4 \, \sqrt {2} + 16} \arctan \left (-\frac {1}{56} \cdot 8^{\frac {3}{4}} \sqrt {7} \sqrt {2} x \sqrt {-4 \, \sqrt {2} + 16} + \frac {1}{112} \cdot 8^{\frac {3}{4}} \sqrt {7} \sqrt {2} \sqrt {4 \, x^{2} - 8^{\frac {1}{4}} x \sqrt {-4 \, \sqrt {2} + 16} + 4 \, \sqrt {2}} \sqrt {-4 \, \sqrt {2} + 16} + \frac {1}{7} \, \sqrt {7} {\left (2 \, \sqrt {2} - 1\right )}\right ) + \frac {1}{224} \cdot 8^{\frac {1}{4}} {\left (\sqrt {2} + 4\right )} \sqrt {-4 \, \sqrt {2} + 16} \log \left (16 \, x^{2} + 4 \cdot 8^{\frac {1}{4}} x \sqrt {-4 \, \sqrt {2} + 16} + 16 \, \sqrt {2}\right ) - \frac {1}{224} \cdot 8^{\frac {1}{4}} {\left (\sqrt {2} + 4\right )} \sqrt {-4 \, \sqrt {2} + 16} \log \left (16 \, x^{2} - 4 \cdot 8^{\frac {1}{4}} x \sqrt {-4 \, \sqrt {2} + 16} + 16 \, \sqrt {2}\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 994 vs.
\(2 (158) = 316\).
time = 0.65, size = 994, normalized size = 5.07 \begin {gather*} \sqrt {\frac {1}{224} + \frac {\sqrt {2}}{112}} \log {\left (x^{2} + x \left (- \frac {4 \sqrt {7} \sqrt {1 + 2 \sqrt {2}}}{7} + \frac {5 \sqrt {14} \sqrt {1 + 2 \sqrt {2}}}{28} + \frac {3 \sqrt {14} \sqrt {1 + 2 \sqrt {2}} \sqrt {4 \sqrt {2} + 9}}{28}\right ) - \frac {33 \sqrt {4 \sqrt {2} + 9}}{28} - \frac {11}{28} + \frac {11 \sqrt {2} \sqrt {4 \sqrt {2} + 9}}{28} + \frac {83 \sqrt {2}}{28} \right )} - \sqrt {\frac {1}{224} + \frac {\sqrt {2}}{112}} \log {\left (x^{2} + x \left (- \frac {3 \sqrt {14} \sqrt {1 + 2 \sqrt {2}} \sqrt {4 \sqrt {2} + 9}}{28} - \frac {5 \sqrt {14} \sqrt {1 + 2 \sqrt {2}}}{28} + \frac {4 \sqrt {7} \sqrt {1 + 2 \sqrt {2}}}{7}\right ) - \frac {33 \sqrt {4 \sqrt {2} + 9}}{28} - \frac {11}{28} + \frac {11 \sqrt {2} \sqrt {4 \sqrt {2} + 9}}{28} + \frac {83 \sqrt {2}}{28} \right )} + 2 \sqrt {- \frac {\sqrt {4 \sqrt {2} + 9}}{112} + \frac {1}{224} + \frac {3 \sqrt {2}}{112}} \operatorname {atan}{\left (\frac {4 \sqrt {14} x}{\sqrt {4 \sqrt {2} + 9} \sqrt {- 2 \sqrt {4 \sqrt {2} + 9} + 1 + 6 \sqrt {2}} + 7 \sqrt {- 2 \sqrt {4 \sqrt {2} + 9} + 1 + 6 \sqrt {2}}} - \frac {8 \sqrt {2} \sqrt {1 + 2 \sqrt {2}}}{\sqrt {4 \sqrt {2} + 9} \sqrt {- 2 \sqrt {4 \sqrt {2} + 9} + 1 + 6 \sqrt {2}} + 7 \sqrt {- 2 \sqrt {4 \sqrt {2} + 9} + 1 + 6 \sqrt {2}}} + \frac {5 \sqrt {1 + 2 \sqrt {2}}}{\sqrt {4 \sqrt {2} + 9} \sqrt {- 2 \sqrt {4 \sqrt {2} + 9} + 1 + 6 \sqrt {2}} + 7 \sqrt {- 2 \sqrt {4 \sqrt {2} + 9} + 1 + 6 \sqrt {2}}} + \frac {3 \sqrt {1 + 2 \sqrt {2}} \sqrt {4 \sqrt {2} + 9}}{\sqrt {4 \sqrt {2} + 9} \sqrt {- 2 \sqrt {4 \sqrt {2} + 9} + 1 + 6 \sqrt {2}} + 7 \sqrt {- 2 \sqrt {4 \sqrt {2} + 9} + 1 + 6 \sqrt {2}}} \right )} + 2 \sqrt {- \frac {\sqrt {4 \sqrt {2} + 9}}{112} + \frac {1}{224} + \frac {3 \sqrt {2}}{112}} \operatorname {atan}{\left (\frac {4 \sqrt {14} x}{\sqrt {4 \sqrt {2} + 9} \sqrt {- 2 \sqrt {4 \sqrt {2} + 9} + 1 + 6 \sqrt {2}} + 7 \sqrt {- 2 \sqrt {4 \sqrt {2} + 9} + 1 + 6 \sqrt {2}}} - \frac {3 \sqrt {1 + 2 \sqrt {2}} \sqrt {4 \sqrt {2} + 9}}{\sqrt {4 \sqrt {2} + 9} \sqrt {- 2 \sqrt {4 \sqrt {2} + 9} + 1 + 6 \sqrt {2}} + 7 \sqrt {- 2 \sqrt {4 \sqrt {2} + 9} + 1 + 6 \sqrt {2}}} - \frac {5 \sqrt {1 + 2 \sqrt {2}}}{\sqrt {4 \sqrt {2} + 9} \sqrt {- 2 \sqrt {4 \sqrt {2} + 9} + 1 + 6 \sqrt {2}} + 7 \sqrt {- 2 \sqrt {4 \sqrt {2} + 9} + 1 + 6 \sqrt {2}}} + \frac {8 \sqrt {2} \sqrt {1 + 2 \sqrt {2}}}{\sqrt {4 \sqrt {2} + 9} \sqrt {- 2 \sqrt {4 \sqrt {2} + 9} + 1 + 6 \sqrt {2}} + 7 \sqrt {- 2 \sqrt {4 \sqrt {2} + 9} + 1 + 6 \sqrt {2}}} \right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.87, size = 252, normalized size = 1.29 \begin {gather*} \frac {1}{112} \, \sqrt {7} {\left (\sqrt {7} 2^{\frac {1}{4}} \sqrt {2 \, \sqrt {2} + 8} - 2^{\frac {1}{4}} \sqrt {-2 \, \sqrt {2} + 8}\right )} \arctan \left (\frac {2 \cdot 2^{\frac {3}{4}} \sqrt {\frac {1}{2}} {\left (x + 2^{\frac {1}{4}} \sqrt {-\frac {1}{8} \, \sqrt {2} + \frac {1}{2}}\right )}}{\sqrt {\sqrt {2} + 4}}\right ) + \frac {1}{112} \, \sqrt {7} {\left (\sqrt {7} 2^{\frac {1}{4}} \sqrt {2 \, \sqrt {2} + 8} - 2^{\frac {1}{4}} \sqrt {-2 \, \sqrt {2} + 8}\right )} \arctan \left (\frac {2 \cdot 2^{\frac {3}{4}} \sqrt {\frac {1}{2}} {\left (x - 2^{\frac {1}{4}} \sqrt {-\frac {1}{8} \, \sqrt {2} + \frac {1}{2}}\right )}}{\sqrt {\sqrt {2} + 4}}\right ) + \frac {1}{224} \, \sqrt {7} {\left (\sqrt {7} 2^{\frac {1}{4}} \sqrt {-2 \, \sqrt {2} + 8} + 2^{\frac {1}{4}} \sqrt {2 \, \sqrt {2} + 8}\right )} \log \left (x^{2} + 2 \cdot 2^{\frac {1}{4}} x \sqrt {-\frac {1}{8} \, \sqrt {2} + \frac {1}{2}} + \sqrt {2}\right ) - \frac {1}{224} \, \sqrt {7} {\left (\sqrt {7} 2^{\frac {1}{4}} \sqrt {-2 \, \sqrt {2} + 8} + 2^{\frac {1}{4}} \sqrt {2 \, \sqrt {2} + 8}\right )} \log \left (x^{2} - 2 \cdot 2^{\frac {1}{4}} x \sqrt {-\frac {1}{8} \, \sqrt {2} + \frac {1}{2}} + \sqrt {2}\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.22, size = 61, normalized size = 0.31 \begin {gather*} \frac {\mathrm {atan}\left (\frac {\sqrt {7}\,x\,\sqrt {7-\sqrt {7}\,7{}\mathrm {i}}}{14}\right )\,\sqrt {7-\sqrt {7}\,7{}\mathrm {i}}\,1{}\mathrm {i}}{14}-\frac {\sqrt {7}\,\mathrm {atan}\left (\frac {x\,\sqrt {1+\sqrt {7}\,1{}\mathrm {i}}}{2}\right )\,\sqrt {1+\sqrt {7}\,1{}\mathrm {i}}\,1{}\mathrm {i}}{14} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________