<s>[INST] Derivative of $\sec^{-1}x$ and integral of $\frac{1}{x\sqrt{x^2-1}}$ My attempt is as follows:-

*

*Derivative of $\sec^{-1}x$
Let $\theta=\sec^{-1}x,$ where $\theta\in [0,\pi]-{\dfrac{\pi}{2}}.$
$$\sec\theta=x.$$
Differentiating both sides with respect to $x:$
$$\sec\theta\cdot\tan\theta\cdot\dfrac{\mathrm d\theta}{\mathrm dx}=1\\
\dfrac{\mathrm d\theta}{\mathrm dx}=\dfrac{1}{x\sqrt{x^2-1}}.$$
As $\sec^{-1}x$ is a strictly increasing function, its derivative should be positive, hence we write $x$ as $|x|$ to ensure that $\dfrac{\mathrm d\theta}{\mathrm dx}$ will not be negative if $x$ is negative. But I wonder why I didn't get $\dfrac{\mathrm d\theta}{\mathrm dx}=\dfrac{1}{|x|\sqrt{x^2-1}}$ in the above calculation?


*Integral of $\dfrac{1}{x\sqrt{x^2-1}}$
Case $1:x>0$
Then the integral is definitely $\sec^{-1}x.$
Case $2: x<0$
Then the integral is $-\sec^{-1}x.$
But many textbooks write that $\displaystyle\int\frac{1}{x\sqrt{x^2-1}}\,\mathrm dx=\sec^{-1}x+C.$
Shouldn't $\displaystyle\int\frac{1}{|x|\sqrt{x^2-1}}\,\mathrm dx=\sec^{-1}x+C\:?$ What am I missing here?
 [/INST] To avoid $\pm$ signs, proceed as follows:

*

*Derivative of $\sec^{-1}x$. Let $\theta=\sec^{-1}x,$ with $\theta\in [0,\pi]-{\dfrac{\pi}{2}}$. Then, $\sin \theta >0$
$$\cos\theta=\frac1{\sec\theta}=\frac1x\implies \sin\theta\cdot\dfrac{\mathrm d\theta}{\mathrm dx}=\frac1{x^2}\\
\dfrac{\mathrm d\theta}{\mathrm dx}=\frac{1}{x^2\sin\theta} =\frac{1}{x^2\sqrt{1-\frac1{x^2}}}= \frac{1}{\sqrt{x^2(x^2-1)}} $$


*Integral of $\dfrac{1}{x\sqrt{x^2-1}}$. For integration valid for the whole domain $|x|>1$
$$\int \frac{1}{x\sqrt{x^2-1}}dx
= \int \frac{d(\sqrt{x^2-1})}{(x^2-1)+1}=\tan^{-1}\sqrt{x^2-1}+C
$$
</s>