Domain of $\sqrt{x}$ function when solving $x^2 - 2=0$ I've been going through this solution and got stuck on explaining myself why  $x^2 = 2 \Rightarrow \sqrt{x^2} =  \sqrt{2}\Rightarrow x = \pm \sqrt2$.  Domain of $f(x)=\sqrt{x}$ is $[0,\infty)$. How taking square root both sides give $\pm \sqrt{2}$ ?

 A: What exactly is not clear to you?
In general $\sqrt{x^2} = |x|$
So your equation is equivalent to $|x| = \sqrt{2}$
And from that last equation you find the two roots
$x=-\sqrt{2}$ and $x=\sqrt{2}$
A: I think whoever wrote the text was referring to the real-valued identity $\sqrt{x^2}=\lvert x\rvert$, hence $\sqrt{x^2}=\sqrt2\Leftrightarrow \lvert x\rvert=\sqrt2\Leftrightarrow x=\sqrt2\lor x=-\sqrt2.$
Personally, I'm something of a fan of $$x^2-2=0\Leftrightarrow (x+\sqrt2)(x-\sqrt2)=0\Leftrightarrow x-\sqrt2=0\lor x+\sqrt2=0.$$
A: There are two distinct concepts at play here. $\sqrt{x}$ is a function denoting the nonnegative square root of $x$. However, the general solution to $a^2 = b^2$ is $a = \pm b$. So $\sqrt{25}=5$, but if $x^2=25$ then $x=\pm5$. As Gae. S. has already mentioned, the easiest way to see that $a^2=b^2 \iff a= \pm b$ is through factorisation:
\begin{align}
&a^2=b^2 \\
\iff&a^2-b^2=0 \\
\iff&(a+b)(a-b)=0 \\
\iff&a=-b \text{ or } a=b \, .
\end{align}
So, in your example, we have $x^2=(\sqrt{2})^2 \iff x=\pm\sqrt{2}$.
