$\int \frac{\sqrt{x}}{x-1}dx $

According to wolfram alpha both answers appear to work; they must somehow differ by an additive constant.

http://www.wolframalpha.com/input/?i=derivative+of+2sqrt(x)%2Bln((sqrt(x)-1)%2F(1%2Bsqrt(x)))

http://www.wolframalpha.com/input/?i=derivative+of+2sqrt(x)%2Bln((1-sqrt(x))%2F(1%2Bsqrt(x)))

In particular that constant should be $\ln(-1)=i\pi$.


In the reals this discrepancy could be explained by understanding the anti-derivative as a piece wise function. When $\sqrt{x}<1$ we must use one form and when $\sqrt{x}>1$ we must use the other.

Your antiderivative should be $$\ln\left| \frac{1-\sqrt{x}}{1+\sqrt{x}}\right|$$

if you want it to hold when $0\leq x<1$ and when $x>1$.


Strictly speaking, your answer is correct. If $x>0$, then $\ln(-x) = \ln(x)+\pi i$; these two are off by a constant. The difference between the two answers here is that what's in the $\ln$ is off by a factor of $-1$, and so the two functions are off by a constant.