<s>[INST] Simplifying the surd $\sqrt{3 - \sqrt{8}}$ Recently I was solving a math problem and I came across the following ( Only part of the problem ):
$$\sqrt{3 - \sqrt{8}}$$
Here's is what I did to simplify the above:
$$(a-b)^2=a^2+b^2-2ab$$
$$\sqrt{1+2-2\sqrt{2}}$$
$$\sqrt{(1-\sqrt{2})^2}$$
$$=1-\sqrt{2}$$
When you expand $(1-\sqrt{2})^2$ you do get $3 - \sqrt{8}$. However, I found that upon the expansion of $(\sqrt{2}-1)^2$ I also arrive at the same answer as before  $3 - \sqrt{8}$.
Yet the in the solution of the problem I was doing it required me to use the latter $(\sqrt{2}-1)^2$ to find the correct answer. $(1-\sqrt{2})^2$ did not help to solve the problem. Why is this the case? Why does the latter only hold true?
I suspect this might have something to do with the square root function only returning a positive value. Might this be the case? If so, could someone explain why a square root function can only return a positive value. My working above seems to give a negative answer ( As $\sqrt{2}>1 )$ in the square root function, but I can't seem to find what I'm doing wrong.
 [/INST] We have $\sqrt {3-\sqrt 8 }=\sqrt {3-2\sqrt 2 }.$ We ask whether there exist rational $a,b$ such that that $$3-2\sqrt 2=(a+b\sqrt 2)^2=(a^2+2b^2)+2ab\sqrt 2.$$ Since $a,b\in\Bbb Q$, this requires $$ (\bullet) \quad a^2+2/a^2=3 \land -2ab=2.$$ So $b=-1/a$ from the 2nd equation of $(\bullet).$ So $3=a^2+2b^2=a^2+2/a^2.$
Let $a^2=x.$ Then $3=x+2/x.$ So $x^2-3x+2=0.$ Take the solution $x=1.$ Now if $a=-1$ then $a^2=1=x,$ and with $b=-1/a=1,$ we see that $(\bullet)$ must hold.
</s>