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

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

[Out]

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

Rubi [A] (verified)

Time = 0.02 (sec) , antiderivative size = 14, normalized size of antiderivative = 0.67, number of steps used = 4, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.150, Rules used = {12, 14, 2228} \[ \int \frac {-5 x+e^x (-2+2 x)}{2 x^2} \, dx=\frac {e^x}{x}-\frac {5 \log (x)}{2} \]

[In]

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

[Out]

E^x/x - (5*Log[x])/2

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, 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
]

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

Mathematica [A] (verified)

Time = 0.07 (sec) , antiderivative size = 17, normalized size of antiderivative = 0.81 \[ \int \frac {-5 x+e^x (-2+2 x)}{2 x^2} \, dx=\frac {1}{2} \left (\frac {2 e^x}{x}-5 \log (x)\right ) \]

[In]

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

[Out]

((2*E^x)/x - 5*Log[x])/2

Maple [A] (verified)

Time = 0.19 (sec) , antiderivative size = 12, normalized size of antiderivative = 0.57

method result size
default \(-\frac {5 \ln \left (x \right )}{2}+\frac {{\mathrm e}^{x}}{x}\) \(12\)
norman \(-\frac {5 \ln \left (x \right )}{2}+\frac {{\mathrm e}^{x}}{x}\) \(12\)
risch \(-\frac {5 \ln \left (x \right )}{2}+\frac {{\mathrm e}^{x}}{x}\) \(12\)
parts \(-\frac {5 \ln \left (x \right )}{2}+\frac {{\mathrm e}^{x}}{x}\) \(12\)
parallelrisch \(-\frac {5 x \ln \left (x \right )-2 \,{\mathrm e}^{x}}{2 x}\) \(16\)

[In]

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

[Out]

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

Fricas [A] (verification not implemented)

none

Time = 0.31 (sec) , antiderivative size = 15, normalized size of antiderivative = 0.71 \[ \int \frac {-5 x+e^x (-2+2 x)}{2 x^2} \, dx=-\frac {5 \, x \log \left (x\right ) - 2 \, e^{x}}{2 \, x} \]

[In]

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

[Out]

-1/2*(5*x*log(x) - 2*e^x)/x

Sympy [A] (verification not implemented)

Time = 0.04 (sec) , antiderivative size = 10, normalized size of antiderivative = 0.48 \[ \int \frac {-5 x+e^x (-2+2 x)}{2 x^2} \, dx=- \frac {5 \log {\left (x \right )}}{2} + \frac {e^{x}}{x} \]

[In]

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

[Out]

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

Maxima [C] (verification not implemented)

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

Time = 0.21 (sec) , antiderivative size = 14, normalized size of antiderivative = 0.67 \[ \int \frac {-5 x+e^x (-2+2 x)}{2 x^2} \, dx={\rm Ei}\left (x\right ) - \Gamma \left (-1, -x\right ) - \frac {5}{2} \, \log \left (x\right ) \]

[In]

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

[Out]

Ei(x) - gamma(-1, -x) - 5/2*log(x)

Giac [A] (verification not implemented)

none

Time = 0.30 (sec) , antiderivative size = 15, normalized size of antiderivative = 0.71 \[ \int \frac {-5 x+e^x (-2+2 x)}{2 x^2} \, dx=-\frac {5 \, x \log \left (x\right ) - 2 \, e^{x}}{2 \, x} \]

[In]

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

[Out]

-1/2*(5*x*log(x) - 2*e^x)/x

Mupad [B] (verification not implemented)

Time = 11.24 (sec) , antiderivative size = 11, normalized size of antiderivative = 0.52 \[ \int \frac {-5 x+e^x (-2+2 x)}{2 x^2} \, dx=\frac {{\mathrm {e}}^x}{x}-\frac {5\,\ln \left (x\right )}{2} \]

[In]

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

[Out]

exp(x)/x - (5*log(x))/2