# 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)$$

Hint:

You might want to plot both $$\arcsin(\frac{1}{x})$$ and $$-\arctan(\sqrt{x^2 - 1})$$, from, say, $$-3$$ to $$-1$$. You could do this using Desmos (https://www.desmos.com/). You might even insert an extra minus sign here or there...

$$\arcsin(\frac{1}{x}) +C = \operatorname{arccot}(\sqrt{x^2 - 1}) + C$$

$$=\frac{\pi}{2} - \arctan(\sqrt{x^2 - 1})+ C$$

You can form another Constant $$C_1 = \pi/2 + C$$.

So you solved correctly, the book answer and your answer are equivalent, you just had to manipulate it a little to get there. The difference is just of a constant which doesn't matter when calculating indefinite integrals.

• Yes, I understand what you're saying but my book gives both results as anwers and I just need to pick one answer.For example, at exam how to know which is good ? – DaniVaja May 1 '19 at 18:48
• @Vizag: I think that the relationship you've asserted in the first line is only correct for $x > 0$; you might want to check that by plotting both sides when $x < 0$. – John Hughes May 1 '19 at 18:50
• @DaniVaja Both are fine, since they are both correct. So you shouldn't worry too much. You could use these answers to see how to show that both forms are equivalent (up to constants). – John Doe May 1 '19 at 18:50
• @DaniVaja: Both the answers look correct to me. The expressions are equivalent up to constants. Are you sure it's not a multiple answers correct kind of question? – Vizag May 1 '19 at 18:53
• Here is the original exercise: imgur.com/hhQUzoi (i don't know the code for posting images).The book says that one answer from 5 is correct and in this exercise I have both answers, which are both good like you said.But for example in an exam, how to know which answer to pick ?In this case they chose arcsin(1/x) + c as correct answer and not -arctan... – DaniVaja May 1 '19 at 18:56