\(\int e^{-e^{x^4}-x^2} (e^{e^{x^4}} (16-16 x-29 x^2+16 x^3-2 x^4)+e^{-3+e^x} (-8-30 x+16 x^2-2 x^3+e^x (16-8 x+x^2)+e^{x^4} (-64 x^3+32 x^4-4 x^5))) \, dx\) [921]

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

Optimal result

Integrand size = 102, antiderivative size = 29 \[ \int e^{-e^{x^4}-x^2} \left (e^{e^{x^4}} \left (16-16 x-29 x^2+16 x^3-2 x^4\right )+e^{-3+e^x} \left (-8-30 x+16 x^2-2 x^3+e^x \left (16-8 x+x^2\right )+e^{x^4} \left (-64 x^3+32 x^4-4 x^5\right )\right )\right ) \, dx=e^{-x^2} (-4+x)^2 \left (e^{-3+e^x-e^{x^4}}+x\right ) \]

[Out]

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

Rubi [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(118\) vs. \(2(29)=58\).

Time = 2.05 (sec) , antiderivative size = 118, normalized size of antiderivative = 4.07, number of steps used = 14, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.059, Rules used = {6874, 2258, 2236, 2240, 2243, 2326} \[ \int e^{-e^{x^4}-x^2} \left (e^{e^{x^4}} \left (16-16 x-29 x^2+16 x^3-2 x^4\right )+e^{-3+e^x} \left (-8-30 x+16 x^2-2 x^3+e^x \left (16-8 x+x^2\right )+e^{x^4} \left (-64 x^3+32 x^4-4 x^5\right )\right )\right ) \, dx=-8 e^{-x^2} x^2+16 e^{-x^2} x+e^{-x^2} x^3+\frac {e^{-e^{x^4}-x^2+e^x-3} (4-x) \left (4 e^{x^4} x^4+2 x^2-16 e^{x^4} x^3-e^x x-8 x+4 e^x\right )}{-4 e^{x^4} x^3-2 x+e^x} \]

[In]

Int[E^(-E^x^4 - x^2)*(E^E^x^4*(16 - 16*x - 29*x^2 + 16*x^3 - 2*x^4) + E^(-3 + E^x)*(-8 - 30*x + 16*x^2 - 2*x^3
 + E^x*(16 - 8*x + x^2) + E^x^4*(-64*x^3 + 32*x^4 - 4*x^5))),x]

[Out]

(16*x)/E^x^2 - (8*x^2)/E^x^2 + x^3/E^x^2 + (E^(-3 + E^x - E^x^4 - x^2)*(4 - x)*(4*E^x - 8*x - E^x*x + 2*x^2 -
16*E^x^4*x^3 + 4*E^x^4*x^4))/(E^x - 2*x - 4*E^x^4*x^3)

Rule 2236

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

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 2243

Int[(F_)^((a_.) + (b_.)*((c_.) + (d_.)*(x_))^(n_))*((c_.) + (d_.)*(x_))^(m_.), x_Symbol] :> Simp[(c + d*x)^(m
- n + 1)*(F^(a + b*(c + d*x)^n)/(b*d*n*Log[F])), x] - Dist[(m - n + 1)/(b*n*Log[F]), Int[(c + d*x)^(m - n)*F^(
a + b*(c + d*x)^n), x], x] /; FreeQ[{F, a, b, c, d}, x] && IntegerQ[2*((m + 1)/n)] && LtQ[0, (m + 1)/n, 5] &&
IntegerQ[n] && (LtQ[0, n, m + 1] || LtQ[m, n, 0])

Rule 2258

Int[(F_)^((a_.) + (b_.)*((c_.) + (d_.)*(x_))^(n_))*(u_), x_Symbol] :> Int[ExpandLinearProduct[F^(a + b*(c + d*
x)^n), u, c, d, x], x] /; FreeQ[{F, a, b, c, d, n}, x] && PolynomialQ[u, 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{align*} \text {integral}& = \int \left (-e^{-x^2} \left (-16+16 x+29 x^2-16 x^3+2 x^4\right )-e^{-3+e^x-e^{x^4}-x^2} (-4+x) \left (-2+4 e^x-8 x-e^x x+2 x^2-16 e^{x^4} x^3+4 e^{x^4} x^4\right )\right ) \, dx \\ & = -\int e^{-x^2} \left (-16+16 x+29 x^2-16 x^3+2 x^4\right ) \, dx-\int e^{-3+e^x-e^{x^4}-x^2} (-4+x) \left (-2+4 e^x-8 x-e^x x+2 x^2-16 e^{x^4} x^3+4 e^{x^4} x^4\right ) \, dx \\ & = \frac {e^{-3+e^x-e^{x^4}-x^2} (4-x) \left (4 e^x-8 x-e^x x+2 x^2-16 e^{x^4} x^3+4 e^{x^4} x^4\right )}{e^x-2 x-4 e^{x^4} x^3}-\int \left (-16 e^{-x^2}+16 e^{-x^2} x+29 e^{-x^2} x^2-16 e^{-x^2} x^3+2 e^{-x^2} x^4\right ) \, dx \\ & = \frac {e^{-3+e^x-e^{x^4}-x^2} (4-x) \left (4 e^x-8 x-e^x x+2 x^2-16 e^{x^4} x^3+4 e^{x^4} x^4\right )}{e^x-2 x-4 e^{x^4} x^3}-2 \int e^{-x^2} x^4 \, dx+16 \int e^{-x^2} \, dx-16 \int e^{-x^2} x \, dx+16 \int e^{-x^2} x^3 \, dx-29 \int e^{-x^2} x^2 \, dx \\ & = 8 e^{-x^2}+\frac {29}{2} e^{-x^2} x-8 e^{-x^2} x^2+e^{-x^2} x^3+\frac {e^{-3+e^x-e^{x^4}-x^2} (4-x) \left (4 e^x-8 x-e^x x+2 x^2-16 e^{x^4} x^3+4 e^{x^4} x^4\right )}{e^x-2 x-4 e^{x^4} x^3}+8 \sqrt {\pi } \text {erf}(x)-3 \int e^{-x^2} x^2 \, dx-\frac {29}{2} \int e^{-x^2} \, dx+16 \int e^{-x^2} x \, dx \\ & = 16 e^{-x^2} x-8 e^{-x^2} x^2+e^{-x^2} x^3+\frac {e^{-3+e^x-e^{x^4}-x^2} (4-x) \left (4 e^x-8 x-e^x x+2 x^2-16 e^{x^4} x^3+4 e^{x^4} x^4\right )}{e^x-2 x-4 e^{x^4} x^3}+\frac {3}{4} \sqrt {\pi } \text {erf}(x)-\frac {3}{2} \int e^{-x^2} \, dx \\ & = 16 e^{-x^2} x-8 e^{-x^2} x^2+e^{-x^2} x^3+\frac {e^{-3+e^x-e^{x^4}-x^2} (4-x) \left (4 e^x-8 x-e^x x+2 x^2-16 e^{x^4} x^3+4 e^{x^4} x^4\right )}{e^x-2 x-4 e^{x^4} x^3} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.12 (sec) , antiderivative size = 39, normalized size of antiderivative = 1.34 \[ \int e^{-e^{x^4}-x^2} \left (e^{e^{x^4}} \left (16-16 x-29 x^2+16 x^3-2 x^4\right )+e^{-3+e^x} \left (-8-30 x+16 x^2-2 x^3+e^x \left (16-8 x+x^2\right )+e^{x^4} \left (-64 x^3+32 x^4-4 x^5\right )\right )\right ) \, dx=e^{-3-e^{x^4}-x^2} (-4+x)^2 \left (e^{e^x}+e^{3+e^{x^4}} x\right ) \]

[In]

Integrate[E^(-E^x^4 - x^2)*(E^E^x^4*(16 - 16*x - 29*x^2 + 16*x^3 - 2*x^4) + E^(-3 + E^x)*(-8 - 30*x + 16*x^2 -
 2*x^3 + E^x*(16 - 8*x + x^2) + E^x^4*(-64*x^3 + 32*x^4 - 4*x^5))),x]

[Out]

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

Maple [A] (verified)

Time = 1.80 (sec) , antiderivative size = 46, normalized size of antiderivative = 1.59

method result size
risch \(\left (x^{3}-8 x^{2}+16 x \right ) {\mathrm e}^{-x^{2}}+\left (x^{2}-8 x +16\right ) {\mathrm e}^{-x^{2}-{\mathrm e}^{x^{4}}+{\mathrm e}^{x}-3}\) \(46\)
parallelrisch \(\left ({\mathrm e}^{{\mathrm e}^{x^{4}}} x^{3}-8 \,{\mathrm e}^{{\mathrm e}^{x^{4}}} x^{2}+x^{2} {\mathrm e}^{{\mathrm e}^{x}-3}+16 \,{\mathrm e}^{{\mathrm e}^{x^{4}}} x -8 \,{\mathrm e}^{{\mathrm e}^{x}-3} x +16 \,{\mathrm e}^{{\mathrm e}^{x}-3}\right ) {\mathrm e}^{-x^{2}} {\mathrm e}^{-{\mathrm e}^{x^{4}}}\) \(67\)

[In]

int(((-2*x^4+16*x^3-29*x^2-16*x+16)*exp(exp(x^4))+((-4*x^5+32*x^4-64*x^3)*exp(x^4)+(x^2-8*x+16)*exp(x)-2*x^3+1
6*x^2-30*x-8)*exp(exp(x)-3))/exp(x^2)/exp(exp(x^4)),x,method=_RETURNVERBOSE)

[Out]

(x^3-8*x^2+16*x)*exp(-x^2)+(x^2-8*x+16)*exp(-x^2-exp(x^4)+exp(x)-3)

Fricas [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 45, normalized size of antiderivative = 1.55 \[ \int e^{-e^{x^4}-x^2} \left (e^{e^{x^4}} \left (16-16 x-29 x^2+16 x^3-2 x^4\right )+e^{-3+e^x} \left (-8-30 x+16 x^2-2 x^3+e^x \left (16-8 x+x^2\right )+e^{x^4} \left (-64 x^3+32 x^4-4 x^5\right )\right )\right ) \, dx={\left (x^{3} - 8 \, x^{2} + 16 \, x\right )} e^{\left (-x^{2}\right )} + {\left (x^{2} - 8 \, x + 16\right )} e^{\left (-x^{2} - e^{\left (x^{4}\right )} + e^{x} - 3\right )} \]

[In]

integrate(((-2*x^4+16*x^3-29*x^2-16*x+16)*exp(exp(x^4))+((-4*x^5+32*x^4-64*x^3)*exp(x^4)+(x^2-8*x+16)*exp(x)-2
*x^3+16*x^2-30*x-8)*exp(exp(x)-3))/exp(x^2)/exp(exp(x^4)),x, algorithm="fricas")

[Out]

(x^3 - 8*x^2 + 16*x)*e^(-x^2) + (x^2 - 8*x + 16)*e^(-x^2 - e^(x^4) + e^x - 3)

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 53 vs. \(2 (24) = 48\).

Time = 0.39 (sec) , antiderivative size = 53, normalized size of antiderivative = 1.83 \[ \int e^{-e^{x^4}-x^2} \left (e^{e^{x^4}} \left (16-16 x-29 x^2+16 x^3-2 x^4\right )+e^{-3+e^x} \left (-8-30 x+16 x^2-2 x^3+e^x \left (16-8 x+x^2\right )+e^{x^4} \left (-64 x^3+32 x^4-4 x^5\right )\right )\right ) \, dx=\left (x^{3} - 8 x^{2} + 16 x\right ) e^{- x^{2}} + \left (x^{2} e^{- x^{2}} - 8 x e^{- x^{2}} + 16 e^{- x^{2}}\right ) e^{e^{x} - 3} e^{- e^{x^{4}}} \]

[In]

integrate(((-2*x**4+16*x**3-29*x**2-16*x+16)*exp(exp(x**4))+((-4*x**5+32*x**4-64*x**3)*exp(x**4)+(x**2-8*x+16)
*exp(x)-2*x**3+16*x**2-30*x-8)*exp(exp(x)-3))/exp(x**2)/exp(exp(x**4)),x)

[Out]

(x**3 - 8*x**2 + 16*x)*exp(-x**2) + (x**2*exp(-x**2) - 8*x*exp(-x**2) + 16*exp(-x**2))*exp(exp(x) - 3)*exp(-ex
p(x**4))

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 73 vs. \(2 (25) = 50\).

Time = 0.31 (sec) , antiderivative size = 73, normalized size of antiderivative = 2.52 \[ \int e^{-e^{x^4}-x^2} \left (e^{e^{x^4}} \left (16-16 x-29 x^2+16 x^3-2 x^4\right )+e^{-3+e^x} \left (-8-30 x+16 x^2-2 x^3+e^x \left (16-8 x+x^2\right )+e^{x^4} \left (-64 x^3+32 x^4-4 x^5\right )\right )\right ) \, dx=\frac {1}{2} \, {\left (2 \, x^{3} + 3 \, x\right )} e^{\left (-x^{2}\right )} - 8 \, {\left (x^{2} + 1\right )} e^{\left (-x^{2}\right )} + \frac {29}{2} \, x e^{\left (-x^{2}\right )} + {\left (x^{2} - 8 \, x + 16\right )} e^{\left (-x^{2} - e^{\left (x^{4}\right )} + e^{x} - 3\right )} + 8 \, e^{\left (-x^{2}\right )} \]

[In]

integrate(((-2*x^4+16*x^3-29*x^2-16*x+16)*exp(exp(x^4))+((-4*x^5+32*x^4-64*x^3)*exp(x^4)+(x^2-8*x+16)*exp(x)-2
*x^3+16*x^2-30*x-8)*exp(exp(x)-3))/exp(x^2)/exp(exp(x^4)),x, algorithm="maxima")

[Out]

1/2*(2*x^3 + 3*x)*e^(-x^2) - 8*(x^2 + 1)*e^(-x^2) + 29/2*x*e^(-x^2) + (x^2 - 8*x + 16)*e^(-x^2 - e^(x^4) + e^x
 - 3) + 8*e^(-x^2)

Giac [F]

\[ \int e^{-e^{x^4}-x^2} \left (e^{e^{x^4}} \left (16-16 x-29 x^2+16 x^3-2 x^4\right )+e^{-3+e^x} \left (-8-30 x+16 x^2-2 x^3+e^x \left (16-8 x+x^2\right )+e^{x^4} \left (-64 x^3+32 x^4-4 x^5\right )\right )\right ) \, dx=\int { -{\left ({\left (2 \, x^{3} - 16 \, x^{2} + 4 \, {\left (x^{5} - 8 \, x^{4} + 16 \, x^{3}\right )} e^{\left (x^{4}\right )} - {\left (x^{2} - 8 \, x + 16\right )} e^{x} + 30 \, x + 8\right )} e^{\left (e^{x} - 3\right )} + {\left (2 \, x^{4} - 16 \, x^{3} + 29 \, x^{2} + 16 \, x - 16\right )} e^{\left (e^{\left (x^{4}\right )}\right )}\right )} e^{\left (-x^{2} - e^{\left (x^{4}\right )}\right )} \,d x } \]

[In]

integrate(((-2*x^4+16*x^3-29*x^2-16*x+16)*exp(exp(x^4))+((-4*x^5+32*x^4-64*x^3)*exp(x^4)+(x^2-8*x+16)*exp(x)-2
*x^3+16*x^2-30*x-8)*exp(exp(x)-3))/exp(x^2)/exp(exp(x^4)),x, algorithm="giac")

[Out]

integrate(-((2*x^3 - 16*x^2 + 4*(x^5 - 8*x^4 + 16*x^3)*e^(x^4) - (x^2 - 8*x + 16)*e^x + 30*x + 8)*e^(e^x - 3)
+ (2*x^4 - 16*x^3 + 29*x^2 + 16*x - 16)*e^(e^(x^4)))*e^(-x^2 - e^(x^4)), x)

Mupad [B] (verification not implemented)

Time = 9.38 (sec) , antiderivative size = 37, normalized size of antiderivative = 1.28 \[ \int e^{-e^{x^4}-x^2} \left (e^{e^{x^4}} \left (16-16 x-29 x^2+16 x^3-2 x^4\right )+e^{-3+e^x} \left (-8-30 x+16 x^2-2 x^3+e^x \left (16-8 x+x^2\right )+e^{x^4} \left (-64 x^3+32 x^4-4 x^5\right )\right )\right ) \, dx={\mathrm {e}}^{-{\mathrm {e}}^{x^4}}\,{\mathrm {e}}^{{\mathrm {e}}^x-x^2-3}\,{\left (x-4\right )}^2+x\,{\mathrm {e}}^{-x^2}\,{\left (x-4\right )}^2 \]

[In]

int(-exp(-exp(x^4))*exp(-x^2)*(exp(exp(x) - 3)*(30*x - exp(x)*(x^2 - 8*x + 16) + exp(x^4)*(64*x^3 - 32*x^4 + 4
*x^5) - 16*x^2 + 2*x^3 + 8) + exp(exp(x^4))*(16*x + 29*x^2 - 16*x^3 + 2*x^4 - 16)),x)

[Out]

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