3.162 \(\int \frac{1}{(-1+x) (2+x)} \, dx\)

Optimal. Leaf size=19 \[ \frac{1}{3} \log (1-x)-\frac{1}{3} \log (x+2) \]

[Out]

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

_______________________________________________________________________________________

Rubi [A]  time = 0.0111303, antiderivative size = 19, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 2, integrand size = 11, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.182 \[ \frac{1}{3} \log (1-x)-\frac{1}{3} \log (x+2) \]

Antiderivative was successfully verified.

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

[Out]

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

_______________________________________________________________________________________

Rubi in Sympy [A]  time = 1.11906, size = 12, normalized size = 0.63 \[ \frac{\log{\left (- x + 1 \right )}}{3} - \frac{\log{\left (x + 2 \right )}}{3} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  rubi_integrate(1/(-1+x)/(2+x),x)

[Out]

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

_______________________________________________________________________________________

Mathematica [A]  time = 0.00400331, size = 19, normalized size = 1. \[ \frac{1}{3} \log (1-x)-\frac{1}{3} \log (x+2) \]

Antiderivative was successfully verified.

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

[Out]

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

_______________________________________________________________________________________

Maple [A]  time = 0.009, size = 14, normalized size = 0.7 \[ -{\frac{\ln \left ( 2+x \right ) }{3}}+{\frac{\ln \left ( -1+x \right ) }{3}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  int(1/(-1+x)/(2+x),x)

[Out]

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

_______________________________________________________________________________________

Maxima [A]  time = 1.37572, size = 18, normalized size = 0.95 \[ -\frac{1}{3} \, \log \left (x + 2\right ) + \frac{1}{3} \, \log \left (x - 1\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate(1/((x + 2)*(x - 1)),x, algorithm="maxima")

[Out]

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

_______________________________________________________________________________________

Fricas [A]  time = 0.232421, size = 18, normalized size = 0.95 \[ -\frac{1}{3} \, \log \left (x + 2\right ) + \frac{1}{3} \, \log \left (x - 1\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate(1/((x + 2)*(x - 1)),x, algorithm="fricas")

[Out]

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

_______________________________________________________________________________________

Sympy [A]  time = 0.089443, size = 12, normalized size = 0.63 \[ \frac{\log{\left (x - 1 \right )}}{3} - \frac{\log{\left (x + 2 \right )}}{3} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate(1/(-1+x)/(2+x),x)

[Out]

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

_______________________________________________________________________________________

GIAC/XCAS [A]  time = 0.210328, size = 20, normalized size = 1.05 \[ -\frac{1}{3} \,{\rm ln}\left ({\left | x + 2 \right |}\right ) + \frac{1}{3} \,{\rm ln}\left ({\left | x - 1 \right |}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate(1/((x + 2)*(x - 1)),x, algorithm="giac")

[Out]

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