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

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

Optimal result

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

[Out]

(x-2+exp(ln(5/2)+2))*(ln(x)-x)/exp(x)

Rubi [B] (verified)

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

Time = 0.35 (sec) , antiderivative size = 104, normalized size of antiderivative = 4.73, number of steps used = 16, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.105, Rules used = {6874, 2230, 2225, 2209, 2207, 2634} \[ \int \frac {e^{-x} \left (-2+3 x-4 x^2+x^3+\frac {5}{2} e^2 \left (1-x+x^2\right )+\left (3 x-\frac {5 e^2 x}{2}-x^2\right ) \log (x)\right )}{x} \, dx=-e^{-x} x^2-2 e^{-x} x+\frac {1}{2} \left (8-5 e^2\right ) e^{-x} x-e^{-x}+\frac {1}{2} \left (8-5 e^2\right ) e^{-x}-\frac {1}{2} \left (6-5 e^2\right ) e^{-x}+e^{-x} \log (x)-\frac {1}{2} e^{-x} \left (-2 x-5 e^2+6\right ) \log (x) \]

[In]

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

[Out]

-E^(-x) - (6 - 5*E^2)/(2*E^x) + (8 - 5*E^2)/(2*E^x) - (2*x)/E^x + ((8 - 5*E^2)*x)/(2*E^x) - x^2/E^x + Log[x]/E
^x - ((6 - 5*E^2 - 2*x)*Log[x])/(2*E^x)

Rule 2207

Int[((b_.)*(F_)^((g_.)*((e_.) + (f_.)*(x_))))^(n_.)*((c_.) + (d_.)*(x_))^(m_.), x_Symbol] :> Simp[(c + d*x)^m*
((b*F^(g*(e + f*x)))^n/(f*g*n*Log[F])), x] - Dist[d*(m/(f*g*n*Log[F])), 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] && GtQ[m, 0] && IntegerQ[2*m] &&  !TrueQ[$UseGamma]

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 2225

Int[((F_)^((c_.)*((a_.) + (b_.)*(x_))))^(n_.), x_Symbol] :> Simp[(F^(c*(a + b*x)))^n/(b*c*n*Log[F]), x] /; Fre
eQ[{F, a, b, c, n}, x]

Rule 2230

Int[(F_)^((c_.)*(v_))*(u_)^(m_.)*(w_), x_Symbol] :> Int[ExpandIntegrand[F^(c*ExpandToSum[v, x]), w*NormalizePo
werOfLinear[u, x]^m, x], x] /; FreeQ[{F, c}, x] && PolynomialQ[w, x] && LinearQ[v, x] && PowerOfLinearQ[u, x]
&& IntegerQ[m] &&  !TrueQ[$UseGamma]

Rule 2634

Int[Log[u_]*(v_), x_Symbol] :> With[{w = IntHide[v, x]}, Dist[Log[u], w, x] - Int[SimplifyIntegrand[w*(D[u, x]
/u), x], x] /; InverseFunctionFreeQ[w, x]] /; InverseFunctionFreeQ[u, x]

Rule 6874

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

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

Mathematica [A] (verified)

Time = 1.53 (sec) , antiderivative size = 25, normalized size of antiderivative = 1.14 \[ \int \frac {e^{-x} \left (-2+3 x-4 x^2+x^3+\frac {5}{2} e^2 \left (1-x+x^2\right )+\left (3 x-\frac {5 e^2 x}{2}-x^2\right ) \log (x)\right )}{x} \, dx=-\frac {1}{2} e^{-x} \left (-4+5 e^2+2 x\right ) (x-\log (x)) \]

[In]

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

[Out]

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

Maple [A] (verified)

Time = 1.36 (sec) , antiderivative size = 33, normalized size of antiderivative = 1.50

method result size
norman \(\left (x \ln \left (x \right )+\left (-\frac {5 \,{\mathrm e}^{2}}{2}+2\right ) x +\left (\frac {5 \,{\mathrm e}^{2}}{2}-2\right ) \ln \left (x \right )-x^{2}\right ) {\mathrm e}^{-x}\) \(33\)
risch \(\frac {\left (5 \,{\mathrm e}^{2}-4+2 x \right ) {\mathrm e}^{-x} \ln \left (x \right )}{2}-\frac {x \left (5 \,{\mathrm e}^{2}-4+2 x \right ) {\mathrm e}^{-x}}{2}\) \(35\)
parallelrisch \(\left (-x \,{\mathrm e}^{\ln \left (\frac {5}{2}\right )+2}+\ln \left (x \right ) {\mathrm e}^{\ln \left (\frac {5}{2}\right )+2}-x^{2}+x \ln \left (x \right )+2 x -2 \ln \left (x \right )\right ) {\mathrm e}^{-x}\) \(39\)

[In]

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

[Out]

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

Fricas [B] (verification not implemented)

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

Time = 0.24 (sec) , antiderivative size = 45, normalized size of antiderivative = 2.05 \[ \int \frac {e^{-x} \left (-2+3 x-4 x^2+x^3+\frac {5}{2} e^2 \left (1-x+x^2\right )+\left (3 x-\frac {5 e^2 x}{2}-x^2\right ) \log (x)\right )}{x} \, dx=-{\left (x^{2} - 2 \, x\right )} e^{\left (-x\right )} - x e^{\left (-x + \log \left (\frac {5}{2}\right ) + 2\right )} + {\left ({\left (x - 2\right )} e^{\left (-x\right )} + e^{\left (-x + \log \left (\frac {5}{2}\right ) + 2\right )}\right )} \log \left (x\right ) \]

[In]

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

[Out]

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

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 39 vs. \(2 (17) = 34\).

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

[In]

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

[Out]

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

Maxima [F]

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

[In]

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

[Out]

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

Giac [B] (verification not implemented)

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

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

[In]

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

[Out]

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

Mupad [B] (verification not implemented)

Time = 9.19 (sec) , antiderivative size = 21, normalized size of antiderivative = 0.95 \[ \int \frac {e^{-x} \left (-2+3 x-4 x^2+x^3+\frac {5}{2} e^2 \left (1-x+x^2\right )+\left (3 x-\frac {5 e^2 x}{2}-x^2\right ) \log (x)\right )}{x} \, dx=-\frac {{\mathrm {e}}^{-x}\,\left (x-\ln \left (x\right )\right )\,\left (2\,x+5\,{\mathrm {e}}^2-4\right )}{2} \]

[In]

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

[Out]

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