\(\int \frac {-2+x}{x} \, dx\) [5200]

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

[Out]

-1+ln(1/x^2)+1/(16+exp(2))+x

Rubi [A] (verified)

Time = 0.00 (sec) , antiderivative size = 6, normalized size of antiderivative = 0.43, number of steps used = 2, number of rules used = 1, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {45} \[ \int \frac {-2+x}{x} \, dx=x-2 \log (x) \]

[In]

Int[(-2 + x)/x,x]

[Out]

x - 2*Log[x]

Rule 45

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d
*x)^n, x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[m, 0] && ( !IntegerQ[n] || (EqQ[c, 0]
&& LeQ[7*m + 4*n + 4, 0]) || LtQ[9*m + 5*(n + 1), 0] || GtQ[m + n + 2, 0])

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

Mathematica [A] (verified)

Time = 0.00 (sec) , antiderivative size = 6, normalized size of antiderivative = 0.43 \[ \int \frac {-2+x}{x} \, dx=x-2 \log (x) \]

[In]

Integrate[(-2 + x)/x,x]

[Out]

x - 2*Log[x]

Maple [A] (verified)

Time = 0.02 (sec) , antiderivative size = 7, normalized size of antiderivative = 0.50

method result size
default \(x -2 \ln \left (x \right )\) \(7\)
norman \(x -2 \ln \left (x \right )\) \(7\)
risch \(x -2 \ln \left (x \right )\) \(7\)
parallelrisch \(x -2 \ln \left (x \right )\) \(7\)

[In]

int((-2+x)/x,x,method=_RETURNVERBOSE)

[Out]

x-2*ln(x)

Fricas [A] (verification not implemented)

none

Time = 0.23 (sec) , antiderivative size = 6, normalized size of antiderivative = 0.43 \[ \int \frac {-2+x}{x} \, dx=x - 2 \, \log \left (x\right ) \]

[In]

integrate((-2+x)/x,x, algorithm="fricas")

[Out]

x - 2*log(x)

Sympy [A] (verification not implemented)

Time = 0.03 (sec) , antiderivative size = 5, normalized size of antiderivative = 0.36 \[ \int \frac {-2+x}{x} \, dx=x - 2 \log {\left (x \right )} \]

[In]

integrate((-2+x)/x,x)

[Out]

x - 2*log(x)

Maxima [A] (verification not implemented)

none

Time = 0.17 (sec) , antiderivative size = 6, normalized size of antiderivative = 0.43 \[ \int \frac {-2+x}{x} \, dx=x - 2 \, \log \left (x\right ) \]

[In]

integrate((-2+x)/x,x, algorithm="maxima")

[Out]

x - 2*log(x)

Giac [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 7, normalized size of antiderivative = 0.50 \[ \int \frac {-2+x}{x} \, dx=x - 2 \, \log \left ({\left | x \right |}\right ) \]

[In]

integrate((-2+x)/x,x, algorithm="giac")

[Out]

x - 2*log(abs(x))

Mupad [B] (verification not implemented)

Time = 0.02 (sec) , antiderivative size = 6, normalized size of antiderivative = 0.43 \[ \int \frac {-2+x}{x} \, dx=x-2\,\ln \left (x\right ) \]

[In]

int((x - 2)/x,x)

[Out]

x - 2*log(x)