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

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

________________________________________________________________________________________

Rubi [A]  time = 0.18, antiderivative size = 15, normalized size of antiderivative = 0.62, number of steps used = 11, number of rules used = 5, integrand size = 29, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.172, Rules used = {6742, 43, 2196, 2176, 2194} \begin {gather*} e^{-x} x^2-x+\log (x) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

-x + x^2/E^x + Log[x]

Rule 43

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d
*x)^n, x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[m, 0] && ( !IntegerQ[n] || (EqQ[c, 0]
&& LeQ[7*m + 4*n + 4, 0]) || LtQ[9*m + 5*(n + 1), 0] || GtQ[m + n + 2, 0])

Rule 2176

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] &&  !$UseGamma === True

Rule 2194

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 2196

Int[(F_)^((c_.)*(v_))*(u_), x_Symbol] :> Int[ExpandIntegrand[F^(c*ExpandToSum[v, x]), u, x], x] /; FreeQ[{F, c
}, x] && PolynomialQ[u, x] && LinearQ[v, x] &&  !$UseGamma === True

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 \left (-\frac {-1+x}{x}-e^{-x} (-2+x) x\right ) \, dx\\ &=-\int \frac {-1+x}{x} \, dx-\int e^{-x} (-2+x) x \, dx\\ &=-\int \left (1-\frac {1}{x}\right ) \, dx-\int \left (-2 e^{-x} x+e^{-x} x^2\right ) \, dx\\ &=-x+\log (x)+2 \int e^{-x} x \, dx-\int e^{-x} x^2 \, dx\\ &=-x-2 e^{-x} x+e^{-x} x^2+\log (x)+2 \int e^{-x} \, dx-2 \int e^{-x} x \, dx\\ &=-2 e^{-x}-x+e^{-x} x^2+\log (x)-2 \int e^{-x} \, dx\\ &=-x+e^{-x} x^2+\log (x)\\ \end {aligned} \end {gather*}

________________________________________________________________________________________

Mathematica [A]  time = 0.02, size = 14, normalized size = 0.58 \begin {gather*} x \left (-1+e^{-x} x\right )+\log (x) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

fricas [A]  time = 0.70, size = 19, normalized size = 0.79 \begin {gather*} {\left (x^{2} - x e^{x} + e^{x} \log \relax (x)\right )} e^{\left (-x\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

giac [A]  time = 0.16, size = 14, normalized size = 0.58 \begin {gather*} x^{2} e^{\left (-x\right )} - x + \log \relax (x) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maple [A]  time = 0.02, size = 15, normalized size = 0.62




method result size



default \(\ln \relax (x )-x +x^{2} {\mathrm e}^{-x}\) \(15\)
risch \(\ln \relax (x )-x +x^{2} {\mathrm e}^{-x}\) \(15\)
norman \(\left (x^{2}-{\mathrm e}^{x} x \right ) {\mathrm e}^{-x}+\ln \relax (x )\) \(18\)



Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maxima [A]  time = 0.36, size = 28, normalized size = 1.17 \begin {gather*} {\left (x^{2} + 2 \, x + 2\right )} e^{\left (-x\right )} - 2 \, {\left (x + 1\right )} e^{\left (-x\right )} - x + \log \relax (x) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

mupad [B]  time = 0.06, size = 14, normalized size = 0.58 \begin {gather*} \ln \relax (x)-x+x^2\,{\mathrm {e}}^{-x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

log(x) - x + x^2*exp(-x)

________________________________________________________________________________________

sympy [A]  time = 0.12, size = 10, normalized size = 0.42 \begin {gather*} x^{2} e^{- x} - x + \log {\relax (x )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

x**2*exp(-x) - x + log(x)

________________________________________________________________________________________