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

Optimal result
Mathematica [A] (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 = 38, antiderivative size = 76 \[ \int \frac {d+e x+f x^2+g x^3+h x^4+i x^5}{4-5 x^2+x^4} \, dx=h x+\frac {i x^2}{2}-\frac {1}{6} (d+4 f+16 h) \text {arctanh}\left (\frac {x}{2}\right )+\frac {1}{3} (d+f+h) \text {arctanh}(x)-\frac {1}{6} (e+g+i) \log \left (1-x^2\right )+\frac {1}{6} (e+4 g+16 i) \log \left (4-x^2\right ) \] Output:

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

Mathematica [A] (verified)

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

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

Output:

(12*h*x + 6*i*x^2 - 2*(d + e + f + g + h + i)*Log[1 - x] + (d + 2*e + 4*(f 
 + 2*g + 4*h + 8*i))*Log[2 - x] + 2*(d - e + f - g + h - i)*Log[1 + x] - ( 
d - 2*(e - 2*f + 4*g - 8*h + 16*i))*Log[2 + x])/12
 

Rubi [A] (verified)

Time = 0.51 (sec) , antiderivative size = 78, normalized size of antiderivative = 1.03, number of steps used = 7, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.158, 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-5 x^2+4} \, dx\)

\(\Big \downarrow \) 2202

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

\(\Big \downarrow \) 2194

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

\(\Big \downarrow \) 2188

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

\(\Big \downarrow \) 2009

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

\(\Big \downarrow \) 2205

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

\(\Big \downarrow \) 2009

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

Input:

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

Output:

h*x - ((d + 4*f + 16*h)*ArcTanh[x/2])/6 + ((d + f + h)*ArcTanh[x])/3 + (i* 
x^2 - ((e + g + i)*Log[1 - x^2])/3 + ((e + 4*g + 16*i)*Log[4 - x^2])/3)/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.09 (sec) , antiderivative size = 107, normalized size of antiderivative = 1.41

method result size
default \(\frac {i \,x^{2}}{2}+h x +\left (\frac {d}{12}+\frac {e}{6}+\frac {f}{3}+\frac {2 g}{3}+\frac {4 h}{3}+\frac {8 i}{3}\right ) \ln \left (x -2\right )+\left (\frac {d}{6}-\frac {e}{6}+\frac {f}{6}-\frac {g}{6}+\frac {h}{6}-\frac {i}{6}\right ) \ln \left (1+x \right )+\left (-\frac {d}{6}-\frac {e}{6}-\frac {f}{6}-\frac {g}{6}-\frac {h}{6}-\frac {i}{6}\right ) \ln \left (x -1\right )+\left (-\frac {d}{12}+\frac {e}{6}-\frac {f}{3}+\frac {2 g}{3}-\frac {4 h}{3}+\frac {8 i}{3}\right ) \ln \left (x +2\right )\) \(107\)
norman \(\frac {i \,x^{2}}{2}+h x +\left (\frac {d}{12}+\frac {e}{6}+\frac {f}{3}+\frac {2 g}{3}+\frac {4 h}{3}+\frac {8 i}{3}\right ) \ln \left (x -2\right )+\left (\frac {d}{6}-\frac {e}{6}+\frac {f}{6}-\frac {g}{6}+\frac {h}{6}-\frac {i}{6}\right ) \ln \left (1+x \right )+\left (-\frac {d}{6}-\frac {e}{6}-\frac {f}{6}-\frac {g}{6}-\frac {h}{6}-\frac {i}{6}\right ) \ln \left (x -1\right )+\left (-\frac {d}{12}+\frac {e}{6}-\frac {f}{3}+\frac {2 g}{3}-\frac {4 h}{3}+\frac {8 i}{3}\right ) \ln \left (x +2\right )\) \(107\)
parallelrisch \(\frac {\ln \left (x -2\right ) e}{6}+\frac {i \,x^{2}}{2}+\frac {\ln \left (x +2\right ) e}{6}+\frac {\ln \left (x -2\right ) f}{3}+\frac {\ln \left (1+x \right ) d}{6}-\frac {\ln \left (x +2\right ) f}{3}-\frac {\ln \left (x -1\right ) d}{6}-\frac {\ln \left (x +2\right ) d}{12}+\frac {\ln \left (x -2\right ) d}{12}-\frac {\ln \left (x -1\right ) e}{6}+\frac {\ln \left (1+x \right ) f}{6}-\frac {\ln \left (1+x \right ) e}{6}-\frac {\ln \left (x -1\right ) f}{6}+\frac {\ln \left (1+x \right ) h}{6}-\frac {\ln \left (1+x \right ) i}{6}-\frac {\ln \left (1+x \right ) g}{6}+h x +\frac {2 \ln \left (x +2\right ) g}{3}-\frac {4 \ln \left (x +2\right ) h}{3}+\frac {8 \ln \left (x +2\right ) i}{3}+\frac {2 \ln \left (x -2\right ) g}{3}+\frac {4 \ln \left (x -2\right ) h}{3}+\frac {8 \ln \left (x -2\right ) i}{3}-\frac {\ln \left (x -1\right ) g}{6}-\frac {\ln \left (x -1\right ) h}{6}-\frac {\ln \left (x -1\right ) i}{6}\) \(179\)
risch \(\frac {\ln \left (2-x \right ) e}{6}+\frac {i \,x^{2}}{2}+\frac {\ln \left (x +2\right ) e}{6}-\frac {\ln \left (1-x \right ) d}{6}+\frac {\ln \left (2-x \right ) d}{12}+\frac {\ln \left (2-x \right ) f}{3}+\frac {\ln \left (1+x \right ) d}{6}-\frac {\ln \left (x +2\right ) f}{3}-\frac {\ln \left (x +2\right ) d}{12}-\frac {\ln \left (1-x \right ) f}{6}-\frac {\ln \left (1-x \right ) e}{6}+\frac {\ln \left (1+x \right ) f}{6}-\frac {\ln \left (1+x \right ) e}{6}+\frac {\ln \left (1+x \right ) h}{6}-\frac {\ln \left (1+x \right ) i}{6}-\frac {\ln \left (1+x \right ) g}{6}+h x +\frac {2 \ln \left (x +2\right ) g}{3}-\frac {4 \ln \left (x +2\right ) h}{3}+\frac {8 \ln \left (x +2\right ) i}{3}-\frac {\ln \left (1-x \right ) g}{6}-\frac {\ln \left (1-x \right ) h}{6}-\frac {\ln \left (1-x \right ) i}{6}+\frac {2 \ln \left (2-x \right ) g}{3}+\frac {4 \ln \left (2-x \right ) h}{3}+\frac {8 \ln \left (2-x \right ) i}{3}\) \(203\)

Input:

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

Output:

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

Fricas [A] (verification not implemented)

Time = 4.59 (sec) , antiderivative size = 88, normalized size of antiderivative = 1.16 \[ \int \frac {d+e x+f x^2+g x^3+h x^4+i x^5}{4-5 x^2+x^4} \, dx=\frac {1}{2} \, i x^{2} + h x - \frac {1}{12} \, {\left (d - 2 \, e + 4 \, f - 8 \, g + 16 \, h - 32 \, i\right )} \log \left (x + 2\right ) + \frac {1}{6} \, {\left (d - e + f - g + h - i\right )} \log \left (x + 1\right ) - \frac {1}{6} \, {\left (d + e + f + g + h + i\right )} \log \left (x - 1\right ) + \frac {1}{12} \, {\left (d + 2 \, e + 4 \, f + 8 \, g + 16 \, h + 32 \, i\right )} \log \left (x - 2\right ) \] Input:

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

Output:

1/2*i*x^2 + h*x - 1/12*(d - 2*e + 4*f - 8*g + 16*h - 32*i)*log(x + 2) + 1/ 
6*(d - e + f - g + h - i)*log(x + 1) - 1/6*(d + e + f + g + h + i)*log(x - 
 1) + 1/12*(d + 2*e + 4*f + 8*g + 16*h + 32*i)*log(x - 2)
                                                                                    
                                                                                    
 

Sympy [F(-1)]

Timed out. \[ \int \frac {d+e x+f x^2+g x^3+h x^4+i x^5}{4-5 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-5*x**2+4),x)
 

Output:

Timed out
 

Maxima [A] (verification not implemented)

Time = 0.03 (sec) , antiderivative size = 88, normalized size of antiderivative = 1.16 \[ \int \frac {d+e x+f x^2+g x^3+h x^4+i x^5}{4-5 x^2+x^4} \, dx=\frac {1}{2} \, i x^{2} + h x - \frac {1}{12} \, {\left (d - 2 \, e + 4 \, f - 8 \, g + 16 \, h - 32 \, i\right )} \log \left (x + 2\right ) + \frac {1}{6} \, {\left (d - e + f - g + h - i\right )} \log \left (x + 1\right ) - \frac {1}{6} \, {\left (d + e + f + g + h + i\right )} \log \left (x - 1\right ) + \frac {1}{12} \, {\left (d + 2 \, e + 4 \, f + 8 \, g + 16 \, h + 32 \, i\right )} \log \left (x - 2\right ) \] Input:

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

Output:

1/2*i*x^2 + h*x - 1/12*(d - 2*e + 4*f - 8*g + 16*h - 32*i)*log(x + 2) + 1/ 
6*(d - e + f - g + h - i)*log(x + 1) - 1/6*(d + e + f + g + h + i)*log(x - 
 1) + 1/12*(d + 2*e + 4*f + 8*g + 16*h + 32*i)*log(x - 2)
 

Giac [A] (verification not implemented)

Time = 0.14 (sec) , antiderivative size = 92, normalized size of antiderivative = 1.21 \[ \int \frac {d+e x+f x^2+g x^3+h x^4+i x^5}{4-5 x^2+x^4} \, dx=\frac {1}{2} \, i x^{2} + h x - \frac {1}{12} \, {\left (d - 2 \, e + 4 \, f - 8 \, g + 16 \, h - 32 \, i\right )} \log \left ({\left | x + 2 \right |}\right ) + \frac {1}{6} \, {\left (d - e + f - g + h - i\right )} \log \left ({\left | x + 1 \right |}\right ) - \frac {1}{6} \, {\left (d + e + f + g + h + i\right )} \log \left ({\left | x - 1 \right |}\right ) + \frac {1}{12} \, {\left (d + 2 \, e + 4 \, f + 8 \, g + 16 \, h + 32 \, i\right )} \log \left ({\left | x - 2 \right |}\right ) \] Input:

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

Output:

1/2*i*x^2 + h*x - 1/12*(d - 2*e + 4*f - 8*g + 16*h - 32*i)*log(abs(x + 2)) 
 + 1/6*(d - e + f - g + h - i)*log(abs(x + 1)) - 1/6*(d + e + f + g + h + 
i)*log(abs(x - 1)) + 1/12*(d + 2*e + 4*f + 8*g + 16*h + 32*i)*log(abs(x - 
2))
 

Mupad [B] (verification not implemented)

Time = 18.42 (sec) , antiderivative size = 108, normalized size of antiderivative = 1.42 \[ \int \frac {d+e x+f x^2+g x^3+h x^4+i x^5}{4-5 x^2+x^4} \, dx=h\,x+\frac {i\,x^2}{2}-\ln \left (x-1\right )\,\left (\frac {d}{6}+\frac {e}{6}+\frac {f}{6}+\frac {g}{6}+\frac {h}{6}+\frac {i}{6}\right )+\ln \left (x+1\right )\,\left (\frac {d}{6}-\frac {e}{6}+\frac {f}{6}-\frac {g}{6}+\frac {h}{6}-\frac {i}{6}\right )+\ln \left (x-2\right )\,\left (\frac {d}{12}+\frac {e}{6}+\frac {f}{3}+\frac {2\,g}{3}+\frac {4\,h}{3}+\frac {8\,i}{3}\right )-\ln \left (x+2\right )\,\left (\frac {d}{12}-\frac {e}{6}+\frac {f}{3}-\frac {2\,g}{3}+\frac {4\,h}{3}-\frac {8\,i}{3}\right ) \] Input:

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

Output:

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

Reduce [B] (verification not implemented)

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

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

Output:

(log(x - 2)*d + 2*log(x - 2)*e + 4*log(x - 2)*f + 8*log(x - 2)*g + 16*log( 
x - 2)*h + 32*log(x - 2)*i - 2*log(x - 1)*d - 2*log(x - 1)*e - 2*log(x - 1 
)*f - 2*log(x - 1)*g - 2*log(x - 1)*h - 2*log(x - 1)*i - log(x + 2)*d + 2* 
log(x + 2)*e - 4*log(x + 2)*f + 8*log(x + 2)*g - 16*log(x + 2)*h + 32*log( 
x + 2)*i + 2*log(x + 1)*d - 2*log(x + 1)*e + 2*log(x + 1)*f - 2*log(x + 1) 
*g + 2*log(x + 1)*h - 2*log(x + 1)*i + 12*h*x + 6*i*x**2)/12