$\int \frac{1}{x\sqrt{{x^2}+1}} dx =\sec^{-1} |x| + C$
I'm a bit confused as to why the solution is $\sec^{-1}|x|$ instead of $\sec^{-1}x$, here is what I did:
let $x = \sec\theta, dx = \sec\theta\cdot \tan\theta \cdot d\theta$
$\int \frac{1}{x\sqrt{{x^2}+1}} dx = \int \frac{\sec\theta\cdot \tan\theta}{\sec\theta \sqrt{{\sec^2}\theta - 1}}dθ = \int \frac{\tan\theta}{\sqrt{\tan^2 \theta}}d\theta = \int1 \cdot d\theta = \theta + C = \sec^{-1}x + C $
Why is it $\sec^{-1}|x|$ instead of $\sec^{-1}x$?
Thanks in advance, and sorry if this question has been posted before.