\(\int \frac {3-6 x+9 x^2+e^{2+2 x} (-1+4 x-5 x^2+2 x^3)}{x^2-2 x^3+3 x^4-2 x^5+x^6} \, dx\) [5034]

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

Optimal result

Integrand size = 58, antiderivative size = 23 \[ \int \frac {3-6 x+9 x^2+e^{2+2 x} \left (-1+4 x-5 x^2+2 x^3\right )}{x^2-2 x^3+3 x^4-2 x^5+x^6} \, dx=\frac {-3+e^{2+2 x}}{x \left (1-x+x^2\right )} \]

[Out]

1/x/(x^2-x+1)*(exp(1+x)^2-3)

Rubi [C] (verified)

Result contains higher order function than in optimal. Order 4 vs. order 3 in optimal.

Time = 1.21 (sec) , antiderivative size = 467, normalized size of antiderivative = 20.30, number of steps used = 31, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.103, Rules used = {6820, 6874, 2208, 2209, 6860, 1604} \[ \int \frac {3-6 x+9 x^2+e^{2+2 x} \left (-1+4 x-5 x^2+2 x^3\right )}{x^2-2 x^3+3 x^4-2 x^5+x^6} \, dx=-\frac {1}{3} \left (3+2 i \sqrt {3}\right ) e^{3+i \sqrt {3}} \operatorname {ExpIntegralEi}\left (2 x-i \sqrt {3}-1\right )+\frac {1}{3} \left (1+i \sqrt {3}\right ) e^{3+i \sqrt {3}} \operatorname {ExpIntegralEi}\left (2 x-i \sqrt {3}-1\right )+\frac {i e^{3+i \sqrt {3}} \operatorname {ExpIntegralEi}\left (2 x-i \sqrt {3}-1\right )}{\sqrt {3}}+\frac {2}{3} e^{3+i \sqrt {3}} \operatorname {ExpIntegralEi}\left (2 x-i \sqrt {3}-1\right )-\frac {1}{3} \left (3-2 i \sqrt {3}\right ) e^{3-i \sqrt {3}} \operatorname {ExpIntegralEi}\left (2 x+i \sqrt {3}-1\right )+\frac {1}{3} \left (1-i \sqrt {3}\right ) e^{3-i \sqrt {3}} \operatorname {ExpIntegralEi}\left (2 x+i \sqrt {3}-1\right )-\frac {i e^{3-i \sqrt {3}} \operatorname {ExpIntegralEi}\left (2 x+i \sqrt {3}-1\right )}{\sqrt {3}}+\frac {2}{3} e^{3-i \sqrt {3}} \operatorname {ExpIntegralEi}\left (2 x+i \sqrt {3}-1\right )-\frac {3}{x \left (x^2-x+1\right )}+\frac {\left (1-i \sqrt {3}\right ) e^{2 x+2}}{3 \left (-2 x-i \sqrt {3}+1\right )}+\frac {2 e^{2 x+2}}{3 \left (-2 x-i \sqrt {3}+1\right )}+\frac {\left (1+i \sqrt {3}\right ) e^{2 x+2}}{3 \left (-2 x+i \sqrt {3}+1\right )}+\frac {2 e^{2 x+2}}{3 \left (-2 x+i \sqrt {3}+1\right )}+\frac {e^{2 x+2}}{x} \]

[In]

Int[(3 - 6*x + 9*x^2 + E^(2 + 2*x)*(-1 + 4*x - 5*x^2 + 2*x^3))/(x^2 - 2*x^3 + 3*x^4 - 2*x^5 + x^6),x]

[Out]

(2*E^(2 + 2*x))/(3*(1 - I*Sqrt[3] - 2*x)) + ((1 - I*Sqrt[3])*E^(2 + 2*x))/(3*(1 - I*Sqrt[3] - 2*x)) + (2*E^(2
+ 2*x))/(3*(1 + I*Sqrt[3] - 2*x)) + ((1 + I*Sqrt[3])*E^(2 + 2*x))/(3*(1 + I*Sqrt[3] - 2*x)) + E^(2 + 2*x)/x -
3/(x*(1 - x + x^2)) + (2*E^(3 + I*Sqrt[3])*ExpIntegralEi[-1 - I*Sqrt[3] + 2*x])/3 + (I*E^(3 + I*Sqrt[3])*ExpIn
tegralEi[-1 - I*Sqrt[3] + 2*x])/Sqrt[3] + ((1 + I*Sqrt[3])*E^(3 + I*Sqrt[3])*ExpIntegralEi[-1 - I*Sqrt[3] + 2*
x])/3 - ((3 + (2*I)*Sqrt[3])*E^(3 + I*Sqrt[3])*ExpIntegralEi[-1 - I*Sqrt[3] + 2*x])/3 + (2*E^(3 - I*Sqrt[3])*E
xpIntegralEi[-1 + I*Sqrt[3] + 2*x])/3 - (I*E^(3 - I*Sqrt[3])*ExpIntegralEi[-1 + I*Sqrt[3] + 2*x])/Sqrt[3] + ((
1 - I*Sqrt[3])*E^(3 - I*Sqrt[3])*ExpIntegralEi[-1 + I*Sqrt[3] + 2*x])/3 - ((3 - (2*I)*Sqrt[3])*E^(3 - I*Sqrt[3
])*ExpIntegralEi[-1 + I*Sqrt[3] + 2*x])/3

Rule 1604

Int[(Pp_)*(Qq_)^(m_.)*(Rr_)^(n_.), x_Symbol] :> With[{p = Expon[Pp, x], q = Expon[Qq, x], r = Expon[Rr, x]}, S
imp[Coeff[Pp, x, p]*x^(p - q - r + 1)*Qq^(m + 1)*(Rr^(n + 1)/((p + m*q + n*r + 1)*Coeff[Qq, x, q]*Coeff[Rr, x,
 r])), x] /; NeQ[p + m*q + n*r + 1, 0] && EqQ[(p + m*q + n*r + 1)*Coeff[Qq, x, q]*Coeff[Rr, x, r]*Pp, Coeff[Pp
, x, p]*x^(p - q - r)*((p - q - r + 1)*Qq*Rr + (m + 1)*x*Rr*D[Qq, x] + (n + 1)*x*Qq*D[Rr, x])]] /; FreeQ[{m, n
}, x] && PolyQ[Pp, x] && PolyQ[Qq, x] && PolyQ[Rr, x] && NeQ[m, -1] && NeQ[n, -1]

Rule 2208

Int[((b_.)*(F_)^((g_.)*((e_.) + (f_.)*(x_))))^(n_.)*((c_.) + (d_.)*(x_))^(m_), x_Symbol] :> Simp[(c + d*x)^(m
+ 1)*((b*F^(g*(e + f*x)))^n/(d*(m + 1))), x] - Dist[f*g*n*(Log[F]/(d*(m + 1))), Int[(c + d*x)^(m + 1)*(b*F^(g*
(e + f*x)))^n, x], x] /; FreeQ[{F, b, c, d, e, f, g, n}, x] && LtQ[m, -1] && IntegerQ[2*m] &&  !TrueQ[$UseGamm
a]

Rule 2209

Int[(F_)^((g_.)*((e_.) + (f_.)*(x_)))/((c_.) + (d_.)*(x_)), x_Symbol] :> Simp[(F^(g*(e - c*(f/d)))/d)*ExpInteg
ralEi[f*g*(c + d*x)*(Log[F]/d)], x] /; FreeQ[{F, c, d, e, f, g}, x] &&  !TrueQ[$UseGamma]

Rule 6820

Int[u_, x_Symbol] :> With[{v = SimplifyIntegrand[u, x]}, Int[v, x] /; SimplerIntegrandQ[v, u, x]]

Rule 6860

Int[(u_)/((a_.) + (b_.)*(x_)^(n_.) + (c_.)*(x_)^(n2_.)), x_Symbol] :> With[{v = RationalFunctionExpand[u/(a +
b*x^n + c*x^(2*n)), x]}, Int[v, x] /; SumQ[v]] /; FreeQ[{a, b, c}, x] && EqQ[n2, 2*n] && IGtQ[n, 0]

Rule 6874

Int[u_, x_Symbol] :> With[{v = ExpandIntegrand[u, x]}, Int[v, x] /; SumQ[v]]

Rubi steps \begin{align*} \text {integral}& = \int \frac {3-6 x+9 x^2+e^{2+2 x} (-1+x)^2 (-1+2 x)}{x^2 \left (1-x+x^2\right )^2} \, dx \\ & = \int \left (\frac {e^{2+2 x} (-1+x)^2 (-1+2 x)}{x^2 \left (1-x+x^2\right )^2}+\frac {3 \left (1-2 x+3 x^2\right )}{x^2 \left (1-x+x^2\right )^2}\right ) \, dx \\ & = 3 \int \frac {1-2 x+3 x^2}{x^2 \left (1-x+x^2\right )^2} \, dx+\int \frac {e^{2+2 x} (-1+x)^2 (-1+2 x)}{x^2 \left (1-x+x^2\right )^2} \, dx \\ & = -\frac {3}{x \left (1-x+x^2\right )}+\int \left (-\frac {e^{2+2 x}}{x^2}+\frac {2 e^{2+2 x}}{x}+\frac {e^{2+2 x} (-1-x)}{\left (1-x+x^2\right )^2}+\frac {e^{2+2 x} (3-2 x)}{1-x+x^2}\right ) \, dx \\ & = -\frac {3}{x \left (1-x+x^2\right )}+2 \int \frac {e^{2+2 x}}{x} \, dx-\int \frac {e^{2+2 x}}{x^2} \, dx+\int \frac {e^{2+2 x} (-1-x)}{\left (1-x+x^2\right )^2} \, dx+\int \frac {e^{2+2 x} (3-2 x)}{1-x+x^2} \, dx \\ & = \frac {e^{2+2 x}}{x}-\frac {3}{x \left (1-x+x^2\right )}+2 e^2 \text {Ei}(2 x)-2 \int \frac {e^{2+2 x}}{x} \, dx+\int \left (\frac {\left (-2-\frac {4 i}{\sqrt {3}}\right ) e^{2+2 x}}{-1-i \sqrt {3}+2 x}+\frac {\left (-2+\frac {4 i}{\sqrt {3}}\right ) e^{2+2 x}}{-1+i \sqrt {3}+2 x}\right ) \, dx+\int \left (-\frac {e^{2+2 x}}{\left (1-x+x^2\right )^2}-\frac {e^{2+2 x} x}{\left (1-x+x^2\right )^2}\right ) \, dx \\ & = \frac {e^{2+2 x}}{x}-\frac {3}{x \left (1-x+x^2\right )}-\frac {1}{3} \left (2 \left (3-2 i \sqrt {3}\right )\right ) \int \frac {e^{2+2 x}}{-1+i \sqrt {3}+2 x} \, dx-\frac {1}{3} \left (2 \left (3+2 i \sqrt {3}\right )\right ) \int \frac {e^{2+2 x}}{-1-i \sqrt {3}+2 x} \, dx-\int \frac {e^{2+2 x}}{\left (1-x+x^2\right )^2} \, dx-\int \frac {e^{2+2 x} x}{\left (1-x+x^2\right )^2} \, dx \\ & = \frac {e^{2+2 x}}{x}-\frac {3}{x \left (1-x+x^2\right )}-\frac {1}{3} \left (3+2 i \sqrt {3}\right ) e^{3+i \sqrt {3}} \text {Ei}\left (-1-i \sqrt {3}+2 x\right )-\frac {1}{3} \left (3-2 i \sqrt {3}\right ) e^{3-i \sqrt {3}} \text {Ei}\left (-1+i \sqrt {3}+2 x\right )-\int \left (-\frac {2 \left (1+i \sqrt {3}\right ) e^{2+2 x}}{3 \left (1+i \sqrt {3}-2 x\right )^2}+\frac {2 i e^{2+2 x}}{3 \sqrt {3} \left (1+i \sqrt {3}-2 x\right )}-\frac {2 \left (1-i \sqrt {3}\right ) e^{2+2 x}}{3 \left (-1+i \sqrt {3}+2 x\right )^2}+\frac {2 i e^{2+2 x}}{3 \sqrt {3} \left (-1+i \sqrt {3}+2 x\right )}\right ) \, dx-\int \left (-\frac {4 e^{2+2 x}}{3 \left (1+i \sqrt {3}-2 x\right )^2}+\frac {4 i e^{2+2 x}}{3 \sqrt {3} \left (1+i \sqrt {3}-2 x\right )}-\frac {4 e^{2+2 x}}{3 \left (-1+i \sqrt {3}+2 x\right )^2}+\frac {4 i e^{2+2 x}}{3 \sqrt {3} \left (-1+i \sqrt {3}+2 x\right )}\right ) \, dx \\ & = \frac {e^{2+2 x}}{x}-\frac {3}{x \left (1-x+x^2\right )}-\frac {1}{3} \left (3+2 i \sqrt {3}\right ) e^{3+i \sqrt {3}} \text {Ei}\left (-1-i \sqrt {3}+2 x\right )-\frac {1}{3} \left (3-2 i \sqrt {3}\right ) e^{3-i \sqrt {3}} \text {Ei}\left (-1+i \sqrt {3}+2 x\right )+\frac {4}{3} \int \frac {e^{2+2 x}}{\left (1+i \sqrt {3}-2 x\right )^2} \, dx+\frac {4}{3} \int \frac {e^{2+2 x}}{\left (-1+i \sqrt {3}+2 x\right )^2} \, dx-\frac {(2 i) \int \frac {e^{2+2 x}}{1+i \sqrt {3}-2 x} \, dx}{3 \sqrt {3}}-\frac {(2 i) \int \frac {e^{2+2 x}}{-1+i \sqrt {3}+2 x} \, dx}{3 \sqrt {3}}-\frac {(4 i) \int \frac {e^{2+2 x}}{1+i \sqrt {3}-2 x} \, dx}{3 \sqrt {3}}-\frac {(4 i) \int \frac {e^{2+2 x}}{-1+i \sqrt {3}+2 x} \, dx}{3 \sqrt {3}}+\frac {1}{3} \left (2 \left (1-i \sqrt {3}\right )\right ) \int \frac {e^{2+2 x}}{\left (-1+i \sqrt {3}+2 x\right )^2} \, dx+\frac {1}{3} \left (2 \left (1+i \sqrt {3}\right )\right ) \int \frac {e^{2+2 x}}{\left (1+i \sqrt {3}-2 x\right )^2} \, dx \\ & = \frac {2 e^{2+2 x}}{3 \left (1-i \sqrt {3}-2 x\right )}+\frac {\left (1-i \sqrt {3}\right ) e^{2+2 x}}{3 \left (1-i \sqrt {3}-2 x\right )}+\frac {2 e^{2+2 x}}{3 \left (1+i \sqrt {3}-2 x\right )}+\frac {\left (1+i \sqrt {3}\right ) e^{2+2 x}}{3 \left (1+i \sqrt {3}-2 x\right )}+\frac {e^{2+2 x}}{x}-\frac {3}{x \left (1-x+x^2\right )}+\frac {i e^{3+i \sqrt {3}} \text {Ei}\left (-1-i \sqrt {3}+2 x\right )}{\sqrt {3}}-\frac {1}{3} \left (3+2 i \sqrt {3}\right ) e^{3+i \sqrt {3}} \text {Ei}\left (-1-i \sqrt {3}+2 x\right )-\frac {i e^{3-i \sqrt {3}} \text {Ei}\left (-1+i \sqrt {3}+2 x\right )}{\sqrt {3}}-\frac {1}{3} \left (3-2 i \sqrt {3}\right ) e^{3-i \sqrt {3}} \text {Ei}\left (-1+i \sqrt {3}+2 x\right )-\frac {4}{3} \int \frac {e^{2+2 x}}{1+i \sqrt {3}-2 x} \, dx+\frac {4}{3} \int \frac {e^{2+2 x}}{-1+i \sqrt {3}+2 x} \, dx+\frac {1}{3} \left (2 \left (1-i \sqrt {3}\right )\right ) \int \frac {e^{2+2 x}}{-1+i \sqrt {3}+2 x} \, dx-\frac {1}{3} \left (2 \left (1+i \sqrt {3}\right )\right ) \int \frac {e^{2+2 x}}{1+i \sqrt {3}-2 x} \, dx \\ & = \frac {2 e^{2+2 x}}{3 \left (1-i \sqrt {3}-2 x\right )}+\frac {\left (1-i \sqrt {3}\right ) e^{2+2 x}}{3 \left (1-i \sqrt {3}-2 x\right )}+\frac {2 e^{2+2 x}}{3 \left (1+i \sqrt {3}-2 x\right )}+\frac {\left (1+i \sqrt {3}\right ) e^{2+2 x}}{3 \left (1+i \sqrt {3}-2 x\right )}+\frac {e^{2+2 x}}{x}-\frac {3}{x \left (1-x+x^2\right )}+\frac {2}{3} e^{3+i \sqrt {3}} \text {Ei}\left (-1-i \sqrt {3}+2 x\right )+\frac {i e^{3+i \sqrt {3}} \text {Ei}\left (-1-i \sqrt {3}+2 x\right )}{\sqrt {3}}+\frac {1}{3} \left (1+i \sqrt {3}\right ) e^{3+i \sqrt {3}} \text {Ei}\left (-1-i \sqrt {3}+2 x\right )-\frac {1}{3} \left (3+2 i \sqrt {3}\right ) e^{3+i \sqrt {3}} \text {Ei}\left (-1-i \sqrt {3}+2 x\right )+\frac {2}{3} e^{3-i \sqrt {3}} \text {Ei}\left (-1+i \sqrt {3}+2 x\right )-\frac {i e^{3-i \sqrt {3}} \text {Ei}\left (-1+i \sqrt {3}+2 x\right )}{\sqrt {3}}+\frac {1}{3} \left (1-i \sqrt {3}\right ) e^{3-i \sqrt {3}} \text {Ei}\left (-1+i \sqrt {3}+2 x\right )-\frac {1}{3} \left (3-2 i \sqrt {3}\right ) e^{3-i \sqrt {3}} \text {Ei}\left (-1+i \sqrt {3}+2 x\right ) \\ \end{align*}

Mathematica [A] (verified)

Time = 1.45 (sec) , antiderivative size = 23, normalized size of antiderivative = 1.00 \[ \int \frac {3-6 x+9 x^2+e^{2+2 x} \left (-1+4 x-5 x^2+2 x^3\right )}{x^2-2 x^3+3 x^4-2 x^5+x^6} \, dx=\frac {-3+e^{2+2 x}}{x \left (1-x+x^2\right )} \]

[In]

Integrate[(3 - 6*x + 9*x^2 + E^(2 + 2*x)*(-1 + 4*x - 5*x^2 + 2*x^3))/(x^2 - 2*x^3 + 3*x^4 - 2*x^5 + x^6),x]

[Out]

(-3 + E^(2 + 2*x))/(x*(1 - x + x^2))

Maple [A] (verified)

Time = 0.22 (sec) , antiderivative size = 23, normalized size of antiderivative = 1.00

method result size
norman \(\frac {-3+{\mathrm e}^{2+2 x}}{x \left (x^{2}-x +1\right )}\) \(23\)
parallelrisch \(\frac {-3+{\mathrm e}^{2+2 x}}{x \left (x^{2}-x +1\right )}\) \(23\)
risch \(-\frac {3}{x \left (x^{2}-x +1\right )}+\frac {{\mathrm e}^{2+2 x}}{x \left (x^{2}-x +1\right )}\) \(37\)
parts \(\frac {4 \,{\mathrm e}^{2+2 x} \left (4 \left (1+x \right )^{2}-1-13 x \right )}{\left (\left (1+x \right )^{2}-3 x \right ) x}-\frac {20 \,{\mathrm e}^{2+2 x} \left (\left (1+x \right )^{2}-4 x \right )}{\left (\left (1+x \right )^{2}-3 x \right ) x}-\frac {11 \,{\mathrm e}^{2+2 x} \left (-1+2 x \right )}{\left (\left (1+x \right )^{2}-3 x \right ) x}+\frac {2 \,{\mathrm e}^{2+2 x} \left (1+x \right ) \left (-1+2 x \right )}{\left (\left (1+x \right )^{2}-3 x \right ) x}-\frac {3}{x}-\frac {3 \left (1-x \right )}{x^{2}-x +1}\) \(146\)
derivativedivides \(-\frac {3}{x}-\frac {18 \left (-\frac {2}{3}+\frac {x}{3}\right )}{\left (1+x \right )^{2}-3 x}-\frac {24}{\left (1+x \right )^{2}-3 x}+\frac {9 x +9}{\left (1+x \right )^{2}-3 x}+\frac {4 \,{\mathrm e}^{2+2 x} \left (4 \left (1+x \right )^{2}-1-13 x \right )}{\left (1+x \right )^{3}-4 \left (1+x \right )^{2}+3+6 x}-\frac {20 \,{\mathrm e}^{2+2 x} \left (\left (1+x \right )^{2}-4 x \right )}{\left (1+x \right )^{3}-4 \left (1+x \right )^{2}+3+6 x}-\frac {11 \,{\mathrm e}^{2+2 x} \left (-1+2 x \right )}{\left (1+x \right )^{3}-4 \left (1+x \right )^{2}+3+6 x}+\frac {2 \,{\mathrm e}^{2+2 x} \left (1+x \right ) \left (-1+2 x \right )}{\left (1+x \right )^{3}-4 \left (1+x \right )^{2}+3+6 x}\) \(196\)
default \(-\frac {3}{x}-\frac {18 \left (-\frac {2}{3}+\frac {x}{3}\right )}{\left (1+x \right )^{2}-3 x}-\frac {24}{\left (1+x \right )^{2}-3 x}+\frac {9 x +9}{\left (1+x \right )^{2}-3 x}+\frac {4 \,{\mathrm e}^{2+2 x} \left (4 \left (1+x \right )^{2}-1-13 x \right )}{\left (1+x \right )^{3}-4 \left (1+x \right )^{2}+3+6 x}-\frac {20 \,{\mathrm e}^{2+2 x} \left (\left (1+x \right )^{2}-4 x \right )}{\left (1+x \right )^{3}-4 \left (1+x \right )^{2}+3+6 x}-\frac {11 \,{\mathrm e}^{2+2 x} \left (-1+2 x \right )}{\left (1+x \right )^{3}-4 \left (1+x \right )^{2}+3+6 x}+\frac {2 \,{\mathrm e}^{2+2 x} \left (1+x \right ) \left (-1+2 x \right )}{\left (1+x \right )^{3}-4 \left (1+x \right )^{2}+3+6 x}\) \(196\)

[In]

int(((2*x^3-5*x^2+4*x-1)*exp(1+x)^2+9*x^2-6*x+3)/(x^6-2*x^5+3*x^4-2*x^3+x^2),x,method=_RETURNVERBOSE)

[Out]

1/x/(x^2-x+1)*(exp(1+x)^2-3)

Fricas [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 21, normalized size of antiderivative = 0.91 \[ \int \frac {3-6 x+9 x^2+e^{2+2 x} \left (-1+4 x-5 x^2+2 x^3\right )}{x^2-2 x^3+3 x^4-2 x^5+x^6} \, dx=\frac {e^{\left (2 \, x + 2\right )} - 3}{x^{3} - x^{2} + x} \]

[In]

integrate(((2*x^3-5*x^2+4*x-1)*exp(1+x)^2+9*x^2-6*x+3)/(x^6-2*x^5+3*x^4-2*x^3+x^2),x, algorithm="fricas")

[Out]

(e^(2*x + 2) - 3)/(x^3 - x^2 + x)

Sympy [A] (verification not implemented)

Time = 0.08 (sec) , antiderivative size = 24, normalized size of antiderivative = 1.04 \[ \int \frac {3-6 x+9 x^2+e^{2+2 x} \left (-1+4 x-5 x^2+2 x^3\right )}{x^2-2 x^3+3 x^4-2 x^5+x^6} \, dx=\frac {e^{2 x + 2}}{x^{3} - x^{2} + x} - \frac {3}{x^{3} - x^{2} + x} \]

[In]

integrate(((2*x**3-5*x**2+4*x-1)*exp(1+x)**2+9*x**2-6*x+3)/(x**6-2*x**5+3*x**4-2*x**3+x**2),x)

[Out]

exp(2*x + 2)/(x**3 - x**2 + x) - 3/(x**3 - x**2 + x)

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 76 vs. \(2 (22) = 44\).

Time = 0.32 (sec) , antiderivative size = 76, normalized size of antiderivative = 3.30 \[ \int \frac {3-6 x+9 x^2+e^{2+2 x} \left (-1+4 x-5 x^2+2 x^3\right )}{x^2-2 x^3+3 x^4-2 x^5+x^6} \, dx=-\frac {4 \, x^{2} - 5 \, x + 3}{x^{3} - x^{2} + x} + \frac {3 \, {\left (2 \, x - 1\right )}}{x^{2} - x + 1} - \frac {2 \, {\left (x + 1\right )}}{x^{2} - x + 1} + \frac {e^{\left (2 \, x + 2\right )}}{x^{3} - x^{2} + x} \]

[In]

integrate(((2*x^3-5*x^2+4*x-1)*exp(1+x)^2+9*x^2-6*x+3)/(x^6-2*x^5+3*x^4-2*x^3+x^2),x, algorithm="maxima")

[Out]

-(4*x^2 - 5*x + 3)/(x^3 - x^2 + x) + 3*(2*x - 1)/(x^2 - x + 1) - 2*(x + 1)/(x^2 - x + 1) + e^(2*x + 2)/(x^3 -
x^2 + x)

Giac [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 21, normalized size of antiderivative = 0.91 \[ \int \frac {3-6 x+9 x^2+e^{2+2 x} \left (-1+4 x-5 x^2+2 x^3\right )}{x^2-2 x^3+3 x^4-2 x^5+x^6} \, dx=\frac {e^{\left (2 \, x + 2\right )} - 3}{x^{3} - x^{2} + x} \]

[In]

integrate(((2*x^3-5*x^2+4*x-1)*exp(1+x)^2+9*x^2-6*x+3)/(x^6-2*x^5+3*x^4-2*x^3+x^2),x, algorithm="giac")

[Out]

(e^(2*x + 2) - 3)/(x^3 - x^2 + x)

Mupad [B] (verification not implemented)

Time = 0.16 (sec) , antiderivative size = 22, normalized size of antiderivative = 0.96 \[ \int \frac {3-6 x+9 x^2+e^{2+2 x} \left (-1+4 x-5 x^2+2 x^3\right )}{x^2-2 x^3+3 x^4-2 x^5+x^6} \, dx=\frac {{\mathrm {e}}^{2\,x+2}-3}{x\,\left (x^2-x+1\right )} \]

[In]

int((exp(2*x + 2)*(4*x - 5*x^2 + 2*x^3 - 1) - 6*x + 9*x^2 + 3)/(x^2 - 2*x^3 + 3*x^4 - 2*x^5 + x^6),x)

[Out]

(exp(2*x + 2) - 3)/(x*(x^2 - x + 1))