Evaluating an indefinite integral $\int\sqrt {x^2 + a^2} dx$ indefinite integral $$\int\sqrt {x^2 + a^2} dx$$
After some transformations and different substitution, I got stuck at this
$$a^2\ln|x+(x^2+a^2)| + \int\sec\theta\tan^2\theta d\theta$$
I am not sure I am getting the first step correct. Tried substituting $ x=a\tan \theta$ but that doesn't help either.

$\displaystyle \int\sqrt{x^{2}+a^{2}}dx$
$\displaystyle x=a.\ sh(t)\Rightarrow dx=a\ ch(t)dt$
$\displaystyle \int\sqrt{x^{2}+a^{2}}dx
=a^{2}\int\ ch^{2}(t)dt=\frac{a^{2}}{2}\int(1+\ ch(2t))dt $
$\displaystyle =\frac{a^{2}}{2}(t+\frac{\ sh(2t)}{2})+c$
$\displaystyle t=\ sh^{-1}(\frac{x}{a})=ln(\frac{x}{a}+\sqrt{1+\frac{x^{2}}{a^{2}}})=ln(x+\sqrt{x^{2}+a^{2}})-ln(a)$
$\displaystyle\ sh(2t)=2\ sh(t)\ ch(t)=2\frac{x}{a}\sqrt{1+\frac{x^{2}}{a^{2}}}=2\frac{x}{a^{2}}\sqrt{a^{2}+x^{2}}$
$\displaystyle \int\sqrt{x^{2}+a^{2}}dx=\frac{a^{2}}{2}ln(x+\sqrt{x^{2}+a^{2}})+\frac{x}{2}\sqrt{x^{2}+a^{2}}+C$
