\(\int \frac {1}{5} e^{-x^2} (10 e^{x^2}-10 x+e^{2 x+2 x^2} (1+2 x+2 x^2)) \, dx\) [6800]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [C] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 44, antiderivative size = 33 \[ \int \frac {1}{5} e^{-x^2} \left (10 e^{x^2}-10 x+e^{2 x+2 x^2} \left (1+2 x+2 x^2\right )\right ) \, dx=2 x+\frac {e^{-x^2} \left (x+\frac {1}{5} e^{x (2+2 x)} x^2\right )}{x} \]

[Out]

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

Rubi [A] (verified)

Time = 0.11 (sec) , antiderivative size = 39, normalized size of antiderivative = 1.18, number of steps used = 5, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.091, Rules used = {12, 6874, 2240, 2326} \[ \int \frac {1}{5} e^{-x^2} \left (10 e^{x^2}-10 x+e^{2 x+2 x^2} \left (1+2 x+2 x^2\right )\right ) \, dx=e^{-x^2}+\frac {e^{2 x (x+1)-x^2} \left (x^2+x\right )}{5 (x+1)}+2 x \]

[In]

Int[(10*E^x^2 - 10*x + E^(2*x + 2*x^2)*(1 + 2*x + 2*x^2))/(5*E^x^2),x]

[Out]

E^(-x^2) + 2*x + (E^(-x^2 + 2*x*(1 + x))*(x + x^2))/(5*(1 + x))

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 2240

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 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{align*} \text {integral}& = \frac {1}{5} \int e^{-x^2} \left (10 e^{x^2}-10 x+e^{2 x+2 x^2} \left (1+2 x+2 x^2\right )\right ) \, dx \\ & = \frac {1}{5} \int \left (10-10 e^{-x^2} x+e^{-x^2+2 x (1+x)} \left (1+2 x+2 x^2\right )\right ) \, dx \\ & = 2 x+\frac {1}{5} \int e^{-x^2+2 x (1+x)} \left (1+2 x+2 x^2\right ) \, dx-2 \int e^{-x^2} x \, dx \\ & = e^{-x^2}+2 x+\frac {e^{-x^2+2 x (1+x)} \left (x+x^2\right )}{5 (1+x)} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.08 (sec) , antiderivative size = 23, normalized size of antiderivative = 0.70 \[ \int \frac {1}{5} e^{-x^2} \left (10 e^{x^2}-10 x+e^{2 x+2 x^2} \left (1+2 x+2 x^2\right )\right ) \, dx=e^{-x^2}+2 x+\frac {1}{5} e^{x (2+x)} x \]

[In]

Integrate[(10*E^x^2 - 10*x + E^(2*x + 2*x^2)*(1 + 2*x + 2*x^2))/(5*E^x^2),x]

[Out]

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

Maple [A] (verified)

Time = 0.09 (sec) , antiderivative size = 20, normalized size of antiderivative = 0.61

method result size
risch \(2 x +{\mathrm e}^{-x^{2}}+\frac {x \,{\mathrm e}^{x \left (2+x \right )}}{5}\) \(20\)
default \(2 x +{\mathrm e}^{-x^{2}}+\frac {{\mathrm e}^{x^{2}+2 x} x}{5}\) \(22\)
parts \(2 x +{\mathrm e}^{-x^{2}}+\frac {{\mathrm e}^{x^{2}+2 x} x}{5}\) \(22\)
norman \(\left (1+2 \,{\mathrm e}^{x^{2}} x +\frac {{\mathrm e}^{2 x^{2}+2 x} x}{5}\right ) {\mathrm e}^{-x^{2}}\) \(30\)
parallelrisch \(\frac {\left (5+10 \,{\mathrm e}^{x^{2}} x +{\mathrm e}^{2 x^{2}+2 x} x \right ) {\mathrm e}^{-x^{2}}}{5}\) \(30\)

[In]

int(1/5*((2*x^2+2*x+1)*exp(2*x^2+2*x)+10*exp(x^2)-10*x)/exp(x^2),x,method=_RETURNVERBOSE)

[Out]

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

Fricas [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 29, normalized size of antiderivative = 0.88 \[ \int \frac {1}{5} e^{-x^2} \left (10 e^{x^2}-10 x+e^{2 x+2 x^2} \left (1+2 x+2 x^2\right )\right ) \, dx=\frac {1}{5} \, {\left (x e^{\left (2 \, x^{2} + 2 \, x\right )} + 10 \, x e^{\left (x^{2}\right )} + 5\right )} e^{\left (-x^{2}\right )} \]

[In]

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

[Out]

1/5*(x*e^(2*x^2 + 2*x) + 10*x*e^(x^2) + 5)*e^(-x^2)

Sympy [A] (verification not implemented)

Time = 0.53 (sec) , antiderivative size = 27, normalized size of antiderivative = 0.82 \[ \int \frac {1}{5} e^{-x^2} \left (10 e^{x^2}-10 x+e^{2 x+2 x^2} \left (1+2 x+2 x^2\right )\right ) \, dx=2 x + \frac {x e^{- x^{2}} e^{2 x^{2} + 2 x}}{5} + e^{- x^{2}} \]

[In]

integrate(1/5*((2*x**2+2*x+1)*exp(2*x**2+2*x)+10*exp(x**2)-10*x)/exp(x**2),x)

[Out]

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

Maxima [C] (verification not implemented)

Result contains higher order function than in optimal. Order 4 vs. order 3.

Time = 0.23 (sec) , antiderivative size = 130, normalized size of antiderivative = 3.94 \[ \int \frac {1}{5} e^{-x^2} \left (10 e^{x^2}-10 x+e^{2 x+2 x^2} \left (1+2 x+2 x^2\right )\right ) \, dx=-\frac {1}{10} i \, \sqrt {\pi } \operatorname {erf}\left (i \, x + i\right ) e^{\left (-1\right )} - \frac {1}{5} \, {\left (\frac {{\left (x + 1\right )}^{3} \Gamma \left (\frac {3}{2}, -{\left (x + 1\right )}^{2}\right )}{\left (-{\left (x + 1\right )}^{2}\right )^{\frac {3}{2}}} - \frac {\sqrt {\pi } {\left (x + 1\right )} {\left (\operatorname {erf}\left (\sqrt {-{\left (x + 1\right )}^{2}}\right ) - 1\right )}}{\sqrt {-{\left (x + 1\right )}^{2}}} + 2 \, e^{\left ({\left (x + 1\right )}^{2}\right )}\right )} e^{\left (-1\right )} - \frac {1}{5} \, {\left (\frac {\sqrt {\pi } {\left (x + 1\right )} {\left (\operatorname {erf}\left (\sqrt {-{\left (x + 1\right )}^{2}}\right ) - 1\right )}}{\sqrt {-{\left (x + 1\right )}^{2}}} - e^{\left ({\left (x + 1\right )}^{2}\right )}\right )} e^{\left (-1\right )} + 2 \, x + e^{\left (-x^{2}\right )} \]

[In]

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

[Out]

-1/10*I*sqrt(pi)*erf(I*x + I)*e^(-1) - 1/5*((x + 1)^3*gamma(3/2, -(x + 1)^2)/(-(x + 1)^2)^(3/2) - sqrt(pi)*(x
+ 1)*(erf(sqrt(-(x + 1)^2)) - 1)/sqrt(-(x + 1)^2) + 2*e^((x + 1)^2))*e^(-1) - 1/5*(sqrt(pi)*(x + 1)*(erf(sqrt(
-(x + 1)^2)) - 1)/sqrt(-(x + 1)^2) - e^((x + 1)^2))*e^(-1) + 2*x + e^(-x^2)

Giac [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 21, normalized size of antiderivative = 0.64 \[ \int \frac {1}{5} e^{-x^2} \left (10 e^{x^2}-10 x+e^{2 x+2 x^2} \left (1+2 x+2 x^2\right )\right ) \, dx=\frac {1}{5} \, x e^{\left (x^{2} + 2 \, x\right )} + 2 \, x + e^{\left (-x^{2}\right )} \]

[In]

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

[Out]

1/5*x*e^(x^2 + 2*x) + 2*x + e^(-x^2)

Mupad [B] (verification not implemented)

Time = 0.20 (sec) , antiderivative size = 21, normalized size of antiderivative = 0.64 \[ \int \frac {1}{5} e^{-x^2} \left (10 e^{x^2}-10 x+e^{2 x+2 x^2} \left (1+2 x+2 x^2\right )\right ) \, dx=2\,x+{\mathrm {e}}^{-x^2}+\frac {x\,{\mathrm {e}}^{x^2+2\,x}}{5} \]

[In]

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

[Out]

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