3.90.82 \(\int e^{-4-x} (-9 e^2+e^{2 x}-4 e^{x+x^2} x+3 e^{1+x^2} (-2+4 x)+e^{2 x^2} (-1+4 x)) \, dx\)

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

________________________________________________________________________________________

Rubi [A]  time = 0.62, antiderivative size = 48, normalized size of antiderivative = 1.85, number of steps used = 14, number of rules used = 8, integrand size = 56, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {6741, 6742, 2194, 2236, 2234, 2204, 2209, 2240} \begin {gather*} -2 e^{x^2-4}+6 e^{x^2-x-3}+e^{2 x^2-x-4}+9 e^{-x-2}+e^{x-4} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

9*E^(-2 - x) + E^(-4 + x) - 2*E^(-4 + x^2) + 6*E^(-3 - x + x^2) + E^(-4 - x + 2*x^2)

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 2204

Int[(F_)^((a_.) + (b_.)*((c_.) + (d_.)*(x_))^2), x_Symbol] :> Simp[(F^a*Sqrt[Pi]*Erfi[(c + d*x)*Rt[b*Log[F], 2
]])/(2*d*Rt[b*Log[F], 2]), x] /; FreeQ[{F, a, b, c, d}, x] && PosQ[b]

Rule 2209

Int[(F_)^((a_.) + (b_.)*((c_.) + (d_.)*(x_))^(n_))*((e_.) + (f_.)*(x_))^(m_.), x_Symbol] :> Simp[((e + f*x)^n*
F^(a + b*(c + d*x)^n))/(b*f*n*(c + d*x)^n*Log[F]), x] /; FreeQ[{F, a, b, c, d, e, f, n}, x] && EqQ[m, n - 1] &
& EqQ[d*e - c*f, 0]

Rule 2234

Int[(F_)^((a_.) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> Dist[F^(a - b^2/(4*c)), Int[F^((b + 2*c*x)^2/(4*c))
, x], x] /; FreeQ[{F, a, b, c}, x]

Rule 2236

Int[(F_)^((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)*((d_.) + (e_.)*(x_)), x_Symbol] :> Simp[(e*F^(a + b*x + c*x^2))/(
2*c*Log[F]), x] /; FreeQ[{F, a, b, c, d, e}, x] && EqQ[b*e - 2*c*d, 0]

Rule 2240

Int[(F_)^((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)*((d_.) + (e_.)*(x_)), x_Symbol] :> Simp[(e*F^(a + b*x + c*x^2))/(
2*c*Log[F]), x] - Dist[(b*e - 2*c*d)/(2*c), Int[F^(a + b*x + c*x^2), x], x] /; FreeQ[{F, a, b, c, d, e}, x] &&
 NeQ[b*e - 2*c*d, 0]

Rule 6741

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

Rule 6742

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

Rubi steps

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

________________________________________________________________________________________

Mathematica [A]  time = 0.22, size = 44, normalized size = 1.69 \begin {gather*} e^{-4-x} \left (9 e^2+e^{2 x}+e^{2 x^2}+6 e^{1+x^2}-2 e^{x+x^2}\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

E^(-4 - x)*(9*E^2 + E^(2*x) + E^(2*x^2) + 6*E^(1 + x^2) - 2*E^(x + x^2))

________________________________________________________________________________________

fricas [B]  time = 0.80, size = 85, normalized size = 3.27 \begin {gather*} \frac {1}{27} \, {\left (9 \, {\left (9 \, e^{4} - 2 \, e^{\left (x^{2} + x + 2\right )}\right )} e^{\left (2 \, x^{2} + 2 \, \log \relax (3) + 2\right )} + e^{\left (4 \, x^{2} + 4 \, \log \relax (3) + 4\right )} + 18 \, e^{\left (3 \, x^{2} + 3 \, \log \relax (3) + 5\right )} + 81 \, e^{\left (2 \, x^{2} + 2 \, x + 4\right )}\right )} e^{\left (-2 \, x^{2} - x - \log \relax (3) - 8\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((-exp(log(3)+1)^2+(4*x-2)*exp(x^2)*exp(log(3)+1)+(4*x-1)*exp(x^2)^2-4*x*exp(x)*exp(x^2)+exp(x)^2)/ex
p(4+x),x, algorithm="fricas")

[Out]

1/27*(9*(9*e^4 - 2*e^(x^2 + x + 2))*e^(2*x^2 + 2*log(3) + 2) + e^(4*x^2 + 4*log(3) + 4) + 18*e^(3*x^2 + 3*log(
3) + 5) + 81*e^(2*x^2 + 2*x + 4))*e^(-2*x^2 - x - log(3) - 8)

________________________________________________________________________________________

giac [A]  time = 0.20, size = 46, normalized size = 1.77 \begin {gather*} {\left (e^{\left (2 \, x^{2} - x + 5\right )} + 6 \, e^{\left (x^{2} - x + 6\right )} - 2 \, e^{\left (x^{2} + 5\right )} + e^{\left (x + 5\right )} + 9 \, e^{\left (-x + 7\right )}\right )} e^{\left (-9\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((-exp(log(3)+1)^2+(4*x-2)*exp(x^2)*exp(log(3)+1)+(4*x-1)*exp(x^2)^2-4*x*exp(x)*exp(x^2)+exp(x)^2)/ex
p(4+x),x, algorithm="giac")

[Out]

(e^(2*x^2 - x + 5) + 6*e^(x^2 - x + 6) - 2*e^(x^2 + 5) + e^(x + 5) + 9*e^(-x + 7))*e^(-9)

________________________________________________________________________________________

maple [A]  time = 0.10, size = 45, normalized size = 1.73




method result size



risch \({\mathrm e}^{x -4}+9 \,{\mathrm e}^{-x -2}+{\mathrm e}^{2 x^{2}-x -4}+2 \left (-{\mathrm e}^{x}+3 \,{\mathrm e}\right ) {\mathrm e}^{x^{2}-x -4}\) \(45\)
default \({\mathrm e}^{-4} {\mathrm e}^{x}-2 \,{\mathrm e}^{-4} {\mathrm e}^{x^{2}}+9 \,{\mathrm e}^{-4} {\mathrm e}^{-x} {\mathrm e}^{2}+{\mathrm e}^{2 x^{2}-x -4}+6 \,{\mathrm e}^{x^{2}-x -3}\) \(55\)
norman \(\left ({\mathrm e}^{-4} {\mathrm e}^{2 x}+{\mathrm e}^{-4} {\mathrm e}^{2 x^{2}}+9 \,{\mathrm e}^{-4} {\mathrm e}^{2}+6 \,{\mathrm e}^{-4} {\mathrm e} \,{\mathrm e}^{x^{2}}-2 \,{\mathrm e}^{x} {\mathrm e}^{-4} {\mathrm e}^{x^{2}}\right ) {\mathrm e}^{-x}\) \(61\)



Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maxima [C]  time = 0.49, size = 178, normalized size = 6.85 \begin {gather*} \frac {1}{4} i \, \sqrt {2} \sqrt {\pi } \operatorname {erf}\left (i \, \sqrt {2} x - \frac {1}{4} i \, \sqrt {2}\right ) e^{\left (-\frac {33}{8}\right )} + 3 i \, \sqrt {\pi } \operatorname {erf}\left (i \, x - \frac {1}{2} i\right ) e^{\left (-\frac {13}{4}\right )} + \frac {1}{4} \, \sqrt {2} {\left (\frac {\sqrt {2} \sqrt {\frac {1}{2}} \sqrt {\pi } {\left (4 \, x - 1\right )} {\left (\operatorname {erf}\left (\frac {1}{2} \, \sqrt {\frac {1}{2}} \sqrt {-{\left (4 \, x - 1\right )}^{2}}\right ) - 1\right )}}{\sqrt {-{\left (4 \, x - 1\right )}^{2}}} + 2 \, \sqrt {2} e^{\left (\frac {1}{8} \, {\left (4 \, x - 1\right )}^{2}\right )}\right )} e^{\left (-\frac {33}{8}\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 {13}{4}\right )} - 2 \, e^{\left (x^{2} - 4\right )} + e^{\left (x - 4\right )} + 9 \, e^{\left (-x - 2\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((-exp(log(3)+1)^2+(4*x-2)*exp(x^2)*exp(log(3)+1)+(4*x-1)*exp(x^2)^2-4*x*exp(x)*exp(x^2)+exp(x)^2)/ex
p(4+x),x, algorithm="maxima")

[Out]

1/4*I*sqrt(2)*sqrt(pi)*erf(I*sqrt(2)*x - 1/4*I*sqrt(2))*e^(-33/8) + 3*I*sqrt(pi)*erf(I*x - 1/2*I)*e^(-13/4) +
1/4*sqrt(2)*(sqrt(2)*sqrt(1/2)*sqrt(pi)*(4*x - 1)*(erf(1/2*sqrt(1/2)*sqrt(-(4*x - 1)^2)) - 1)/sqrt(-(4*x - 1)^
2) + 2*sqrt(2)*e^(1/8*(4*x - 1)^2))*e^(-33/8) + 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^(-13/4) - 2*e^(x^2 - 4) + e^(x - 4) + 9*e^(-x - 2)

________________________________________________________________________________________

mupad [B]  time = 8.32, size = 47, normalized size = 1.81 \begin {gather*} 9\,{\mathrm {e}}^{-x}\,{\mathrm {e}}^{-2}-2\,{\mathrm {e}}^{x^2}\,{\mathrm {e}}^{-4}+{\mathrm {e}}^{-4}\,{\mathrm {e}}^x+6\,{\mathrm {e}}^{-x}\,{\mathrm {e}}^{x^2}\,{\mathrm {e}}^{-3}+{\mathrm {e}}^{-x}\,{\mathrm {e}}^{-4}\,{\mathrm {e}}^{2\,x^2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

9*exp(-x)*exp(-2) - 2*exp(x^2)*exp(-4) + exp(-4)*exp(x) + 6*exp(-x)*exp(x^2)*exp(-3) + exp(-x)*exp(-4)*exp(2*x
^2)

________________________________________________________________________________________

sympy [B]  time = 0.28, size = 63, normalized size = 2.42 \begin {gather*} \frac {\left (\left (- 2 e^{4} e^{2 x} + 6 e^{5} e^{x}\right ) e^{x^{2}} + e^{4} e^{x} e^{2 x^{2}}\right ) e^{- 2 x}}{e^{8}} + \frac {e^{2} e^{x} + 9 e^{4} e^{- x}}{e^{6}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

((-2*exp(4)*exp(2*x) + 6*exp(5)*exp(x))*exp(x**2) + exp(4)*exp(x)*exp(2*x**2))*exp(-8)*exp(-2*x) + (exp(2)*exp
(x) + 9*exp(4)*exp(-x))*exp(-6)

________________________________________________________________________________________