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

Optimal. Leaf size=29 \[ \frac {x}{2}-\left (e+\frac {e^{e^{x (-x+\log (x))}}}{x}+x\right )^2 \]

[Out]

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

________________________________________________________________________________________

Rubi [F]
time = 2.44, antiderivative size = 0, normalized size of antiderivative = 0.00, number of steps used = 0, number of rules used = 0, integrand size = 0, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.000, Rules used = {} \begin {gather*} \int \frac {x^3-4 e x^3-4 x^4+e^{2 e^{-x^2+x \log (x)}} \left (4+e^{-x^2+x \log (x)} \left (-4 x+8 x^2-4 x \log (x)\right )\right )+e^{e^{-x^2+x \log (x)}} \left (4 e x+e^{-x^2+x \log (x)} \left (-4 x^3+8 x^4+e \left (-4 x^2+8 x^3\right )+\left (-4 e x^2-4 x^3\right ) \log (x)\right )\right )}{2 x^3} \, dx \end {gather*}

Verification is not applicable to the result.

[In]

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

[Out]

((1 - 4*E)*x)/2 - x^2 + 2*Defer[Int][E^((2*x^x)/E^x^2)/x^3, x] + 2*Defer[Int][E^(1 + x^x/E^x^2)/x^2, x] - 2*De
fer[Int][E^(-x^2 + (2*x^x)/E^x^2)*x^(-2 + x), x] - 2*Log[x]*Defer[Int][E^(-x^2 + (2*x^x)/E^x^2)*x^(-2 + x), x]
 - 2*Defer[Int][E^(1 - x^2 + x^x/E^x^2)*x^(-1 + x), x] - 2*Log[x]*Defer[Int][E^(1 - x^2 + x^x/E^x^2)*x^(-1 + x
), x] + 4*Defer[Int][E^(-x^2 + (2*x^x)/E^x^2)*x^(-1 + x), x] - 2*(1 - 2*E)*Defer[Int][E^(-x^2 + x^x/E^x^2)*x^x
, x] - 2*Log[x]*Defer[Int][E^(-x^2 + x^x/E^x^2)*x^x, x] + 4*Defer[Int][E^(-x^2 + x^x/E^x^2)*x^(1 + x), x] + 2*
Defer[Int][Defer[Int][E^(-x^2 + (2*x^x)/E^x^2)*x^(-2 + x), x]/x, x] + 2*Defer[Int][Defer[Int][E^(1 - x^2 + x^x
/E^x^2)*x^(-1 + x), x]/x, x] + 2*Defer[Int][Defer[Int][E^(-x^2 + x^x/E^x^2)*x^x, x]/x, x]

Rubi steps

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

________________________________________________________________________________________

Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(69\) vs. \(2(29)=58\).
time = 1.45, size = 69, normalized size = 2.38 \begin {gather*} \frac {1}{2} \left (-4 e^{e^{-x^2} x^x}-\frac {2 e^{2 e^{-x^2} x^x}}{x^2}-\frac {4 e^{1+e^{-x^2} x^x}}{x}+x-4 e x-2 x^2\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [A]
time = 0.20, size = 52, normalized size = 1.79

method result size
risch \(-2 x \,{\mathrm e}-x^{2}+\frac {x}{2}-\frac {{\mathrm e}^{2 x^{x} {\mathrm e}^{-x^{2}}}}{x^{2}}-\frac {2 \left (x +{\mathrm e}\right ) {\mathrm e}^{x^{x} {\mathrm e}^{-x^{2}}}}{x}\) \(52\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 56 vs. \(2 (27) = 54\).
time = 0.32, size = 56, normalized size = 1.93 \begin {gather*} -x^{2} - 2 \, x e + \frac {1}{2} \, x - \frac {2 \, {\left (x^{2} + x e\right )} e^{\left (e^{\left (-x^{2} + x \log \left (x\right )\right )}\right )} + e^{\left (2 \, e^{\left (-x^{2} + x \log \left (x\right )\right )}\right )}}{x^{2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-x^2 - 2*x*e + 1/2*x - (2*(x^2 + x*e)*e^(e^(-x^2 + x*log(x))) + e^(2*e^(-x^2 + x*log(x))))/x^2

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 61 vs. \(2 (27) = 54\).
time = 0.38, size = 61, normalized size = 2.10 \begin {gather*} -\frac {2 \, x^{4} + 4 \, x^{3} e - x^{3} + 4 \, {\left (x^{2} + x e\right )} e^{\left (e^{\left (-x^{2} + x \log \left (x\right )\right )}\right )} + 2 \, e^{\left (2 \, e^{\left (-x^{2} + x \log \left (x\right )\right )}\right )}}{2 \, x^{2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 58 vs. \(2 (20) = 40\).
time = 0.30, size = 58, normalized size = 2.00 \begin {gather*} - x^{2} + x \left (\frac {1}{2} - 2 e\right ) + \frac {- x e^{2 e^{- x^{2} + x \log {\left (x \right )}}} + \left (- 2 x^{3} - 2 e x^{2}\right ) e^{e^{- x^{2} + x \log {\left (x \right )}}}}{x^{3}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-x**2 + x*(1/2 - 2*E) + (-x*exp(2*exp(-x**2 + x*log(x))) + (-2*x**3 - 2*E*x**2)*exp(exp(-x**2 + x*log(x))))/x*
*3

________________________________________________________________________________________

Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

integrate(-1/2*(4*x^4 + 4*x^3*e - x^3 - 4*((2*x^2 - x*log(x) - x)*e^(-x^2 + x*log(x)) + 1)*e^(2*e^(-x^2 + x*lo
g(x))) - 4*(x*e + (2*x^4 - x^3 + (2*x^3 - x^2)*e - (x^3 + x^2*e)*log(x))*e^(-x^2 + x*log(x)))*e^(e^(-x^2 + x*l
og(x))))/x^3, x)

________________________________________________________________________________________

Mupad [B]
time = 1.39, size = 62, normalized size = 2.14 \begin {gather*} \frac {x}{2}-2\,{\mathrm {e}}^{x^x\,{\mathrm {e}}^{-x^2}}-2\,x\,\mathrm {e}-\frac {2\,{\mathrm {e}}^{x^x\,{\mathrm {e}}^{-x^2}+1}}{x}-x^2-\frac {{\mathrm {e}}^{2\,x^x\,{\mathrm {e}}^{-x^2}}}{x^2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________