Problem with square roots and squares Suppose we have
$$ x^{2} = (-x)^{2}.$$
I understand that this equation holds because
$$\begin{aligned}
(-x)^{2} &amp; = (-1\cdot x)^{2} \\
&amp; = (-1)^{2} \cdot x^{2} \\
&amp; = x^{2},
\end{aligned}$$
and so $\sqrt{x^{2}} = \sqrt{x^{2}}$ becomes $x = x$ and everything is fine.
But what if we just take the square root first, like so:
$$\sqrt{x^{2}} = \sqrt{(-x)^{2}}.$$
Wouldn't this gives $x = -x$, which is a contradiction?
Since $\sqrt{x}$ denotes the nonnegative square root of $x$, it is not true in general that $\sqrt{x^2}=x$. For instance, if $x=-5$, then
$$
\sqrt{x^2}=\sqrt{25}=5=-x \, .
$$
So sometimes $\sqrt{x^2}$ equals $x$ and sometimes it equals $-x$, depending on the sign of $x$. In general,
$$
\sqrt{x^2} =
\begin{cases}
x \text{ if $x\geq0$} \\
-x \text{ if $x\leq 0$}
\end{cases}
\, .
$$
What makes things confusing is that if $x&lt;0$, then $-x$ is positive.
i think here i'm not really sure if the outer square root can be applied first simply to be honest. I mean it looks like just in itself this example proves that the square root needs to follow certain rules to &quot;make sense&quot;.