<s>[INST] How to solve $\int\sqrt{1+x\sqrt{x^2+2}}dx$ I need to solve
$$\int\sqrt{1+x\sqrt{x^2+2}}dx$$
I've chosen the substitution variables
$$u=\sqrt{x^2+2}$$
$$du=\frac{x}{\sqrt{x^2+2}}$$
However, I am completly stuck at
$$\int\sqrt{1+xu} dx$$
Which let me believe I've chosen wrong substitution variables.
I've then tried letting $u=x^2+2$ or simply $u=x$, but it does not help me at all solving it.
Would someone please give me an hint on this ?
Thanks.
 [/INST] Consider the integral
\begin{align}
I = \int \sqrt{1 + x \sqrt{x^{2} + 2}} \, dx
\end{align}
Make the substitution $x = \sqrt{2} \, csch(t)$ to obtain the integral
\begin{align}
I = - \sqrt{2} \, \int \sqrt{1 + 2 \, csch(t) \, coth(t)} \cdot csch(t) \, coth(t) \, dt.
\end{align} 
Now Wolfram can calculate the integral and provides the result
\begin{align}
- \frac{I}{\sqrt{2}} &= \frac{1}{2} \sinh(t) \sqrt{2 coth(t) csch(t)+1} \left[\frac{g(t)}{\sqrt{4 cosh(t)+cosh(2 t)-1}} - csch^2(t) \right] 
\end{align}
where
\begin{align}
g(t) = \ln\left(\tanh^2\left(\frac{t}{2}\right)\right) - \ln\left(1 + \tanh^2\left(\frac{t}{2}\right) + \sqrt{-\tanh^4\left(\frac{t}{2}\right) + 2 \tanh^2\left( \frac{t}{2}\right) +1} \right)
\end{align}
By making a careful backward substitution the result becomes
\begin{align}
I &= \frac{1}{\sqrt{2}} \left[ x \sqrt{1+x\sqrt{x^{2}+2}} + \ln\left( 1 + \frac{(x + \sqrt{x^2 + 2})^{2}}{2} + \sqrt{\frac{(x + \sqrt{x^2 + 2})^{4}}{4} + (x + \sqrt{x^2 + 2})^{2} - 1} \,  \right) \right]
\end{align}
</s>