3.84.76 \(\int (4+e^x (-1-x)+2 x) \, dx\)

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

________________________________________________________________________________________

Rubi [A]  time = 0.01, antiderivative size = 18, normalized size of antiderivative = 1.12, number of steps used = 3, number of rules used = 2, integrand size = 14, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {2176, 2194} \begin {gather*} x^2+4 x+e^x-e^x (x+1) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

E^x + 4*x + x^2 - E^x*(1 + 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]

Rubi steps

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

________________________________________________________________________________________

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

Antiderivative was successfully verified.

[In]

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

[Out]

4*x - E^x*x + x^2

________________________________________________________________________________________

fricas [A]  time = 0.88, size = 12, normalized size = 0.75 \begin {gather*} x^{2} - x e^{x} + 4 \, x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

giac [A]  time = 0.28, size = 12, normalized size = 0.75 \begin {gather*} x^{2} - x e^{x} + 4 \, x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maple [A]  time = 0.01, size = 13, normalized size = 0.81




method result size



default \(4 x -{\mathrm e}^{x} x +x^{2}\) \(13\)
norman \(4 x -{\mathrm e}^{x} x +x^{2}\) \(13\)
risch \(4 x -{\mathrm e}^{x} x +x^{2}\) \(13\)



Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maxima [A]  time = 0.36, size = 12, normalized size = 0.75 \begin {gather*} x^{2} - x e^{x} + 4 \, x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

mupad [B]  time = 0.04, size = 9, normalized size = 0.56 \begin {gather*} x\,\left (x-{\mathrm {e}}^x+4\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________