3.34.99 \(\int e^{-x} (2-e^x+e (1-x)-2 x) \, dx\)

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

________________________________________________________________________________________

Rubi [A]  time = 0.08, antiderivative size = 14, normalized size of antiderivative = 0.82, number of steps used = 5, number of rules used = 3, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.130, Rules used = {6742, 2194, 2176} \begin {gather*} (2+e) e^{-x} x-x \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

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

________________________________________________________________________________________

Mathematica [A]  time = 0.02, size = 14, normalized size = 0.82 \begin {gather*} -x+e^{-x} (2+e) x \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

fricas [A]  time = 0.52, size = 18, normalized size = 1.06 \begin {gather*} {\left (x e - x e^{x} + 2 \, x\right )} e^{\left (-x\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

giac [A]  time = 0.18, size = 19, normalized size = 1.12 \begin {gather*} 2 \, x e^{\left (-x\right )} + x e^{\left (-x + 1\right )} - x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

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




method result size



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



Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maxima [B]  time = 0.54, size = 39, normalized size = 2.29 \begin {gather*} {\left (x e + e\right )} e^{\left (-x\right )} + 2 \, {\left (x + 1\right )} e^{\left (-x\right )} - x - 2 \, e^{\left (-x\right )} - e^{\left (-x + 1\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

mupad [B]  time = 0.07, size = 19, normalized size = 1.12 \begin {gather*} 2\,x\,{\mathrm {e}}^{-x}-x+x\,{\mathrm {e}}^{-x}\,\mathrm {e} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(-exp(-x)*(2*x + exp(x) + exp(1)*(x - 1) - 2),x)

[Out]

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

________________________________________________________________________________________

sympy [A]  time = 0.12, size = 12, normalized size = 0.71 \begin {gather*} - x + \left (2 x + e x\right ) e^{- x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________