Indefinite intergral of $\int { \sqrt{ x^2-a^2} \over x } \mathrm dx $

Use the substitution:

$$x = a \sec(\theta)\implies dx = a \sec\theta\tan\theta\,d\theta$$

And use the identity

$$\sec^2(\theta)-1 = \tan^2(\theta).$$ $\require{cancel}$ Then your integral becomes: $$\begin{align}\int { \sqrt{x^2-a^2} \over x } dx & = \int \dfrac{\sqrt{a^2\sec^2 \theta - a^2}(\cancel{a \sec\theta}\tan\theta \,d\theta) }{\cancel{a\sec\theta}}\, \\ \\ & = a\int \sqrt{\tan^2\theta}\, \tan\theta\,d\theta \\ \\ &= a\int \tan^2 \theta \,d\theta \\ \\ & = a\int (\sec^2 \theta - 1)\,d\theta \\ \\ & = a \int \sec^2 \theta \,d\theta - a\int d\theta\\ \\ & = a \tan\theta - a\theta + c\end{align}$$

Now, back substitute to get $$\sqrt{x^2 - a^2} - a\left(\operatorname{arcsec} \left({x\over a }\right)\right) +c$$


Calculating this integral can be done in this way:

$$\int { \sqrt{x^2-a^2} \over x } dx =\int { x^2-a^2 \over x\sqrt{x^2-a^2} } dx= \int { x \over \sqrt{x^2-a^2} } dx-\int { a^2 \over x\sqrt{x^2-a^2} } dx =\sqrt{x^2-a^2}(+-)a\cdot\int {(\frac{x}{a})'\over \sqrt{1-(\frac{x}{a})^2)} } dx=\sqrt{x^2-a^2}(+-)a\cdot\arcsin(\frac{x}{a})+C.$$