\(\int \frac {x^2+e^{-e^{-4+4 x}+x^2} (4+16 e^{-4+4 x} x-8 x^2)}{x^2} \, dx\) [3294]

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

Optimal result

Integrand size = 41, antiderivative size = 22 \[ \int \frac {x^2+e^{-e^{-4+4 x}+x^2} \left (4+16 e^{-4+4 x} x-8 x^2\right )}{x^2} \, dx=-\frac {4 e^{-e^{-4+4 x}+x^2}}{x}+x \]

[Out]

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

Rubi [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(55\) vs. \(2(22)=44\).

Time = 0.10 (sec) , antiderivative size = 55, normalized size of antiderivative = 2.50, number of steps used = 3, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.049, Rules used = {14, 2326} \[ \int \frac {x^2+e^{-e^{-4+4 x}+x^2} \left (4+16 e^{-4+4 x} x-8 x^2\right )}{x^2} \, dx=x-\frac {4 e^{x^2-e^{4 x-4}-4} \left (2 e^{4 x} x-e^4 x^2\right )}{\left (2 e^{4 x-4}-x\right ) x^2} \]

[In]

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

[Out]

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

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]

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

Mathematica [A] (verified)

Time = 0.12 (sec) , antiderivative size = 22, normalized size of antiderivative = 1.00 \[ \int \frac {x^2+e^{-e^{-4+4 x}+x^2} \left (4+16 e^{-4+4 x} x-8 x^2\right )}{x^2} \, dx=-\frac {4 e^{-e^{-4+4 x}+x^2}}{x}+x \]

[In]

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

[Out]

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

Maple [A] (verified)

Time = 1.18 (sec) , antiderivative size = 21, normalized size of antiderivative = 0.95

method result size
risch \(x -\frac {4 \,{\mathrm e}^{-{\mathrm e}^{-4+4 x}+x^{2}}}{x}\) \(21\)
norman \(\frac {x^{2}-4 \,{\mathrm e}^{-{\mathrm e}^{-4+4 x}+x^{2}}}{x}\) \(26\)
parallelrisch \(\frac {x^{2}-4 \,{\mathrm e}^{-{\mathrm e}^{-4+4 x}+x^{2}}}{x}\) \(26\)

[In]

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

[Out]

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

Fricas [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 23, normalized size of antiderivative = 1.05 \[ \int \frac {x^2+e^{-e^{-4+4 x}+x^2} \left (4+16 e^{-4+4 x} x-8 x^2\right )}{x^2} \, dx=\frac {x^{2} - 4 \, e^{\left (x^{2} - e^{\left (4 \, x - 4\right )}\right )}}{x} \]

[In]

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

[Out]

(x^2 - 4*e^(x^2 - e^(4*x - 4)))/x

Sympy [A] (verification not implemented)

Time = 0.09 (sec) , antiderivative size = 15, normalized size of antiderivative = 0.68 \[ \int \frac {x^2+e^{-e^{-4+4 x}+x^2} \left (4+16 e^{-4+4 x} x-8 x^2\right )}{x^2} \, dx=x - \frac {4 e^{x^{2} - e^{4 x - 4}}}{x} \]

[In]

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

[Out]

x - 4*exp(x**2 - exp(4*x - 4))/x

Maxima [A] (verification not implemented)

none

Time = 0.30 (sec) , antiderivative size = 20, normalized size of antiderivative = 0.91 \[ \int \frac {x^2+e^{-e^{-4+4 x}+x^2} \left (4+16 e^{-4+4 x} x-8 x^2\right )}{x^2} \, dx=x - \frac {4 \, e^{\left (x^{2} - e^{\left (4 \, x - 4\right )}\right )}}{x} \]

[In]

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

[Out]

x - 4*e^(x^2 - e^(4*x - 4))/x

Giac [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 23, normalized size of antiderivative = 1.05 \[ \int \frac {x^2+e^{-e^{-4+4 x}+x^2} \left (4+16 e^{-4+4 x} x-8 x^2\right )}{x^2} \, dx=\frac {x^{2} - 4 \, e^{\left (x^{2} - e^{\left (4 \, x - 4\right )}\right )}}{x} \]

[In]

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

[Out]

(x^2 - 4*e^(x^2 - e^(4*x - 4)))/x

Mupad [B] (verification not implemented)

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

[In]

int((exp(x^2 - exp(4*x - 4))*(16*x*exp(4*x - 4) - 8*x^2 + 4) + x^2)/x^2,x)

[Out]

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