TITLE: $\sqrt{x}$$\sqrt{x}$ = $x$ but $\sqrt{x^2}$ = $|x|$. Why?
QUESTION [9 upvotes]: $\sqrt{x}$$\sqrt{x}$ = $x$ but $\sqrt{x^2}$ = $|x|$. Why is this?
I'm just learning algebra again after many years and I can't seem to figure out why this is. I'm sure this is trivial but if someone could explain it it would help me a lot. Thanks!

REPLY [17 votes]: By definition $\sqrt x$ is the unique non-negative real number $y$ such that $y^2=x$, so $\sqrt x\cdot\sqrt x=x$ is true by definition. 
Now apply the definition to $\sqrt{x^2}$: $\sqrt{x^2}$ is the unique non-negative real number $y$ such that $y^2=x^2$. If $x=0$, the only real number whose square is $x^2$ is $0$, so of course $\sqrt{x^2}=0=|0|$. If $x\ne 0$, there are always two real numbers $y$ such that $y^2=x^2$: one of them is $x$, and the other is $-x$. Exactly one of these two is positive. Since we don’t know whether $x$ is positive or not, we don’t know which of them is positive, but we know that whichever it is, it’s $|x|$. Therefore $|x|$ is the unique positive real number such that $|x|^2=x^2$, and by definition $\sqrt{x^2}=|x|$.
As an example, suppose that $x=-3$. Then $x^2=9$, and the two real numbers whose squares are $9$ are $-3$ (i.e., $x$) and $3$ (i.e., $-x$). The non-negative one is $3=-(-3)=|-3|$. Had we started with $x=3$, $x^2$ would still have been $9$, and we’d still have wanted the positive one of $x$ and $-x$, but this time that would be $x$, not $-x$. It’s still true, however, that $|x|=|3|=3$, the one that we want.