3.45.31 \(\int (-1-2 x+e^x (1+3 x+x^2)) \, dx\)

Optimal. Leaf size=19 \[ (-1-x) \left (4 x+\left (-3-e^x\right ) x\right ) \]

________________________________________________________________________________________

Rubi [A]  time = 0.04, antiderivative size = 21, normalized size of antiderivative = 1.11, number of steps used = 9, number of rules used = 3, integrand size = 17, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.176, Rules used = {2196, 2194, 2176} \begin {gather*} e^x x^2-x^2+e^x x-x \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

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 2196

Int[(F_)^((c_.)*(v_))*(u_), x_Symbol] :> Int[ExpandIntegrand[F^(c*ExpandToSum[v, x]), u, x], x] /; FreeQ[{F, c
}, x] && PolynomialQ[u, x] && LinearQ[v, x] &&  !$UseGamma === True

Rubi steps

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

________________________________________________________________________________________

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

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maple [A]  time = 0.01, size = 18, normalized size = 0.95




method result size



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



Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maxima [A]  time = 0.37, size = 17, normalized size = 0.89 \begin {gather*} -x^{2} + {\left (x^{2} + x\right )} e^{x} - x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________