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

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

Optimal result

Integrand size = 22, antiderivative size = 121 \[ \int \frac {1}{x^2 \left (a-b+2 a x^2+a x^4\right )} \, dx=-\frac {1}{(a-b) x}-\frac {\sqrt [4]{a} \arctan \left (\frac {\sqrt [4]{a} x}{\sqrt {\sqrt {a}-\sqrt {b}}}\right )}{2 \left (\sqrt {a}-\sqrt {b}\right )^{3/2} \sqrt {b}}+\frac {\sqrt [4]{a} \arctan \left (\frac {\sqrt [4]{a} x}{\sqrt {\sqrt {a}+\sqrt {b}}}\right )}{2 \left (\sqrt {a}+\sqrt {b}\right )^{3/2} \sqrt {b}} \] Output:

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

Mathematica [A] (verified)

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

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

Output:

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

Rubi [A] (verified)

Time = 0.42 (sec) , antiderivative size = 149, normalized size of antiderivative = 1.23, number of steps used = 5, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.227, Rules used = {1443, 25, 27, 1480, 218}

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^2 \left (a x^4+2 a x^2+a-b\right )} \, dx\)

\(\Big \downarrow \) 1443

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

\(\Big \downarrow \) 25

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

\(\Big \downarrow \) 27

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

\(\Big \downarrow \) 1480

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

\(\Big \downarrow \) 218

\(\displaystyle -\frac {a \left (\frac {\left (\frac {\sqrt {a}}{\sqrt {b}}+1\right ) \arctan \left (\frac {\sqrt [4]{a} x}{\sqrt {\sqrt {a}-\sqrt {b}}}\right )}{2 a^{3/4} \sqrt {\sqrt {a}-\sqrt {b}}}+\frac {\left (1-\frac {\sqrt {a}}{\sqrt {b}}\right ) \arctan \left (\frac {\sqrt [4]{a} x}{\sqrt {\sqrt {a}+\sqrt {b}}}\right )}{2 a^{3/4} \sqrt {\sqrt {a}+\sqrt {b}}}\right )}{a-b}-\frac {1}{x (a-b)}\)

Input:

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

Output:

-(1/((a - b)*x)) - (a*(((1 + Sqrt[a]/Sqrt[b])*ArcTan[(a^(1/4)*x)/Sqrt[Sqrt 
[a] - Sqrt[b]]])/(2*a^(3/4)*Sqrt[Sqrt[a] - Sqrt[b]]) + ((1 - Sqrt[a]/Sqrt[ 
b])*ArcTan[(a^(1/4)*x)/Sqrt[Sqrt[a] + Sqrt[b]]])/(2*a^(3/4)*Sqrt[Sqrt[a] + 
 Sqrt[b]])))/(a - 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 218
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]/a)*ArcTan[x/R 
t[a/b, 2]], x] /; FreeQ[{a, b}, x] && PosQ[a/b]
 

rule 1443
Int[((d_.)*(x_))^(m_)*((a_) + (b_.)*(x_)^2 + (c_.)*(x_)^4)^(p_), x_Symbol] 
:> Simp[(d*x)^(m + 1)*((a + b*x^2 + c*x^4)^(p + 1)/(a*d*(m + 1))), x] - Sim 
p[1/(a*d^2*(m + 1))   Int[(d*x)^(m + 2)*(b*(m + 2*p + 3) + c*(m + 4*p + 5)* 
x^2)*(a + b*x^2 + c*x^4)^p, x], x] /; FreeQ[{a, b, c, d, p}, x] && NeQ[b^2 
- 4*a*c, 0] && LtQ[m, -1] && IntegerQ[2*p] && (IntegerQ[p] || IntegerQ[m])
 

rule 1480
Int[((d_) + (e_.)*(x_)^2)/((a_) + (b_.)*(x_)^2 + (c_.)*(x_)^4), x_Symbol] : 
> With[{q = Rt[b^2 - 4*a*c, 2]}, Simp[(e/2 + (2*c*d - b*e)/(2*q))   Int[1/( 
b/2 - q/2 + c*x^2), x], x] + Simp[(e/2 - (2*c*d - b*e)/(2*q))   Int[1/(b/2 
+ q/2 + c*x^2), x], x]] /; FreeQ[{a, b, c, d, e}, x] && NeQ[b^2 - 4*a*c, 0] 
 && NeQ[c*d^2 - a*e^2, 0] && PosQ[b^2 - 4*a*c]
 
Maple [A] (verified)

Time = 0.10 (sec) , antiderivative size = 119, normalized size of antiderivative = 0.98

method result size
default \(-\frac {1}{\left (a -b \right ) x}-\frac {a^{2} \left (-\frac {\left (\sqrt {a b}+a \right ) \operatorname {arctanh}\left (\frac {a x}{\sqrt {\left (\sqrt {a b}-a \right ) a}}\right )}{2 a \sqrt {a b}\, \sqrt {\left (\sqrt {a b}-a \right ) a}}+\frac {\left (\sqrt {a b}-a \right ) \arctan \left (\frac {a x}{\sqrt {\left (\sqrt {a b}+a \right ) a}}\right )}{2 a \sqrt {a b}\, \sqrt {\left (\sqrt {a b}+a \right ) a}}\right )}{a -b}\) \(119\)
risch \(-\frac {1}{\left (a -b \right ) x}+\frac {\left (\munderset {\textit {\_R} =\operatorname {RootOf}\left (\left (a^{3} b^{2}-3 a^{2} b^{3}+3 b^{4} a -b^{5}\right ) \textit {\_Z}^{4}+\left (2 a^{2} b +6 b^{2} a \right ) \textit {\_Z}^{2}+a \right )}{\sum }\textit {\_R} \ln \left (\left (\left (b \,a^{4}+2 a^{3} b^{2}-12 a^{2} b^{3}+14 b^{4} a -5 b^{5}\right ) \textit {\_R}^{4}+\left (a^{3}+6 a^{2} b +25 b^{2} a \right ) \textit {\_R}^{2}+4 a \right ) x +\left (3 a^{3} b -5 a^{2} b^{2}+b^{3} a +b^{4}\right ) \textit {\_R}^{3}\right )\right )}{4}\) \(164\)

Input:

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

Output:

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

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 1612 vs. \(2 (81) = 162\).

Time = 0.09 (sec) , antiderivative size = 1612, normalized size of antiderivative = 13.32 \[ \int \frac {1}{x^2 \left (a-b+2 a x^2+a x^4\right )} \, dx=\text {Too large to display} \] Input:

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

Output:

1/4*((a - b)*x*sqrt(-(a^2 + 3*a*b + (a^3*b - 3*a^2*b^2 + 3*a*b^3 - b^4)*sq 
rt((9*a^3 + 6*a^2*b + a*b^2)/(a^6*b - 6*a^5*b^2 + 15*a^4*b^3 - 20*a^3*b^4 
+ 15*a^2*b^5 - 6*a*b^6 + b^7)))/(a^3*b - 3*a^2*b^2 + 3*a*b^3 - b^4))*log(( 
3*a^2 + a*b)*x + (6*a^2*b + 2*a*b^2 - (a^4*b - 2*a^3*b^2 + 2*a*b^4 - b^5)* 
sqrt((9*a^3 + 6*a^2*b + a*b^2)/(a^6*b - 6*a^5*b^2 + 15*a^4*b^3 - 20*a^3*b^ 
4 + 15*a^2*b^5 - 6*a*b^6 + b^7)))*sqrt(-(a^2 + 3*a*b + (a^3*b - 3*a^2*b^2 
+ 3*a*b^3 - b^4)*sqrt((9*a^3 + 6*a^2*b + a*b^2)/(a^6*b - 6*a^5*b^2 + 15*a^ 
4*b^3 - 20*a^3*b^4 + 15*a^2*b^5 - 6*a*b^6 + b^7)))/(a^3*b - 3*a^2*b^2 + 3* 
a*b^3 - b^4))) - (a - b)*x*sqrt(-(a^2 + 3*a*b + (a^3*b - 3*a^2*b^2 + 3*a*b 
^3 - b^4)*sqrt((9*a^3 + 6*a^2*b + a*b^2)/(a^6*b - 6*a^5*b^2 + 15*a^4*b^3 - 
 20*a^3*b^4 + 15*a^2*b^5 - 6*a*b^6 + b^7)))/(a^3*b - 3*a^2*b^2 + 3*a*b^3 - 
 b^4))*log((3*a^2 + a*b)*x - (6*a^2*b + 2*a*b^2 - (a^4*b - 2*a^3*b^2 + 2*a 
*b^4 - b^5)*sqrt((9*a^3 + 6*a^2*b + a*b^2)/(a^6*b - 6*a^5*b^2 + 15*a^4*b^3 
 - 20*a^3*b^4 + 15*a^2*b^5 - 6*a*b^6 + b^7)))*sqrt(-(a^2 + 3*a*b + (a^3*b 
- 3*a^2*b^2 + 3*a*b^3 - b^4)*sqrt((9*a^3 + 6*a^2*b + a*b^2)/(a^6*b - 6*a^5 
*b^2 + 15*a^4*b^3 - 20*a^3*b^4 + 15*a^2*b^5 - 6*a*b^6 + b^7)))/(a^3*b - 3* 
a^2*b^2 + 3*a*b^3 - b^4))) + (a - b)*x*sqrt(-(a^2 + 3*a*b - (a^3*b - 3*a^2 
*b^2 + 3*a*b^3 - b^4)*sqrt((9*a^3 + 6*a^2*b + a*b^2)/(a^6*b - 6*a^5*b^2 + 
15*a^4*b^3 - 20*a^3*b^4 + 15*a^2*b^5 - 6*a*b^6 + b^7)))/(a^3*b - 3*a^2*b^2 
 + 3*a*b^3 - b^4))*log((3*a^2 + a*b)*x + (6*a^2*b + 2*a*b^2 + (a^4*b - ...
 

Sympy [A] (verification not implemented)

Time = 1.94 (sec) , antiderivative size = 134, normalized size of antiderivative = 1.11 \[ \int \frac {1}{x^2 \left (a-b+2 a x^2+a x^4\right )} \, dx=\operatorname {RootSum} {\left (t^{4} \cdot \left (256 a^{3} b^{2} - 768 a^{2} b^{3} + 768 a b^{4} - 256 b^{5}\right ) + t^{2} \cdot \left (32 a^{2} b + 96 a b^{2}\right ) + a, \left ( t \mapsto t \log {\left (x + \frac {64 t^{3} a^{4} b - 128 t^{3} a^{3} b^{2} + 128 t^{3} a b^{4} - 64 t^{3} b^{5} + 4 t a^{3} + 40 t a^{2} b + 20 t a b^{2}}{3 a^{2} + a b} \right )} \right )\right )} - \frac {1}{x \left (a - b\right )} \] Input:

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

Output:

RootSum(_t**4*(256*a**3*b**2 - 768*a**2*b**3 + 768*a*b**4 - 256*b**5) + _t 
**2*(32*a**2*b + 96*a*b**2) + a, Lambda(_t, _t*log(x + (64*_t**3*a**4*b - 
128*_t**3*a**3*b**2 + 128*_t**3*a*b**4 - 64*_t**3*b**5 + 4*_t*a**3 + 40*_t 
*a**2*b + 20*_t*a*b**2)/(3*a**2 + a*b)))) - 1/(x*(a - b))
 

Maxima [F]

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

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

Output:

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

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 698 vs. \(2 (81) = 162\).

Time = 0.21 (sec) , antiderivative size = 698, normalized size of antiderivative = 5.77 \[ \int \frac {1}{x^2 \left (a-b+2 a x^2+a x^4\right )} \, dx=\frac {{\left ({\left (3 \, \sqrt {a^{2} + \sqrt {a b} a} \sqrt {a b} a b - 4 \, \sqrt {a^{2} + \sqrt {a b} a} \sqrt {a b} b^{2}\right )} {\left (a - b\right )}^{2} {\left | a \right |} - 2 \, {\left (3 \, \sqrt {a^{2} + \sqrt {a b} a} a^{3} b - 7 \, \sqrt {a^{2} + \sqrt {a b} a} a^{2} b^{2} + 4 \, \sqrt {a^{2} + \sqrt {a b} a} a b^{3}\right )} {\left | a - b \right |} {\left | a \right |} + {\left (3 \, \sqrt {a^{2} + \sqrt {a b} a} \sqrt {a b} a^{4} - 10 \, \sqrt {a^{2} + \sqrt {a b} a} \sqrt {a b} a^{3} b + 11 \, \sqrt {a^{2} + \sqrt {a b} a} \sqrt {a b} a^{2} b^{2} - 4 \, \sqrt {a^{2} + \sqrt {a b} a} \sqrt {a b} a b^{3}\right )} {\left | a \right |}\right )} \arctan \left (\frac {x}{\sqrt {\frac {a^{2} - a b + \sqrt {{\left (a^{2} - a b\right )}^{2} - {\left (a^{2} - a b\right )} {\left (a^{2} - 2 \, a b + b^{2}\right )}}}{a^{2} - a b}}}\right )}{2 \, {\left (3 \, a^{6} b - 13 \, a^{5} b^{2} + 21 \, a^{4} b^{3} - 15 \, a^{3} b^{4} + 4 \, a^{2} b^{5}\right )} {\left | a - b \right |}} - \frac {{\left ({\left (3 \, \sqrt {a^{2} - \sqrt {a b} a} \sqrt {a b} a b - 4 \, \sqrt {a^{2} - \sqrt {a b} a} \sqrt {a b} b^{2}\right )} {\left (a - b\right )}^{2} {\left | a \right |} + 2 \, {\left (3 \, \sqrt {a^{2} - \sqrt {a b} a} a^{3} b - 7 \, \sqrt {a^{2} - \sqrt {a b} a} a^{2} b^{2} + 4 \, \sqrt {a^{2} - \sqrt {a b} a} a b^{3}\right )} {\left | a - b \right |} {\left | a \right |} + {\left (3 \, \sqrt {a^{2} - \sqrt {a b} a} \sqrt {a b} a^{4} - 10 \, \sqrt {a^{2} - \sqrt {a b} a} \sqrt {a b} a^{3} b + 11 \, \sqrt {a^{2} - \sqrt {a b} a} \sqrt {a b} a^{2} b^{2} - 4 \, \sqrt {a^{2} - \sqrt {a b} a} \sqrt {a b} a b^{3}\right )} {\left | a \right |}\right )} \arctan \left (\frac {x}{\sqrt {\frac {a^{2} - a b - \sqrt {{\left (a^{2} - a b\right )}^{2} - {\left (a^{2} - a b\right )} {\left (a^{2} - 2 \, a b + b^{2}\right )}}}{a^{2} - a b}}}\right )}{2 \, {\left (3 \, a^{6} b - 13 \, a^{5} b^{2} + 21 \, a^{4} b^{3} - 15 \, a^{3} b^{4} + 4 \, a^{2} b^{5}\right )} {\left | a - b \right |}} - \frac {1}{{\left (a - b\right )} x} \] Input:

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

Output:

1/2*((3*sqrt(a^2 + sqrt(a*b)*a)*sqrt(a*b)*a*b - 4*sqrt(a^2 + sqrt(a*b)*a)* 
sqrt(a*b)*b^2)*(a - b)^2*abs(a) - 2*(3*sqrt(a^2 + sqrt(a*b)*a)*a^3*b - 7*s 
qrt(a^2 + sqrt(a*b)*a)*a^2*b^2 + 4*sqrt(a^2 + sqrt(a*b)*a)*a*b^3)*abs(a - 
b)*abs(a) + (3*sqrt(a^2 + sqrt(a*b)*a)*sqrt(a*b)*a^4 - 10*sqrt(a^2 + sqrt( 
a*b)*a)*sqrt(a*b)*a^3*b + 11*sqrt(a^2 + sqrt(a*b)*a)*sqrt(a*b)*a^2*b^2 - 4 
*sqrt(a^2 + sqrt(a*b)*a)*sqrt(a*b)*a*b^3)*abs(a))*arctan(x/sqrt((a^2 - a*b 
 + sqrt((a^2 - a*b)^2 - (a^2 - a*b)*(a^2 - 2*a*b + b^2)))/(a^2 - a*b)))/(( 
3*a^6*b - 13*a^5*b^2 + 21*a^4*b^3 - 15*a^3*b^4 + 4*a^2*b^5)*abs(a - b)) - 
1/2*((3*sqrt(a^2 - sqrt(a*b)*a)*sqrt(a*b)*a*b - 4*sqrt(a^2 - sqrt(a*b)*a)* 
sqrt(a*b)*b^2)*(a - b)^2*abs(a) + 2*(3*sqrt(a^2 - sqrt(a*b)*a)*a^3*b - 7*s 
qrt(a^2 - sqrt(a*b)*a)*a^2*b^2 + 4*sqrt(a^2 - sqrt(a*b)*a)*a*b^3)*abs(a - 
b)*abs(a) + (3*sqrt(a^2 - sqrt(a*b)*a)*sqrt(a*b)*a^4 - 10*sqrt(a^2 - sqrt( 
a*b)*a)*sqrt(a*b)*a^3*b + 11*sqrt(a^2 - sqrt(a*b)*a)*sqrt(a*b)*a^2*b^2 - 4 
*sqrt(a^2 - sqrt(a*b)*a)*sqrt(a*b)*a*b^3)*abs(a))*arctan(x/sqrt((a^2 - a*b 
 - sqrt((a^2 - a*b)^2 - (a^2 - a*b)*(a^2 - 2*a*b + b^2)))/(a^2 - a*b)))/(( 
3*a^6*b - 13*a^5*b^2 + 21*a^4*b^3 - 15*a^3*b^4 + 4*a^2*b^5)*abs(a - b)) - 
1/((a - b)*x)
 

Mupad [B] (verification not implemented)

Time = 19.59 (sec) , antiderivative size = 2774, normalized size of antiderivative = 22.93 \[ \int \frac {1}{x^2 \left (a-b+2 a x^2+a x^4\right )} \, dx=\text {Too large to display} \] Input:

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

Output:

atan(((x*(8*a^7*b - 4*a^8 + 4*a^4*b^4 - 8*a^5*b^3) + (-(3*a*b^2 + a^2*b + 
3*a*(a*b^3)^(1/2) + b*(a*b^3)^(1/2))/(16*(3*a*b^4 - b^5 - 3*a^2*b^3 + a^3* 
b^2)))^(1/2)*(32*a^8*b + 32*a^4*b^5 - 128*a^5*b^4 + 192*a^6*b^3 - 128*a^7* 
b^2 - x*(-(3*a*b^2 + a^2*b + 3*a*(a*b^3)^(1/2) + b*(a*b^3)^(1/2))/(16*(3*a 
*b^4 - b^5 - 3*a^2*b^3 + a^3*b^2)))^(1/2)*(64*a^9*b - 64*a^4*b^6 + 320*a^5 
*b^5 - 640*a^6*b^4 + 640*a^7*b^3 - 320*a^8*b^2)))*(-(3*a*b^2 + a^2*b + 3*a 
*(a*b^3)^(1/2) + b*(a*b^3)^(1/2))/(16*(3*a*b^4 - b^5 - 3*a^2*b^3 + a^3*b^2 
)))^(1/2)*1i + (x*(8*a^7*b - 4*a^8 + 4*a^4*b^4 - 8*a^5*b^3) - (-(3*a*b^2 + 
 a^2*b + 3*a*(a*b^3)^(1/2) + b*(a*b^3)^(1/2))/(16*(3*a*b^4 - b^5 - 3*a^2*b 
^3 + a^3*b^2)))^(1/2)*(32*a^8*b + 32*a^4*b^5 - 128*a^5*b^4 + 192*a^6*b^3 - 
 128*a^7*b^2 + x*(-(3*a*b^2 + a^2*b + 3*a*(a*b^3)^(1/2) + b*(a*b^3)^(1/2)) 
/(16*(3*a*b^4 - b^5 - 3*a^2*b^3 + a^3*b^2)))^(1/2)*(64*a^9*b - 64*a^4*b^6 
+ 320*a^5*b^5 - 640*a^6*b^4 + 640*a^7*b^3 - 320*a^8*b^2)))*(-(3*a*b^2 + a^ 
2*b + 3*a*(a*b^3)^(1/2) + b*(a*b^3)^(1/2))/(16*(3*a*b^4 - b^5 - 3*a^2*b^3 
+ a^3*b^2)))^(1/2)*1i)/(6*a^6*b - 2*a^7 + (x*(8*a^7*b - 4*a^8 + 4*a^4*b^4 
- 8*a^5*b^3) + (-(3*a*b^2 + a^2*b + 3*a*(a*b^3)^(1/2) + b*(a*b^3)^(1/2))/( 
16*(3*a*b^4 - b^5 - 3*a^2*b^3 + a^3*b^2)))^(1/2)*(32*a^8*b + 32*a^4*b^5 - 
128*a^5*b^4 + 192*a^6*b^3 - 128*a^7*b^2 - x*(-(3*a*b^2 + a^2*b + 3*a*(a*b^ 
3)^(1/2) + b*(a*b^3)^(1/2))/(16*(3*a*b^4 - b^5 - 3*a^2*b^3 + a^3*b^2)))^(1 
/2)*(64*a^9*b - 64*a^4*b^6 + 320*a^5*b^5 - 640*a^6*b^4 + 640*a^7*b^3 - ...
 

Reduce [B] (verification not implemented)

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

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

Output:

( - 4*sqrt(a)*sqrt(sqrt(b)*sqrt(a) + a)*atan((a*x)/(sqrt(a)*sqrt(sqrt(b)*s 
qrt(a) + a)))*b*x + 2*sqrt(b)*sqrt(sqrt(b)*sqrt(a) + a)*atan((a*x)/(sqrt(a 
)*sqrt(sqrt(b)*sqrt(a) + a)))*a*x + 2*sqrt(b)*sqrt(sqrt(b)*sqrt(a) + a)*at 
an((a*x)/(sqrt(a)*sqrt(sqrt(b)*sqrt(a) + a)))*b*x + 2*sqrt(a)*sqrt(sqrt(b) 
*sqrt(a) - a)*log( - sqrt(sqrt(b)*sqrt(a) - a) + sqrt(a)*x)*b*x - 2*sqrt(a 
)*sqrt(sqrt(b)*sqrt(a) - a)*log(sqrt(sqrt(b)*sqrt(a) - a) + sqrt(a)*x)*b*x 
 + sqrt(b)*sqrt(sqrt(b)*sqrt(a) - a)*log( - sqrt(sqrt(b)*sqrt(a) - a) + sq 
rt(a)*x)*a*x + sqrt(b)*sqrt(sqrt(b)*sqrt(a) - a)*log( - sqrt(sqrt(b)*sqrt( 
a) - a) + sqrt(a)*x)*b*x - sqrt(b)*sqrt(sqrt(b)*sqrt(a) - a)*log(sqrt(sqrt 
(b)*sqrt(a) - a) + sqrt(a)*x)*a*x - sqrt(b)*sqrt(sqrt(b)*sqrt(a) - a)*log( 
sqrt(sqrt(b)*sqrt(a) - a) + sqrt(a)*x)*b*x - 4*a*b + 4*b**2)/(4*b*x*(a**2 
- 2*a*b + b**2))