3.70.49 \(\int e^{-1-x} (-5+5 x+9 e^{1+x} x^2+e^{1+3 x+2 x^2} (3+6 x+12 x^2)+e^{1+2 x+x^2} (12 x+6 x^2+12 x^3)) \, dx\) [6949]

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

[Out]

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

________________________________________________________________________________________

Rubi [B] Leaf count is larger than twice the leaf count of optimal. \(67\) vs. \(2(25)=50\).
time = 0.36, antiderivative size = 67, normalized size of antiderivative = 2.68, number of steps used = 7, number of rules used = 4, integrand size = 71, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.056, Rules used = {6874, 2225, 2207, 2326} \begin {gather*} 3 x^3+\frac {6 e^{x^2+x} \left (2 x^2+x\right ) x}{2 x+1}+\frac {3 e^{2 x^2+2 x} \left (2 x^2+x\right )}{2 x+1}-5 e^{-x-1} x \end {gather*}

Antiderivative was successfully verified.

[In]

Int[E^(-1 - x)*(-5 + 5*x + 9*E^(1 + x)*x^2 + E^(1 + 3*x + 2*x^2)*(3 + 6*x + 12*x^2) + E^(1 + 2*x + x^2)*(12*x
+ 6*x^2 + 12*x^3)),x]

[Out]

-5*E^(-1 - x)*x + 3*x^3 + (3*E^(2*x + 2*x^2)*(x + 2*x^2))/(1 + 2*x) + (6*E^(x + x^2)*x*(x + 2*x^2))/(1 + 2*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]

Rule 2326

Int[(y_.)*(F_)^(u_)*((v_) + (w_)), x_Symbol] :> With[{z = v*(y/(Log[F]*D[u, x]))}, Simp[F^u*z, x] /; EqQ[D[z,
x], w*y]] /; FreeQ[F, x]

Rule 6874

Int[u_, x_Symbol] :> With[{v = ExpandIntegrand[u, x]}, Int[v, x] /; SumQ[v]]

Rubi steps

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

________________________________________________________________________________________

Mathematica [A]
time = 3.69, size = 40, normalized size = 1.60 \begin {gather*} 3-5 e^{-1-x} x+3 e^{2 x (1+x)} x+6 e^{x (1+x)} x^2+3 x^3 \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[E^(-1 - x)*(-5 + 5*x + 9*E^(1 + x)*x^2 + E^(1 + 3*x + 2*x^2)*(3 + 6*x + 12*x^2) + E^(1 + 2*x + x^2)*
(12*x + 6*x^2 + 12*x^3)),x]

[Out]

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

________________________________________________________________________________________

Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(60\) vs. \(2(23)=46\).
time = 0.31, size = 61, normalized size = 2.44

method result size
risch \(3 x^{3}-5 x \,{\mathrm e}^{-x -1}+3 x \,{\mathrm e}^{2 \left (x +1\right ) x}+6 x^{2} {\mathrm e}^{\left (x +1\right ) x}\) \(37\)
norman \(\left (-5 x +3 x^{3} {\mathrm e}^{x +1}+6 \,{\mathrm e}^{x +1} {\mathrm e}^{x^{2}+x} x^{2}+3 \,{\mathrm e}^{x +1} {\mathrm e}^{2 x^{2}+2 x} x \right ) {\mathrm e}^{-x -1}\) \(51\)
default \(3 x^{3}+5 \,{\mathrm e}^{-1} {\mathrm e}^{-x}+5 \,{\mathrm e}^{-1} \left (-x \,{\mathrm e}^{-x}-{\mathrm e}^{-x}\right )+6 x^{2} {\mathrm e}^{x^{2}+x}+3 x \,{\mathrm e}^{2 x^{2}+2 x}\) \(61\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(((12*x^2+6*x+3)*exp(x+1)*exp(x^2+x)^2+(12*x^3+6*x^2+12*x)*exp(x+1)*exp(x^2+x)+9*x^2*exp(x+1)+5*x-5)/exp(x+
1),x,method=_RETURNVERBOSE)

[Out]

3*x^3+5/exp(1)/exp(x)+5/exp(1)*(-x/exp(x)-1/exp(x))+6*x^2*exp(x^2+x)+3*x*exp(2*x^2+2*x)

________________________________________________________________________________________

Maxima [C] Result contains higher order function than in optimal. Order 4 vs. order 3.
time = 0.56, size = 362, normalized size = 14.48 \begin {gather*} 3 \, x^{3} - \frac {3}{4} i \, \sqrt {2} \sqrt {\pi } \operatorname {erf}\left (i \, \sqrt {2} x + \frac {1}{2} i \, \sqrt {2}\right ) e^{\left (-\frac {1}{2}\right )} - \frac {3}{4} \, \sqrt {2} {\left (\frac {\sqrt {\pi } {\left (2 \, x + 1\right )} {\left (\operatorname {erf}\left (\sqrt {\frac {1}{2}} \sqrt {-{\left (2 \, x + 1\right )}^{2}}\right ) - 1\right )}}{\sqrt {-{\left (2 \, x + 1\right )}^{2}}} - \sqrt {2} e^{\left (\frac {1}{2} \, {\left (2 \, x + 1\right )}^{2}\right )}\right )} e^{\left (-\frac {1}{2}\right )} + \frac {3}{4} \, {\left (\frac {12 \, {\left (2 \, x + 1\right )}^{3} \Gamma \left (\frac {3}{2}, -\frac {1}{4} \, {\left (2 \, x + 1\right )}^{2}\right )}{\left (-{\left (2 \, x + 1\right )}^{2}\right )^{\frac {3}{2}}} - \frac {\sqrt {\pi } {\left (2 \, x + 1\right )} {\left (\operatorname {erf}\left (\frac {1}{2} \, \sqrt {-{\left (2 \, x + 1\right )}^{2}}\right ) - 1\right )}}{\sqrt {-{\left (2 \, x + 1\right )}^{2}}} + 6 \, e^{\left (\frac {1}{4} \, {\left (2 \, x + 1\right )}^{2}\right )} - 8 \, \Gamma \left (2, -\frac {1}{4} \, {\left (2 \, x + 1\right )}^{2}\right )\right )} e^{\left (-\frac {1}{4}\right )} - \frac {3}{4} \, {\left (\frac {4 \, {\left (2 \, x + 1\right )}^{3} \Gamma \left (\frac {3}{2}, -\frac {1}{4} \, {\left (2 \, x + 1\right )}^{2}\right )}{\left (-{\left (2 \, x + 1\right )}^{2}\right )^{\frac {3}{2}}} - \frac {\sqrt {\pi } {\left (2 \, x + 1\right )} {\left (\operatorname {erf}\left (\frac {1}{2} \, \sqrt {-{\left (2 \, x + 1\right )}^{2}}\right ) - 1\right )}}{\sqrt {-{\left (2 \, x + 1\right )}^{2}}} + 4 \, e^{\left (\frac {1}{4} \, {\left (2 \, x + 1\right )}^{2}\right )}\right )} e^{\left (-\frac {1}{4}\right )} - 3 \, {\left (\frac {\sqrt {\pi } {\left (2 \, x + 1\right )} {\left (\operatorname {erf}\left (\frac {1}{2} \, \sqrt {-{\left (2 \, x + 1\right )}^{2}}\right ) - 1\right )}}{\sqrt {-{\left (2 \, x + 1\right )}^{2}}} - 2 \, e^{\left (\frac {1}{4} \, {\left (2 \, x + 1\right )}^{2}\right )}\right )} e^{\left (-\frac {1}{4}\right )} + \frac {3}{2} \, {\left (2 \, x - 1\right )} e^{\left (2 \, x^{2} + 2 \, x\right )} - 5 \, {\left (x + 1\right )} e^{\left (-x - 1\right )} + 5 \, e^{\left (-x - 1\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(((12*x^2+6*x+3)*exp(1+x)*exp(x^2+x)^2+(12*x^3+6*x^2+12*x)*exp(1+x)*exp(x^2+x)+9*x^2*exp(1+x)+5*x-5)/
exp(1+x),x, algorithm="maxima")

[Out]

3*x^3 - 3/4*I*sqrt(2)*sqrt(pi)*erf(I*sqrt(2)*x + 1/2*I*sqrt(2))*e^(-1/2) - 3/4*sqrt(2)*(sqrt(pi)*(2*x + 1)*(er
f(sqrt(1/2)*sqrt(-(2*x + 1)^2)) - 1)/sqrt(-(2*x + 1)^2) - sqrt(2)*e^(1/2*(2*x + 1)^2))*e^(-1/2) + 3/4*(12*(2*x
 + 1)^3*gamma(3/2, -1/4*(2*x + 1)^2)/(-(2*x + 1)^2)^(3/2) - sqrt(pi)*(2*x + 1)*(erf(1/2*sqrt(-(2*x + 1)^2)) -
1)/sqrt(-(2*x + 1)^2) + 6*e^(1/4*(2*x + 1)^2) - 8*gamma(2, -1/4*(2*x + 1)^2))*e^(-1/4) - 3/4*(4*(2*x + 1)^3*ga
mma(3/2, -1/4*(2*x + 1)^2)/(-(2*x + 1)^2)^(3/2) - sqrt(pi)*(2*x + 1)*(erf(1/2*sqrt(-(2*x + 1)^2)) - 1)/sqrt(-(
2*x + 1)^2) + 4*e^(1/4*(2*x + 1)^2))*e^(-1/4) - 3*(sqrt(pi)*(2*x + 1)*(erf(1/2*sqrt(-(2*x + 1)^2)) - 1)/sqrt(-
(2*x + 1)^2) - 2*e^(1/4*(2*x + 1)^2))*e^(-1/4) + 3/2*(2*x - 1)*e^(2*x^2 + 2*x) - 5*(x + 1)*e^(-x - 1) + 5*e^(-
x - 1)

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 73 vs. \(2 (23) = 46\).
time = 0.38, size = 73, normalized size = 2.92 \begin {gather*} {\left (3 \, x^{3} e^{\left (2 \, x^{2} + 4 \, x + 2\right )} + 3 \, x e^{\left (4 \, x^{2} + 6 \, x + 2\right )} + {\left (6 \, x^{2} e^{\left (x^{2} + 2 \, x + 1\right )} - 5 \, x\right )} e^{\left (2 \, x^{2} + 3 \, x + 1\right )}\right )} e^{\left (-2 \, x^{2} - 4 \, x - 2\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(((12*x^2+6*x+3)*exp(1+x)*exp(x^2+x)^2+(12*x^3+6*x^2+12*x)*exp(1+x)*exp(x^2+x)+9*x^2*exp(1+x)+5*x-5)/
exp(1+x),x, algorithm="fricas")

[Out]

(3*x^3*e^(2*x^2 + 4*x + 2) + 3*x*e^(4*x^2 + 6*x + 2) + (6*x^2*e^(x^2 + 2*x + 1) - 5*x)*e^(2*x^2 + 3*x + 1))*e^
(-2*x^2 - 4*x - 2)

________________________________________________________________________________________

Sympy [A]
time = 0.10, size = 39, normalized size = 1.56 \begin {gather*} 3 x^{3} + 6 x^{2} e^{x^{2} + x} - 5 x e^{- x - 1} + 3 x e^{2 x^{2} + 2 x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(((12*x**2+6*x+3)*exp(1+x)*exp(x**2+x)**2+(12*x**3+6*x**2+12*x)*exp(1+x)*exp(x**2+x)+9*x**2*exp(1+x)+
5*x-5)/exp(1+x),x)

[Out]

3*x**3 + 6*x**2*exp(x**2 + x) - 5*x*exp(-x - 1) + 3*x*exp(2*x**2 + 2*x)

________________________________________________________________________________________

Giac [A]
time = 0.41, size = 44, normalized size = 1.76 \begin {gather*} {\left (3 \, x^{3} e + 6 \, x^{2} e^{\left (x^{2} + x + 1\right )} + 3 \, x e^{\left (2 \, x^{2} + 2 \, x + 1\right )} - 5 \, x e^{\left (-x\right )}\right )} e^{\left (-1\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(((12*x^2+6*x+3)*exp(1+x)*exp(x^2+x)^2+(12*x^3+6*x^2+12*x)*exp(1+x)*exp(x^2+x)+9*x^2*exp(1+x)+5*x-5)/
exp(1+x),x, algorithm="giac")

[Out]

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

________________________________________________________________________________________

Mupad [B]
time = 0.23, size = 39, normalized size = 1.56 \begin {gather*} 6\,x^2\,{\mathrm {e}}^{x^2+x}-5\,x\,{\mathrm {e}}^{-x-1}+3\,x\,{\mathrm {e}}^{2\,x^2+2\,x}+3\,x^3 \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(exp(- x - 1)*(5*x + 9*x^2*exp(x + 1) + exp(x + x^2)*exp(x + 1)*(12*x + 6*x^2 + 12*x^3) + exp(x + 1)*exp(2*
x + 2*x^2)*(6*x + 12*x^2 + 3) - 5),x)

[Out]

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

________________________________________________________________________________________