3.1.45 \(\int \frac {1}{2-x^2+x^4} \, dx\) [45]

3.1.45.1 Optimal result
3.1.45.2 Mathematica [C] (verified)
3.1.45.3 Rubi [A] (verified)
3.1.45.4 Maple [C] (verified)
3.1.45.5 Fricas [C] (verification not implemented)
3.1.45.6 Sympy [A] (verification not implemented)
3.1.45.7 Maxima [F]
3.1.45.8 Giac [A] (verification not implemented)
3.1.45.9 Mupad [B] (verification not implemented)
3.1.45.10 Reduce [B] (verification not implemented)

3.1.45.1 Optimal result

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 )}} \]

output
-1/28*arctan((-2*x+(1+2*2^(1/2))^(1/2))/(-1+2*2^(1/2))^(1/2))*(14+28*2^(1/ 
2))^(1/2)+1/28*arctan((2*x+(1+2*2^(1/2))^(1/2))/(-1+2*2^(1/2))^(1/2))*(14+ 
28*2^(1/2))^(1/2)-1/4*ln(x^2+2^(1/2)-x*(1+2*2^(1/2))^(1/2))/(2+4*2^(1/2))^ 
(1/2)+1/4*ln(x^2+2^(1/2)+x*(1+2*2^(1/2))^(1/2))/(2+4*2^(1/2))^(1/2)
 
3.1.45.2 Mathematica [C] (verified)

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 )}} \]

input
Integrate[(2 - x^2 + x^4)^(-1),x]
 
output
((-I)*ArcTan[x/Sqrt[(-1 - I*Sqrt[7])/2]])/Sqrt[(7*(-1 - I*Sqrt[7]))/2] + ( 
I*ArcTan[x/Sqrt[(-1 + I*Sqrt[7])/2]])/Sqrt[(7*(-1 + I*Sqrt[7]))/2]
 
3.1.45.3 Rubi [A] (verified)

Time = 0.35 (sec) , antiderivative size = 218, normalized size of antiderivative = 1.11, number of steps used = 7, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.500, Rules used = {1407, 1142, 25, 1083, 217, 1103}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \frac {1}{x^4-x^2+2} \, dx\)

\(\Big \downarrow \) 1407

\(\displaystyle \frac {\int \frac {\sqrt {1+2 \sqrt {2}}-x}{x^2-\sqrt {1+2 \sqrt {2}} x+\sqrt {2}}dx}{2 \sqrt {2 \left (1+2 \sqrt {2}\right )}}+\frac {\int \frac {x+\sqrt {1+2 \sqrt {2}}}{x^2+\sqrt {1+2 \sqrt {2}} x+\sqrt {2}}dx}{2 \sqrt {2 \left (1+2 \sqrt {2}\right )}}\)

\(\Big \downarrow \) 1142

\(\displaystyle \frac {\frac {1}{2} \sqrt {1+2 \sqrt {2}} \int \frac {1}{x^2-\sqrt {1+2 \sqrt {2}} x+\sqrt {2}}dx-\frac {1}{2} \int -\frac {\sqrt {1+2 \sqrt {2}}-2 x}{x^2-\sqrt {1+2 \sqrt {2}} x+\sqrt {2}}dx}{2 \sqrt {2 \left (1+2 \sqrt {2}\right )}}+\frac {\frac {1}{2} \sqrt {1+2 \sqrt {2}} \int \frac {1}{x^2+\sqrt {1+2 \sqrt {2}} x+\sqrt {2}}dx+\frac {1}{2} \int \frac {2 x+\sqrt {1+2 \sqrt {2}}}{x^2+\sqrt {1+2 \sqrt {2}} x+\sqrt {2}}dx}{2 \sqrt {2 \left (1+2 \sqrt {2}\right )}}\)

\(\Big \downarrow \) 25

\(\displaystyle \frac {\frac {1}{2} \sqrt {1+2 \sqrt {2}} \int \frac {1}{x^2-\sqrt {1+2 \sqrt {2}} x+\sqrt {2}}dx+\frac {1}{2} \int \frac {\sqrt {1+2 \sqrt {2}}-2 x}{x^2-\sqrt {1+2 \sqrt {2}} x+\sqrt {2}}dx}{2 \sqrt {2 \left (1+2 \sqrt {2}\right )}}+\frac {\frac {1}{2} \sqrt {1+2 \sqrt {2}} \int \frac {1}{x^2+\sqrt {1+2 \sqrt {2}} x+\sqrt {2}}dx+\frac {1}{2} \int \frac {2 x+\sqrt {1+2 \sqrt {2}}}{x^2+\sqrt {1+2 \sqrt {2}} x+\sqrt {2}}dx}{2 \sqrt {2 \left (1+2 \sqrt {2}\right )}}\)

\(\Big \downarrow \) 1083

\(\displaystyle \frac {\frac {1}{2} \int \frac {\sqrt {1+2 \sqrt {2}}-2 x}{x^2-\sqrt {1+2 \sqrt {2}} x+\sqrt {2}}dx-\sqrt {1+2 \sqrt {2}} \int \frac {1}{-\left (2 x-\sqrt {1+2 \sqrt {2}}\right )^2-2 \sqrt {2}+1}d\left (2 x-\sqrt {1+2 \sqrt {2}}\right )}{2 \sqrt {2 \left (1+2 \sqrt {2}\right )}}+\frac {\frac {1}{2} \int \frac {2 x+\sqrt {1+2 \sqrt {2}}}{x^2+\sqrt {1+2 \sqrt {2}} x+\sqrt {2}}dx-\sqrt {1+2 \sqrt {2}} \int \frac {1}{-\left (2 x+\sqrt {1+2 \sqrt {2}}\right )^2-2 \sqrt {2}+1}d\left (2 x+\sqrt {1+2 \sqrt {2}}\right )}{2 \sqrt {2 \left (1+2 \sqrt {2}\right )}}\)

\(\Big \downarrow \) 217

\(\displaystyle \frac {\frac {1}{2} \int \frac {\sqrt {1+2 \sqrt {2}}-2 x}{x^2-\sqrt {1+2 \sqrt {2}} x+\sqrt {2}}dx+\sqrt {\frac {1+2 \sqrt {2}}{2 \sqrt {2}-1}} \arctan \left (\frac {2 x-\sqrt {1+2 \sqrt {2}}}{\sqrt {2 \sqrt {2}-1}}\right )}{2 \sqrt {2 \left (1+2 \sqrt {2}\right )}}+\frac {\frac {1}{2} \int \frac {2 x+\sqrt {1+2 \sqrt {2}}}{x^2+\sqrt {1+2 \sqrt {2}} x+\sqrt {2}}dx+\sqrt {\frac {1+2 \sqrt {2}}{2 \sqrt {2}-1}} \arctan \left (\frac {2 x+\sqrt {1+2 \sqrt {2}}}{\sqrt {2 \sqrt {2}-1}}\right )}{2 \sqrt {2 \left (1+2 \sqrt {2}\right )}}\)

\(\Big \downarrow \) 1103

\(\displaystyle \frac {\sqrt {\frac {1+2 \sqrt {2}}{2 \sqrt {2}-1}} \arctan \left (\frac {2 x-\sqrt {1+2 \sqrt {2}}}{\sqrt {2 \sqrt {2}-1}}\right )-\frac {1}{2} \log \left (x^2-\sqrt {1+2 \sqrt {2}} x+\sqrt {2}\right )}{2 \sqrt {2 \left (1+2 \sqrt {2}\right )}}+\frac {\sqrt {\frac {1+2 \sqrt {2}}{2 \sqrt {2}-1}} \arctan \left (\frac {2 x+\sqrt {1+2 \sqrt {2}}}{\sqrt {2 \sqrt {2}-1}}\right )+\frac {1}{2} \log \left (x^2+\sqrt {1+2 \sqrt {2}} x+\sqrt {2}\right )}{2 \sqrt {2 \left (1+2 \sqrt {2}\right )}}\)

input
Int[(2 - x^2 + x^4)^(-1),x]
 
output
(Sqrt[(1 + 2*Sqrt[2])/(-1 + 2*Sqrt[2])]*ArcTan[(-Sqrt[1 + 2*Sqrt[2]] + 2*x 
)/Sqrt[-1 + 2*Sqrt[2]]] - Log[Sqrt[2] - Sqrt[1 + 2*Sqrt[2]]*x + x^2]/2)/(2 
*Sqrt[2*(1 + 2*Sqrt[2])]) + (Sqrt[(1 + 2*Sqrt[2])/(-1 + 2*Sqrt[2])]*ArcTan 
[(Sqrt[1 + 2*Sqrt[2]] + 2*x)/Sqrt[-1 + 2*Sqrt[2]]] + Log[Sqrt[2] + Sqrt[1 
+ 2*Sqrt[2]]*x + x^2]/2)/(2*Sqrt[2*(1 + 2*Sqrt[2])])
 

3.1.45.3.1 Defintions of rubi rules used

rule 25
Int[-(Fx_), x_Symbol] :> Simp[Identity[-1]   Int[Fx, x], x]
 

rule 217
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(-(Rt[-a, 2]*Rt[-b, 2])^( 
-1))*ArcTan[Rt[-b, 2]*(x/Rt[-a, 2])], x] /; FreeQ[{a, b}, x] && PosQ[a/b] & 
& (LtQ[a, 0] || LtQ[b, 0])
 

rule 1083
Int[((a_) + (b_.)*(x_) + (c_.)*(x_)^2)^(-1), x_Symbol] :> Simp[-2   Subst[I 
nt[1/Simp[b^2 - 4*a*c - x^2, x], x], x, b + 2*c*x], x] /; FreeQ[{a, b, c}, 
x]
 

rule 1103
Int[((d_) + (e_.)*(x_))/((a_.) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> S 
imp[d*(Log[RemoveContent[a + b*x + c*x^2, x]]/b), x] /; FreeQ[{a, b, c, d, 
e}, x] && EqQ[2*c*d - b*e, 0]
 

rule 1142
Int[((d_.) + (e_.)*(x_))/((a_) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> S 
imp[(2*c*d - b*e)/(2*c)   Int[1/(a + b*x + c*x^2), x], x] + Simp[e/(2*c) 
Int[(b + 2*c*x)/(a + b*x + c*x^2), x], x] /; FreeQ[{a, b, c, d, e}, x]
 

rule 1407
Int[((a_) + (b_.)*(x_)^2 + (c_.)*(x_)^4)^(-1), x_Symbol] :> With[{q = Rt[a/ 
c, 2]}, With[{r = Rt[2*q - b/c, 2]}, Simp[1/(2*c*q*r)   Int[(r - x)/(q - r* 
x + x^2), x], x] + Simp[1/(2*c*q*r)   Int[(r + x)/(q + r*x + x^2), x], x]]] 
 /; FreeQ[{a, b, c}, x] && NeQ[b^2 - 4*a*c, 0] && NegQ[b^2 - 4*a*c]
 
3.1.45.4 Maple [C] (verified)

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\)

input
int(1/(x^4-x^2+2),x,method=_RETURNVERBOSE)
 
output
1/2*sum(1/(2*_R^3-_R)*ln(x-_R),_R=RootOf(_Z^4-_Z^2+2))
 
3.1.45.5 Fricas [C] (verification not implemented)

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 ) \]

input
integrate(1/(x^4-x^2+2),x, algorithm="fricas")
 
output
1/28*sqrt(7)*sqrt(I*sqrt(7) - 1)*log((sqrt(7) - I)*sqrt(I*sqrt(7) - 1) + 4 
*x) - 1/28*sqrt(7)*sqrt(I*sqrt(7) - 1)*log(-(sqrt(7) - I)*sqrt(I*sqrt(7) - 
 1) + 4*x) + 1/28*sqrt(7)*sqrt(-I*sqrt(7) - 1)*log((sqrt(7) + I)*sqrt(-I*s 
qrt(7) - 1) + 4*x) - 1/28*sqrt(7)*sqrt(-I*sqrt(7) - 1)*log(-(sqrt(7) + I)* 
sqrt(-I*sqrt(7) - 1) + 4*x)
 
3.1.45.6 Sympy [A] (verification not implemented)

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 )} \]

input
integrate(1/(x**4-x**2+2),x)
 
output
RootSum(1568*_t**4 + 28*_t**2 + 1, Lambda(_t, _t*log(-112*_t**3 + 6*_t + x 
)))
 
3.1.45.7 Maxima [F]

\[ \int \frac {1}{2-x^2+x^4} \, dx=\int { \frac {1}{x^{4} - x^{2} + 2} \,d x } \]

input
integrate(1/(x^4-x^2+2),x, algorithm="maxima")
 
output
integrate(1/(x^4 - x^2 + 2), x)
 
3.1.45.8 Giac [A] (verification not implemented)

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 ) \]

input
integrate(1/(x^4-x^2+2),x, algorithm="giac")
 
output
1/112*sqrt(7)*(sqrt(7)*2^(1/4)*sqrt(-2*sqrt(2) + 8) + 2^(1/4)*sqrt(2*sqrt( 
2) + 8))*arctan(1/4*2^(3/4)*(2^(1/4)*sqrt(1/2)*sqrt(sqrt(2) + 4) + 2*x)/sq 
rt(-1/8*sqrt(2) + 1/2)) + 1/112*sqrt(7)*(sqrt(7)*2^(1/4)*sqrt(-2*sqrt(2) + 
 8) + 2^(1/4)*sqrt(2*sqrt(2) + 8))*arctan(-1/4*2^(3/4)*(2^(1/4)*sqrt(1/2)* 
sqrt(sqrt(2) + 4) - 2*x)/sqrt(-1/8*sqrt(2) + 1/2)) + 1/224*sqrt(7)*(sqrt(7 
)*2^(1/4)*sqrt(2*sqrt(2) + 8) - 2^(1/4)*sqrt(-2*sqrt(2) + 8))*log(2^(1/4)* 
sqrt(1/2)*x*sqrt(sqrt(2) + 4) + x^2 + sqrt(2)) - 1/224*sqrt(7)*(sqrt(7)*2^ 
(1/4)*sqrt(2*sqrt(2) + 8) - 2^(1/4)*sqrt(-2*sqrt(2) + 8))*log(-2^(1/4)*sqr 
t(1/2)*x*sqrt(sqrt(2) + 4) + x^2 + sqrt(2))
 
3.1.45.9 Mupad [B] (verification not implemented)

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} \]

input
int(1/(x^4 - x^2 + 2),x)
 
output
(atan((x*(- 7^(1/2)*7i - 7)^(1/2)*1i)/(4*((7^(1/2)*1i)/2 + 1/2)) + (7^(1/2 
)*x*(- 7^(1/2)*7i - 7)^(1/2))/(28*((7^(1/2)*1i)/2 + 1/2)))*(- 7^(1/2)*7i - 
 7)^(1/2)*1i)/14 + (7^(1/2)*atan((x*(7^(1/2)*1i - 1)^(1/2))/(4*((7^(1/2)*1 
i)/2 - 1/2)) - (7^(1/2)*x*(7^(1/2)*1i - 1)^(1/2)*1i)/(4*((7^(1/2)*1i)/2 - 
1/2)))*(7^(1/2)*1i - 1)^(1/2)*1i)/14
 
3.1.45.10 Reduce [B] (verification not implemented)

Time = 0.00 (sec) , antiderivative size = 235, normalized size of antiderivative = 1.20 \[ \int \frac {1}{2-x^2+x^4} \, dx=-\frac {\sqrt {2 \sqrt {2}-1}\, \sqrt {2}\, \mathit {atan} \left (\frac {\sqrt {2 \sqrt {2}+1}-2 x}{\sqrt {2 \sqrt {2}-1}}\right )}{28}-\frac {\sqrt {2 \sqrt {2}-1}\, \mathit {atan} \left (\frac {\sqrt {2 \sqrt {2}+1}-2 x}{\sqrt {2 \sqrt {2}-1}}\right )}{7}+\frac {\sqrt {2 \sqrt {2}-1}\, \sqrt {2}\, \mathit {atan} \left (\frac {\sqrt {2 \sqrt {2}+1}+2 x}{\sqrt {2 \sqrt {2}-1}}\right )}{28}+\frac {\sqrt {2 \sqrt {2}-1}\, \mathit {atan} \left (\frac {\sqrt {2 \sqrt {2}+1}+2 x}{\sqrt {2 \sqrt {2}-1}}\right )}{7}+\frac {\sqrt {2 \sqrt {2}+1}\, \sqrt {2}\, \mathrm {log}\left (-\sqrt {2 \sqrt {2}+1}\, x +\sqrt {2}+x^{2}\right )}{56}-\frac {\sqrt {2 \sqrt {2}+1}\, \sqrt {2}\, \mathrm {log}\left (\sqrt {2 \sqrt {2}+1}\, x +\sqrt {2}+x^{2}\right )}{56}-\frac {\sqrt {2 \sqrt {2}+1}\, \mathrm {log}\left (-\sqrt {2 \sqrt {2}+1}\, x +\sqrt {2}+x^{2}\right )}{14}+\frac {\sqrt {2 \sqrt {2}+1}\, \mathrm {log}\left (\sqrt {2 \sqrt {2}+1}\, x +\sqrt {2}+x^{2}\right )}{14} \]

input
int(1/(x**4 - x**2 + 2),x)
 
output
( - 2*sqrt(2*sqrt(2) - 1)*sqrt(2)*atan((sqrt(2*sqrt(2) + 1) - 2*x)/sqrt(2* 
sqrt(2) - 1)) - 8*sqrt(2*sqrt(2) - 1)*atan((sqrt(2*sqrt(2) + 1) - 2*x)/sqr 
t(2*sqrt(2) - 1)) + 2*sqrt(2*sqrt(2) - 1)*sqrt(2)*atan((sqrt(2*sqrt(2) + 1 
) + 2*x)/sqrt(2*sqrt(2) - 1)) + 8*sqrt(2*sqrt(2) - 1)*atan((sqrt(2*sqrt(2) 
 + 1) + 2*x)/sqrt(2*sqrt(2) - 1)) + sqrt(2*sqrt(2) + 1)*sqrt(2)*log( - sqr 
t(2*sqrt(2) + 1)*x + sqrt(2) + x**2) - sqrt(2*sqrt(2) + 1)*sqrt(2)*log(sqr 
t(2*sqrt(2) + 1)*x + sqrt(2) + x**2) - 4*sqrt(2*sqrt(2) + 1)*log( - sqrt(2 
*sqrt(2) + 1)*x + sqrt(2) + x**2) + 4*sqrt(2*sqrt(2) + 1)*log(sqrt(2*sqrt( 
2) + 1)*x + sqrt(2) + x**2))/56