\(\int \frac {-3 x+e^{5/x} (5+x)+e^x (-x+x^2)-x \log (\frac {x}{3})}{x^3} \, dx\) [7866]

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

[Out]

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

Rubi [A] (verified)

Time = 0.07 (sec) , antiderivative size = 35, normalized size of antiderivative = 0.92, number of steps used = 7, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.103, Rules used = {14, 2228, 2326, 2341} \[ \int \frac {-3 x+e^{5/x} (5+x)+e^x \left (-x+x^2\right )-x \log \left (\frac {x}{3}\right )}{x^3} \, dx=-\frac {e^{5/x}}{x}+\frac {e^x}{x}+\frac {1}{x}+\frac {\log \left (\frac {x}{3}\right )+3}{x} \]

[In]

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

[Out]

x^(-1) - E^(5/x)/x + E^x/x + (3 + Log[x/3])/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 2228

Int[(F_)^((c_.)*(v_))*(u_)^(m_.)*(w_), x_Symbol] :> With[{b = Coefficient[v, x, 1], d = Coefficient[u, x, 0],
e = Coefficient[u, x, 1], f = Coefficient[w, x, 0], g = Coefficient[w, x, 1]}, Simp[g*u^(m + 1)*(F^(c*v)/(b*c*
e*Log[F])), x] /; EqQ[e*g*(m + 1) - b*c*(e*f - d*g)*Log[F], 0]] /; FreeQ[{F, c, m}, x] && LinearQ[{u, v, w}, 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 2341

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))*((d_.)*(x_))^(m_.), x_Symbol] :> Simp[(d*x)^(m + 1)*((a + b*Log[c*x^
n])/(d*(m + 1))), x] - Simp[b*n*((d*x)^(m + 1)/(d*(m + 1)^2)), x] /; FreeQ[{a, b, c, d, m, n}, x] && NeQ[m, -1
]

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

Mathematica [A] (verified)

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

[In]

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

[Out]

(4 - E^(5/x) + E^x + Log[x/3])/x

Maple [A] (verified)

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

method result size
parallelrisch \(-\frac {-4-{\mathrm e}^{x}-\ln \left (\frac {x}{3}\right )+{\mathrm e}^{\frac {5}{x}}}{x}\) \(24\)
risch \(\frac {\ln \left (\frac {x}{3}\right )}{x}+\frac {4+{\mathrm e}^{x}-{\mathrm e}^{\frac {5}{x}}}{x}\) \(26\)
default \(\frac {{\mathrm e}^{x}}{x}-\frac {{\mathrm e}^{\frac {5}{x}}}{x}+\frac {4}{x}+\frac {\ln \left (\frac {x}{3}\right )}{x}\) \(32\)
parts \(\frac {{\mathrm e}^{x}}{x}-\frac {{\mathrm e}^{\frac {5}{x}}}{x}+\frac {4}{x}+\frac {\ln \left (\frac {x}{3}\right )}{x}\) \(32\)

[In]

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

[Out]

-1/x*(-4-exp(x)-ln(1/3*x)+exp(5/x))

Fricas [A] (verification not implemented)

none

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

[In]

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

[Out]

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

Sympy [A] (verification not implemented)

Time = 0.14 (sec) , antiderivative size = 20, normalized size of antiderivative = 0.53 \[ \int \frac {-3 x+e^{5/x} (5+x)+e^x \left (-x+x^2\right )-x \log \left (\frac {x}{3}\right )}{x^3} \, dx=- \frac {e^{\frac {5}{x}}}{x} + \frac {e^{x}}{x} + \frac {\log {\left (\frac {x}{3} \right )}}{x} + \frac {4}{x} \]

[In]

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

[Out]

-exp(5/x)/x + exp(x)/x + log(x/3)/x + 4/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 = 40, normalized size of antiderivative = 1.05 \[ \int \frac {-3 x+e^{5/x} (5+x)+e^x \left (-x+x^2\right )-x \log \left (\frac {x}{3}\right )}{x^3} \, dx=\frac {\log \left (\frac {1}{3} \, x\right )}{x} + \frac {4}{x} + {\rm Ei}\left (x\right ) - \frac {1}{5} \, e^{\frac {5}{x}} + \frac {1}{5} \, \Gamma \left (2, -\frac {5}{x}\right ) - \Gamma \left (-1, -x\right ) \]

[In]

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

[Out]

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

Giac [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 20, normalized size of antiderivative = 0.53 \[ \int \frac {-3 x+e^{5/x} (5+x)+e^x \left (-x+x^2\right )-x \log \left (\frac {x}{3}\right )}{x^3} \, dx=\frac {e^{x} - e^{\frac {5}{x}} + \log \left (\frac {1}{3} \, x\right ) + 4}{x} \]

[In]

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

[Out]

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

Mupad [B] (verification not implemented)

Time = 11.96 (sec) , antiderivative size = 20, normalized size of antiderivative = 0.53 \[ \int \frac {-3 x+e^{5/x} (5+x)+e^x \left (-x+x^2\right )-x \log \left (\frac {x}{3}\right )}{x^3} \, dx=\frac {\ln \left (\frac {x}{3}\right )-{\mathrm {e}}^{5/x}+{\mathrm {e}}^x+4}{x} \]

[In]

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

[Out]

(log(x/3) - exp(5/x) + exp(x) + 4)/x