I have to find the value of:
( The picture )

Now, I understood how they took $x = \sqrt{1+2x}$ $\implies x^2-2x-1= 0$
But how did they take $(x-1)^2 = 2$?
$$ x^2-2x-1 = \underbrace{x^2-2x+\color{red}{1}}-\color{red}{1}-1 = (x-1)^2-1-1 = (x-1)^2-2$$
so $$ x^2-2x-1 = 0\implies (x-1)^2=2$$