Mistake in solving $-\int \frac{1}{x\sqrt{x^2-1}}$ I have this function $$f:(-\infty ,-1)\rightarrow \mathbb{R}, f(x)=\frac{1}{x\sqrt{x^{2}-1}}$$ and I need to find the primitives of $f(x)$.So because $x<-1$ I need to calculate $-\int \frac{1}{x\sqrt{x^2-1}}\,dx=-\arctan(\sqrt{x^2-1})+C$ but in my book the correct answer is $\arcsin\left(\frac{1}{x}\right)+C$
Where is my mistake?I solved the integral using $u=\sqrt{x^{2}-1}$

It is known that $$\arctan(x)+\arctan(1/x)=C$$ where $C$ is a constant. So your solution can be written as $$\arctan\left(\frac1{\sqrt{x^2-1}}\right):=u$$Then using some trig identities, $$\frac1{\sqrt{x^2-1}}=\tan u\\\sec^2 u=1+\tan^2 u=\frac{x^2}{x^2-1}\\\sin^2 u=1-\cos^2 u=1-\left(\frac{x^2-1}{x^2}\right)=\frac1{x^2}\\u=\arcsin\left(\frac1x\right)$$
