\(\int \frac {d+e x+f x^2+g x^3+h x^4+i x^5}{1+x^2+x^4} \, dx\) [44]

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

Optimal result

Integrand size = 36, antiderivative size = 136 \[ \int \frac {d+e x+f x^2+g x^3+h x^4+i x^5}{1+x^2+x^4} \, dx=h x+\frac {i x^2}{2}-\frac {(d+f-2 h) \arctan \left (\frac {1-2 x}{\sqrt {3}}\right )}{2 \sqrt {3}}+\frac {(d+f-2 h) \arctan \left (\frac {1+2 x}{\sqrt {3}}\right )}{2 \sqrt {3}}+\frac {(2 e-g-i) \arctan \left (\frac {1+2 x^2}{\sqrt {3}}\right )}{2 \sqrt {3}}+\frac {1}{2} (d-f) \text {arctanh}\left (\frac {x}{1+x^2}\right )+\frac {1}{4} (g-i) \log \left (1+x^2+x^4\right ) \] Output:

h*x+1/2*i*x^2-1/6*(d+f-2*h)*arctan(1/3*(1-2*x)*3^(1/2))*3^(1/2)+1/6*(d+f-2 
*h)*arctan(1/3*(1+2*x)*3^(1/2))*3^(1/2)+1/6*(2*e-g-i)*arctan(1/3*(2*x^2+1) 
*3^(1/2))*3^(1/2)+1/2*(d-f)*arctanh(x/(x^2+1))+1/4*(g-i)*ln(x^4+x^2+1)
 

Mathematica [C] (verified)

Result contains complex when optimal does not.

Time = 0.80 (sec) , antiderivative size = 187, normalized size of antiderivative = 1.38 \[ \int \frac {d+e x+f x^2+g x^3+h x^4+i x^5}{1+x^2+x^4} \, dx=\frac {1}{12} \left (6 x (2 h+i x)+\left (1+i \sqrt {3}\right ) \left (2 \sqrt {3} d-\left (3 i+\sqrt {3}\right ) f-\left (-3 i+\sqrt {3}\right ) h\right ) \arctan \left (\frac {1}{2} \left (-i+\sqrt {3}\right ) x\right )+\left (i+\sqrt {3}\right ) \left (-2 i \sqrt {3} d+\left (3+i \sqrt {3}\right ) f+i \left (3 i+\sqrt {3}\right ) h\right ) \arctan \left (\frac {1}{2} \left (i+\sqrt {3}\right ) x\right )-2 \sqrt {3} (2 e-g-i) \arctan \left (\frac {\sqrt {3}}{1+2 x^2}\right )+3 (g-i) \log \left (1+x^2+x^4\right )\right ) \] Input:

Integrate[(d + e*x + f*x^2 + g*x^3 + h*x^4 + i*x^5)/(1 + x^2 + x^4),x]
 

Output:

(6*x*(2*h + i*x) + (1 + I*Sqrt[3])*(2*Sqrt[3]*d - (3*I + Sqrt[3])*f - (-3* 
I + Sqrt[3])*h)*ArcTan[((-I + Sqrt[3])*x)/2] + (I + Sqrt[3])*((-2*I)*Sqrt[ 
3]*d + (3 + I*Sqrt[3])*f + I*(3*I + Sqrt[3])*h)*ArcTan[((I + Sqrt[3])*x)/2 
] - 2*Sqrt[3]*(2*e - g - i)*ArcTan[Sqrt[3]/(1 + 2*x^2)] + 3*(g - i)*Log[1 
+ x^2 + x^4])/12
 

Rubi [A] (verified)

Time = 0.53 (sec) , antiderivative size = 150, normalized size of antiderivative = 1.10, number of steps used = 7, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.167, Rules used = {2202, 2194, 2188, 2009, 2205, 2009}

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 {d+e x+f x^2+g x^3+h x^4+i x^5}{x^4+x^2+1} \, dx\)

\(\Big \downarrow \) 2202

\(\displaystyle \int \frac {h x^4+f x^2+d}{x^4+x^2+1}dx+\int \frac {x \left (i x^4+g x^2+e\right )}{x^4+x^2+1}dx\)

\(\Big \downarrow \) 2194

\(\displaystyle \int \frac {h x^4+f x^2+d}{x^4+x^2+1}dx+\frac {1}{2} \int \frac {i x^4+g x^2+e}{x^4+x^2+1}dx^2\)

\(\Big \downarrow \) 2188

\(\displaystyle \int \frac {h x^4+f x^2+d}{x^4+x^2+1}dx+\frac {1}{2} \int \left (i+\frac {(g-i) x^2+e-i}{x^4+x^2+1}\right )dx^2\)

\(\Big \downarrow \) 2009

\(\displaystyle \int \frac {h x^4+f x^2+d}{x^4+x^2+1}dx+\frac {1}{2} \left (\frac {\arctan \left (\frac {2 x^2+1}{\sqrt {3}}\right ) (2 e-g-i)}{\sqrt {3}}+\frac {1}{2} (g-i) \log \left (x^4+x^2+1\right )+i x^2\right )\)

\(\Big \downarrow \) 2205

\(\displaystyle \int \left (h+\frac {(f-h) x^2+d-h}{x^4+x^2+1}\right )dx+\frac {1}{2} \left (\frac {\arctan \left (\frac {2 x^2+1}{\sqrt {3}}\right ) (2 e-g-i)}{\sqrt {3}}+\frac {1}{2} (g-i) \log \left (x^4+x^2+1\right )+i x^2\right )\)

\(\Big \downarrow \) 2009

\(\displaystyle -\frac {\arctan \left (\frac {1-2 x}{\sqrt {3}}\right ) (d+f-2 h)}{2 \sqrt {3}}+\frac {\arctan \left (\frac {2 x+1}{\sqrt {3}}\right ) (d+f-2 h)}{2 \sqrt {3}}+\frac {1}{2} \left (\frac {\arctan \left (\frac {2 x^2+1}{\sqrt {3}}\right ) (2 e-g-i)}{\sqrt {3}}+\frac {1}{2} (g-i) \log \left (x^4+x^2+1\right )+i x^2\right )-\frac {1}{4} (d-f) \log \left (x^2-x+1\right )+\frac {1}{4} (d-f) \log \left (x^2+x+1\right )+h x\)

Input:

Int[(d + e*x + f*x^2 + g*x^3 + h*x^4 + i*x^5)/(1 + x^2 + x^4),x]
 

Output:

h*x - ((d + f - 2*h)*ArcTan[(1 - 2*x)/Sqrt[3]])/(2*Sqrt[3]) + ((d + f - 2* 
h)*ArcTan[(1 + 2*x)/Sqrt[3]])/(2*Sqrt[3]) - ((d - f)*Log[1 - x + x^2])/4 + 
 ((d - f)*Log[1 + x + x^2])/4 + (i*x^2 + ((2*e - g - i)*ArcTan[(1 + 2*x^2) 
/Sqrt[3]])/Sqrt[3] + ((g - i)*Log[1 + x^2 + x^4])/2)/2
 

Defintions of rubi rules used

rule 2009
Int[u_, x_Symbol] :> Simp[IntSum[u, x], x] /; SumQ[u]
 

rule 2188
Int[(Pq_)*((a_) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[Expand 
Integrand[Pq*(a + b*x + c*x^2)^p, x], x] /; FreeQ[{a, b, c}, x] && PolyQ[Pq 
, x] && IGtQ[p, -2]
 

rule 2194
Int[(Pq_)*(x_)^(m_.)*((a_) + (b_.)*(x_)^2 + (c_.)*(x_)^4)^(p_), x_Symbol] : 
> Simp[1/2   Subst[Int[x^((m - 1)/2)*SubstFor[x^2, Pq, x]*(a + b*x + c*x^2) 
^p, x], x, x^2], x] /; FreeQ[{a, b, c, p}, x] && PolyQ[Pq, x^2] && IntegerQ 
[(m - 1)/2]
 

rule 2202
Int[(Pn_)*((a_) + (b_.)*(x_)^2 + (c_.)*(x_)^4)^(p_), x_Symbol] :> Module[{n 
 = Expon[Pn, x], k}, Int[Sum[Coeff[Pn, x, 2*k]*x^(2*k), {k, 0, n/2}]*(a + b 
*x^2 + c*x^4)^p, x] + Int[x*Sum[Coeff[Pn, x, 2*k + 1]*x^(2*k), {k, 0, (n - 
1)/2}]*(a + b*x^2 + c*x^4)^p, x]] /; FreeQ[{a, b, c, p}, x] && PolyQ[Pn, x] 
 &&  !PolyQ[Pn, x^2]
 

rule 2205
Int[(Px_)/((a_) + (b_.)*(x_)^2 + (c_.)*(x_)^4), x_Symbol] :> Int[ExpandInte 
grand[Px/(a + b*x^2 + c*x^4), x], x] /; FreeQ[{a, b, c}, x] && PolyQ[Px, x^ 
2] && Expon[Px, x^2] > 1
 
Maple [A] (verified)

Time = 0.37 (sec) , antiderivative size = 117, normalized size of antiderivative = 0.86

method result size
default \(\frac {i \,x^{2}}{2}+h x +\frac {\left (d -f +g -i \right ) \ln \left (x^{2}+x +1\right )}{4}+\frac {\left (\frac {d}{2}-e +\frac {f}{2}+\frac {g}{2}-h +\frac {i}{2}\right ) \arctan \left (\frac {\left (1+2 x \right ) \sqrt {3}}{3}\right ) \sqrt {3}}{3}+\frac {\left (g -i +f -d \right ) \ln \left (x^{2}-x +1\right )}{4}+\frac {\left (\frac {d}{2}+e +\frac {f}{2}-\frac {g}{2}-h -\frac {i}{2}\right ) \sqrt {3}\, \arctan \left (\frac {\left (2 x -1\right ) \sqrt {3}}{3}\right )}{3}\) \(117\)
risch \(\text {Expression too large to display}\) \(407271\)

Input:

int((i*x^5+h*x^4+g*x^3+f*x^2+e*x+d)/(x^4+x^2+1),x,method=_RETURNVERBOSE)
 

Output:

1/2*i*x^2+h*x+1/4*(d-f+g-i)*ln(x^2+x+1)+1/3*(1/2*d-e+1/2*f+1/2*g-h+1/2*i)* 
arctan(1/3*(1+2*x)*3^(1/2))*3^(1/2)+1/4*(g-i+f-d)*ln(x^2-x+1)+1/3*(1/2*d+e 
+1/2*f-1/2*g-h-1/2*i)*3^(1/2)*arctan(1/3*(2*x-1)*3^(1/2))
 

Fricas [A] (verification not implemented)

Time = 4.20 (sec) , antiderivative size = 106, normalized size of antiderivative = 0.78 \[ \int \frac {d+e x+f x^2+g x^3+h x^4+i x^5}{1+x^2+x^4} \, dx=\frac {1}{2} \, i x^{2} + \frac {1}{6} \, \sqrt {3} {\left (d - 2 \, e + f + g - 2 \, h + i\right )} \arctan \left (\frac {1}{3} \, \sqrt {3} {\left (2 \, x + 1\right )}\right ) + \frac {1}{6} \, \sqrt {3} {\left (d + 2 \, e + f - g - 2 \, h - i\right )} \arctan \left (\frac {1}{3} \, \sqrt {3} {\left (2 \, x - 1\right )}\right ) + h x + \frac {1}{4} \, {\left (d - f + g - i\right )} \log \left (x^{2} + x + 1\right ) - \frac {1}{4} \, {\left (d - f - g + i\right )} \log \left (x^{2} - x + 1\right ) \] Input:

integrate((i*x^5+h*x^4+g*x^3+f*x^2+e*x+d)/(x^4+x^2+1),x, algorithm="fricas 
")
 

Output:

1/2*i*x^2 + 1/6*sqrt(3)*(d - 2*e + f + g - 2*h + i)*arctan(1/3*sqrt(3)*(2* 
x + 1)) + 1/6*sqrt(3)*(d + 2*e + f - g - 2*h - i)*arctan(1/3*sqrt(3)*(2*x 
- 1)) + h*x + 1/4*(d - f + g - i)*log(x^2 + x + 1) - 1/4*(d - f - g + i)*l 
og(x^2 - x + 1)
 

Sympy [F(-1)]

Timed out. \[ \int \frac {d+e x+f x^2+g x^3+h x^4+i x^5}{1+x^2+x^4} \, dx=\text {Timed out} \] Input:

integrate((i*x**5+h*x**4+g*x**3+f*x**2+e*x+d)/(x**4+x**2+1),x)
 

Output:

Timed out
 

Maxima [A] (verification not implemented)

Time = 0.11 (sec) , antiderivative size = 106, normalized size of antiderivative = 0.78 \[ \int \frac {d+e x+f x^2+g x^3+h x^4+i x^5}{1+x^2+x^4} \, dx=\frac {1}{2} \, i x^{2} + \frac {1}{6} \, \sqrt {3} {\left (d - 2 \, e + f + g - 2 \, h + i\right )} \arctan \left (\frac {1}{3} \, \sqrt {3} {\left (2 \, x + 1\right )}\right ) + \frac {1}{6} \, \sqrt {3} {\left (d + 2 \, e + f - g - 2 \, h - i\right )} \arctan \left (\frac {1}{3} \, \sqrt {3} {\left (2 \, x - 1\right )}\right ) + h x + \frac {1}{4} \, {\left (d - f + g - i\right )} \log \left (x^{2} + x + 1\right ) - \frac {1}{4} \, {\left (d - f - g + i\right )} \log \left (x^{2} - x + 1\right ) \] Input:

integrate((i*x^5+h*x^4+g*x^3+f*x^2+e*x+d)/(x^4+x^2+1),x, algorithm="maxima 
")
 

Output:

1/2*i*x^2 + 1/6*sqrt(3)*(d - 2*e + f + g - 2*h + i)*arctan(1/3*sqrt(3)*(2* 
x + 1)) + 1/6*sqrt(3)*(d + 2*e + f - g - 2*h - i)*arctan(1/3*sqrt(3)*(2*x 
- 1)) + h*x + 1/4*(d - f + g - i)*log(x^2 + x + 1) - 1/4*(d - f - g + i)*l 
og(x^2 - x + 1)
 

Giac [A] (verification not implemented)

Time = 0.12 (sec) , antiderivative size = 106, normalized size of antiderivative = 0.78 \[ \int \frac {d+e x+f x^2+g x^3+h x^4+i x^5}{1+x^2+x^4} \, dx=\frac {1}{2} \, i x^{2} + \frac {1}{6} \, \sqrt {3} {\left (d - 2 \, e + f + g - 2 \, h + i\right )} \arctan \left (\frac {1}{3} \, \sqrt {3} {\left (2 \, x + 1\right )}\right ) + \frac {1}{6} \, \sqrt {3} {\left (d + 2 \, e + f - g - 2 \, h - i\right )} \arctan \left (\frac {1}{3} \, \sqrt {3} {\left (2 \, x - 1\right )}\right ) + h x + \frac {1}{4} \, {\left (d - f + g - i\right )} \log \left (x^{2} + x + 1\right ) - \frac {1}{4} \, {\left (d - f - g + i\right )} \log \left (x^{2} - x + 1\right ) \] Input:

integrate((i*x^5+h*x^4+g*x^3+f*x^2+e*x+d)/(x^4+x^2+1),x, algorithm="giac")
 

Output:

1/2*i*x^2 + 1/6*sqrt(3)*(d - 2*e + f + g - 2*h + i)*arctan(1/3*sqrt(3)*(2* 
x + 1)) + 1/6*sqrt(3)*(d + 2*e + f - g - 2*h - i)*arctan(1/3*sqrt(3)*(2*x 
- 1)) + h*x + 1/4*(d - f + g - i)*log(x^2 + x + 1) - 1/4*(d - f - g + i)*l 
og(x^2 - x + 1)
 

Mupad [B] (verification not implemented)

Time = 26.95 (sec) , antiderivative size = 1509, normalized size of antiderivative = 11.10 \[ \int \frac {d+e x+f x^2+g x^3+h x^4+i x^5}{1+x^2+x^4} \, dx=\text {Too large to display} \] Input:

int((d + e*x + f*x^2 + g*x^3 + h*x^4 + i*x^5)/(x^2 + x^4 + 1),x)
 

Output:

h*x - log(d*g*3i - d*f*9i - d*e*6i + d*h*3i + d*i*3i + e*h*6i - f*h*3i - g 
*h*3i - h*i*3i - 3*3^(1/2)*d^2 - d^2*x*6i - f^2*x*3i + d^2*3i + f^2*6i - 2 
*3^(1/2)*d*e + 3*3^(1/2)*d*f + 3^(1/2)*d*g + 4*3^(1/2)*e*f + 3*3^(1/2)*d*h 
 + 3^(1/2)*d*i - 2*3^(1/2)*e*h - 2*3^(1/2)*f*g - 3*3^(1/2)*f*h - 2*3^(1/2) 
*f*i + 3^(1/2)*g*h + 3^(1/2)*h*i + d*f*x*9i + e*f*x*6i + d*h*x*3i - e*h*x* 
6i - f*g*x*3i - f*h*x*3i - f*i*x*3i + g*h*x*3i + h*i*x*3i - 3*3^(1/2)*f^2* 
x + 3*3^(1/2)*d*f*x - 2*3^(1/2)*d*g*x - 2*3^(1/2)*e*f*x - 3*3^(1/2)*d*h*x 
- 2*3^(1/2)*d*i*x - 2*3^(1/2)*e*h*x + 3^(1/2)*f*g*x + 3*3^(1/2)*f*h*x + 3^ 
(1/2)*f*i*x + 3^(1/2)*g*h*x + 3^(1/2)*h*i*x + 4*3^(1/2)*d*e*x)*(d/4 - f/4 
- g/4 + i/4 + (3^(1/2)*d*1i)/12 + (3^(1/2)*e*1i)/6 + (3^(1/2)*f*1i)/12 - ( 
3^(1/2)*g*1i)/12 - (3^(1/2)*h*1i)/6 - (3^(1/2)*i*1i)/12) - log(d*e*6i + d* 
f*9i - d*g*3i - d*h*3i - d*i*3i - e*h*6i + f*h*3i + g*h*3i + h*i*3i - 3*3^ 
(1/2)*d^2 + d^2*x*6i + f^2*x*3i - d^2*3i - f^2*6i - 2*3^(1/2)*d*e + 3*3^(1 
/2)*d*f + 3^(1/2)*d*g + 4*3^(1/2)*e*f + 3*3^(1/2)*d*h + 3^(1/2)*d*i - 2*3^ 
(1/2)*e*h - 2*3^(1/2)*f*g - 3*3^(1/2)*f*h - 2*3^(1/2)*f*i + 3^(1/2)*g*h + 
3^(1/2)*h*i - d*f*x*9i - e*f*x*6i - d*h*x*3i + e*h*x*6i + f*g*x*3i + f*h*x 
*3i + f*i*x*3i - g*h*x*3i - h*i*x*3i - 3*3^(1/2)*f^2*x + 3*3^(1/2)*d*f*x - 
 2*3^(1/2)*d*g*x - 2*3^(1/2)*e*f*x - 3*3^(1/2)*d*h*x - 2*3^(1/2)*d*i*x - 2 
*3^(1/2)*e*h*x + 3^(1/2)*f*g*x + 3*3^(1/2)*f*h*x + 3^(1/2)*f*i*x + 3^(1/2) 
*g*h*x + 3^(1/2)*h*i*x + 4*3^(1/2)*d*e*x)*(d/4 - f/4 - g/4 + i/4 - (3^(...
 

Reduce [B] (verification not implemented)

Time = 0.16 (sec) , antiderivative size = 290, normalized size of antiderivative = 2.13 \[ \int \frac {d+e x+f x^2+g x^3+h x^4+i x^5}{1+x^2+x^4} \, dx=\frac {\sqrt {3}\, \mathit {atan} \left (\frac {2 x -1}{\sqrt {3}}\right ) d}{6}+\frac {\sqrt {3}\, \mathit {atan} \left (\frac {2 x -1}{\sqrt {3}}\right ) e}{3}+\frac {\sqrt {3}\, \mathit {atan} \left (\frac {2 x -1}{\sqrt {3}}\right ) f}{6}-\frac {\sqrt {3}\, \mathit {atan} \left (\frac {2 x -1}{\sqrt {3}}\right ) g}{6}-\frac {\sqrt {3}\, \mathit {atan} \left (\frac {2 x -1}{\sqrt {3}}\right ) h}{3}-\frac {\sqrt {3}\, \mathit {atan} \left (\frac {2 x -1}{\sqrt {3}}\right ) i}{6}+\frac {\sqrt {3}\, \mathit {atan} \left (\frac {2 x +1}{\sqrt {3}}\right ) d}{6}-\frac {\sqrt {3}\, \mathit {atan} \left (\frac {2 x +1}{\sqrt {3}}\right ) e}{3}+\frac {\sqrt {3}\, \mathit {atan} \left (\frac {2 x +1}{\sqrt {3}}\right ) f}{6}+\frac {\sqrt {3}\, \mathit {atan} \left (\frac {2 x +1}{\sqrt {3}}\right ) g}{6}-\frac {\sqrt {3}\, \mathit {atan} \left (\frac {2 x +1}{\sqrt {3}}\right ) h}{3}+\frac {\sqrt {3}\, \mathit {atan} \left (\frac {2 x +1}{\sqrt {3}}\right ) i}{6}-\frac {\mathrm {log}\left (x^{2}-x +1\right ) d}{4}+\frac {\mathrm {log}\left (x^{2}-x +1\right ) f}{4}+\frac {\mathrm {log}\left (x^{2}-x +1\right ) g}{4}-\frac {\mathrm {log}\left (x^{2}-x +1\right ) i}{4}+\frac {\mathrm {log}\left (x^{2}+x +1\right ) d}{4}-\frac {\mathrm {log}\left (x^{2}+x +1\right ) f}{4}+\frac {\mathrm {log}\left (x^{2}+x +1\right ) g}{4}-\frac {\mathrm {log}\left (x^{2}+x +1\right ) i}{4}+h x +\frac {i \,x^{2}}{2} \] Input:

int((i*x^5+h*x^4+g*x^3+f*x^2+e*x+d)/(x^4+x^2+1),x)
 

Output:

(2*sqrt(3)*atan((2*x - 1)/sqrt(3))*d + 4*sqrt(3)*atan((2*x - 1)/sqrt(3))*e 
 + 2*sqrt(3)*atan((2*x - 1)/sqrt(3))*f - 2*sqrt(3)*atan((2*x - 1)/sqrt(3)) 
*g - 4*sqrt(3)*atan((2*x - 1)/sqrt(3))*h - 2*sqrt(3)*atan((2*x - 1)/sqrt(3 
))*i + 2*sqrt(3)*atan((2*x + 1)/sqrt(3))*d - 4*sqrt(3)*atan((2*x + 1)/sqrt 
(3))*e + 2*sqrt(3)*atan((2*x + 1)/sqrt(3))*f + 2*sqrt(3)*atan((2*x + 1)/sq 
rt(3))*g - 4*sqrt(3)*atan((2*x + 1)/sqrt(3))*h + 2*sqrt(3)*atan((2*x + 1)/ 
sqrt(3))*i - 3*log(x**2 - x + 1)*d + 3*log(x**2 - x + 1)*f + 3*log(x**2 - 
x + 1)*g - 3*log(x**2 - x + 1)*i + 3*log(x**2 + x + 1)*d - 3*log(x**2 + x 
+ 1)*f + 3*log(x**2 + x + 1)*g - 3*log(x**2 + x + 1)*i + 12*h*x + 6*i*x**2 
)/12