Integrand size = 12, antiderivative size = 196 \[ \int \frac {1}{2-x^2+x^4} \, dx=-\frac {1}{2} \sqrt {\frac {1}{14} \left (1+2 \sqrt {2}\right )} \arctan \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 )} \arctan \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]
Time = 0.11 (sec) , antiderivative size = 196, normalized size of antiderivative = 1.00, number of steps used = 9, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.417, Rules used = {1108, 648, 632, 210, 642} \[ \int \frac {1}{2-x^2+x^4} \, dx=-\frac {1}{2} \sqrt {\frac {1}{14} \left (1+2 \sqrt {2}\right )} \arctan \left (\frac {\sqrt {1+2 \sqrt {2}}-2 x}{\sqrt {2 \sqrt {2}-1}}\right )+\frac {1}{2} \sqrt {\frac {1}{14} \left (1+2 \sqrt {2}\right )} \arctan \left (\frac {2 x+\sqrt {1+2 \sqrt {2}}}{\sqrt {2 \sqrt {2}-1}}\right )-\frac {\log \left (x^2-\sqrt {1+2 \sqrt {2}} x+\sqrt {2}\right )}{4 \sqrt {2 \left (1+2 \sqrt {2}\right )}}+\frac {\log \left (x^2+\sqrt {1+2 \sqrt {2}} x+\sqrt {2}\right )}{4 \sqrt {2 \left (1+2 \sqrt {2}\right )}} \]
[In]
[Out]
Rule 210
Rule 632
Rule 642
Rule 648
Rule 1108
Rubi steps \begin{align*} \text {integral}& = \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 {\arctan \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 {\arctan \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*}
Result contains complex when optimal does not.
Time = 0.05 (sec) , antiderivative size = 91, normalized size of antiderivative = 0.46 \[ \int \frac {1}{2-x^2+x^4} \, dx=-\frac {i \arctan \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 \arctan \left (\frac {x}{\sqrt {\frac {1}{2} \left (-1+i \sqrt {7}\right )}}\right )}{\sqrt {\frac {7}{2} \left (-1+i \sqrt {7}\right )}} \]
[In]
[Out]
Result contains higher order function than in optimal. Order 9 vs. order 3.
Time = 0.13 (sec) , antiderivative size = 35, normalized size of antiderivative = 0.18
method | result | size |
risch | \(\frac {\left (\munderset {\textit {\_R} =\operatorname {RootOf}\left (\textit {\_Z}^{4}-\textit {\_Z}^{2}+2\right )}{\sum }\frac {\ln \left (x -\textit {\_R} \right )}{2 \textit {\_R}^{3}-\textit {\_R}}\right )}{2}\) | \(35\) |
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}}}\) | \(253\) |
[In]
[Out]
Result contains complex when optimal does not.
Time = 0.24 (sec) , antiderivative size = 139, normalized size of antiderivative = 0.71 \[ \int \frac {1}{2-x^2+x^4} \, dx=\frac {1}{28} \, \sqrt {7} \sqrt {i \, \sqrt {7} - 1} \log \left ({\left (\sqrt {7} - i\right )} \sqrt {i \, \sqrt {7} - 1} + 4 \, x\right ) - \frac {1}{28} \, \sqrt {7} \sqrt {i \, \sqrt {7} - 1} \log \left (-{\left (\sqrt {7} - i\right )} \sqrt {i \, \sqrt {7} - 1} + 4 \, x\right ) + \frac {1}{28} \, \sqrt {7} \sqrt {-i \, \sqrt {7} - 1} \log \left ({\left (\sqrt {7} + i\right )} \sqrt {-i \, \sqrt {7} - 1} + 4 \, x\right ) - \frac {1}{28} \, \sqrt {7} \sqrt {-i \, \sqrt {7} - 1} \log \left (-{\left (\sqrt {7} + i\right )} \sqrt {-i \, \sqrt {7} - 1} + 4 \, x\right ) \]
[In]
[Out]
Time = 0.34 (sec) , antiderivative size = 24, normalized size of antiderivative = 0.12 \[ \int \frac {1}{2-x^2+x^4} \, dx=\operatorname {RootSum} {\left (1568 t^{4} + 28 t^{2} + 1, \left ( t \mapsto t \log {\left (- 112 t^{3} + 6 t + x \right )} \right )\right )} \]
[In]
[Out]
\[ \int \frac {1}{2-x^2+x^4} \, dx=\int { \frac {1}{x^{4} - x^{2} + 2} \,d x } \]
[In]
[Out]
none
Time = 0.46 (sec) , antiderivative size = 256, normalized size of antiderivative = 1.31 \[ \int \frac {1}{2-x^2+x^4} \, dx=\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^{\frac {3}{4}} {\left (2^{\frac {1}{4}} \sqrt {\frac {1}{2}} \sqrt {\sqrt {2} + 4} + 2 \, x\right )}}{4 \, \sqrt {-\frac {1}{8} \, \sqrt {2} + \frac {1}{2}}}\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^{\frac {3}{4}} {\left (2^{\frac {1}{4}} \sqrt {\frac {1}{2}} \sqrt {\sqrt {2} + 4} - 2 \, x\right )}}{4 \, \sqrt {-\frac {1}{8} \, \sqrt {2} + \frac {1}{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 (2^{\frac {1}{4}} \sqrt {\frac {1}{2}} x \sqrt {\sqrt {2} + 4} + x^{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 (-2^{\frac {1}{4}} \sqrt {\frac {1}{2}} x \sqrt {\sqrt {2} + 4} + x^{2} + \sqrt {2}\right ) \]
[In]
[Out]
Time = 0.11 (sec) , antiderivative size = 132, normalized size of antiderivative = 0.67 \[ \int \frac {1}{2-x^2+x^4} \, dx=\frac {\mathrm {atan}\left (\frac {x\,\sqrt {-7-\sqrt {7}\,7{}\mathrm {i}}\,1{}\mathrm {i}}{4\,\left (\frac {1}{2}+\frac {\sqrt {7}\,1{}\mathrm {i}}{2}\right )}+\frac {\sqrt {7}\,x\,\sqrt {-7-\sqrt {7}\,7{}\mathrm {i}}}{28\,\left (\frac {1}{2}+\frac {\sqrt {7}\,1{}\mathrm {i}}{2}\right )}\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}}}{4\,\left (-\frac {1}{2}+\frac {\sqrt {7}\,1{}\mathrm {i}}{2}\right )}-\frac {\sqrt {7}\,x\,\sqrt {-1+\sqrt {7}\,1{}\mathrm {i}}\,1{}\mathrm {i}}{4\,\left (-\frac {1}{2}+\frac {\sqrt {7}\,1{}\mathrm {i}}{2}\right )}\right )\,\sqrt {-1+\sqrt {7}\,1{}\mathrm {i}}\,1{}\mathrm {i}}{14} \]
[In]
[Out]