\(\int \frac {e^{-x} (-5 x+e^x (e^{4/x} (4-x)+e^4 x-2 x^2))}{5 x} \, dx\) [9871]

   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 = 44, antiderivative size = 28 \[ \int \frac {e^{-x} \left (-5 x+e^x \left (e^{4/x} (4-x)+e^4 x-2 x^2\right )\right )}{5 x} \, dx=2+e^{-x}+\frac {1}{5} \left (e^4-e^{4/x}-x\right ) x \]

[Out]

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

Rubi [A] (verified)

Time = 0.11 (sec) , antiderivative size = 33, normalized size of antiderivative = 1.18, number of steps used = 5, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.091, Rules used = {12, 6820, 2225, 2326} \[ \int \frac {e^{-x} \left (-5 x+e^x \left (e^{4/x} (4-x)+e^4 x-2 x^2\right )\right )}{5 x} \, dx=-\frac {x^2}{5}-\frac {1}{5} e^{4/x} x+\frac {e^4 x}{5}+e^{-x} \]

[In]

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

[Out]

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

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 2225

Int[((F_)^((c_.)*((a_.) + (b_.)*(x_))))^(n_.), x_Symbol] :> Simp[(F^(c*(a + b*x)))^n/(b*c*n*Log[F]), x] /; Fre
eQ[{F, a, b, c, n}, 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 6820

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

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

Mathematica [A] (verified)

Time = 0.04 (sec) , antiderivative size = 32, normalized size of antiderivative = 1.14 \[ \int \frac {e^{-x} \left (-5 x+e^x \left (e^{4/x} (4-x)+e^4 x-2 x^2\right )\right )}{5 x} \, dx=\frac {1}{5} \left (5 e^{-x}+e^4 x-e^{4/x} x-x^2\right ) \]

[In]

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

[Out]

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

Maple [A] (verified)

Time = 0.50 (sec) , antiderivative size = 25, normalized size of antiderivative = 0.89

method result size
default \(\frac {x \,{\mathrm e}^{4}}{5}-\frac {x^{2}}{5}+{\mathrm e}^{-x}-\frac {x \,{\mathrm e}^{\frac {4}{x}}}{5}\) \(25\)
risch \(\frac {x \,{\mathrm e}^{4}}{5}-\frac {x^{2}}{5}+{\mathrm e}^{-x}-\frac {x \,{\mathrm e}^{\frac {4}{x}}}{5}\) \(25\)
parts \(\frac {x \,{\mathrm e}^{4}}{5}-\frac {x^{2}}{5}+{\mathrm e}^{-x}-\frac {x \,{\mathrm e}^{\frac {4}{x}}}{5}\) \(25\)
norman \(\left (1-\frac {{\mathrm e}^{x} x^{2}}{5}+\frac {x \,{\mathrm e}^{4} {\mathrm e}^{x}}{5}-\frac {{\mathrm e}^{x} {\mathrm e}^{\frac {4}{x}} x}{5}\right ) {\mathrm e}^{-x}\) \(33\)
parallelrisch \(\frac {\left (x \,{\mathrm e}^{4} {\mathrm e}^{x}+5-{\mathrm e}^{x} x^{2}-{\mathrm e}^{x} {\mathrm e}^{\frac {4}{x}} x \right ) {\mathrm e}^{-x}}{5}\) \(33\)

[In]

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

[Out]

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

Fricas [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 28, normalized size of antiderivative = 1.00 \[ \int \frac {e^{-x} \left (-5 x+e^x \left (e^{4/x} (4-x)+e^4 x-2 x^2\right )\right )}{5 x} \, dx=-\frac {1}{5} \, {\left ({\left (x^{2} - x e^{4} + x e^{\frac {4}{x}}\right )} e^{x} - 5\right )} e^{\left (-x\right )} \]

[In]

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

[Out]

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

Sympy [A] (verification not implemented)

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

[In]

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

[Out]

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

Maxima [C] (verification not implemented)

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

Time = 0.22 (sec) , antiderivative size = 32, normalized size of antiderivative = 1.14 \[ \int \frac {e^{-x} \left (-5 x+e^x \left (e^{4/x} (4-x)+e^4 x-2 x^2\right )\right )}{5 x} \, dx=-\frac {1}{5} \, x^{2} + \frac {1}{5} \, x e^{4} - \frac {4}{5} \, {\rm Ei}\left (\frac {4}{x}\right ) + e^{\left (-x\right )} + \frac {4}{5} \, \Gamma \left (-1, -\frac {4}{x}\right ) \]

[In]

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

[Out]

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

Giac [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 24, normalized size of antiderivative = 0.86 \[ \int \frac {e^{-x} \left (-5 x+e^x \left (e^{4/x} (4-x)+e^4 x-2 x^2\right )\right )}{5 x} \, dx=-\frac {1}{5} \, x^{2} + \frac {1}{5} \, x e^{4} - \frac {1}{5} \, x e^{\frac {4}{x}} + e^{\left (-x\right )} \]

[In]

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

[Out]

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

Mupad [B] (verification not implemented)

Time = 17.93 (sec) , antiderivative size = 24, normalized size of antiderivative = 0.86 \[ \int \frac {e^{-x} \left (-5 x+e^x \left (e^{4/x} (4-x)+e^4 x-2 x^2\right )\right )}{5 x} \, dx={\mathrm {e}}^{-x}+\frac {x\,{\mathrm {e}}^4}{5}-\frac {x\,{\mathrm {e}}^{4/x}}{5}-\frac {x^2}{5} \]

[In]

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

[Out]

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