\(\int \frac {e^{-3+x-x^2} (-x+2 x^2+e^{3-x+x^2} x^2-4 x^3+e^3 (4-4 x+8 x^2)+(-x^2+2 x^3) \log (x))}{x^2} \, dx\) [2599]

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

Optimal result

Integrand size = 70, antiderivative size = 31 \[ \int \frac {e^{-3+x-x^2} \left (-x+2 x^2+e^{3-x+x^2} x^2-4 x^3+e^3 \left (4-4 x+8 x^2\right )+\left (-x^2+2 x^3\right ) \log (x)\right )}{x^2} \, dx=2+x-\frac {e^{x-x^2} \left (4-\frac {x (2-\log (x))}{e^3}\right )}{x} \]

[Out]

x+2-(4-(-ln(x)+2)/exp(3)*x)/x/exp(x^2-x)

Rubi [F]

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

[In]

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

[Out]

2*E^(-3 + x - x^2) - (4*E^(x - x^2))/x + x + (Sqrt[Pi]*Erf[(1 - 2*x)/2])/E^(11/4) + 4*E^(1/4)*Sqrt[Pi]*Erf[(1
- 2*x)/2] - ((1 + 4*E^3)*Sqrt[Pi]*Erf[(1 - 2*x)/2])/E^(11/4) - E^(-3 + x - x^2)*Log[x] + Defer[Int][E^(-3 + x
- x^2)/x, x] - (1 + 4*E^3)*Defer[Int][E^(-3 + x - x^2)/x, x] + 4*Defer[Int][E^(x - x^2)/x, x]

Rubi steps \begin{align*} \text {integral}& = \int \left (1+\frac {e^{-3+x-x^2} \left (4 e^3-\left (1+4 e^3\right ) x+2 \left (1+4 e^3\right ) x^2-4 x^3-x^2 \log (x)+2 x^3 \log (x)\right )}{x^2}\right ) \, dx \\ & = x+\int \frac {e^{-3+x-x^2} \left (4 e^3-\left (1+4 e^3\right ) x+2 \left (1+4 e^3\right ) x^2-4 x^3-x^2 \log (x)+2 x^3 \log (x)\right )}{x^2} \, dx \\ & = x+\int \left (\frac {e^{-3+x-x^2} \left (4 e^3-\left (1+4 e^3\right ) x+2 \left (1+4 e^3\right ) x^2-4 x^3\right )}{x^2}+e^{-3+x-x^2} (-1+2 x) \log (x)\right ) \, dx \\ & = x+\int \frac {e^{-3+x-x^2} \left (4 e^3-\left (1+4 e^3\right ) x+2 \left (1+4 e^3\right ) x^2-4 x^3\right )}{x^2} \, dx+\int e^{-3+x-x^2} (-1+2 x) \log (x) \, dx \\ & = x-e^{-3+x-x^2} \log (x)+\int \frac {e^{-3+x-x^2}}{x} \, dx+\int \left (2 e^{-3+x-x^2} \left (1+4 e^3\right )+\frac {4 e^{x-x^2}}{x^2}+\frac {e^{-3+x-x^2} \left (-1-4 e^3\right )}{x}-4 e^{-3+x-x^2} x\right ) \, dx \\ & = x-e^{-3+x-x^2} \log (x)+4 \int \frac {e^{x-x^2}}{x^2} \, dx-4 \int e^{-3+x-x^2} x \, dx+\left (-1-4 e^3\right ) \int \frac {e^{-3+x-x^2}}{x} \, dx+\left (2 \left (1+4 e^3\right )\right ) \int e^{-3+x-x^2} \, dx+\int \frac {e^{-3+x-x^2}}{x} \, dx \\ & = 2 e^{-3+x-x^2}-\frac {4 e^{x-x^2}}{x}+x-e^{-3+x-x^2} \log (x)-2 \int e^{-3+x-x^2} \, dx+4 \int \frac {e^{x-x^2}}{x} \, dx-8 \int e^{x-x^2} \, dx+\left (-1-4 e^3\right ) \int \frac {e^{-3+x-x^2}}{x} \, dx+\frac {\left (2 \left (1+4 e^3\right )\right ) \int e^{-\frac {1}{4} (1-2 x)^2} \, dx}{e^{11/4}}+\int \frac {e^{-3+x-x^2}}{x} \, dx \\ & = 2 e^{-3+x-x^2}-\frac {4 e^{x-x^2}}{x}+x-\frac {\left (1+4 e^3\right ) \sqrt {\pi } \text {erf}\left (\frac {1}{2} (1-2 x)\right )}{e^{11/4}}-e^{-3+x-x^2} \log (x)+4 \int \frac {e^{x-x^2}}{x} \, dx-\frac {2 \int e^{-\frac {1}{4} (1-2 x)^2} \, dx}{e^{11/4}}-\left (8 \sqrt [4]{e}\right ) \int e^{-\frac {1}{4} (1-2 x)^2} \, dx+\left (-1-4 e^3\right ) \int \frac {e^{-3+x-x^2}}{x} \, dx+\int \frac {e^{-3+x-x^2}}{x} \, dx \\ & = 2 e^{-3+x-x^2}-\frac {4 e^{x-x^2}}{x}+x+\frac {\sqrt {\pi } \text {erf}\left (\frac {1}{2} (1-2 x)\right )}{e^{11/4}}+4 \sqrt [4]{e} \sqrt {\pi } \text {erf}\left (\frac {1}{2} (1-2 x)\right )-\frac {\left (1+4 e^3\right ) \sqrt {\pi } \text {erf}\left (\frac {1}{2} (1-2 x)\right )}{e^{11/4}}-e^{-3+x-x^2} \log (x)+4 \int \frac {e^{x-x^2}}{x} \, dx+\left (-1-4 e^3\right ) \int \frac {e^{-3+x-x^2}}{x} \, dx+\int \frac {e^{-3+x-x^2}}{x} \, dx \\ \end{align*}

Mathematica [A] (verified)

Time = 0.92 (sec) , antiderivative size = 42, normalized size of antiderivative = 1.35 \[ \int \frac {e^{-3+x-x^2} \left (-x+2 x^2+e^{3-x+x^2} x^2-4 x^3+e^3 \left (4-4 x+8 x^2\right )+\left (-x^2+2 x^3\right ) \log (x)\right )}{x^2} \, dx=2 e^{-3+x-x^2}-\frac {4 e^{x-x^2}}{x}+x-e^{-3+x-x^2} \log (x) \]

[In]

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

[Out]

2*E^(-3 + x - x^2) - (4*E^(x - x^2))/x + x - E^(-3 + x - x^2)*Log[x]

Maple [A] (verified)

Time = 0.32 (sec) , antiderivative size = 35, normalized size of antiderivative = 1.13

method result size
parts \(x +\frac {\left (-4+2 \,{\mathrm e}^{-3} x -x \,{\mathrm e}^{-3} \ln \left (x \right )\right ) {\mathrm e}^{-x^{2}+x}}{x}\) \(35\)
default \({\mathrm e}^{-3} \left (\frac {\left (2 x -x \ln \left (x \right )-4 \,{\mathrm e}^{3}\right ) {\mathrm e}^{-x^{2}+x}}{x}+x \,{\mathrm e}^{3}\right )\) \(38\)
norman \(\frac {\left (-4+x^{2} {\mathrm e}^{x^{2}-x}+2 \,{\mathrm e}^{-3} x -x \,{\mathrm e}^{-3} \ln \left (x \right )\right ) {\mathrm e}^{-x^{2}+x}}{x}\) \(45\)
parallelrisch \(\frac {{\mathrm e}^{-3} \left (x^{2} {\mathrm e}^{3} {\mathrm e}^{x^{2}-x}-x \ln \left (x \right )-4 \,{\mathrm e}^{3}+2 x \right ) {\mathrm e}^{-x^{2}+x}}{x}\) \(46\)
risch \(-\ln \left (x \right ) {\mathrm e}^{-x^{2}+x -3}+\frac {\left (x^{2} {\mathrm e}^{x^{2}-x +3}-4 \,{\mathrm e}^{3}+2 x \right ) {\mathrm e}^{-x^{2}+x -3}}{x}\) \(49\)

[In]

int(((2*x^3-x^2)*ln(x)+x^2*exp(3)*exp(x^2-x)+(8*x^2-4*x+4)*exp(3)-4*x^3+2*x^2-x)/x^2/exp(3)/exp(x^2-x),x,metho
d=_RETURNVERBOSE)

[Out]

x+(-4+2*x/exp(3)-x/exp(3)*ln(x))/x/exp(x^2-x)

Fricas [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 39, normalized size of antiderivative = 1.26 \[ \int \frac {e^{-3+x-x^2} \left (-x+2 x^2+e^{3-x+x^2} x^2-4 x^3+e^3 \left (4-4 x+8 x^2\right )+\left (-x^2+2 x^3\right ) \log (x)\right )}{x^2} \, dx=\frac {{\left (x^{2} e^{\left (x^{2} - x + 3\right )} - x \log \left (x\right ) + 2 \, x - 4 \, e^{3}\right )} e^{\left (-x^{2} + x - 3\right )}}{x} \]

[In]

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

[Out]

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

Sympy [A] (verification not implemented)

Time = 0.12 (sec) , antiderivative size = 26, normalized size of antiderivative = 0.84 \[ \int \frac {e^{-3+x-x^2} \left (-x+2 x^2+e^{3-x+x^2} x^2-4 x^3+e^3 \left (4-4 x+8 x^2\right )+\left (-x^2+2 x^3\right ) \log (x)\right )}{x^2} \, dx=x + \frac {\left (- x \log {\left (x \right )} + 2 x - 4 e^{3}\right ) e^{- x^{2} + x}}{x e^{3}} \]

[In]

integrate(((2*x**3-x**2)*ln(x)+x**2*exp(3)*exp(x**2-x)+(8*x**2-4*x+4)*exp(3)-4*x**3+2*x**2-x)/x**2/exp(3)/exp(
x**2-x),x)

[Out]

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

Maxima [F]

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

[In]

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

[Out]

sqrt(pi)*erf(x - 1/2)*e^(-11/4) + x + integrate(-(4*x^3 - 8*x^2*e^3 + x*(4*e^3 + 1) - (2*x^3 - x^2)*log(x) - 4
*e^3)*e^(-x^2 + x - 3)/x^2, x)

Giac [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 48, normalized size of antiderivative = 1.55 \[ \int \frac {e^{-3+x-x^2} \left (-x+2 x^2+e^{3-x+x^2} x^2-4 x^3+e^3 \left (4-4 x+8 x^2\right )+\left (-x^2+2 x^3\right ) \log (x)\right )}{x^2} \, dx=\frac {{\left (x^{2} e^{3} - x e^{\left (-x^{2} + x\right )} \log \left (x\right ) + 2 \, x e^{\left (-x^{2} + x\right )} - 4 \, e^{\left (-x^{2} + x + 3\right )}\right )} e^{\left (-3\right )}}{x} \]

[In]

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

[Out]

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

Mupad [B] (verification not implemented)

Time = 8.39 (sec) , antiderivative size = 41, normalized size of antiderivative = 1.32 \[ \int \frac {e^{-3+x-x^2} \left (-x+2 x^2+e^{3-x+x^2} x^2-4 x^3+e^3 \left (4-4 x+8 x^2\right )+\left (-x^2+2 x^3\right ) \log (x)\right )}{x^2} \, dx=x+2\,{\mathrm {e}}^{-3}\,{\mathrm {e}}^{-x^2}\,{\mathrm {e}}^x-\frac {4\,{\mathrm {e}}^{-x^2}\,{\mathrm {e}}^x}{x}-{\mathrm {e}}^{-3}\,{\mathrm {e}}^{-x^2}\,{\mathrm {e}}^x\,\ln \left (x\right ) \]

[In]

int(-(exp(-3)*exp(x - x^2)*(x - exp(3)*(8*x^2 - 4*x + 4) + log(x)*(x^2 - 2*x^3) - 2*x^2 + 4*x^3 - x^2*exp(3)*e
xp(x^2 - x)))/x^2,x)

[Out]

x + 2*exp(-3)*exp(-x^2)*exp(x) - (4*exp(-x^2)*exp(x))/x - exp(-3)*exp(-x^2)*exp(x)*log(x)