Evaluate $\int \sqrt{x^2 + a^2}\mathrm{d}x$ I tried using integration by parts and could get to this point:
\begin{align}
\int \sqrt{x^2 + a^2}\mathrm{d}x &= x\sqrt{x^2+a^2} - \int x\frac{2x}{\sqrt{x^2 + a^2}}\mathrm{d}x 
\\\\ &= x\sqrt{x^2+a^2} -2\int \sqrt{x^2 + a^2}\mathrm{d}x + \int \frac{2a^2}{\sqrt{x^2 + a^2}}\mathrm{d}x 
\end{align}
then, I don't know how to get:
$$\int \frac{2a^2}{\sqrt{x^2 + a^2}}\mathrm{d}x$$

Those types of integrals usually take advantage of some properties of the hyperbolic sine and cosine functions - $$\sinh t=\frac{e^t-e^{-t}}{2}\\\cosh t=\frac{e^t+e^{-t}}{2}\\(\sinh t)'=\cosh t\\(\cosh t)'=-\sinh t$$ We solve by plugging in $x=a\sinh t$: $$\int\sqrt{x^2+a^2}dx=\int a\sqrt{a^2\sinh^2 t+a^2}\cosh tdt=\int a^2\sqrt{\sinh^2 t+1}\cosh tdt=a^2\int\sqrt{\cosh^2 t}\cosh^2 tdt=a^2\int \cosh^2 tdt$$
Where the last equality is true since $\sinh^2 t+1=\cosh^2 t$. Another identity of the hyperbolic sine and cosine functions is: $$\cosh^2 t=\frac{\cosh 2t+1}{2}$$ So the integral becomes: $$a^2\int \cosh^2 tdt=a^2\int \frac{\cosh 2t+1}{2}dt=\frac{a^2}{2}\left(\frac{\sinh 2t}{2}+t\right)=\frac{a^2}{2}\left(\sinh t\cosh t+t\right)$$
Since $\sinh 2t=2\sinh t\cosh t$.
Finally, plugging $x$ back, we get:
$$x=a\sinh t\Rightarrow \cosh t=\frac{\sqrt{a^2\sinh^2 t+a^2}}{a^2}=\frac{\sqrt{x^2+a^2}}{a^2}$$
And  also:  $$x=a\sinh t\Rightarrow t=\text{arcsinh} \frac{x}{a}$$
Hence: $$\int\sqrt{x^2+a^2}dx=\frac{a^2}{2}\left(\frac{\sqrt{x^2+a^2}}{a^2}+\text{arcsinh} \frac{x}{a}\right)+C$$
