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

   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 = 11, antiderivative size = 19 \[ \int \frac {1}{(-1+x) (2+x)} \, dx=\frac {1}{3} \log (1-x)-\frac {1}{3} \log (2+x) \]

[Out]

1/3*ln(1-x)-1/3*ln(2+x)

Rubi [A] (verified)

Time = 0.00 (sec) , antiderivative size = 19, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.182, Rules used = {36, 31} \[ \int \frac {1}{(-1+x) (2+x)} \, dx=\frac {1}{3} \log (1-x)-\frac {1}{3} \log (x+2) \]

[In]

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

[Out]

Log[1 - x]/3 - Log[2 + x]/3

Rule 31

Int[((a_) + (b_.)*(x_))^(-1), x_Symbol] :> Simp[Log[RemoveContent[a + b*x, x]]/b, x] /; FreeQ[{a, b}, x]

Rule 36

Int[1/(((a_.) + (b_.)*(x_))*((c_.) + (d_.)*(x_))), x_Symbol] :> Dist[b/(b*c - a*d), Int[1/(a + b*x), x], x] -
Dist[d/(b*c - a*d), Int[1/(c + d*x), x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0]

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

Mathematica [A] (verified)

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

[In]

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

[Out]

Log[1 - x]/3 - Log[2 + x]/3

Maple [A] (verified)

Time = 0.15 (sec) , antiderivative size = 14, normalized size of antiderivative = 0.74

method result size
default \(\frac {\ln \left (-1+x \right )}{3}-\frac {\ln \left (2+x \right )}{3}\) \(14\)
norman \(\frac {\ln \left (-1+x \right )}{3}-\frac {\ln \left (2+x \right )}{3}\) \(14\)
risch \(\frac {\ln \left (-1+x \right )}{3}-\frac {\ln \left (2+x \right )}{3}\) \(14\)
parallelrisch \(\frac {\ln \left (-1+x \right )}{3}-\frac {\ln \left (2+x \right )}{3}\) \(14\)

[In]

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

[Out]

1/3*ln(-1+x)-1/3*ln(2+x)

Fricas [A] (verification not implemented)

none

Time = 0.24 (sec) , antiderivative size = 13, normalized size of antiderivative = 0.68 \[ \int \frac {1}{(-1+x) (2+x)} \, dx=-\frac {1}{3} \, \log \left (x + 2\right ) + \frac {1}{3} \, \log \left (x - 1\right ) \]

[In]

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

[Out]

-1/3*log(x + 2) + 1/3*log(x - 1)

Sympy [A] (verification not implemented)

Time = 0.04 (sec) , antiderivative size = 12, normalized size of antiderivative = 0.63 \[ \int \frac {1}{(-1+x) (2+x)} \, dx=\frac {\log {\left (x - 1 \right )}}{3} - \frac {\log {\left (x + 2 \right )}}{3} \]

[In]

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

[Out]

log(x - 1)/3 - log(x + 2)/3

Maxima [A] (verification not implemented)

none

Time = 0.22 (sec) , antiderivative size = 13, normalized size of antiderivative = 0.68 \[ \int \frac {1}{(-1+x) (2+x)} \, dx=-\frac {1}{3} \, \log \left (x + 2\right ) + \frac {1}{3} \, \log \left (x - 1\right ) \]

[In]

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

[Out]

-1/3*log(x + 2) + 1/3*log(x - 1)

Giac [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 15, normalized size of antiderivative = 0.79 \[ \int \frac {1}{(-1+x) (2+x)} \, dx=-\frac {1}{3} \, \log \left ({\left | x + 2 \right |}\right ) + \frac {1}{3} \, \log \left ({\left | x - 1 \right |}\right ) \]

[In]

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

[Out]

-1/3*log(abs(x + 2)) + 1/3*log(abs(x - 1))

Mupad [B] (verification not implemented)

Time = 0.10 (sec) , antiderivative size = 12, normalized size of antiderivative = 0.63 \[ \int \frac {1}{(-1+x) (2+x)} \, dx=\frac {\ln \left (\frac {x-1}{x+2}\right )}{3} \]

[In]

int(1/((x - 1)*(x + 2)),x)

[Out]

log((x - 1)/(x + 2))/3