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

Optimal result
Mathematica [A] (verified)
Rubi [A] (verified)
Maple [A] (verified)
Fricas [B] (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 = 31, antiderivative size = 105 \[ \int \frac {\left (2-3 x+x^2\right ) \left (d+e x+f x^2\right )}{\left (4-5 x^2+x^4\right )^2} \, dx=-\frac {5 d-6 e+8 f+(3 d-4 e+6 f) x}{12 \left (2+3 x+x^2\right )}-\frac {1}{36} (d+e+f) \log (1-x)+\frac {1}{144} (d+2 e+4 f) \log (2-x)-\frac {1}{36} (7 d-13 e+19 f) \log (1+x)+\frac {1}{144} (31 d-50 e+76 f) \log (2+x) \] Output:

-1/12*(5*d-6*e+8*f+(3*d-4*e+6*f)*x)/(x^2+3*x+2)-1/36*(d+e+f)*ln(1-x)+1/144 
*(d+2*e+4*f)*ln(2-x)-1/36*(7*d-13*e+19*f)*ln(1+x)+1/144*(31*d-50*e+76*f)*l 
n(2+x)
 

Mathematica [A] (verified)

Time = 0.08 (sec) , antiderivative size = 97, normalized size of antiderivative = 0.92 \[ \int \frac {\left (2-3 x+x^2\right ) \left (d+e x+f x^2\right )}{\left (4-5 x^2+x^4\right )^2} \, dx=\frac {1}{144} \left (-\frac {12 (-6 e+8 f-4 e x+6 f x+d (5+3 x))}{2+3 x+x^2}-4 (d+e+f) \log (1-x)+(d+2 e+4 f) \log (2-x)-4 (7 d-13 e+19 f) \log (1+x)+(31 d-50 e+76 f) \log (2+x)\right ) \] Input:

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

Output:

((-12*(-6*e + 8*f - 4*e*x + 6*f*x + d*(5 + 3*x)))/(2 + 3*x + x^2) - 4*(d + 
 e + f)*Log[1 - x] + (d + 2*e + 4*f)*Log[2 - x] - 4*(7*d - 13*e + 19*f)*Lo 
g[1 + x] + (31*d - 50*e + 76*f)*Log[2 + x])/144
 

Rubi [A] (verified)

Time = 0.53 (sec) , antiderivative size = 110, normalized size of antiderivative = 1.05, number of steps used = 7, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.226, Rules used = {2019, 2135, 27, 2141, 27, 1141, 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 {\left (x^2-3 x+2\right ) \left (d+e x+f x^2\right )}{\left (x^4-5 x^2+4\right )^2} \, dx\)

\(\Big \downarrow \) 2019

\(\displaystyle \int \frac {d+e x+f x^2}{\left (x^2-3 x+2\right ) \left (x^2+3 x+2\right )^2}dx\)

\(\Big \downarrow \) 2135

\(\displaystyle -\frac {1}{72} \int \frac {6 \left ((3 d-4 e+6 f) x^2-4 (2 d-3 e+5 f) x+3 d-10 e+12 f\right )}{\left (x^2-3 x+2\right ) \left (x^2+3 x+2\right )}dx-\frac {x (3 d-4 e+6 f)+5 d-6 e+8 f}{12 \left (x^2+3 x+2\right )}\)

\(\Big \downarrow \) 27

\(\displaystyle -\frac {1}{12} \int \frac {(3 d-4 e+6 f) x^2-4 (2 d-3 e+5 f) x+3 d-10 e+12 f}{\left (x^2-3 x+2\right ) \left (x^2+3 x+2\right )}dx-\frac {x (3 d-4 e+6 f)+5 d-6 e+8 f}{12 \left (x^2+3 x+2\right )}\)

\(\Big \downarrow \) 2141

\(\displaystyle \frac {1}{12} \left (-\frac {1}{72} \int -\frac {6 (7 d+6 e+4 f-(3 d+2 e) x)}{x^2-3 x+2}dx-\frac {1}{72} \int \frac {6 (25 d-54 e+76 f-(3 d+2 e) x)}{x^2+3 x+2}dx\right )-\frac {x (3 d-4 e+6 f)+5 d-6 e+8 f}{12 \left (x^2+3 x+2\right )}\)

\(\Big \downarrow \) 27

\(\displaystyle \frac {1}{12} \left (\frac {1}{12} \int \frac {7 d+6 e+4 f-(3 d+2 e) x}{x^2-3 x+2}dx-\frac {1}{12} \int \frac {25 d-54 e+76 f-(3 d+2 e) x}{x^2+3 x+2}dx\right )-\frac {x (3 d-4 e+6 f)+5 d-6 e+8 f}{12 \left (x^2+3 x+2\right )}\)

\(\Big \downarrow \) 1141

\(\displaystyle \frac {1}{12} \left (\frac {1}{12} \int \left (\frac {4 (d+e+f)}{1-x}-\frac {d+2 e+4 f}{2-x}\right )dx-\frac {1}{12} \int \left (\frac {4 (7 d-13 e+19 f)}{x+1}-\frac {31 d-50 e+76 f}{x+2}\right )dx\right )-\frac {x (3 d-4 e+6 f)+5 d-6 e+8 f}{12 \left (x^2+3 x+2\right )}\)

\(\Big \downarrow \) 2009

\(\displaystyle \frac {1}{12} \left (\frac {1}{12} (\log (2-x) (d+2 e+4 f)-4 \log (1-x) (d+e+f))+\frac {1}{12} (\log (x+2) (31 d-50 e+76 f)-4 \log (x+1) (7 d-13 e+19 f))\right )-\frac {x (3 d-4 e+6 f)+5 d-6 e+8 f}{12 \left (x^2+3 x+2\right )}\)

Input:

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

Output:

-1/12*(5*d - 6*e + 8*f + (3*d - 4*e + 6*f)*x)/(2 + 3*x + x^2) + ((-4*(d + 
e + f)*Log[1 - x] + (d + 2*e + 4*f)*Log[2 - x])/12 + (-4*(7*d - 13*e + 19* 
f)*Log[1 + x] + (31*d - 50*e + 76*f)*Log[2 + x])/12)/12
 

Defintions of rubi rules used

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 1141
Int[((d_.) + (e_.)*(x_))^(m_.)*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_), x_ 
Symbol] :> With[{q = Rt[b^2 - 4*a*c, 2]}, Simp[1/c^p   Int[ExpandIntegrand[ 
(d + e*x)^m*(b/2 - q/2 + c*x)^p*(b/2 + q/2 + c*x)^p, x], x], x] /; EqQ[p, - 
1] ||  !FractionalPowerFactorQ[q]] /; FreeQ[{a, b, c, d, e}, x] && ILtQ[p, 
0] && IntegerQ[m] && NiceSqrtQ[b^2 - 4*a*c]
 

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

rule 2019
Int[(u_.)*(Px_)^(p_.)*(Qx_)^(q_.), x_Symbol] :> Int[u*PolynomialQuotient[Px 
, Qx, x]^p*Qx^(p + q), x] /; FreeQ[q, x] && PolyQ[Px, x] && PolyQ[Qx, x] && 
 EqQ[PolynomialRemainder[Px, Qx, x], 0] && IntegerQ[p] && LtQ[p*q, 0]
 

rule 2135
Int[(Px_)*((a_) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_)*((d_) + (e_.)*(x_) + (f_. 
)*(x_)^2)^(q_), x_Symbol] :> With[{A = Coeff[Px, x, 0], B = Coeff[Px, x, 1] 
, C = Coeff[Px, x, 2]}, Simp[(a + b*x + c*x^2)^(p + 1)*((d + e*x + f*x^2)^( 
q + 1)/((b^2 - 4*a*c)*((c*d - a*f)^2 - (b*d - a*e)*(c*e - b*f))*(p + 1)))*( 
(A*c - a*C)*(2*a*c*e - b*(c*d + a*f)) + (A*b - a*B)*(2*c^2*d + b^2*f - c*(b 
*e + 2*a*f)) + c*(A*(2*c^2*d + b^2*f - c*(b*e + 2*a*f)) - B*(b*c*d - 2*a*c* 
e + a*b*f) + C*(b^2*d - a*b*e - 2*a*(c*d - a*f)))*x), x] + Simp[1/((b^2 - 4 
*a*c)*((c*d - a*f)^2 - (b*d - a*e)*(c*e - b*f))*(p + 1))   Int[(a + b*x + c 
*x^2)^(p + 1)*(d + e*x + f*x^2)^q*Simp[(b*B - 2*A*c - 2*a*C)*((c*d - a*f)^2 
 - (b*d - a*e)*(c*e - b*f))*(p + 1) + (b^2*(C*d + A*f) - b*(B*c*d + A*c*e + 
 a*C*e + a*B*f) + 2*(A*c*(c*d - a*f) - a*(c*C*d - B*c*e - a*C*f)))*(a*f*(p 
+ 1) - c*d*(p + 2)) - e*((A*c - a*C)*(2*a*c*e - b*(c*d + a*f)) + (A*b - a*B 
)*(2*c^2*d + b^2*f - c*(b*e + 2*a*f)))*(p + q + 2) - (2*f*((A*c - a*C)*(2*a 
*c*e - b*(c*d + a*f)) + (A*b - a*B)*(2*c^2*d + b^2*f - c*(b*e + 2*a*f)))*(p 
 + q + 2) - (b^2*(C*d + A*f) - b*(B*c*d + A*c*e + a*C*e + a*B*f) + 2*(A*c*( 
c*d - a*f) - a*(c*C*d - B*c*e - a*C*f)))*(b*f*(p + 1) - c*e*(2*p + q + 4))) 
*x - c*f*(b^2*(C*d + A*f) - b*(B*c*d + A*c*e + a*C*e + a*B*f) + 2*(A*c*(c*d 
 - a*f) - a*(c*C*d - B*c*e - a*C*f)))*(2*p + 2*q + 5)*x^2, x], x], x]] /; F 
reeQ[{a, b, c, d, e, f, q}, x] && PolyQ[Px, x, 2] && LtQ[p, -1] && NeQ[(c*d 
 - a*f)^2 - (b*d - a*e)*(c*e - b*f), 0] &&  !( !IntegerQ[p] && ILtQ[q, -1]) 
 &&  !IGtQ[q, 0]
 

rule 2141
Int[(Px_)/(((a_) + (b_.)*(x_) + (c_.)*(x_)^2)*((d_) + (e_.)*(x_) + (f_.)*(x 
_)^2)), x_Symbol] :> With[{A = Coeff[Px, x, 0], B = Coeff[Px, x, 1], C = Co 
eff[Px, x, 2], q = c^2*d^2 - b*c*d*e + a*c*e^2 + b^2*d*f - 2*a*c*d*f - a*b* 
e*f + a^2*f^2}, Simp[1/q   Int[(A*c^2*d - a*c*C*d - A*b*c*e + a*B*c*e + A*b 
^2*f - a*b*B*f - a*A*c*f + a^2*C*f + c*(B*c*d - b*C*d - A*c*e + a*C*e + A*b 
*f - a*B*f)*x)/(a + b*x + c*x^2), x], x] + Simp[1/q   Int[(c*C*d^2 - B*c*d* 
e + A*c*e^2 + b*B*d*f - A*c*d*f - a*C*d*f - A*b*e*f + a*A*f^2 - f*(B*c*d - 
b*C*d - A*c*e + a*C*e + A*b*f - a*B*f)*x)/(d + e*x + f*x^2), x], x] /; NeQ[ 
q, 0]] /; FreeQ[{a, b, c, d, e, f}, x] && PolyQ[Px, x, 2]
 
Maple [A] (verified)

Time = 0.07 (sec) , antiderivative size = 96, normalized size of antiderivative = 0.91

method result size
default \(\left (\frac {d}{144}+\frac {e}{72}+\frac {f}{36}\right ) \ln \left (x -2\right )+\left (-\frac {7 d}{36}+\frac {13 e}{36}-\frac {19 f}{36}\right ) \ln \left (1+x \right )-\frac {\frac {d}{6}-\frac {e}{6}+\frac {f}{6}}{1+x}+\left (-\frac {d}{36}-\frac {e}{36}-\frac {f}{36}\right ) \ln \left (x -1\right )-\frac {\frac {d}{12}-\frac {e}{6}+\frac {f}{3}}{x +2}+\left (\frac {31 d}{144}-\frac {25 e}{72}+\frac {19 f}{36}\right ) \ln \left (x +2\right )\) \(96\)
norman \(\frac {\left (-\frac {d}{4}+\frac {e}{3}-\frac {f}{2}\right ) x^{3}+\left (\frac {3 d}{4}-\frac {5 e}{6}+f \right ) x +\left (\frac {d}{3}-\frac {e}{2}+\frac {5 f}{6}\right ) x^{2}-\frac {5 d}{6}+e -\frac {4 f}{3}}{x^{4}-5 x^{2}+4}+\left (-\frac {7 d}{36}+\frac {13 e}{36}-\frac {19 f}{36}\right ) \ln \left (1+x \right )+\left (-\frac {d}{36}-\frac {e}{36}-\frac {f}{36}\right ) \ln \left (x -1\right )+\left (\frac {d}{144}+\frac {e}{72}+\frac {f}{36}\right ) \ln \left (x -2\right )+\left (\frac {31 d}{144}-\frac {25 e}{72}+\frac {19 f}{36}\right ) \ln \left (x +2\right )\) \(121\)
risch \(\frac {\left (-\frac {d}{4}+\frac {e}{3}-\frac {f}{2}\right ) x -\frac {5 d}{12}+\frac {e}{2}-\frac {2 f}{3}}{x^{2}+3 x +2}+\frac {31 \ln \left (x +2\right ) d}{144}-\frac {25 \ln \left (x +2\right ) e}{72}+\frac {19 \ln \left (x +2\right ) f}{36}-\frac {7 \ln \left (-x -1\right ) d}{36}+\frac {13 \ln \left (-x -1\right ) e}{36}-\frac {19 \ln \left (-x -1\right ) f}{36}-\frac {\ln \left (x -1\right ) d}{36}-\frac {\ln \left (x -1\right ) e}{36}-\frac {\ln \left (x -1\right ) f}{36}+\frac {\ln \left (2-x \right ) d}{144}+\frac {\ln \left (2-x \right ) e}{72}+\frac {\ln \left (2-x \right ) f}{36}\) \(131\)
parallelrisch \(\frac {-96 f -36 d x -72 f x -60 d +72 e +48 e x +4 \ln \left (x -2\right ) e -100 \ln \left (x +2\right ) e -4 \ln \left (x -1\right ) x^{2} d -84 \ln \left (1+x \right ) x d +156 \ln \left (1+x \right ) x e +93 \ln \left (x +2\right ) x d -150 \ln \left (x +2\right ) x e -4 \ln \left (x -1\right ) x^{2} e +228 \ln \left (x +2\right ) x f +3 \ln \left (x -2\right ) x d +8 \ln \left (x -2\right ) f -56 \ln \left (1+x \right ) d +152 \ln \left (x +2\right ) f -8 \ln \left (x -1\right ) d -12 \ln \left (x -1\right ) x e -228 \ln \left (1+x \right ) x f +62 \ln \left (x +2\right ) d +12 \ln \left (x -2\right ) x f +2 \ln \left (x -2\right ) d -8 \ln \left (x -1\right ) e -152 \ln \left (1+x \right ) f +104 \ln \left (1+x \right ) e -8 \ln \left (x -1\right ) f -4 \ln \left (x -1\right ) x^{2} f -28 \ln \left (1+x \right ) x^{2} d +52 \ln \left (1+x \right ) x^{2} e +\ln \left (x -2\right ) x^{2} d +2 \ln \left (x -2\right ) x^{2} e -76 \ln \left (1+x \right ) x^{2} f +31 \ln \left (x +2\right ) x^{2} d -50 \ln \left (x +2\right ) x^{2} e +76 \ln \left (x +2\right ) x^{2} f +6 \ln \left (x -2\right ) x e -12 \ln \left (x -1\right ) x d -12 \ln \left (x -1\right ) x f +4 \ln \left (x -2\right ) x^{2} f}{144 x^{2}+432 x +288}\) \(334\)

Input:

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

Output:

(1/144*d+1/72*e+1/36*f)*ln(x-2)+(-7/36*d+13/36*e-19/36*f)*ln(1+x)-(1/6*d-1 
/6*e+1/6*f)/(1+x)+(-1/36*d-1/36*e-1/36*f)*ln(x-1)-(1/12*d-1/6*e+1/3*f)/(x+ 
2)+(31/144*d-25/72*e+19/36*f)*ln(x+2)
 

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 191 vs. \(2 (95) = 190\).

Time = 0.29 (sec) , antiderivative size = 191, normalized size of antiderivative = 1.82 \[ \int \frac {\left (2-3 x+x^2\right ) \left (d+e x+f x^2\right )}{\left (4-5 x^2+x^4\right )^2} \, dx=-\frac {12 \, {\left (3 \, d - 4 \, e + 6 \, f\right )} x - {\left ({\left (31 \, d - 50 \, e + 76 \, f\right )} x^{2} + 3 \, {\left (31 \, d - 50 \, e + 76 \, f\right )} x + 62 \, d - 100 \, e + 152 \, f\right )} \log \left (x + 2\right ) + 4 \, {\left ({\left (7 \, d - 13 \, e + 19 \, f\right )} x^{2} + 3 \, {\left (7 \, d - 13 \, e + 19 \, f\right )} x + 14 \, d - 26 \, e + 38 \, f\right )} \log \left (x + 1\right ) + 4 \, {\left ({\left (d + e + f\right )} x^{2} + 3 \, {\left (d + e + f\right )} x + 2 \, d + 2 \, e + 2 \, f\right )} \log \left (x - 1\right ) - {\left ({\left (d + 2 \, e + 4 \, f\right )} x^{2} + 3 \, {\left (d + 2 \, e + 4 \, f\right )} x + 2 \, d + 4 \, e + 8 \, f\right )} \log \left (x - 2\right ) + 60 \, d - 72 \, e + 96 \, f}{144 \, {\left (x^{2} + 3 \, x + 2\right )}} \] Input:

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

Output:

-1/144*(12*(3*d - 4*e + 6*f)*x - ((31*d - 50*e + 76*f)*x^2 + 3*(31*d - 50* 
e + 76*f)*x + 62*d - 100*e + 152*f)*log(x + 2) + 4*((7*d - 13*e + 19*f)*x^ 
2 + 3*(7*d - 13*e + 19*f)*x + 14*d - 26*e + 38*f)*log(x + 1) + 4*((d + e + 
 f)*x^2 + 3*(d + e + f)*x + 2*d + 2*e + 2*f)*log(x - 1) - ((d + 2*e + 4*f) 
*x^2 + 3*(d + 2*e + 4*f)*x + 2*d + 4*e + 8*f)*log(x - 2) + 60*d - 72*e + 9 
6*f)/(x^2 + 3*x + 2)
 

Sympy [F(-1)]

Timed out. \[ \int \frac {\left (2-3 x+x^2\right ) \left (d+e x+f x^2\right )}{\left (4-5 x^2+x^4\right )^2} \, dx=\text {Timed out} \] Input:

integrate((x**2-3*x+2)*(f*x**2+e*x+d)/(x**4-5*x**2+4)**2,x)
 

Output:

Timed out
 

Maxima [A] (verification not implemented)

Time = 0.04 (sec) , antiderivative size = 91, normalized size of antiderivative = 0.87 \[ \int \frac {\left (2-3 x+x^2\right ) \left (d+e x+f x^2\right )}{\left (4-5 x^2+x^4\right )^2} \, dx=\frac {1}{144} \, {\left (31 \, d - 50 \, e + 76 \, f\right )} \log \left (x + 2\right ) - \frac {1}{36} \, {\left (7 \, d - 13 \, e + 19 \, f\right )} \log \left (x + 1\right ) - \frac {1}{36} \, {\left (d + e + f\right )} \log \left (x - 1\right ) + \frac {1}{144} \, {\left (d + 2 \, e + 4 \, f\right )} \log \left (x - 2\right ) - \frac {{\left (3 \, d - 4 \, e + 6 \, f\right )} x + 5 \, d - 6 \, e + 8 \, f}{12 \, {\left (x^{2} + 3 \, x + 2\right )}} \] Input:

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

Output:

1/144*(31*d - 50*e + 76*f)*log(x + 2) - 1/36*(7*d - 13*e + 19*f)*log(x + 1 
) - 1/36*(d + e + f)*log(x - 1) + 1/144*(d + 2*e + 4*f)*log(x - 2) - 1/12* 
((3*d - 4*e + 6*f)*x + 5*d - 6*e + 8*f)/(x^2 + 3*x + 2)
 

Giac [A] (verification not implemented)

Time = 0.13 (sec) , antiderivative size = 95, normalized size of antiderivative = 0.90 \[ \int \frac {\left (2-3 x+x^2\right ) \left (d+e x+f x^2\right )}{\left (4-5 x^2+x^4\right )^2} \, dx=\frac {1}{144} \, {\left (31 \, d - 50 \, e + 76 \, f\right )} \log \left ({\left | x + 2 \right |}\right ) - \frac {1}{36} \, {\left (7 \, d - 13 \, e + 19 \, f\right )} \log \left ({\left | x + 1 \right |}\right ) - \frac {1}{36} \, {\left (d + e + f\right )} \log \left ({\left | x - 1 \right |}\right ) + \frac {1}{144} \, {\left (d + 2 \, e + 4 \, f\right )} \log \left ({\left | x - 2 \right |}\right ) - \frac {{\left (3 \, d - 4 \, e + 6 \, f\right )} x + 5 \, d - 6 \, e + 8 \, f}{12 \, {\left (x + 2\right )} {\left (x + 1\right )}} \] Input:

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

Output:

1/144*(31*d - 50*e + 76*f)*log(abs(x + 2)) - 1/36*(7*d - 13*e + 19*f)*log( 
abs(x + 1)) - 1/36*(d + e + f)*log(abs(x - 1)) + 1/144*(d + 2*e + 4*f)*log 
(abs(x - 2)) - 1/12*((3*d - 4*e + 6*f)*x + 5*d - 6*e + 8*f)/((x + 2)*(x + 
1))
 

Mupad [B] (verification not implemented)

Time = 18.01 (sec) , antiderivative size = 97, normalized size of antiderivative = 0.92 \[ \int \frac {\left (2-3 x+x^2\right ) \left (d+e x+f x^2\right )}{\left (4-5 x^2+x^4\right )^2} \, dx=\ln \left (x-2\right )\,\left (\frac {d}{144}+\frac {e}{72}+\frac {f}{36}\right )-\ln \left (x+1\right )\,\left (\frac {7\,d}{36}-\frac {13\,e}{36}+\frac {19\,f}{36}\right )-\ln \left (x-1\right )\,\left (\frac {d}{36}+\frac {e}{36}+\frac {f}{36}\right )+\ln \left (x+2\right )\,\left (\frac {31\,d}{144}-\frac {25\,e}{72}+\frac {19\,f}{36}\right )-\frac {\frac {5\,d}{12}-\frac {e}{2}+\frac {2\,f}{3}+x\,\left (\frac {d}{4}-\frac {e}{3}+\frac {f}{2}\right )}{x^2+3\,x+2} \] Input:

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

Output:

log(x - 2)*(d/144 + e/72 + f/36) - log(x + 1)*((7*d)/36 - (13*e)/36 + (19* 
f)/36) - log(x - 1)*(d/36 + e/36 + f/36) + log(x + 2)*((31*d)/144 - (25*e) 
/72 + (19*f)/36) - ((5*d)/12 - e/2 + (2*f)/3 + x*(d/4 - e/3 + f/2))/(3*x + 
 x^2 + 2)
 

Reduce [B] (verification not implemented)

Time = 0.17 (sec) , antiderivative size = 340, normalized size of antiderivative = 3.24 \[ \int \frac {\left (2-3 x+x^2\right ) \left (d+e x+f x^2\right )}{\left (4-5 x^2+x^4\right )^2} \, dx=\frac {-48 f -36 d +40 e -228 \,\mathrm {log}\left (x +1\right ) f x +228 \,\mathrm {log}\left (x +2\right ) f x +12 \,\mathrm {log}\left (x -2\right ) f x -12 \,\mathrm {log}\left (x -1\right ) f x +3 \,\mathrm {log}\left (x -2\right ) d x +6 \,\mathrm {log}\left (x -2\right ) e x -12 \,\mathrm {log}\left (x -1\right ) d x -12 \,\mathrm {log}\left (x -1\right ) e x +93 \,\mathrm {log}\left (x +2\right ) d x -150 \,\mathrm {log}\left (x +2\right ) e x -84 \,\mathrm {log}\left (x +1\right ) d x +156 \,\mathrm {log}\left (x +1\right ) e x +2 \,\mathrm {log}\left (x -2\right ) d +62 \,\mathrm {log}\left (x +2\right ) d +4 \,\mathrm {log}\left (x -2\right ) e +8 \,\mathrm {log}\left (x -2\right ) f -8 \,\mathrm {log}\left (x -1\right ) d -8 \,\mathrm {log}\left (x -1\right ) e -8 \,\mathrm {log}\left (x -1\right ) f -100 \,\mathrm {log}\left (x +2\right ) e +152 \,\mathrm {log}\left (x +2\right ) f -56 \,\mathrm {log}\left (x +1\right ) d +104 \,\mathrm {log}\left (x +1\right ) e -152 \,\mathrm {log}\left (x +1\right ) f -16 e \,x^{2}+\mathrm {log}\left (x -2\right ) d \,x^{2}+2 \,\mathrm {log}\left (x -2\right ) e \,x^{2}+4 \,\mathrm {log}\left (x -2\right ) f \,x^{2}-4 \,\mathrm {log}\left (x -1\right ) d \,x^{2}-4 \,\mathrm {log}\left (x -1\right ) e \,x^{2}-4 \,\mathrm {log}\left (x -1\right ) f \,x^{2}+31 \,\mathrm {log}\left (x +2\right ) d \,x^{2}-50 \,\mathrm {log}\left (x +2\right ) e \,x^{2}+76 \,\mathrm {log}\left (x +2\right ) f \,x^{2}-28 \,\mathrm {log}\left (x +1\right ) d \,x^{2}+52 \,\mathrm {log}\left (x +1\right ) e \,x^{2}-76 \,\mathrm {log}\left (x +1\right ) f \,x^{2}+24 f \,x^{2}+12 d \,x^{2}}{144 x^{2}+432 x +288} \] Input:

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

Output:

(log(x - 2)*d*x**2 + 3*log(x - 2)*d*x + 2*log(x - 2)*d + 2*log(x - 2)*e*x* 
*2 + 6*log(x - 2)*e*x + 4*log(x - 2)*e + 4*log(x - 2)*f*x**2 + 12*log(x - 
2)*f*x + 8*log(x - 2)*f - 4*log(x - 1)*d*x**2 - 12*log(x - 1)*d*x - 8*log( 
x - 1)*d - 4*log(x - 1)*e*x**2 - 12*log(x - 1)*e*x - 8*log(x - 1)*e - 4*lo 
g(x - 1)*f*x**2 - 12*log(x - 1)*f*x - 8*log(x - 1)*f + 31*log(x + 2)*d*x** 
2 + 93*log(x + 2)*d*x + 62*log(x + 2)*d - 50*log(x + 2)*e*x**2 - 150*log(x 
 + 2)*e*x - 100*log(x + 2)*e + 76*log(x + 2)*f*x**2 + 228*log(x + 2)*f*x + 
 152*log(x + 2)*f - 28*log(x + 1)*d*x**2 - 84*log(x + 1)*d*x - 56*log(x + 
1)*d + 52*log(x + 1)*e*x**2 + 156*log(x + 1)*e*x + 104*log(x + 1)*e - 76*l 
og(x + 1)*f*x**2 - 228*log(x + 1)*f*x - 152*log(x + 1)*f + 12*d*x**2 - 36* 
d - 16*e*x**2 + 40*e + 24*f*x**2 - 48*f)/(144*(x**2 + 3*x + 2))