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]

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

________________________________________________________________________________________

Rubi [A]  time = 0.00, antiderivative size = 19, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 11, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.182, Rules used = {36, 31} \[ \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

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*} \int \frac {1}{(-1+x) (2+x)} \, dx &=\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]  time = 0.00, size = 19, normalized size = 1.00 \[ \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

________________________________________________________________________________________

fricas [A]  time = 0.38, size = 13, normalized size = 0.68 \[ -\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/(-1+x)/(2+x),x, algorithm="fricas")

[Out]

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

________________________________________________________________________________________

giac [A]  time = 0.97, size = 15, normalized size = 0.79 \[ -\frac {1}{3} \, \log \left ({\left | x + 2 \right |}\right ) + \frac {1}{3} \, \log \left ({\left | x - 1 \right |}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maxima [A]  time = 0.59, size = 13, normalized size = 0.68 \[ -\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/(-1+x)/(2+x),x, algorithm="maxima")

[Out]

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

________________________________________________________________________________________

mupad [B]  time = 0.10, size = 12, normalized size = 0.63 \[ \frac {\ln \left (\frac {x-1}{x+2}\right )}{3} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

sympy [A]  time = 0.10, 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

________________________________________________________________________________________