Square Root of $x^2$

Does the $\sqrt{x^2}$ equal $x$ or $|x|$? In other words is it an agreement that we take by default the positive square root of $x$ or we have to explicitly define it with absolute value as there could be two roots to $x^2$ ($+x$ or $-x$)?


Assuming you are talking about real $x$, the square root is defined to be the principal square root i.e. the positive one. So $\sqrt{x^2}=|x|$, as, for example $\sqrt{4}=2$ and not $-2$, while $(-2)^2=4$


The symbol $\sqrt{x}$ always denotes the positive number $y$ satisfying the equation $y^2 = x$. The reasoning behind this, as far as I know, is to make $\sqrt{x}$ a function. Every positive real number has two square roots (e.g. both $3$ and $-3$ are square roots of $9$), but if $\sqrt{x}$ denoted both of these numbers, then it would be much more annoying to deal with. For example, in an inequality, you would not be able to multiply both sides by $\sqrt{x}$, since you would have no guarantee that $\sqrt{x} > 0$. By calling $\sqrt{x}$ the positive root, it represents one number, not two, and this allows you to only deal with the negative root when you want to.

To be consistent with $\sqrt{x} > 0$, we must say $\sqrt{x^2} = |x|$.

To reinforce this, consider $\sqrt{(-2)^2}$. If we simply said that $\sqrt{x^2} = x$, then we would have $\sqrt{(-2)^2} = -2$. While it's true that $-2$ is a square root of $4$, because $(-2)^2 = 4$, it is not the positive square root, so this answer is not what we want. The positive square root is $2$, and since $\sqrt{x}$ denotes the positive root, $\sqrt{(-2)^2} = |-2| = 2.$