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

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

Optimal result

Integrand size = 14, antiderivative size = 39 \[ \int \frac {1}{x \left (1+x^2+x^4\right )} \, dx=-\frac {\arctan \left (\frac {1+2 x^2}{\sqrt {3}}\right )}{2 \sqrt {3}}+\log (x)-\frac {1}{4} \log \left (1+x^2+x^4\right ) \] Output:

-1/6*arctan(1/3*(2*x^2+1)*3^(1/2))*3^(1/2)+ln(x)-1/4*ln(x^4+x^2+1)
 

Mathematica [C] (verified)

Result contains complex when optimal does not.

Time = 0.03 (sec) , antiderivative size = 65, normalized size of antiderivative = 1.67 \[ \int \frac {1}{x \left (1+x^2+x^4\right )} \, dx=\log (x)-\frac {1}{12} i \left (\left (-3 i+\sqrt {3}\right ) \log \left (-i+\sqrt {3}-2 i x^2\right )-\left (3 i+\sqrt {3}\right ) \log \left (i+\sqrt {3}+2 i x^2\right )\right ) \] Input:

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

Output:

Log[x] - (I/12)*((-3*I + Sqrt[3])*Log[-I + Sqrt[3] - (2*I)*x^2] - (3*I + S 
qrt[3])*Log[I + Sqrt[3] + (2*I)*x^2])
 

Rubi [A] (verified)

Time = 0.35 (sec) , antiderivative size = 43, normalized size of antiderivative = 1.10, number of steps used = 8, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.500, Rules used = {1434, 1144, 25, 1142, 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 \left (x^4+x^2+1\right )} \, dx\)

\(\Big \downarrow \) 1434

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

\(\Big \downarrow \) 1144

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

\(\Big \downarrow \) 25

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

\(\Big \downarrow \) 1142

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

\(\Big \downarrow \) 1083

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

\(\Big \downarrow \) 217

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

\(\Big \downarrow \) 1103

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

Input:

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

Output:

(-(ArcTan[(1 + 2*x^2)/Sqrt[3]]/Sqrt[3]) + Log[x^2] - Log[1 + x^2 + x^4]/2) 
/2
 

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 1144
Int[1/(((d_.) + (e_.)*(x_))*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)), x_Symbol] 
 :> Simp[e*(Log[RemoveContent[d + e*x, x]]/(c*d^2 - b*d*e + a*e^2)), x] + S 
imp[1/(c*d^2 - b*d*e + a*e^2)   Int[(c*d - b*e - c*e*x)/(a + b*x + c*x^2), 
x], x] /; FreeQ[{a, b, c, d, e}, x]
 

rule 1434
Int[(x_)^(m_)*((a_) + (b_.)*(x_)^2 + (c_.)*(x_)^4)^(p_.), x_Symbol] :> Simp 
[1/2   Subst[Int[x^((m - 1)/2)*(a + b*x + c*x^2)^p, x], x, x^2], x] /; Free 
Q[{a, b, c, p}, x] && IntegerQ[(m - 1)/2]
 
Maple [A] (verified)

Time = 0.07 (sec) , antiderivative size = 31, normalized size of antiderivative = 0.79

method result size
risch \(\ln \left (x \right )-\frac {\ln \left (x^{4}+x^{2}+1\right )}{4}-\frac {\sqrt {3}\, \arctan \left (\frac {2 \left (x^{2}+\frac {1}{2}\right ) \sqrt {3}}{3}\right )}{6}\) \(31\)
default \(-\frac {\ln \left (x^{2}+x +1\right )}{4}+\frac {\arctan \left (\frac {\left (1+2 x \right ) \sqrt {3}}{3}\right ) \sqrt {3}}{6}-\frac {\ln \left (x^{2}-x +1\right )}{4}-\frac {\sqrt {3}\, \arctan \left (\frac {\left (2 x -1\right ) \sqrt {3}}{3}\right )}{6}+\ln \left (x \right )\) \(56\)

Input:

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

Output:

ln(x)-1/4*ln(x^4+x^2+1)-1/6*3^(1/2)*arctan(2/3*(x^2+1/2)*3^(1/2))
 

Fricas [A] (verification not implemented)

Time = 0.07 (sec) , antiderivative size = 32, normalized size of antiderivative = 0.82 \[ \int \frac {1}{x \left (1+x^2+x^4\right )} \, dx=-\frac {1}{6} \, \sqrt {3} \arctan \left (\frac {1}{3} \, \sqrt {3} {\left (2 \, x^{2} + 1\right )}\right ) - \frac {1}{4} \, \log \left (x^{4} + x^{2} + 1\right ) + \log \left (x\right ) \] Input:

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

Output:

-1/6*sqrt(3)*arctan(1/3*sqrt(3)*(2*x^2 + 1)) - 1/4*log(x^4 + x^2 + 1) + lo 
g(x)
 

Sympy [A] (verification not implemented)

Time = 0.06 (sec) , antiderivative size = 41, normalized size of antiderivative = 1.05 \[ \int \frac {1}{x \left (1+x^2+x^4\right )} \, dx=\log {\left (x \right )} - \frac {\log {\left (x^{4} + x^{2} + 1 \right )}}{4} - \frac {\sqrt {3} \operatorname {atan}{\left (\frac {2 \sqrt {3} x^{2}}{3} + \frac {\sqrt {3}}{3} \right )}}{6} \] Input:

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

Output:

log(x) - log(x**4 + x**2 + 1)/4 - sqrt(3)*atan(2*sqrt(3)*x**2/3 + sqrt(3)/ 
3)/6
 

Maxima [A] (verification not implemented)

Time = 0.11 (sec) , antiderivative size = 36, normalized size of antiderivative = 0.92 \[ \int \frac {1}{x \left (1+x^2+x^4\right )} \, dx=-\frac {1}{6} \, \sqrt {3} \arctan \left (\frac {1}{3} \, \sqrt {3} {\left (2 \, x^{2} + 1\right )}\right ) - \frac {1}{4} \, \log \left (x^{4} + x^{2} + 1\right ) + \frac {1}{2} \, \log \left (x^{2}\right ) \] Input:

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

Output:

-1/6*sqrt(3)*arctan(1/3*sqrt(3)*(2*x^2 + 1)) - 1/4*log(x^4 + x^2 + 1) + 1/ 
2*log(x^2)
 

Giac [A] (verification not implemented)

Time = 0.11 (sec) , antiderivative size = 36, normalized size of antiderivative = 0.92 \[ \int \frac {1}{x \left (1+x^2+x^4\right )} \, dx=-\frac {1}{6} \, \sqrt {3} \arctan \left (\frac {1}{3} \, \sqrt {3} {\left (2 \, x^{2} + 1\right )}\right ) - \frac {1}{4} \, \log \left (x^{4} + x^{2} + 1\right ) + \frac {1}{2} \, \log \left (x^{2}\right ) \] Input:

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

Output:

-1/6*sqrt(3)*arctan(1/3*sqrt(3)*(2*x^2 + 1)) - 1/4*log(x^4 + x^2 + 1) + 1/ 
2*log(x^2)
 

Mupad [B] (verification not implemented)

Time = 18.52 (sec) , antiderivative size = 34, normalized size of antiderivative = 0.87 \[ \int \frac {1}{x \left (1+x^2+x^4\right )} \, dx=\ln \left (x\right )-\frac {\ln \left (x^4+x^2+1\right )}{4}-\frac {\sqrt {3}\,\mathrm {atan}\left (\frac {2\,\sqrt {3}\,x^2}{3}+\frac {\sqrt {3}}{3}\right )}{6} \] Input:

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

Output:

log(x) - log(x^2 + x^4 + 1)/4 - (3^(1/2)*atan(3^(1/2)/3 + (2*3^(1/2)*x^2)/ 
3))/6
 

Reduce [B] (verification not implemented)

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

int(1/x/(x^4+x^2+1),x)
 

Output:

( - 2*sqrt(3)*atan((2*x - 1)/sqrt(3)) + 2*sqrt(3)*atan((2*x + 1)/sqrt(3)) 
- 3*log(x**2 - x + 1) - 3*log(x**2 + x + 1) + 12*log(x))/12