\(\int (4+e^x (-1-x)+2 x) \, dx\) [8376]

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

Optimal result

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

[Out]

ln(3)-3/5+x*(x-exp(x)+4)

Rubi [A] (verified)

Time = 0.01 (sec) , antiderivative size = 18, normalized size of antiderivative = 1.12, number of steps used = 3, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {2207, 2225} \[ \int \left (4+e^x (-1-x)+2 x\right ) \, dx=x^2+4 x+e^x-e^x (x+1) \]

[In]

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

[Out]

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

Rubi steps \begin{align*} \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{align*}

Mathematica [A] (verified)

Time = 0.00 (sec) , antiderivative size = 13, normalized size of antiderivative = 0.81 \[ \int \left (4+e^x (-1-x)+2 x\right ) \, dx=4 x-e^x x+x^2 \]

[In]

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

[Out]

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

Maple [A] (verified)

Time = 0.03 (sec) , antiderivative size = 13, normalized size of antiderivative = 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\)
parallelrisch \(4 x -{\mathrm e}^{x} x +x^{2}\) \(13\)
parts \(4 x -{\mathrm e}^{x} x +x^{2}\) \(13\)

[In]

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

[Out]

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

Fricas [A] (verification not implemented)

none

Time = 0.24 (sec) , antiderivative size = 12, normalized size of antiderivative = 0.75 \[ \int \left (4+e^x (-1-x)+2 x\right ) \, dx=x^{2} - x e^{x} + 4 \, x \]

[In]

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

[Out]

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

Sympy [A] (verification not implemented)

Time = 0.04 (sec) , antiderivative size = 10, normalized size of antiderivative = 0.62 \[ \int \left (4+e^x (-1-x)+2 x\right ) \, dx=x^{2} - x e^{x} + 4 x \]

[In]

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

[Out]

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

Maxima [A] (verification not implemented)

none

Time = 0.19 (sec) , antiderivative size = 12, normalized size of antiderivative = 0.75 \[ \int \left (4+e^x (-1-x)+2 x\right ) \, dx=x^{2} - x e^{x} + 4 \, x \]

[In]

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

[Out]

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

Giac [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 12, normalized size of antiderivative = 0.75 \[ \int \left (4+e^x (-1-x)+2 x\right ) \, dx=x^{2} - x e^{x} + 4 \, x \]

[In]

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

[Out]

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

Mupad [B] (verification not implemented)

Time = 0.05 (sec) , antiderivative size = 9, normalized size of antiderivative = 0.56 \[ \int \left (4+e^x (-1-x)+2 x\right ) \, dx=x\,\left (x-{\mathrm {e}}^x+4\right ) \]

[In]

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

[Out]

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