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

   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 = 77, antiderivative size = 33 \[ \int \frac {x^2+e^{-x+\frac {-x-e^4 x+\log ^2(4)}{x}} x \left (-x+x^2+\log ^2(4)\right )+e^{\frac {-x-e^4 x+\log ^2(4)}{x}} \left (x^2-x \log ^2(4)\right )}{x^2} \, dx=x+e^{-e^4+\frac {-x+\log ^2(4)}{x}} \left (x-e^{-x} x\right ) \]

[Out]

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

Rubi [A] (verified)

Time = 0.67 (sec) , antiderivative size = 66, normalized size of antiderivative = 2.00, number of steps used = 6, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.039, Rules used = {14, 6874, 2326} \[ \int \frac {x^2+e^{-x+\frac {-x-e^4 x+\log ^2(4)}{x}} x \left (-x+x^2+\log ^2(4)\right )+e^{\frac {-x-e^4 x+\log ^2(4)}{x}} \left (x^2-x \log ^2(4)\right )}{x^2} \, dx=-\frac {e^{-x+\frac {\log ^2(4)}{x}-e^4-1} \left (x^2+\log ^2(4)\right )}{x \left (\frac {\log ^2(4)}{x^2}+1\right )}+x+x e^{\frac {\log ^2(4)}{x}-e^4-1} \]

[In]

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

[Out]

x + E^(-1 - E^4 + Log[4]^2/x)*x - (E^(-1 - E^4 - x + Log[4]^2/x)*(x^2 + Log[4]^2))/(x*(1 + Log[4]^2/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]

Rule 6874

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

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

Mathematica [A] (verified)

Time = 0.12 (sec) , antiderivative size = 43, normalized size of antiderivative = 1.30 \[ \int \frac {x^2+e^{-x+\frac {-x-e^4 x+\log ^2(4)}{x}} x \left (-x+x^2+\log ^2(4)\right )+e^{\frac {-x-e^4 x+\log ^2(4)}{x}} \left (x^2-x \log ^2(4)\right )}{x^2} \, dx=\left (1+e^{-1-e^4+\frac {\log ^2(4)}{x}}-e^{-1-e^4-x+\frac {\log ^2(4)}{x}}\right ) x \]

[In]

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

[Out]

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

Maple [A] (verified)

Time = 1.14 (sec) , antiderivative size = 47, normalized size of antiderivative = 1.42

method result size
risch \(x \,{\mathrm e}^{-\frac {x \,{\mathrm e}^{4}-4 \ln \left (2\right )^{2}+x}{x}}-x \,{\mathrm e}^{-\frac {x \,{\mathrm e}^{4}-4 \ln \left (2\right )^{2}+x^{2}+x}{x}}+x\) \(47\)
parallelrisch \(x \,{\mathrm e}^{-\frac {x \,{\mathrm e}^{4}-4 \ln \left (2\right )^{2}+x}{x}}-{\mathrm e}^{-\frac {x \,{\mathrm e}^{4}-4 \ln \left (2\right )^{2}+x}{x}} {\mathrm e}^{\ln \left (x \right )-x}+x\) \(50\)
default \(x +\frac {x^{2} {\mathrm e}^{\frac {4 \ln \left (2\right )^{2}-x \,{\mathrm e}^{4}-x}{x}}-x \,{\mathrm e}^{\frac {4 \ln \left (2\right )^{2}-x \,{\mathrm e}^{4}-x}{x}} {\mathrm e}^{\ln \left (x \right )-x}}{x}\) \(62\)
parts \(x +\frac {x^{2} {\mathrm e}^{\frac {4 \ln \left (2\right )^{2}-x \,{\mathrm e}^{4}-x}{x}}-x \,{\mathrm e}^{\frac {4 \ln \left (2\right )^{2}-x \,{\mathrm e}^{4}-x}{x}} {\mathrm e}^{\ln \left (x \right )-x}}{x}\) \(62\)
norman \(\frac {x^{2}+x^{2} {\mathrm e}^{\frac {4 \ln \left (2\right )^{2}-x \,{\mathrm e}^{4}-x}{x}}-x \,{\mathrm e}^{\frac {4 \ln \left (2\right )^{2}-x \,{\mathrm e}^{4}-x}{x}} {\mathrm e}^{\ln \left (x \right )-x}}{x}\) \(63\)

[In]

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

[Out]

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

Fricas [A] (verification not implemented)

none

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

[In]

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

[Out]

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

Sympy [A] (verification not implemented)

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

[In]

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

[Out]

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

Maxima [C] (verification not implemented)

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

Time = 0.37 (sec) , antiderivative size = 71, normalized size of antiderivative = 2.15 \[ \int \frac {x^2+e^{-x+\frac {-x-e^4 x+\log ^2(4)}{x}} x \left (-x+x^2+\log ^2(4)\right )+e^{\frac {-x-e^4 x+\log ^2(4)}{x}} \left (x^2-x \log ^2(4)\right )}{x^2} \, dx=4 \, {\rm Ei}\left (\frac {4 \, \log \left (2\right )^{2}}{x}\right ) e^{\left (-e^{4} - 1\right )} \log \left (2\right )^{2} - 4 \, e^{\left (-e^{4} - 1\right )} \Gamma \left (-1, -\frac {4 \, \log \left (2\right )^{2}}{x}\right ) \log \left (2\right )^{2} - x e^{\left (-x + \frac {4 \, \log \left (2\right )^{2}}{x} - e^{4} - 1\right )} + x \]

[In]

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

[Out]

4*Ei(4*log(2)^2/x)*e^(-e^4 - 1)*log(2)^2 - 4*e^(-e^4 - 1)*gamma(-1, -4*log(2)^2/x)*log(2)^2 - x*e^(-x + 4*log(
2)^2/x - e^4 - 1) + x

Giac [A] (verification not implemented)

none

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

[In]

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

[Out]

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

Mupad [B] (verification not implemented)

Time = 11.79 (sec) , antiderivative size = 45, normalized size of antiderivative = 1.36 \[ \int \frac {x^2+e^{-x+\frac {-x-e^4 x+\log ^2(4)}{x}} x \left (-x+x^2+\log ^2(4)\right )+e^{\frac {-x-e^4 x+\log ^2(4)}{x}} \left (x^2-x \log ^2(4)\right )}{x^2} \, dx=x+x\,{\mathrm {e}}^{-{\mathrm {e}}^4}\,{\mathrm {e}}^{-1}\,{\mathrm {e}}^{\frac {4\,{\ln \left (2\right )}^2}{x}}-x\,{\mathrm {e}}^{-{\mathrm {e}}^4}\,{\mathrm {e}}^{-x}\,{\mathrm {e}}^{-1}\,{\mathrm {e}}^{\frac {4\,{\ln \left (2\right )}^2}{x}} \]

[In]

int((x^2 - exp(-(x + x*exp(4) - 4*log(2)^2)/x)*(4*x*log(2)^2 - x^2) + exp(log(x) - x)*exp(-(x + x*exp(4) - 4*l
og(2)^2)/x)*(4*log(2)^2 - x + x^2))/x^2,x)

[Out]

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