Solution (source code)

= Solution

The <partial fraction decomposition> is $(x-1)/[x(x+1)]=-1/x+2/(x+1)$. Since both endpoints are positive, integration gives
$$
\boxed{\int_a^b\frac{x-1}{x(x+1)}dx=\left[-\ln x+2\ln(x+1)\right]_a^b=\ln\frac{a(b+1)^2}{b(a+1)^2}.}
$$