Is $(\sqrt{-x})^2$ equal to $x$ or $-x$? I have read How is it, that $\sqrt{x^2}$ is not $ x$, but $|x|$? and Is $\sqrt{x^2}=|x|$ or $=x$? Isn&#39;t $(x^2)^\frac12=x?$, but I can't understand what the value of $(\sqrt{-x})^2$ is when using complex numbers. My understanding is that it can be either


$x$, since

$$(\sqrt{-x})^2 = \sqrt{-x} \cdot \sqrt{-x} =  \sqrt{(-x)\cdot(-x)} = \sqrt{x^2} = x$$
or $-x$, since

$$(\sqrt{-x})^2 = (\sqrt{x} \cdot i)^2 = \sqrt{x}^2 \cdot i^2 = x \cdot (-1) = -x$$


Is this reasoning wrong? If so, why is it wrong and what is the correct solution?
This is because the property $\sqrt{xy} = \sqrt{x}\sqrt{y}$ that we're using does not hold for $x,y \in \Bbb C$, only for $x,y \in \Bbb R$. The complex square root is not a function per se, it is a multi-valued function.
We use the polar representation $x = re^{i\theta}$. This gives:

$-x = (-1)\cdot x = e^{i\pi} \cdot re^{i\theta} = r e^{i(\pi + \theta)}$

$\sqrt{-x} = r^{1/2} e^{1/2\cdot i (\pi + \theta)} = r^{1/2} e^{i(\pi/2 + \theta/2)}$

$(\sqrt{-x})^2 = r e^{i(\pi + \theta)} = -x$.