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.

$$\sqrt{x^2+a^2}dx = a^2\sqrt{\Big(\frac{x}{a}\Big)^2+1}\,d\frac{x}{a}.$$
Set $\sinh\theta=\frac{x}{a}$.
$$\sqrt{1+\sinh^2\theta}d\sinh\theta=\cosh^2\theta d\theta=\frac{1}{2}(\cosh2\theta+1)d\theta=\frac{1}{4}d(\sinh2\theta+2\theta).$$
