I wished to solve $$\int \frac{\sqrt{x}}{x-1}dx \tag{1}$$ through hyperbolic trig substitution. My work is as follows:
Let $\sqrt{x}=\tanh (\theta)$. Then $(1)$ becomes $$\int -2\tanh^2(\theta)\ d\theta=-2\theta+2\tanh(\theta) +C.$$ Subbing back in yields $$-2\text{arctanh}\big(\sqrt{x}\big)+2\sqrt{x} +C. $$ Using $$\text{arctanh}(m)=\frac{1}{2}\ln\Big(\frac{1+m}{1-m} \Big) $$ I arrive at the answer $$2\sqrt{x}+\ln\Big(\frac{1-\sqrt{x}}{1+\sqrt{x}} \Big) +C. $$ However, the answer key and other integration methods suggest the answer $$ 2\sqrt{x}+\ln\Big(\frac{\sqrt{x}-1}{1+\sqrt{x}} \Big) +C. $$ Where did I go wrong?
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$.