\(\int \frac {e^{e^5} (x^2+2 x^3+e^{\frac {2 (-16+4 x-x^2)}{x}} (32-2 x^2)+e^{\frac {-16+4 x-x^2}{x}} (32 x+2 x^2-2 x^3))}{x^2} \, dx\) [5387]

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

Optimal result

Integrand size = 74, antiderivative size = 25 \[ \int \frac {e^{e^5} \left (x^2+2 x^3+e^{\frac {2 \left (-16+4 x-x^2\right )}{x}} \left (32-2 x^2\right )+e^{\frac {-16+4 x-x^2}{x}} \left (32 x+2 x^2-2 x^3\right )\right )}{x^2} \, dx=e^{e^5} \left (1+x+\left (e^{4-\frac {16}{x}-x}+x\right )^2\right ) \]

[Out]

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

Rubi [B] (verified)

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

Time = 0.19 (sec) , antiderivative size = 68, normalized size of antiderivative = 2.72, number of steps used = 5, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.054, Rules used = {12, 14, 6838, 2326} \[ \int \frac {e^{e^5} \left (x^2+2 x^3+e^{\frac {2 \left (-16+4 x-x^2\right )}{x}} \left (32-2 x^2\right )+e^{\frac {-16+4 x-x^2}{x}} \left (32 x+2 x^2-2 x^3\right )\right )}{x^2} \, dx=e^{e^5} x^2-\frac {2 e^{-x-\frac {16}{x}+e^5+4} \left (16-x^2\right )}{\left (1-\frac {16}{x^2}\right ) x}+e^{e^5} x+e^{-2 x-\frac {32}{x}+e^5+8} \]

[In]

Int[(E^E^5*(x^2 + 2*x^3 + E^((2*(-16 + 4*x - x^2))/x)*(32 - 2*x^2) + E^((-16 + 4*x - x^2)/x)*(32*x + 2*x^2 - 2
*x^3)))/x^2,x]

[Out]

E^(8 + E^5 - 32/x - 2*x) + E^E^5*x + E^E^5*x^2 - (2*E^(4 + E^5 - 16/x - x)*(16 - x^2))/((1 - 16/x^2)*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 14

Int[(u_)*((c_.)*(x_))^(m_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*u, x], x] /; FreeQ[{c, m}, x] && SumQ[u]
 &&  !LinearQ[u, x] &&  !MatchQ[u, (a_) + (b_.)*(v_) /; FreeQ[{a, b}, x] && InverseFunctionQ[v]]

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 6838

Int[(F_)^(v_)*(u_), x_Symbol] :> With[{q = DerivativeDivides[v, u, x]}, Simp[q*(F^v/Log[F]), x] /;  !FalseQ[q]
] /; FreeQ[F, x]

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

Mathematica [A] (verified)

Time = 2.78 (sec) , antiderivative size = 38, normalized size of antiderivative = 1.52 \[ \int \frac {e^{e^5} \left (x^2+2 x^3+e^{\frac {2 \left (-16+4 x-x^2\right )}{x}} \left (32-2 x^2\right )+e^{\frac {-16+4 x-x^2}{x}} \left (32 x+2 x^2-2 x^3\right )\right )}{x^2} \, dx=e^{e^5} \left (e^{8-\frac {32}{x}-2 x}+x+2 e^{4-\frac {16}{x}-x} x+x^2\right ) \]

[In]

Integrate[(E^E^5*(x^2 + 2*x^3 + E^((2*(-16 + 4*x - x^2))/x)*(32 - 2*x^2) + E^((-16 + 4*x - x^2)/x)*(32*x + 2*x
^2 - 2*x^3)))/x^2,x]

[Out]

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

Maple [A] (verified)

Time = 0.62 (sec) , antiderivative size = 43, normalized size of antiderivative = 1.72

method result size
parallelrisch \({\mathrm e}^{{\mathrm e}^{5}} \left (x^{2}+2 x \,{\mathrm e}^{-\frac {x^{2}-4 x +16}{x}}+{\mathrm e}^{-\frac {2 \left (x^{2}-4 x +16\right )}{x}}+x \right )\) \(43\)
parts \({\mathrm e}^{{\mathrm e}^{5}} \left (x^{2}+x \right )+2 \,{\mathrm e}^{{\mathrm e}^{5}} x \,{\mathrm e}^{\frac {-x^{2}+4 x -16}{x}}+{\mathrm e}^{{\mathrm e}^{5}} {\mathrm e}^{\frac {-2 x^{2}+8 x -32}{x}}\) \(53\)
risch \(x^{2} {\mathrm e}^{{\mathrm e}^{5}}+2 x \,{\mathrm e}^{\frac {x \,{\mathrm e}^{5}-x^{2}+4 x -16}{x}}+{\mathrm e}^{\frac {x \,{\mathrm e}^{5}-2 x^{2}+8 x -32}{x}}+x \,{\mathrm e}^{{\mathrm e}^{5}}\) \(55\)
norman \(\frac {x^{2} {\mathrm e}^{{\mathrm e}^{5}}+{\mathrm e}^{{\mathrm e}^{5}} x^{3}+x \,{\mathrm e}^{{\mathrm e}^{5}} {\mathrm e}^{\frac {-2 x^{2}+8 x -32}{x}}+2 x^{2} {\mathrm e}^{{\mathrm e}^{5}} {\mathrm e}^{\frac {-x^{2}+4 x -16}{x}}}{x}\) \(65\)

[In]

int(((-2*x^2+32)*exp((-x^2+4*x-16)/x)^2+(-2*x^3+2*x^2+32*x)*exp((-x^2+4*x-16)/x)+2*x^3+x^2)*exp(exp(5))/x^2,x,
method=_RETURNVERBOSE)

[Out]

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

Fricas [A] (verification not implemented)

none

Time = 0.24 (sec) , antiderivative size = 40, normalized size of antiderivative = 1.60 \[ \int \frac {e^{e^5} \left (x^2+2 x^3+e^{\frac {2 \left (-16+4 x-x^2\right )}{x}} \left (32-2 x^2\right )+e^{\frac {-16+4 x-x^2}{x}} \left (32 x+2 x^2-2 x^3\right )\right )}{x^2} \, dx={\left (x^{2} + 2 \, x e^{\left (-\frac {x^{2} - 4 \, x + 16}{x}\right )} + x + e^{\left (-\frac {2 \, {\left (x^{2} - 4 \, x + 16\right )}}{x}\right )}\right )} e^{\left (e^{5}\right )} \]

[In]

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

[Out]

(x^2 + 2*x*e^(-(x^2 - 4*x + 16)/x) + x + e^(-2*(x^2 - 4*x + 16)/x))*e^(e^5)

Sympy [B] (verification not implemented)

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

Time = 0.14 (sec) , antiderivative size = 53, normalized size of antiderivative = 2.12 \[ \int \frac {e^{e^5} \left (x^2+2 x^3+e^{\frac {2 \left (-16+4 x-x^2\right )}{x}} \left (32-2 x^2\right )+e^{\frac {-16+4 x-x^2}{x}} \left (32 x+2 x^2-2 x^3\right )\right )}{x^2} \, dx=x^{2} e^{e^{5}} + 2 x e^{\frac {- x^{2} + 4 x - 16}{x}} e^{e^{5}} + x e^{e^{5}} + e^{\frac {2 \left (- x^{2} + 4 x - 16\right )}{x}} e^{e^{5}} \]

[In]

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

[Out]

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

Maxima [A] (verification not implemented)

none

Time = 0.24 (sec) , antiderivative size = 35, normalized size of antiderivative = 1.40 \[ \int \frac {e^{e^5} \left (x^2+2 x^3+e^{\frac {2 \left (-16+4 x-x^2\right )}{x}} \left (32-2 x^2\right )+e^{\frac {-16+4 x-x^2}{x}} \left (32 x+2 x^2-2 x^3\right )\right )}{x^2} \, dx={\left (x^{2} + {\left (2 \, x e^{\left (x - \frac {16}{x} + 4\right )} + e^{\left (-\frac {32}{x} + 8\right )}\right )} e^{\left (-2 \, x\right )} + x\right )} e^{\left (e^{5}\right )} \]

[In]

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

[Out]

(x^2 + (2*x*e^(x - 16/x + 4) + e^(-32/x + 8))*e^(-2*x) + x)*e^(e^5)

Giac [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 40, normalized size of antiderivative = 1.60 \[ \int \frac {e^{e^5} \left (x^2+2 x^3+e^{\frac {2 \left (-16+4 x-x^2\right )}{x}} \left (32-2 x^2\right )+e^{\frac {-16+4 x-x^2}{x}} \left (32 x+2 x^2-2 x^3\right )\right )}{x^2} \, dx={\left (x^{2} + 2 \, x e^{\left (-\frac {x^{2} - 4 \, x + 16}{x}\right )} + x + e^{\left (-\frac {2 \, {\left (x^{2} - 4 \, x + 16\right )}}{x}\right )}\right )} e^{\left (e^{5}\right )} \]

[In]

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

[Out]

(x^2 + 2*x*e^(-(x^2 - 4*x + 16)/x) + x + e^(-2*(x^2 - 4*x + 16)/x))*e^(e^5)

Mupad [B] (verification not implemented)

Time = 12.74 (sec) , antiderivative size = 47, normalized size of antiderivative = 1.88 \[ \int \frac {e^{e^5} \left (x^2+2 x^3+e^{\frac {2 \left (-16+4 x-x^2\right )}{x}} \left (32-2 x^2\right )+e^{\frac {-16+4 x-x^2}{x}} \left (32 x+2 x^2-2 x^3\right )\right )}{x^2} \, dx=x^2\,{\mathrm {e}}^{{\mathrm {e}}^5}+x\,{\mathrm {e}}^{{\mathrm {e}}^5}+{\mathrm {e}}^{-2\,x}\,{\mathrm {e}}^8\,{\mathrm {e}}^{-\frac {32}{x}}\,{\mathrm {e}}^{{\mathrm {e}}^5}+2\,x\,{\mathrm {e}}^{-x}\,{\mathrm {e}}^4\,{\mathrm {e}}^{-\frac {16}{x}}\,{\mathrm {e}}^{{\mathrm {e}}^5} \]

[In]

int((exp(exp(5))*(exp(-(x^2 - 4*x + 16)/x)*(32*x + 2*x^2 - 2*x^3) - exp(-(2*(x^2 - 4*x + 16))/x)*(2*x^2 - 32)
+ x^2 + 2*x^3))/x^2,x)

[Out]

x^2*exp(exp(5)) + x*exp(exp(5)) + exp(-2*x)*exp(8)*exp(-32/x)*exp(exp(5)) + 2*x*exp(-x)*exp(4)*exp(-16/x)*exp(
exp(5))