\(\int \frac {e^{x+x^2} (4+e^{\frac {1}{e^3}} (-1-2 x)+8 x)+e^{x+2 x^2} (-1-x-4 x^2)}{e} \, dx\) [4806]

   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 = 49, antiderivative size = 26 \[ \int \frac {e^{x+x^2} \left (4+e^{\frac {1}{e^3}} (-1-2 x)+8 x\right )+e^{x+2 x^2} \left (-1-x-4 x^2\right )}{e} \, dx=e^{-1+x+x^2} \left (4-e^{\frac {1}{e^3}}-e^{x^2} x\right ) \]

[Out]

(4-exp(exp(-3))-exp(x^2)*x)*exp(x)/exp(1)*exp(x^2)

Rubi [A] (verified)

Time = 0.04 (sec) , antiderivative size = 45, normalized size of antiderivative = 1.73, number of steps used = 5, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.082, Rules used = {12, 2276, 2268, 2326} \[ \int \frac {e^{x+x^2} \left (4+e^{\frac {1}{e^3}} (-1-2 x)+8 x\right )+e^{x+2 x^2} \left (-1-x-4 x^2\right )}{e} \, dx=\left (4-e^{\frac {1}{e^3}}\right ) e^{x^2+x-1}-\frac {e^{2 x^2+x-1} \left (4 x^2+x\right )}{4 x+1} \]

[In]

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

[Out]

E^(-1 + x + x^2)*(4 - E^E^(-3)) - (E^(-1 + x + 2*x^2)*(x + 4*x^2))/(1 + 4*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 2268

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 2276

Int[(F_)^(v_)*(u_)^(m_.), x_Symbol] :> Int[ExpandToSum[u, x]^m*F^ExpandToSum[v, x], x] /; FreeQ[{F, m}, x] &&
LinearQ[u, x] && QuadraticQ[v, x] &&  !(LinearMatchQ[u, x] && QuadraticMatchQ[v, 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]

Rubi steps \begin{align*} \text {integral}& = \frac {\int \left (e^{x+x^2} \left (4+e^{\frac {1}{e^3}} (-1-2 x)+8 x\right )+e^{x+2 x^2} \left (-1-x-4 x^2\right )\right ) \, dx}{e} \\ & = \frac {\int e^{x+x^2} \left (4+e^{\frac {1}{e^3}} (-1-2 x)+8 x\right ) \, dx}{e}+\frac {\int e^{x+2 x^2} \left (-1-x-4 x^2\right ) \, dx}{e} \\ & = -\frac {e^{-1+x+2 x^2} \left (x+4 x^2\right )}{1+4 x}+\frac {\int e^{x+x^2} \left (4-e^{\frac {1}{e^3}}+2 \left (4-e^{\frac {1}{e^3}}\right ) x\right ) \, dx}{e} \\ & = e^{-1+x+x^2} \left (4-e^{\frac {1}{e^3}}\right )-\frac {e^{-1+x+2 x^2} \left (x+4 x^2\right )}{1+4 x} \\ \end{align*}

Mathematica [A] (verified)

Time = 2.55 (sec) , antiderivative size = 24, normalized size of antiderivative = 0.92 \[ \int \frac {e^{x+x^2} \left (4+e^{\frac {1}{e^3}} (-1-2 x)+8 x\right )+e^{x+2 x^2} \left (-1-x-4 x^2\right )}{e} \, dx=-e^{-1+x+x^2} \left (-4+e^{\frac {1}{e^3}}+e^{x^2} x\right ) \]

[In]

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

[Out]

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

Maple [A] (verified)

Time = 0.16 (sec) , antiderivative size = 36, normalized size of antiderivative = 1.38

method result size
norman \(-x \,{\mathrm e}^{-1} {\mathrm e}^{x} {\mathrm e}^{2 x^{2}}-{\mathrm e}^{-1} \left ({\mathrm e}^{{\mathrm e}^{-3}}-4\right ) {\mathrm e}^{x} {\mathrm e}^{x^{2}}\) \(36\)
risch \(-x \,{\mathrm e}^{\left (1+x \right ) \left (-1+2 x \right )}-{\mathrm e}^{x^{2}+x -1} {\mathrm e}^{{\mathrm e}^{-3}}+4 \,{\mathrm e}^{x^{2}+x -1}\) \(36\)
parallelrisch \({\mathrm e}^{-1} \left (-{\mathrm e}^{2 x^{2}} {\mathrm e}^{x} x -{\mathrm e}^{{\mathrm e}^{-3}} {\mathrm e}^{x^{2}} {\mathrm e}^{x}+4 \,{\mathrm e}^{x} {\mathrm e}^{x^{2}}\right )\) \(39\)
default \({\mathrm e}^{-1} \left (4 \,{\mathrm e}^{x^{2}+x}+\frac {i {\mathrm e}^{{\mathrm e}^{-3}} \sqrt {\pi }\, {\mathrm e}^{-\frac {1}{4}} \operatorname {erf}\left (i x +\frac {1}{2} i\right )}{2}-2 \,{\mathrm e}^{{\mathrm e}^{-3}} \left (\frac {{\mathrm e}^{x^{2}+x}}{2}+\frac {i \sqrt {\pi }\, {\mathrm e}^{-\frac {1}{4}} \operatorname {erf}\left (i x +\frac {1}{2} i\right )}{4}\right )-x \,{\mathrm e}^{2 x^{2}+x}\right )\) \(79\)

[In]

int(((-4*x^2-x-1)*exp(x)*exp(x^2)^2+((-1-2*x)*exp(1/exp(3))+8*x+4)*exp(x)*exp(x^2))/exp(1),x,method=_RETURNVER
BOSE)

[Out]

-x/exp(1)*exp(x)*exp(x^2)^2-(exp(1/exp(3))-4)/exp(1)*exp(x)*exp(x^2)

Fricas [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 27, normalized size of antiderivative = 1.04 \[ \int \frac {e^{x+x^2} \left (4+e^{\frac {1}{e^3}} (-1-2 x)+8 x\right )+e^{x+2 x^2} \left (-1-x-4 x^2\right )}{e} \, dx=-{\left (x e^{\left (2 \, x^{2} + x\right )} + {\left (e^{\left (e^{\left (-3\right )}\right )} - 4\right )} e^{\left (x^{2} + x\right )}\right )} e^{\left (-1\right )} \]

[In]

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

[Out]

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

Sympy [A] (verification not implemented)

Time = 0.17 (sec) , antiderivative size = 44, normalized size of antiderivative = 1.69 \[ \int \frac {e^{x+x^2} \left (4+e^{\frac {1}{e^3}} (-1-2 x)+8 x\right )+e^{x+2 x^2} \left (-1-x-4 x^2\right )}{e} \, dx=\frac {- e x e^{x} e^{2 x^{2}} + \left (- e e^{x} e^{e^{-3}} + 4 e e^{x}\right ) e^{x^{2}}}{e^{2}} \]

[In]

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

[Out]

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

Maxima [C] (verification not implemented)

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

Time = 0.24 (sec) , antiderivative size = 153, normalized size of antiderivative = 5.88 \[ \int \frac {e^{x+x^2} \left (4+e^{\frac {1}{e^3}} (-1-2 x)+8 x\right )+e^{x+2 x^2} \left (-1-x-4 x^2\right )}{e} \, dx=\frac {1}{2} \, {\left (-4 i \, \sqrt {\pi } \operatorname {erf}\left (i \, x + \frac {1}{2} i\right ) e^{\left (-\frac {1}{4}\right )} + i \, \sqrt {\pi } \operatorname {erf}\left (i \, x + \frac {1}{2} i\right ) e^{\left (e^{\left (-3\right )} - \frac {1}{4}\right )} - 4 \, {\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 )} - 2 \, x e^{\left (2 \, x^{2} + x\right )} + {\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 (e^{\left (-3\right )} - \frac {1}{4}\right )}\right )} e^{\left (-1\right )} \]

[In]

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

[Out]

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

Giac [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 27, normalized size of antiderivative = 1.04 \[ \int \frac {e^{x+x^2} \left (4+e^{\frac {1}{e^3}} (-1-2 x)+8 x\right )+e^{x+2 x^2} \left (-1-x-4 x^2\right )}{e} \, dx=-{\left (x e^{\left (2 \, x^{2} + x\right )} + {\left (e^{\left (e^{\left (-3\right )}\right )} - 4\right )} e^{\left (x^{2} + x\right )}\right )} e^{\left (-1\right )} \]

[In]

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

[Out]

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

Mupad [B] (verification not implemented)

Time = 0.18 (sec) , antiderivative size = 20, normalized size of antiderivative = 0.77 \[ \int \frac {e^{x+x^2} \left (4+e^{\frac {1}{e^3}} (-1-2 x)+8 x\right )+e^{x+2 x^2} \left (-1-x-4 x^2\right )}{e} \, dx=-{\mathrm {e}}^{x^2+x-1}\,\left ({\mathrm {e}}^{{\mathrm {e}}^{-3}}+x\,{\mathrm {e}}^{x^2}-4\right ) \]

[In]

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

[Out]

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