Differentiating $\ln(x-1)$ gives $1/(x-1)$, but integrating $1/(x-1)$ gives $\ln|x-1|$. Clearly there is a discrepancy. Why is the integral of $1/(x-1)$ given as $\ln|x-1|$? I have not been able to find a satisfactory explanation.
Isn't that technically expanding the scope of the domain to more than it should actually be?
Actually, we have
$$\frac{d\ln|x-1|}{dx}=\frac{1}{x-1}$$
for $x\ne1$.
When $x>1$, $\ln|x-1|=\ln(x-1)$ and so
$$\frac{d\ln|x-1|}{dx}=\frac{d\ln(x-1)}{dx}=\frac{1}{x-1}$$
When $x<1$, $\ln|x-1|=\ln(1-x)$ and so
$$\frac{d\ln|x-1|}{dx}=\frac{d\ln(1-x)}{d(1-x)}\cdot\frac{d(1-x)}{dx}=\frac{-1}{1-x}=\frac{1}{x-1}$$