We are on the real domain.
We have that $\dfrac 1 {\sqrt {x^2 - a^2} }$ is defined only for $|x| > a$.
It is straightforward to evaluate $\displaystyle \int \dfrac {\mathrm d x} {\sqrt {x^2 - a^2} }$ for $x > a$.
It comes out to $\cosh^{-1} \dfrac x a$.
However, it's not so straightforward when $x < -a$.
Substitute $z = -x$ to put it into the positive real domain, and get $\mathrm d z = -\mathrm d x$.
Using integration by substitution you get:
$$\int \dfrac {\mathrm d x} {\sqrt {x^2 - a^2} } = -\int \dfrac {\mathrm d z} {\sqrt {z^2 - a^2} }$$
which seems to work out to $-\cosh^{-1} \left({\dfrac z a}\right) = -\cosh^{-1} \left({\dfrac {-x} a}\right) = -\cosh^{-1} \left|{\dfrac x a}\right|$.
But I don't believe that, I think that minus sign needs to go, because I find in the book (R.P. Gillespie's "Integration") that he sort of expects it to be $\cosh^{-1} \left|{\dfrac x a}\right|$.
That also corresponds to what I see when I draw the graph of the integrand and see it is always positive.
So how do we reconcile this fact that it's obviously positive with my evaluation where it comes out negative?