How to find substitution for integral: $\int \frac{1}{\sqrt{x^2+a}} dx$? How to find substitution for integral: $$\int\frac{1}{\sqrt{x^2+a}} dx$$ (a<>0).
On Integral Calculator, they gave me this for first substitution:

Substitute $$u=\frac{x}{\sqrt{a}}\longrightarrow\ \frac{du}{dx}=\frac{1}{\sqrt{a}}\ (steps)\ ⟶\ dx=\sqrt{a}du:
=\int\frac{\sqrt{a}}{\sqrt{au2+adu}}$$

but how I could find that $$\frac{x}{\sqrt{a}}$$ substitution?
 A: HINT
It depends on the sign of $a$. Let us suppose that $a > 0$.
In such case, it is convenient to apply the substitution $x = \sqrt{a}\sinh(u)$:
\begin{align*}
\int\frac{\mathrm{d}x}{\sqrt{x^{2} + a}} & = \int\frac{\mathrm{d}(\sqrt{a}\sinh(u))}{\sqrt{a\sinh^{2}(u) + a}}\\\\
& = \int\frac{\cosh(u)}{\sqrt{\sinh^{2}(u) + 1}}\mathrm{d}u\\\\
& = \int\frac{\cosh(u)}{\cosh(u)}\mathrm{d}u\\\\
& = u + C\\\\
& = \operatorname{arcsinh}\left(\frac{x}{\sqrt{a}}\right) + C
\end{align*}
Similar approach applies to $a < 0$.
Can you take it from here?
A: What you posted looks like a first step that won't get you very far anyway. Here is a different approach.
You are motivated to make $x^2+a$ into a perfect square. This resembles the trig identity:
$$\tan^2t+1=\sec^2t$$
Except you need to multiply by $a$ to get that $1$ to become an $a$:
$$a\tan^2t+a=a\sec^2t$$
$$\left(\overbrace{\sqrt{a}\tan t}^{x}\right)^2+a=\left(\sqrt{a}\sec t\right)^2$$
So I suggest you substitute $x=\sqrt{a}\tan t$, $dx=\sqrt{a}\sec^2 t$, and see where that takes you.
A: We usually manipulate integrals using algebraic methods or substitutions to make integrals identical to those in the integrals table. The integral's solution is then reached by using the formula from the table.
In this case assume that $a>0$, then:
$$\int_{}^{}\frac{1}{\sqrt{x^2+a}}dx=\int_{}^{}\frac{1}{\sqrt{a\left( \frac{x^2}{a}+1 \right)}}dx=\frac{1}{\sqrt{a}}\int_{}^{}\frac{1}{\sqrt{\left( \frac{x^2}{a}+1 \right)}}dx$$
Now from table of integrals the last integral resembles to $ \int_{}^{}\frac{1}{\sqrt{u^2+1}}du=\sinh^{-1}(u)+C $
So, that is the reason to use the substitution $ u^2=\frac{x^2}{a} $ or $u=\frac{x}{\sqrt{a}}$
