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

Optimal. Leaf size=19 \[ 2+4 e^{-x}+x+x^2+4 (1+\log (5)) \]

________________________________________________________________________________________

Rubi [A]  time = 0.03, antiderivative size = 12, normalized size of antiderivative = 0.63, number of steps used = 3, number of rules used = 2, integrand size = 17, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.118, Rules used = {6688, 2194} \begin {gather*} x^2+x+4 e^{-x} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

4/E^x + x + x^2

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 6688

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

Rubi steps

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

________________________________________________________________________________________

Mathematica [A]  time = 0.01, size = 12, normalized size = 0.63 \begin {gather*} 4 e^{-x}+x+x^2 \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

4/E^x + x + x^2

________________________________________________________________________________________

fricas [A]  time = 0.76, size = 15, normalized size = 0.79 \begin {gather*} {\left ({\left (x^{2} + x\right )} e^{x} + 4\right )} e^{\left (-x\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

giac [A]  time = 0.21, size = 11, normalized size = 0.58 \begin {gather*} x^{2} + x + 4 \, e^{\left (-x\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maple [A]  time = 0.03, size = 12, normalized size = 0.63




method result size



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



Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

x^2+x+4/exp(x)

________________________________________________________________________________________

maxima [A]  time = 0.43, size = 11, normalized size = 0.58 \begin {gather*} x^{2} + x + 4 \, e^{\left (-x\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

mupad [B]  time = 0.05, size = 11, normalized size = 0.58 \begin {gather*} x+4\,{\mathrm {e}}^{-x}+x^2 \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

sympy [A]  time = 0.08, size = 8, normalized size = 0.42 \begin {gather*} x^{2} + x + 4 e^{- x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________