<s>[INST] Integral of $\sqrt{x-\sqrt{x^2+1}}dx$ On Wolfram Alpha's website, I find
$$\int\sqrt{x-\sqrt{x^2+1}}dx=\frac23 \sqrt{x - \sqrt{1 + x^2}}( {2 x + \sqrt{1 + x^2}})+C$$
I am trying to get this answer by substitution by $x=\tan(\theta), y=\sqrt{x-\sqrt{x^2+1}},$ or  $y={x-\sqrt{x^2+1}}$. But the integrated  converted to more difficult form .
 [/INST] Leonardo says this will not be easy to solve.  With
$$
t=\sqrt{x-\sqrt{x^2+1}}
$$
I get
$$
\int \sqrt{x-\sqrt{x^2+1}} \;dx = 
-2\int\sqrt{\frac{(t^4-1)^2}{4t^2}+1}\;dt
=-\int \left(t^2+\frac{1}{t^2}\right)\;dt
$$
and that integral is easy.
$$\begin{align*}
-\int \left(t^2+\frac{1}{t^2}\right)\;dt &= \frac{-t^3}{3}+\frac{1}{t}+C
\\
&=
\frac{-\left( x-\sqrt {{x}^{2}+1} \right) ^{3/2}}{3}+{\frac {1}{\sqrt {x-
\sqrt {{x}^{2}+1}}}}+C
\\
&=\frac23 \sqrt{x - \sqrt{1 + x^2}}\big( {2 x + \sqrt{1 + x^2}}\big)+C
\end{align*}$$
</s>