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

   Optimal result
   Rubi [A] (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 = 120, antiderivative size = 26 \[ \int \frac {4 x^2+e^{\frac {-4+x-x^2}{x}} \left (-16+4 x^2\right )+\left (e^{\frac {-4+x-x^2}{x}} x^2-x^3\right ) \log \left (e^{\frac {-4+x-x^2}{x}}-x\right )}{\left (e^{\frac {-4+x-x^2}{x}} x^2-x^3\right ) \log \left (e^{\frac {-4+x-x^2}{x}}-x\right )} \, dx=x-\log \left (\log ^4\left (e^{\frac {-4+x-x^2}{x}}-x\right )\right ) \]

[Out]

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

Rubi [A] (verified)

Time = 0.51 (sec) , antiderivative size = 22, normalized size of antiderivative = 0.85, number of steps used = 3, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.017, Rules used = {6820, 6816} \[ \int \frac {4 x^2+e^{\frac {-4+x-x^2}{x}} \left (-16+4 x^2\right )+\left (e^{\frac {-4+x-x^2}{x}} x^2-x^3\right ) \log \left (e^{\frac {-4+x-x^2}{x}}-x\right )}{\left (e^{\frac {-4+x-x^2}{x}} x^2-x^3\right ) \log \left (e^{\frac {-4+x-x^2}{x}}-x\right )} \, dx=x-4 \log \left (\log \left (e^{-x-\frac {4}{x}+1}-x\right )\right ) \]

[In]

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

[Out]

x - 4*Log[Log[E^(1 - 4/x - x) - x]]

Rule 6816

Int[(u_)/(y_), x_Symbol] :> With[{q = DerivativeDivides[y, u, x]}, Simp[q*Log[RemoveContent[y, x]], x] /;  !Fa
lseQ[q]]

Rule 6820

Int[u_, x_Symbol] :> With[{v = SimplifyIntegrand[u, x]}, Int[v, x] /; SimplerIntegrandQ[v, u, x]]

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

Mathematica [A] (verified)

Time = 0.75 (sec) , antiderivative size = 22, normalized size of antiderivative = 0.85 \[ \int \frac {4 x^2+e^{\frac {-4+x-x^2}{x}} \left (-16+4 x^2\right )+\left (e^{\frac {-4+x-x^2}{x}} x^2-x^3\right ) \log \left (e^{\frac {-4+x-x^2}{x}}-x\right )}{\left (e^{\frac {-4+x-x^2}{x}} x^2-x^3\right ) \log \left (e^{\frac {-4+x-x^2}{x}}-x\right )} \, dx=x-4 \log \left (\log \left (e^{1-\frac {4}{x}-x}-x\right )\right ) \]

[In]

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

[Out]

x - 4*Log[Log[E^(1 - 4/x - x) - x]]

Maple [A] (verified)

Time = 0.12 (sec) , antiderivative size = 24, normalized size of antiderivative = 0.92

method result size
norman \(x -4 \ln \left (\ln \left ({\mathrm e}^{\frac {-x^{2}+x -4}{x}}-x \right )\right )\) \(24\)
risch \(x -4 \ln \left (\ln \left ({\mathrm e}^{-\frac {x^{2}-x +4}{x}}-x \right )\right )\) \(25\)
parallelrisch \(x -4 \ln \left (\ln \left ({\mathrm e}^{-\frac {x^{2}-x +4}{x}}-x \right )\right )\) \(25\)

[In]

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

[Out]

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

Fricas [A] (verification not implemented)

none

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

[In]

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

[Out]

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

Sympy [A] (verification not implemented)

Time = 0.21 (sec) , antiderivative size = 17, normalized size of antiderivative = 0.65 \[ \int \frac {4 x^2+e^{\frac {-4+x-x^2}{x}} \left (-16+4 x^2\right )+\left (e^{\frac {-4+x-x^2}{x}} x^2-x^3\right ) \log \left (e^{\frac {-4+x-x^2}{x}}-x\right )}{\left (e^{\frac {-4+x-x^2}{x}} x^2-x^3\right ) \log \left (e^{\frac {-4+x-x^2}{x}}-x\right )} \, dx=x - 4 \log {\left (\log {\left (- x + e^{\frac {- x^{2} + x - 4}{x}} \right )} \right )} \]

[In]

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

[Out]

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

Maxima [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 33, normalized size of antiderivative = 1.27 \[ \int \frac {4 x^2+e^{\frac {-4+x-x^2}{x}} \left (-16+4 x^2\right )+\left (e^{\frac {-4+x-x^2}{x}} x^2-x^3\right ) \log \left (e^{\frac {-4+x-x^2}{x}}-x\right )}{\left (e^{\frac {-4+x-x^2}{x}} x^2-x^3\right ) \log \left (e^{\frac {-4+x-x^2}{x}}-x\right )} \, dx=x - 4 \, \log \left (-\frac {x^{2} - x \log \left (-x e^{\left (x + \frac {4}{x}\right )} + e\right ) + 4}{x}\right ) \]

[In]

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

[Out]

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

Giac [A] (verification not implemented)

none

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

[In]

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

[Out]

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

Mupad [B] (verification not implemented)

Time = 14.09 (sec) , antiderivative size = 23, normalized size of antiderivative = 0.88 \[ \int \frac {4 x^2+e^{\frac {-4+x-x^2}{x}} \left (-16+4 x^2\right )+\left (e^{\frac {-4+x-x^2}{x}} x^2-x^3\right ) \log \left (e^{\frac {-4+x-x^2}{x}}-x\right )}{\left (e^{\frac {-4+x-x^2}{x}} x^2-x^3\right ) \log \left (e^{\frac {-4+x-x^2}{x}}-x\right )} \, dx=x-4\,\ln \left (\ln \left ({\mathrm {e}}^{-x}\,\mathrm {e}\,{\mathrm {e}}^{-\frac {4}{x}}-x\right )\right ) \]

[In]

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

[Out]

x - 4*log(log(exp(-x)*exp(1)*exp(-4/x) - x))