\(\int \frac {1}{a^2+b+2 a x^2+x^4} \, dx\) [328]

Optimal result
Mathematica [C] (verified)
Rubi [A] (verified)
Maple [C] (verified)
Fricas [B] (verification not implemented)
Sympy [A] (verification not implemented)
Maxima [F]
Giac [A] (verification not implemented)
Mupad [B] (verification not implemented)
Reduce [B] (verification not implemented)

Optimal result

Integrand size = 16, antiderivative size = 227 \[ \int \frac {1}{a^2+b+2 a x^2+x^4} \, dx=-\frac {\arctan \left (\frac {\sqrt {-a+\sqrt {a^2+b}}-\sqrt {2} x}{\sqrt {a+\sqrt {a^2+b}}}\right )}{2 \sqrt {2} \sqrt {a^2+b} \sqrt {a+\sqrt {a^2+b}}}+\frac {\arctan \left (\frac {\sqrt {-a+\sqrt {a^2+b}}+\sqrt {2} x}{\sqrt {a+\sqrt {a^2+b}}}\right )}{2 \sqrt {2} \sqrt {a^2+b} \sqrt {a+\sqrt {a^2+b}}}+\frac {\text {arctanh}\left (\frac {\sqrt {2} \sqrt {-a+\sqrt {a^2+b}} x}{\sqrt {a^2+b}+x^2}\right )}{2 \sqrt {2} \sqrt {a^2+b} \sqrt {-a+\sqrt {a^2+b}}} \] Output:

-1/4*arctan(((-a+(a^2+b)^(1/2))^(1/2)-x*2^(1/2))/(a+(a^2+b)^(1/2))^(1/2))* 
2^(1/2)/(a^2+b)^(1/2)/(a+(a^2+b)^(1/2))^(1/2)+1/4*arctan(((-a+(a^2+b)^(1/2 
))^(1/2)+x*2^(1/2))/(a+(a^2+b)^(1/2))^(1/2))*2^(1/2)/(a^2+b)^(1/2)/(a+(a^2 
+b)^(1/2))^(1/2)+1/4*arctanh(2^(1/2)*(-a+(a^2+b)^(1/2))^(1/2)*x/((a^2+b)^( 
1/2)+x^2))*2^(1/2)/(a^2+b)^(1/2)/(-a+(a^2+b)^(1/2))^(1/2)
 

Mathematica [C] (verified)

Result contains complex when optimal does not.

Time = 0.03 (sec) , antiderivative size = 81, normalized size of antiderivative = 0.36 \[ \int \frac {1}{a^2+b+2 a x^2+x^4} \, dx=-\frac {i \left (\frac {\arctan \left (\frac {x}{\sqrt {a-i \sqrt {b}}}\right )}{\sqrt {a-i \sqrt {b}}}-\frac {\arctan \left (\frac {x}{\sqrt {a+i \sqrt {b}}}\right )}{\sqrt {a+i \sqrt {b}}}\right )}{2 \sqrt {b}} \] Input:

Integrate[(a^2 + b + 2*a*x^2 + x^4)^(-1),x]
 

Output:

((-1/2*I)*(ArcTan[x/Sqrt[a - I*Sqrt[b]]]/Sqrt[a - I*Sqrt[b]] - ArcTan[x/Sq 
rt[a + I*Sqrt[b]]]/Sqrt[a + I*Sqrt[b]]))/Sqrt[b]
 

Rubi [A] (verified)

Time = 1.03 (sec) , antiderivative size = 323, normalized size of antiderivative = 1.42, number of steps used = 8, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.438, Rules used = {1407, 1142, 25, 27, 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}{a^2+2 a x^2+b+x^4} \, dx\)

\(\Big \downarrow \) 1407

\(\displaystyle \frac {\int \frac {\sqrt {2} \sqrt {\sqrt {a^2+b}-a}-x}{x^2-\sqrt {2} \sqrt {\sqrt {a^2+b}-a} x+\sqrt {a^2+b}}dx}{2 \sqrt {2} \sqrt {a^2+b} \sqrt {\sqrt {a^2+b}-a}}+\frac {\int \frac {x+\sqrt {2} \sqrt {\sqrt {a^2+b}-a}}{x^2+\sqrt {2} \sqrt {\sqrt {a^2+b}-a} x+\sqrt {a^2+b}}dx}{2 \sqrt {2} \sqrt {a^2+b} \sqrt {\sqrt {a^2+b}-a}}\)

\(\Big \downarrow \) 1142

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

\(\Big \downarrow \) 25

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

\(\Big \downarrow \) 27

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

\(\Big \downarrow \) 1083

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

\(\Big \downarrow \) 217

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

\(\Big \downarrow \) 1103

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

Input:

Int[(a^2 + b + 2*a*x^2 + x^4)^(-1),x]
 

Output:

((Sqrt[-a + Sqrt[a^2 + b]]*ArcTan[(-(Sqrt[2]*Sqrt[-a + Sqrt[a^2 + b]]) + 2 
*x)/(Sqrt[2]*Sqrt[a + Sqrt[a^2 + b]])])/Sqrt[a + Sqrt[a^2 + b]] - Log[Sqrt 
[a^2 + b] - Sqrt[2]*Sqrt[-a + Sqrt[a^2 + b]]*x + x^2]/2)/(2*Sqrt[2]*Sqrt[a 
^2 + b]*Sqrt[-a + Sqrt[a^2 + b]]) + ((Sqrt[-a + Sqrt[a^2 + b]]*ArcTan[(Sqr 
t[2]*Sqrt[-a + Sqrt[a^2 + b]] + 2*x)/(Sqrt[2]*Sqrt[a + Sqrt[a^2 + b]])])/S 
qrt[a + Sqrt[a^2 + b]] + Log[Sqrt[a^2 + b] + Sqrt[2]*Sqrt[-a + Sqrt[a^2 + 
b]]*x + x^2]/2)/(2*Sqrt[2]*Sqrt[a^2 + b]*Sqrt[-a + Sqrt[a^2 + b]])
 

Defintions of rubi rules used

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

rule 27
Int[(a_)*(Fx_), x_Symbol] :> Simp[a   Int[Fx, x], x] /; FreeQ[a, x] &&  !Ma 
tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, 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]
 
Maple [C] (verified)

Result contains higher order function than in optimal. Order 9 vs. order 3.

Time = 0.17 (sec) , antiderivative size = 37, normalized size of antiderivative = 0.16

method result size
risch \(\frac {\left (\munderset {\textit {\_R} =\operatorname {RootOf}\left (\textit {\_Z}^{4}+2 a \,\textit {\_Z}^{2}+a^{2}+b \right )}{\sum }\frac {\ln \left (x -\textit {\_R} \right )}{\textit {\_R}^{3}+\textit {\_R} a}\right )}{4}\) \(37\)
default \(\frac {\frac {\left (\sqrt {a^{2}+b}\, \sqrt {2 \sqrt {a^{2}+b}-2 a}\, a^{2}+\sqrt {2 \sqrt {a^{2}+b}-2 a}\, a^{3}+\sqrt {a^{2}+b}\, \sqrt {2 \sqrt {a^{2}+b}-2 a}\, b +\sqrt {2 \sqrt {a^{2}+b}-2 a}\, a b \right ) \ln \left (x^{2}+x \sqrt {2 \sqrt {a^{2}+b}-2 a}+\sqrt {a^{2}+b}\right )}{2}+\frac {2 \left (2 a^{2} b +2 b^{2}-\frac {\left (\sqrt {a^{2}+b}\, \sqrt {2 \sqrt {a^{2}+b}-2 a}\, a^{2}+\sqrt {2 \sqrt {a^{2}+b}-2 a}\, a^{3}+\sqrt {a^{2}+b}\, \sqrt {2 \sqrt {a^{2}+b}-2 a}\, b +\sqrt {2 \sqrt {a^{2}+b}-2 a}\, a b \right ) \sqrt {2 \sqrt {a^{2}+b}-2 a}}{2}\right ) \arctan \left (\frac {2 x +\sqrt {2 \sqrt {a^{2}+b}-2 a}}{\sqrt {2 \sqrt {a^{2}+b}+2 a}}\right )}{\sqrt {2 \sqrt {a^{2}+b}+2 a}}}{4 b \left (a^{2}+b \right )^{\frac {3}{2}}}+\frac {\frac {\left (-\sqrt {a^{2}+b}\, \sqrt {2 \sqrt {a^{2}+b}-2 a}\, a^{2}-\sqrt {2 \sqrt {a^{2}+b}-2 a}\, a^{3}-\sqrt {a^{2}+b}\, \sqrt {2 \sqrt {a^{2}+b}-2 a}\, b -\sqrt {2 \sqrt {a^{2}+b}-2 a}\, a b \right ) \ln \left (x^{2}-x \sqrt {2 \sqrt {a^{2}+b}-2 a}+\sqrt {a^{2}+b}\right )}{2}+\frac {2 \left (2 a^{2} b +2 b^{2}+\frac {\left (-\sqrt {a^{2}+b}\, \sqrt {2 \sqrt {a^{2}+b}-2 a}\, a^{2}-\sqrt {2 \sqrt {a^{2}+b}-2 a}\, a^{3}-\sqrt {a^{2}+b}\, \sqrt {2 \sqrt {a^{2}+b}-2 a}\, b -\sqrt {2 \sqrt {a^{2}+b}-2 a}\, a b \right ) \sqrt {2 \sqrt {a^{2}+b}-2 a}}{2}\right ) \arctan \left (\frac {2 x -\sqrt {2 \sqrt {a^{2}+b}-2 a}}{\sqrt {2 \sqrt {a^{2}+b}+2 a}}\right )}{\sqrt {2 \sqrt {a^{2}+b}+2 a}}}{4 b \left (a^{2}+b \right )^{\frac {3}{2}}}\) \(617\)

Input:

int(1/(x^4+2*a*x^2+a^2+b),x,method=_RETURNVERBOSE)
 

Output:

1/4*sum(1/(_R^3+_R*a)*ln(x-_R),_R=RootOf(_Z^4+2*_Z^2*a+a^2+b))
 

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 583 vs. \(2 (171) = 342\).

Time = 0.10 (sec) , antiderivative size = 583, normalized size of antiderivative = 2.57 \[ \int \frac {1}{a^2+b+2 a x^2+x^4} \, dx=\frac {1}{4} \, \sqrt {\frac {{\left (a^{2} b + b^{2}\right )} \sqrt {-\frac {1}{a^{4} b + 2 \, a^{2} b^{2} + b^{3}}} + a}{a^{2} b + b^{2}}} \log \left ({\left ({\left (a^{3} b + a b^{2}\right )} \sqrt {-\frac {1}{a^{4} b + 2 \, a^{2} b^{2} + b^{3}}} + b\right )} \sqrt {\frac {{\left (a^{2} b + b^{2}\right )} \sqrt {-\frac {1}{a^{4} b + 2 \, a^{2} b^{2} + b^{3}}} + a}{a^{2} b + b^{2}}} + x\right ) - \frac {1}{4} \, \sqrt {\frac {{\left (a^{2} b + b^{2}\right )} \sqrt {-\frac {1}{a^{4} b + 2 \, a^{2} b^{2} + b^{3}}} + a}{a^{2} b + b^{2}}} \log \left (-{\left ({\left (a^{3} b + a b^{2}\right )} \sqrt {-\frac {1}{a^{4} b + 2 \, a^{2} b^{2} + b^{3}}} + b\right )} \sqrt {\frac {{\left (a^{2} b + b^{2}\right )} \sqrt {-\frac {1}{a^{4} b + 2 \, a^{2} b^{2} + b^{3}}} + a}{a^{2} b + b^{2}}} + x\right ) - \frac {1}{4} \, \sqrt {-\frac {{\left (a^{2} b + b^{2}\right )} \sqrt {-\frac {1}{a^{4} b + 2 \, a^{2} b^{2} + b^{3}}} - a}{a^{2} b + b^{2}}} \log \left ({\left ({\left (a^{3} b + a b^{2}\right )} \sqrt {-\frac {1}{a^{4} b + 2 \, a^{2} b^{2} + b^{3}}} - b\right )} \sqrt {-\frac {{\left (a^{2} b + b^{2}\right )} \sqrt {-\frac {1}{a^{4} b + 2 \, a^{2} b^{2} + b^{3}}} - a}{a^{2} b + b^{2}}} + x\right ) + \frac {1}{4} \, \sqrt {-\frac {{\left (a^{2} b + b^{2}\right )} \sqrt {-\frac {1}{a^{4} b + 2 \, a^{2} b^{2} + b^{3}}} - a}{a^{2} b + b^{2}}} \log \left (-{\left ({\left (a^{3} b + a b^{2}\right )} \sqrt {-\frac {1}{a^{4} b + 2 \, a^{2} b^{2} + b^{3}}} - b\right )} \sqrt {-\frac {{\left (a^{2} b + b^{2}\right )} \sqrt {-\frac {1}{a^{4} b + 2 \, a^{2} b^{2} + b^{3}}} - a}{a^{2} b + b^{2}}} + x\right ) \] Input:

integrate(1/(x^4+2*a*x^2+a^2+b),x, algorithm="fricas")
 

Output:

1/4*sqrt(((a^2*b + b^2)*sqrt(-1/(a^4*b + 2*a^2*b^2 + b^3)) + a)/(a^2*b + b 
^2))*log(((a^3*b + a*b^2)*sqrt(-1/(a^4*b + 2*a^2*b^2 + b^3)) + b)*sqrt(((a 
^2*b + b^2)*sqrt(-1/(a^4*b + 2*a^2*b^2 + b^3)) + a)/(a^2*b + b^2)) + x) - 
1/4*sqrt(((a^2*b + b^2)*sqrt(-1/(a^4*b + 2*a^2*b^2 + b^3)) + a)/(a^2*b + b 
^2))*log(-((a^3*b + a*b^2)*sqrt(-1/(a^4*b + 2*a^2*b^2 + b^3)) + b)*sqrt((( 
a^2*b + b^2)*sqrt(-1/(a^4*b + 2*a^2*b^2 + b^3)) + a)/(a^2*b + b^2)) + x) - 
 1/4*sqrt(-((a^2*b + b^2)*sqrt(-1/(a^4*b + 2*a^2*b^2 + b^3)) - a)/(a^2*b + 
 b^2))*log(((a^3*b + a*b^2)*sqrt(-1/(a^4*b + 2*a^2*b^2 + b^3)) - b)*sqrt(- 
((a^2*b + b^2)*sqrt(-1/(a^4*b + 2*a^2*b^2 + b^3)) - a)/(a^2*b + b^2)) + x) 
 + 1/4*sqrt(-((a^2*b + b^2)*sqrt(-1/(a^4*b + 2*a^2*b^2 + b^3)) - a)/(a^2*b 
 + b^2))*log(-((a^3*b + a*b^2)*sqrt(-1/(a^4*b + 2*a^2*b^2 + b^3)) - b)*sqr 
t(-((a^2*b + b^2)*sqrt(-1/(a^4*b + 2*a^2*b^2 + b^3)) - a)/(a^2*b + b^2)) + 
 x)
 

Sympy [A] (verification not implemented)

Time = 0.39 (sec) , antiderivative size = 63, normalized size of antiderivative = 0.28 \[ \int \frac {1}{a^2+b+2 a x^2+x^4} \, dx=\operatorname {RootSum} {\left (t^{4} \cdot \left (256 a^{2} b^{2} + 256 b^{3}\right ) - 32 t^{2} a b + 1, \left ( t \mapsto t \log {\left (64 t^{3} a^{3} b + 64 t^{3} a b^{2} - 4 t a^{2} + 4 t b + x \right )} \right )\right )} \] Input:

integrate(1/(x**4+2*a*x**2+a**2+b),x)
 

Output:

RootSum(_t**4*(256*a**2*b**2 + 256*b**3) - 32*_t**2*a*b + 1, Lambda(_t, _t 
*log(64*_t**3*a**3*b + 64*_t**3*a*b**2 - 4*_t*a**2 + 4*_t*b + x)))
 

Maxima [F]

\[ \int \frac {1}{a^2+b+2 a x^2+x^4} \, dx=\int { \frac {1}{x^{4} + 2 \, a x^{2} + a^{2} + b} \,d x } \] Input:

integrate(1/(x^4+2*a*x^2+a^2+b),x, algorithm="maxima")
 

Output:

integrate(1/(x^4 + 2*a*x^2 + a^2 + b), x)
 

Giac [A] (verification not implemented)

Time = 0.12 (sec) , antiderivative size = 75, normalized size of antiderivative = 0.33 \[ \int \frac {1}{a^2+b+2 a x^2+x^4} \, dx=-\frac {\sqrt {a + \sqrt {-b}} \arctan \left (\frac {x}{\sqrt {a + \sqrt {-b}}}\right )}{2 \, {\left (a \sqrt {-b} - b\right )}} + \frac {\sqrt {a - \sqrt {-b}} \arctan \left (\frac {x}{\sqrt {a - \sqrt {-b}}}\right )}{2 \, {\left (a \sqrt {-b} + b\right )}} \] Input:

integrate(1/(x^4+2*a*x^2+a^2+b),x, algorithm="giac")
 

Output:

-1/2*sqrt(a + sqrt(-b))*arctan(x/sqrt(a + sqrt(-b)))/(a*sqrt(-b) - b) + 1/ 
2*sqrt(a - sqrt(-b))*arctan(x/sqrt(a - sqrt(-b)))/(a*sqrt(-b) + b)
 

Mupad [B] (verification not implemented)

Time = 17.43 (sec) , antiderivative size = 872, normalized size of antiderivative = 3.84 \[ \int \frac {1}{a^2+b+2 a x^2+x^4} \, dx=-2\,\mathrm {atanh}\left (\frac {8\,x\,\sqrt {\frac {a\,b}{16\,\left (a^2\,b^2+b^3\right )}-\frac {\sqrt {-b^3}}{16\,\left (a^2\,b^2+b^3\right )}}}{\frac {2\,b\,\sqrt {-b^3}}{a^2\,b^2+b^3}-\frac {2\,a\,b^2}{a^2\,b^2+b^3}}-\frac {8\,a^2\,b^2\,x\,\sqrt {\frac {a\,b}{16\,\left (a^2\,b^2+b^3\right )}-\frac {\sqrt {-b^3}}{16\,\left (a^2\,b^2+b^3\right )}}}{\frac {2\,b^4\,\sqrt {-b^3}}{a^2\,b^2+b^3}-\frac {2\,a^3\,b^4}{a^2\,b^2+b^3}-\frac {2\,a\,b^5}{a^2\,b^2+b^3}+\frac {2\,a^2\,b^3\,\sqrt {-b^3}}{a^2\,b^2+b^3}}+\frac {8\,a\,b\,x\,\sqrt {\frac {a\,b}{16\,\left (a^2\,b^2+b^3\right )}-\frac {\sqrt {-b^3}}{16\,\left (a^2\,b^2+b^3\right )}}\,\sqrt {-b^3}}{\frac {2\,b^4\,\sqrt {-b^3}}{a^2\,b^2+b^3}-\frac {2\,a^3\,b^4}{a^2\,b^2+b^3}-\frac {2\,a\,b^5}{a^2\,b^2+b^3}+\frac {2\,a^2\,b^3\,\sqrt {-b^3}}{a^2\,b^2+b^3}}\right )\,\sqrt {\frac {a\,b-\sqrt {-b^3}}{16\,\left (a^2\,b^2+b^3\right )}}-2\,\mathrm {atanh}\left (\frac {8\,a^2\,b^2\,x\,\sqrt {\frac {\sqrt {-b^3}}{16\,\left (a^2\,b^2+b^3\right )}+\frac {a\,b}{16\,\left (a^2\,b^2+b^3\right )}}}{\frac {2\,b^4\,\sqrt {-b^3}}{a^2\,b^2+b^3}+\frac {2\,a^3\,b^4}{a^2\,b^2+b^3}+\frac {2\,a\,b^5}{a^2\,b^2+b^3}+\frac {2\,a^2\,b^3\,\sqrt {-b^3}}{a^2\,b^2+b^3}}-\frac {8\,x\,\sqrt {\frac {\sqrt {-b^3}}{16\,\left (a^2\,b^2+b^3\right )}+\frac {a\,b}{16\,\left (a^2\,b^2+b^3\right )}}}{\frac {2\,b\,\sqrt {-b^3}}{a^2\,b^2+b^3}+\frac {2\,a\,b^2}{a^2\,b^2+b^3}}+\frac {8\,a\,b\,x\,\sqrt {\frac {\sqrt {-b^3}}{16\,\left (a^2\,b^2+b^3\right )}+\frac {a\,b}{16\,\left (a^2\,b^2+b^3\right )}}\,\sqrt {-b^3}}{\frac {2\,b^4\,\sqrt {-b^3}}{a^2\,b^2+b^3}+\frac {2\,a^3\,b^4}{a^2\,b^2+b^3}+\frac {2\,a\,b^5}{a^2\,b^2+b^3}+\frac {2\,a^2\,b^3\,\sqrt {-b^3}}{a^2\,b^2+b^3}}\right )\,\sqrt {\frac {a\,b+\sqrt {-b^3}}{16\,\left (a^2\,b^2+b^3\right )}} \] Input:

int(1/(b + 2*a*x^2 + a^2 + x^4),x)
 

Output:

- 2*atanh((8*x*((a*b)/(16*(b^3 + a^2*b^2)) - (-b^3)^(1/2)/(16*(b^3 + a^2*b 
^2)))^(1/2))/((2*b*(-b^3)^(1/2))/(b^3 + a^2*b^2) - (2*a*b^2)/(b^3 + a^2*b^ 
2)) - (8*a^2*b^2*x*((a*b)/(16*(b^3 + a^2*b^2)) - (-b^3)^(1/2)/(16*(b^3 + a 
^2*b^2)))^(1/2))/((2*b^4*(-b^3)^(1/2))/(b^3 + a^2*b^2) - (2*a^3*b^4)/(b^3 
+ a^2*b^2) - (2*a*b^5)/(b^3 + a^2*b^2) + (2*a^2*b^3*(-b^3)^(1/2))/(b^3 + a 
^2*b^2)) + (8*a*b*x*((a*b)/(16*(b^3 + a^2*b^2)) - (-b^3)^(1/2)/(16*(b^3 + 
a^2*b^2)))^(1/2)*(-b^3)^(1/2))/((2*b^4*(-b^3)^(1/2))/(b^3 + a^2*b^2) - (2* 
a^3*b^4)/(b^3 + a^2*b^2) - (2*a*b^5)/(b^3 + a^2*b^2) + (2*a^2*b^3*(-b^3)^( 
1/2))/(b^3 + a^2*b^2)))*((a*b - (-b^3)^(1/2))/(16*(b^3 + a^2*b^2)))^(1/2) 
- 2*atanh((8*a^2*b^2*x*((-b^3)^(1/2)/(16*(b^3 + a^2*b^2)) + (a*b)/(16*(b^3 
 + a^2*b^2)))^(1/2))/((2*b^4*(-b^3)^(1/2))/(b^3 + a^2*b^2) + (2*a^3*b^4)/( 
b^3 + a^2*b^2) + (2*a*b^5)/(b^3 + a^2*b^2) + (2*a^2*b^3*(-b^3)^(1/2))/(b^3 
 + a^2*b^2)) - (8*x*((-b^3)^(1/2)/(16*(b^3 + a^2*b^2)) + (a*b)/(16*(b^3 + 
a^2*b^2)))^(1/2))/((2*b*(-b^3)^(1/2))/(b^3 + a^2*b^2) + (2*a*b^2)/(b^3 + a 
^2*b^2)) + (8*a*b*x*((-b^3)^(1/2)/(16*(b^3 + a^2*b^2)) + (a*b)/(16*(b^3 + 
a^2*b^2)))^(1/2)*(-b^3)^(1/2))/((2*b^4*(-b^3)^(1/2))/(b^3 + a^2*b^2) + (2* 
a^3*b^4)/(b^3 + a^2*b^2) + (2*a*b^5)/(b^3 + a^2*b^2) + (2*a^2*b^3*(-b^3)^( 
1/2))/(b^3 + a^2*b^2)))*((a*b + (-b^3)^(1/2))/(16*(b^3 + a^2*b^2)))^(1/2)
 

Reduce [B] (verification not implemented)

Time = 0.17 (sec) , antiderivative size = 569, normalized size of antiderivative = 2.51 \[ \int \frac {1}{a^2+b+2 a x^2+x^4} \, dx=\frac {\sqrt {2}\, \left (2 \sqrt {\sqrt {a^{2}+b}+a}\, \sqrt {a^{2}+b}\, \mathit {atan} \left (\frac {\sqrt {\sqrt {a^{2}+b}-a}\, \sqrt {2}-2 x}{\sqrt {\sqrt {a^{2}+b}+a}\, \sqrt {2}}\right ) a -2 \sqrt {\sqrt {a^{2}+b}+a}\, \mathit {atan} \left (\frac {\sqrt {\sqrt {a^{2}+b}-a}\, \sqrt {2}-2 x}{\sqrt {\sqrt {a^{2}+b}+a}\, \sqrt {2}}\right ) a^{2}-2 \sqrt {\sqrt {a^{2}+b}+a}\, \mathit {atan} \left (\frac {\sqrt {\sqrt {a^{2}+b}-a}\, \sqrt {2}-2 x}{\sqrt {\sqrt {a^{2}+b}+a}\, \sqrt {2}}\right ) b -2 \sqrt {\sqrt {a^{2}+b}+a}\, \sqrt {a^{2}+b}\, \mathit {atan} \left (\frac {\sqrt {\sqrt {a^{2}+b}-a}\, \sqrt {2}+2 x}{\sqrt {\sqrt {a^{2}+b}+a}\, \sqrt {2}}\right ) a +2 \sqrt {\sqrt {a^{2}+b}+a}\, \mathit {atan} \left (\frac {\sqrt {\sqrt {a^{2}+b}-a}\, \sqrt {2}+2 x}{\sqrt {\sqrt {a^{2}+b}+a}\, \sqrt {2}}\right ) a^{2}+2 \sqrt {\sqrt {a^{2}+b}+a}\, \mathit {atan} \left (\frac {\sqrt {\sqrt {a^{2}+b}-a}\, \sqrt {2}+2 x}{\sqrt {\sqrt {a^{2}+b}+a}\, \sqrt {2}}\right ) b -\sqrt {\sqrt {a^{2}+b}-a}\, \sqrt {a^{2}+b}\, \mathrm {log}\left (\sqrt {a^{2}+b}-\sqrt {\sqrt {a^{2}+b}-a}\, \sqrt {2}\, x +x^{2}\right ) a +\sqrt {\sqrt {a^{2}+b}-a}\, \sqrt {a^{2}+b}\, \mathrm {log}\left (\sqrt {a^{2}+b}+\sqrt {\sqrt {a^{2}+b}-a}\, \sqrt {2}\, x +x^{2}\right ) a -\sqrt {\sqrt {a^{2}+b}-a}\, \mathrm {log}\left (\sqrt {a^{2}+b}-\sqrt {\sqrt {a^{2}+b}-a}\, \sqrt {2}\, x +x^{2}\right ) a^{2}-\sqrt {\sqrt {a^{2}+b}-a}\, \mathrm {log}\left (\sqrt {a^{2}+b}-\sqrt {\sqrt {a^{2}+b}-a}\, \sqrt {2}\, x +x^{2}\right ) b +\sqrt {\sqrt {a^{2}+b}-a}\, \mathrm {log}\left (\sqrt {a^{2}+b}+\sqrt {\sqrt {a^{2}+b}-a}\, \sqrt {2}\, x +x^{2}\right ) a^{2}+\sqrt {\sqrt {a^{2}+b}-a}\, \mathrm {log}\left (\sqrt {a^{2}+b}+\sqrt {\sqrt {a^{2}+b}-a}\, \sqrt {2}\, x +x^{2}\right ) b \right )}{8 b \left (a^{2}+b \right )} \] Input:

int(1/(x^4+2*a*x^2+a^2+b),x)
 

Output:

(sqrt(2)*(2*sqrt(sqrt(a**2 + b) + a)*sqrt(a**2 + b)*atan((sqrt(sqrt(a**2 + 
 b) - a)*sqrt(2) - 2*x)/(sqrt(sqrt(a**2 + b) + a)*sqrt(2)))*a - 2*sqrt(sqr 
t(a**2 + b) + a)*atan((sqrt(sqrt(a**2 + b) - a)*sqrt(2) - 2*x)/(sqrt(sqrt( 
a**2 + b) + a)*sqrt(2)))*a**2 - 2*sqrt(sqrt(a**2 + b) + a)*atan((sqrt(sqrt 
(a**2 + b) - a)*sqrt(2) - 2*x)/(sqrt(sqrt(a**2 + b) + a)*sqrt(2)))*b - 2*s 
qrt(sqrt(a**2 + b) + a)*sqrt(a**2 + b)*atan((sqrt(sqrt(a**2 + b) - a)*sqrt 
(2) + 2*x)/(sqrt(sqrt(a**2 + b) + a)*sqrt(2)))*a + 2*sqrt(sqrt(a**2 + b) + 
 a)*atan((sqrt(sqrt(a**2 + b) - a)*sqrt(2) + 2*x)/(sqrt(sqrt(a**2 + b) + a 
)*sqrt(2)))*a**2 + 2*sqrt(sqrt(a**2 + b) + a)*atan((sqrt(sqrt(a**2 + b) - 
a)*sqrt(2) + 2*x)/(sqrt(sqrt(a**2 + b) + a)*sqrt(2)))*b - sqrt(sqrt(a**2 + 
 b) - a)*sqrt(a**2 + b)*log(sqrt(a**2 + b) - sqrt(sqrt(a**2 + b) - a)*sqrt 
(2)*x + x**2)*a + sqrt(sqrt(a**2 + b) - a)*sqrt(a**2 + b)*log(sqrt(a**2 + 
b) + sqrt(sqrt(a**2 + b) - a)*sqrt(2)*x + x**2)*a - sqrt(sqrt(a**2 + b) - 
a)*log(sqrt(a**2 + b) - sqrt(sqrt(a**2 + b) - a)*sqrt(2)*x + x**2)*a**2 - 
sqrt(sqrt(a**2 + b) - a)*log(sqrt(a**2 + b) - sqrt(sqrt(a**2 + b) - a)*sqr 
t(2)*x + x**2)*b + sqrt(sqrt(a**2 + b) - a)*log(sqrt(a**2 + b) + sqrt(sqrt 
(a**2 + b) - a)*sqrt(2)*x + x**2)*a**2 + sqrt(sqrt(a**2 + b) - a)*log(sqrt 
(a**2 + b) + sqrt(sqrt(a**2 + b) - a)*sqrt(2)*x + x**2)*b))/(8*b*(a**2 + b 
))