\(\int (2+e^x-2 x) \, dx\) [6893]

   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 = 8, antiderivative size = 17 \[ \int \left (2+e^x-2 x\right ) \, dx=5+e^x+2 x-x^2-\log (6) \]

[Out]

5+2*x-ln(6)-x^2+exp(x)

Rubi [A] (verified)

Time = 0.00 (sec) , antiderivative size = 12, normalized size of antiderivative = 0.71, number of steps used = 2, number of rules used = 1, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.125, Rules used = {2225} \[ \int \left (2+e^x-2 x\right ) \, dx=-x^2+2 x+e^x \]

[In]

Int[2 + E^x - 2*x,x]

[Out]

E^x + 2*x - x^2

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}& = 2 x-x^2+\int e^x \, dx \\ & = e^x+2 x-x^2 \\ \end{align*}

Mathematica [A] (verified)

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

[In]

Integrate[2 + E^x - 2*x,x]

[Out]

E^x + 2*x - x^2

Maple [A] (verified)

Time = 0.01 (sec) , antiderivative size = 12, normalized size of antiderivative = 0.71

method result size
default \({\mathrm e}^{x}-x^{2}+2 x\) \(12\)
norman \({\mathrm e}^{x}-x^{2}+2 x\) \(12\)
risch \({\mathrm e}^{x}-x^{2}+2 x\) \(12\)
parallelrisch \({\mathrm e}^{x}-x^{2}+2 x\) \(12\)
parts \({\mathrm e}^{x}-x^{2}+2 x\) \(12\)

[In]

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

[Out]

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

Fricas [A] (verification not implemented)

none

Time = 0.23 (sec) , antiderivative size = 11, normalized size of antiderivative = 0.65 \[ \int \left (2+e^x-2 x\right ) \, dx=-x^{2} + 2 \, x + e^{x} \]

[In]

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

[Out]

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

Sympy [A] (verification not implemented)

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

[In]

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

[Out]

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

Maxima [A] (verification not implemented)

none

Time = 0.17 (sec) , antiderivative size = 11, normalized size of antiderivative = 0.65 \[ \int \left (2+e^x-2 x\right ) \, dx=-x^{2} + 2 \, x + e^{x} \]

[In]

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

[Out]

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

Giac [A] (verification not implemented)

none

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

[In]

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

[Out]

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

Mupad [B] (verification not implemented)

Time = 12.40 (sec) , antiderivative size = 11, normalized size of antiderivative = 0.65 \[ \int \left (2+e^x-2 x\right ) \, dx=2\,x+{\mathrm {e}}^x-x^2 \]

[In]

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

[Out]

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