<s>[INST] Integrating $\int \sqrt{x+\sqrt{x^2+1}}\,\mathrm{d}x$ Integrating $$\int \sqrt{x+\sqrt{x^2+1}}\,\mathrm{d}x$$
Using substitution of $x=\tan \theta$, I got the required answer. But is there a more elegant solution to the problem?
 [/INST] Let $$ I = \int \sqrt{x+\sqrt{x^2+1}} \, dx\;,$$ Let $$x+\sqrt{x^2+1} = t^2 \tag 1$$
Then $$ \left(1+\frac{x}{\sqrt{x^2+1}}\right) \, dx = 2t \, dt\Rightarrow t^2 \, dx = 2t\sqrt{x^2+1} \, dt$$
Now using $$\bullet\; \left(\sqrt{x^2+1}+x\right)\cdot \left(\sqrt{x^2+1}-x\right) = 1$$
So we get $$ \sqrt{x^2+1}-x = \frac{1}{\sqrt{x^2+1}+x} = \frac{1}{t^2} \tag 2$$
Now add $(1)$ and $(2)\;,$ we get $\displaystyle \sqrt{x^2+1} = \frac{t^2+t^{-2}}{2}$
So we get $$ dx = \frac{\left(t^2+t^{-2}\right)\cdot 2t}{2t^2} \, dt$$
so Integral $$\displaystyle I = \int ( t^2+t^{-2}) \, dt = \frac{t^3}{3}-\frac{1}{t}+\mathcal{C}$$
</s>