3.16.88 \(\int \frac {e^{\frac {1}{2} (-x+2 x^2-x^3-e^x (1-2 x+x^2))} (-2+5 e^{\frac {1}{2} (x-2 x^2+x^3+e^x (1-2 x+x^2))}-x+4 x^2-3 x^3+e^x (x-x^3))}{x^2} \, dx\)

Optimal. Leaf size=34 \[ e^4-\frac {5}{x}-\frac {-2 e^{-\frac {1}{2} (-1+x)^2 \left (e^x+x\right )}+x}{x} \]

________________________________________________________________________________________

Rubi [B]  time = 19.51, antiderivative size = 82, normalized size of antiderivative = 2.41, number of steps used = 4, number of rules used = 3, integrand size = 93, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.032, Rules used = {6741, 6742, 2288} \begin {gather*} \frac {2 e^{-\frac {1}{2} (1-x)^2 \left (x+e^x\right )} \left (e^x x^3+3 x^3-4 x^2-e^x x+x\right )}{x^2 \left (\left (e^x+1\right ) (1-x)^2-2 (1-x) \left (x+e^x\right )\right )}-\frac {5}{x} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

Rule 2288

Int[(y_.)*(F_)^(u_)*((v_) + (w_)), x_Symbol] :> With[{z = (v*y)/(Log[F]*D[u, x])}, Simp[F^u*z, x] /; EqQ[D[z,
x], w*y]] /; FreeQ[F, x]

Rule 6741

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

Rule 6742

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

Rubi steps

\begin {gather*} \begin {aligned} \text {integral} &=\int \frac {e^{-\frac {1}{2} (-1+x)^2 \left (e^x+x\right )} \left (-2+5 e^{\frac {1}{2} \left (x-2 x^2+x^3+e^x \left (1-2 x+x^2\right )\right )}-x+4 x^2-3 x^3+e^x \left (x-x^3\right )\right )}{x^2} \, dx\\ &=\int \left (\frac {5}{x^2}-\frac {e^{-\frac {1}{2} (-1+x)^2 \left (e^x+x\right )} \left (2+x-e^x x-4 x^2+3 x^3+e^x x^3\right )}{x^2}\right ) \, dx\\ &=-\frac {5}{x}-\int \frac {e^{-\frac {1}{2} (-1+x)^2 \left (e^x+x\right )} \left (2+x-e^x x-4 x^2+3 x^3+e^x x^3\right )}{x^2} \, dx\\ &=-\frac {5}{x}+\frac {2 e^{-\frac {1}{2} (1-x)^2 \left (e^x+x\right )} \left (x-e^x x-4 x^2+3 x^3+e^x x^3\right )}{x^2 \left (\left (1+e^x\right ) (1-x)^2-2 (1-x) \left (e^x+x\right )\right )}\\ \end {aligned} \end {gather*}

________________________________________________________________________________________

Mathematica [A]  time = 0.22, size = 24, normalized size = 0.71 \begin {gather*} \frac {-5+2 e^{-\frac {1}{2} (-1+x)^2 \left (e^x+x\right )}}{x} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

fricas [B]  time = 0.78, size = 61, normalized size = 1.79 \begin {gather*} -\frac {{\left (5 \, e^{\left (\frac {1}{2} \, x^{3} - x^{2} + \frac {1}{2} \, {\left (x^{2} - 2 \, x + 1\right )} e^{x} + \frac {1}{2} \, x\right )} - 2\right )} e^{\left (-\frac {1}{2} \, x^{3} + x^{2} - \frac {1}{2} \, {\left (x^{2} - 2 \, x + 1\right )} e^{x} - \frac {1}{2} \, x\right )}}{x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

giac [F]  time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int -\frac {{\left (3 \, x^{3} - 4 \, x^{2} + {\left (x^{3} - x\right )} e^{x} + x - 5 \, e^{\left (\frac {1}{2} \, x^{3} - x^{2} + \frac {1}{2} \, {\left (x^{2} - 2 \, x + 1\right )} e^{x} + \frac {1}{2} \, x\right )} + 2\right )} e^{\left (-\frac {1}{2} \, x^{3} + x^{2} - \frac {1}{2} \, {\left (x^{2} - 2 \, x + 1\right )} e^{x} - \frac {1}{2} \, x\right )}}{x^{2}}\,{d x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maple [A]  time = 0.08, size = 24, normalized size = 0.71




method result size



risch \(-\frac {5}{x}+\frac {2 \,{\mathrm e}^{-\frac {\left (x -1\right )^{2} \left ({\mathrm e}^{x}+x \right )}{2}}}{x}\) \(24\)
norman \(\frac {\left (2-5 \,{\mathrm e}^{\frac {\left (x^{2}-2 x +1\right ) {\mathrm e}^{x}}{2}+\frac {x^{3}}{2}-x^{2}+\frac {x}{2}}\right ) {\mathrm e}^{-\frac {\left (x^{2}-2 x +1\right ) {\mathrm e}^{x}}{2}-\frac {x^{3}}{2}+x^{2}-\frac {x}{2}}}{x}\) \(65\)



Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maxima [F]  time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} -\frac {5}{x} - \int \frac {{\left ({\left (x^{3} - x\right )} e^{\left (x^{2} + x\right )} + {\left (3 \, x^{3} - 4 \, x^{2} + x + 2\right )} e^{\left (x^{2}\right )}\right )} e^{\left (-\frac {1}{2} \, x^{3} - \frac {1}{2} \, x^{2} e^{x} + x e^{x} - \frac {1}{2} \, x - \frac {1}{2} \, e^{x}\right )}}{x^{2}}\,{d x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

mupad [B]  time = 1.16, size = 39, normalized size = 1.15 \begin {gather*} \frac {2\,{\mathrm {e}}^{x\,{\mathrm {e}}^x-\frac {{\mathrm {e}}^x}{2}-\frac {x^2\,{\mathrm {e}}^x}{2}-\frac {x}{2}+x^2-\frac {x^3}{2}}}{x}-\frac {5}{x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

sympy [A]  time = 0.23, size = 32, normalized size = 0.94 \begin {gather*} \frac {2 e^{- \frac {x^{3}}{2} + x^{2} - \frac {x}{2} - \left (\frac {x^{2}}{2} - x + \frac {1}{2}\right ) e^{x}}}{x} - \frac {5}{x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________