Calculating $ \int \frac{1}{x} \sqrt{\frac{x+a}{x-a}}\mathrm dx $ I want to evaluate $ \int \frac{1}{x} \sqrt{\frac{x+a}{x-a}}\mathrm dx $.
$ x=a\cosh(2t), \int \frac{1}{x} \sqrt{\frac{x+a}{x-a}}dx= \int \frac{2\tanh(2t)}{\tanh(t)}dt= \int \frac{4}{1+\tanh^2(t)}\mathrm dt $
$ u=\tanh(t), \int \frac{4}{1+\tanh^2(t)}dt=2 \int (\frac{1}{1+u^2}+\frac{1}{1-u^2})\mathrm du=2 \mathrm{artanh}(u)+2\arctan(u)+C= $
$ \mathrm{arcosh}(x/a)+2\arctan(\sqrt{\frac{x^2-a^2}{x^2+a^2}})+C $
However, I could not manage to show that the derivative of this function is $ \frac{1}{x} \sqrt{\frac{x+a}{x-a}} $.

After substitutions back into the correct anti-derivative in terms of $u$, I get different result:
$$
  \cosh^{-1}\left(\frac{x}{a}\right) + 2 \arctan\left( \sqrt{ \frac{x-a}{x+a} }\right) + C
$$
Differentiating this, I get $\dfrac{1}{x} \left( \dfrac{x-a}{x+a} \right)^{-\frac12}$.
