3.63.44 \(\int (1-6 x+e^x (1+x)+e^{1+x} (-2 x-x^2)) \, dx\)

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

________________________________________________________________________________________

Rubi [A]  time = 0.06, antiderivative size = 29, normalized size of antiderivative = 1.53, number of steps used = 11, number of rules used = 4, integrand size = 27, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.148, Rules used = {2176, 2194, 1593, 2196} \begin {gather*} -e^{x+1} x^2-3 x^2+x-e^x+e^x (x+1) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

Rule 1593

Int[(u_.)*((a_.)*(x_)^(p_.) + (b_.)*(x_)^(q_.))^(n_.), x_Symbol] :> Int[u*x^(n*p)*(a + b*x^(q - p))^n, x] /; F
reeQ[{a, b, p, q}, x] && IntegerQ[n] && PosQ[q - p]

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-3 x^2+\int e^x (1+x) \, dx+\int e^{1+x} \left (-2 x-x^2\right ) \, dx\\ &=x-3 x^2+e^x (1+x)-\int e^x \, dx+\int e^{1+x} (-2-x) x \, dx\\ &=-e^x+x-3 x^2+e^x (1+x)+\int \left (-2 e^{1+x} x-e^{1+x} x^2\right ) \, dx\\ &=-e^x+x-3 x^2+e^x (1+x)-2 \int e^{1+x} x \, dx-\int e^{1+x} x^2 \, dx\\ &=-e^x+x-2 e^{1+x} x-3 x^2-e^{1+x} x^2+e^x (1+x)+2 \int e^{1+x} \, dx+2 \int e^{1+x} x \, dx\\ &=-e^x+2 e^{1+x}+x-3 x^2-e^{1+x} x^2+e^x (1+x)-2 \int e^{1+x} \, dx\\ &=-e^x+x-3 x^2-e^{1+x} x^2+e^x (1+x)\\ \end {aligned} \end {gather*}

________________________________________________________________________________________

Mathematica [A]  time = 0.01, size = 22, normalized size = 1.16 \begin {gather*} x+e^x x-3 x^2-e^{1+x} x^2 \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

fricas [A]  time = 1.17, size = 32, normalized size = 1.68 \begin {gather*} -{\left ({\left (3 \, x^{2} - x\right )} e + {\left (x^{2} e - x\right )} e^{\left (x + 1\right )}\right )} e^{\left (-1\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

giac [A]  time = 0.14, size = 20, normalized size = 1.05 \begin {gather*} -x^{2} e^{\left (x + 1\right )} - 3 \, x^{2} + x e^{x} + x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maple [A]  time = 0.04, size = 21, normalized size = 1.11




method result size



norman \(x +{\mathrm e}^{x} x -3 x^{2}-x^{2} {\mathrm e} \,{\mathrm e}^{x}\) \(21\)
risch \(-x^{2} {\mathrm e}^{x +1}+{\mathrm e}^{x} x +x -3 x^{2}\) \(21\)
default \({\mathrm e}^{x} x +x -{\mathrm e}^{x +1} \left (x +1\right )^{2}+2 \,{\mathrm e}^{x +1} \left (x +1\right )-{\mathrm e}^{x +1}-3 x^{2}\) \(38\)



Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maxima [A]  time = 0.44, size = 20, normalized size = 1.05 \begin {gather*} -x^{2} e^{\left (x + 1\right )} - 3 \, x^{2} + x e^{x} + x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

mupad [B]  time = 0.06, size = 20, normalized size = 1.05 \begin {gather*} x+x\,{\mathrm {e}}^x-3\,x^2-x^2\,\mathrm {e}\,{\mathrm {e}}^x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________