<s>[INST] How to integrate $\int \sqrt{x^2+a^2}dx$ $a$ is a parameter. I have no idea where to start
 [/INST] Integrating by parts 
$$I=\int \sqrt{x^2+a^2}\cdot1dx$$
$$=\sqrt{x^2+a^2}\int dx-\int\left( \frac{d \sqrt{x^2+a^2}}{dx}\int dx\right)dx$$
$$=x\sqrt{x^2+a^2}-\int\frac{x^2 dx}{\sqrt{x^2+a^2}}$$
Now, $$\int\frac{x^2 dx}{\sqrt{x^2+a^2}}=\frac{x^2+a^2-a^2}{\sqrt{x^2+a^2}}dx=I-a^2\int\frac{dx}{\sqrt{x^2+a^2}}$$
Put $x=a\tan \theta $ in 
$$\int\frac{dx}{\sqrt{x^2+a^2}}$$
</s>