\(\int \frac {e^{-\frac {x^2}{-1+x}} (2+16 x-4 x^2-2 x^3+e^4 (4 x-2 x^2))}{1-2 x+x^2} \, dx\) [9067]

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

Optimal result

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

[Out]

2*(exp(4)+x+5)/exp(x-x/(1-x))

Rubi [F]

\[ \int \frac {e^{-\frac {x^2}{-1+x}} \left (2+16 x-4 x^2-2 x^3+e^4 \left (4 x-2 x^2\right )\right )}{1-2 x+x^2} \, dx=\int \frac {e^{-\frac {x^2}{-1+x}} \left (2+16 x-4 x^2-2 x^3+e^4 \left (4 x-2 x^2\right )\right )}{1-2 x+x^2} \, dx \]

[In]

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

[Out]

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

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

Mathematica [A] (verified)

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

[In]

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

[Out]

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

Maple [A] (verified)

Time = 0.72 (sec) , antiderivative size = 20, normalized size of antiderivative = 0.87

method result size
gosper \(2 \left ({\mathrm e}^{4}+x +5\right ) {\mathrm e}^{-\frac {x^{2}}{-1+x}}\) \(20\)
risch \(\left (2 x +2 \,{\mathrm e}^{4}+10\right ) {\mathrm e}^{-\frac {x^{2}}{-1+x}}\) \(22\)
norman \(\frac {\left (\left (2 \,{\mathrm e}^{4}+8\right ) x +2 x^{2}-10-2 \,{\mathrm e}^{4}\right ) {\mathrm e}^{-\frac {x^{2}}{-1+x}}}{-1+x}\) \(38\)
parallelrisch \(\frac {\left (-10+2 x \,{\mathrm e}^{4}+2 x^{2}-2 \,{\mathrm e}^{4}+8 x \right ) {\mathrm e}^{-\frac {x^{2}}{-1+x}}}{-1+x}\) \(38\)

[In]

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

[Out]

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

Fricas [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 18, normalized size of antiderivative = 0.78 \[ \int \frac {e^{-\frac {x^2}{-1+x}} \left (2+16 x-4 x^2-2 x^3+e^4 \left (4 x-2 x^2\right )\right )}{1-2 x+x^2} \, dx=2 \, {\left (x + e^{4} + 5\right )} e^{\left (-\frac {x^{2}}{x - 1}\right )} \]

[In]

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

[Out]

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

Sympy [A] (verification not implemented)

Time = 0.13 (sec) , antiderivative size = 17, normalized size of antiderivative = 0.74 \[ \int \frac {e^{-\frac {x^2}{-1+x}} \left (2+16 x-4 x^2-2 x^3+e^4 \left (4 x-2 x^2\right )\right )}{1-2 x+x^2} \, dx=\left (2 x + 10 + 2 e^{4}\right ) e^{- \frac {x^{2}}{x - 1}} \]

[In]

integrate(((-2*x**2+4*x)*exp(4)-2*x**3-4*x**2+16*x+2)/(x**2-2*x+1)/exp(x**2/(-1+x)),x)

[Out]

(2*x + 10 + 2*exp(4))*exp(-x**2/(x - 1))

Maxima [A] (verification not implemented)

none

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

[In]

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

[Out]

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

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 43 vs. \(2 (20) = 40\).

Time = 0.28 (sec) , antiderivative size = 43, normalized size of antiderivative = 1.87 \[ \int \frac {e^{-\frac {x^2}{-1+x}} \left (2+16 x-4 x^2-2 x^3+e^4 \left (4 x-2 x^2\right )\right )}{1-2 x+x^2} \, dx=2 \, x e^{\left (-\frac {x^{2}}{x - 1}\right )} + 2 \, e^{\left (-\frac {x^{2}}{x - 1} + 4\right )} + 10 \, e^{\left (-\frac {x^{2}}{x - 1}\right )} \]

[In]

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

[Out]

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

Mupad [B] (verification not implemented)

Time = 12.79 (sec) , antiderivative size = 18, normalized size of antiderivative = 0.78 \[ \int \frac {e^{-\frac {x^2}{-1+x}} \left (2+16 x-4 x^2-2 x^3+e^4 \left (4 x-2 x^2\right )\right )}{1-2 x+x^2} \, dx=2\,{\mathrm {e}}^{-\frac {x^2}{x-1}}\,\left (x+{\mathrm {e}}^4+5\right ) \]

[In]

int((exp(-x^2/(x - 1))*(16*x + exp(4)*(4*x - 2*x^2) - 4*x^2 - 2*x^3 + 2))/(x^2 - 2*x + 1),x)

[Out]

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