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'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?
 A: 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.
A: If you define the square root as the “principal” one, then the identity
$$
(\sqrt{z})^2=z
$$
holds for every complex number $z$. It's obvious for $z=0$, while for $z\ne0$ one writes $z=re^{i\varphi}$ for a unique $\varphi\in[0,2\pi)$, defining
$$
\sqrt{z}=\sqrt{r}e^{i\varphi/2}
$$
where $\sqrt{r}$ is well defined because $r$ is a positive real. Then
$$
(\sqrt{z})^2=(\sqrt{r}e^{i\varphi/2})^2=re^{i\varphi}=z
$$
However, there are simple examples where
$$
\sqrt{z_1z_2}\ne\sqrt{z_1}\cdot\sqrt{z_2}
$$
For instance, if $z_1=z_2=-1$, we get
$$
\sqrt{z_1z_2}=\sqrt{1}=1
$$
whereas
$$
\sqrt{z_1}\cdot\sqrt{z_2}=i\cdot i=-1
$$
Thus your arguments based on the identity are generally wrong.
Another failure is in the fact that $\sqrt{z^2}=z$ doesn't necessarily hold. The example is again $z=-1$.
A: It really depends on the situation. If you are solving an equation $x^2=a$, then you need to consider both real square roots (ignoring complex roots). If you have $x=\sqrt{a}$, then you are specifying the positive root.
For complex roots, you have to use a different convention to specify which root you want to take. Maybe by convention, take the root with the smallest angle to the real axis?
But to answer the question: if $-x$ is a complex number, then $\left(\sqrt{-x}\right)^2=-x$ since by definition, you squared the square root of a complex number. This should be true regardless of what root you take: $\left(\sqrt[n]{z}\right)^n=z$. Of course, you always have the freedom to change the angle by $2\pi$, i.e. $z=|z|e^{i(\theta+2\pi k)}$ for any $k\in\mathbb{Z}$. I figure by convention, it makes sense to choose $k=0$ when allowed to do so.
As an example of the positive square root convention, consider the quadratic equation:
$$x=\frac{-b\color{red}{+}\sqrt{b^2-4ac}}{2a}.$$
This is automatically only one specific solution to the equation $ax^2+bx+c=0$. You have to change the "$\color{red}{+}$" to a "$\color{red}{-}$" in order to get the other solution.
Sometimes I've seen expressions such as $x=\mp \sqrt{a} \pm \sqrt{b}$. In this case it truly matters how you take the square roots as you only have $x=- \sqrt{a} + \sqrt{b}$ and $x=+\sqrt{a} - \sqrt{b}$ ("$+$" sign unnecessary to specify the positive square root on the latter). You cannot just arbitrarily choose which root to use!
A: Assuming $x \in \mathbb{R}$, the usual convention yields a value of $-x$.  A simple way to see this is to try two values: $x = 1$ and $x = -1$.  If $x = 1$, then $\sqrt{-1} = i$, and then $i^2 = -1 = -x$.
If $x = -1$, then $\sqrt{1} = 1$, and then $1^2 = 1 = -x$.
ETA: As others have pointed out, if $x \in \mathbb{C}$ generally, then there is no convention for the value of the square root.  However, even if we define $\sqrt{x}$ to be any of the values whose square is $x$, then any reasonable interpretation of the expression $\left(\sqrt{-x}\right)^2$ seems to produce $-x$.  (We replace $\sqrt{-x}$ by any value $u$ whose square is $-x$.  Then $u^2 = -x$.)
A: Assuming $x\in\mathbb{R^+}$:
$$\left(\sqrt{-x}\right)^2=$$
$$\left(i\cdot\sqrt{x}\right)^2=$$
$$i^2\cdot\left(\sqrt{x}\right)^2=$$
$$-1\cdot\left(\sqrt{x}\right)^2=$$
$$-1\cdot x=$$
$$-x$$
A: 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$.
A: The symbol:
$$\sqrt{a}$$
refers to either:


*

*"the" number whose square is $a$

*any one number whose square is $a$

*the set or "list" of all numbers whose squares are $a$

*a number chosen in some well-defined conventional way from the set of numbers whose squares are $a$


In all of these cases, by definition:
$$(\sqrt{a})^2 = a$$
If that were not the case, $\sqrt{a}$ would not be the/one/some/all number(s) whose square is $a$ ...
Plugging in $a=-x$, we get:
$$(\sqrt{-x})^2 = -x$$
This holds in all contexts where $\sqrt{\quad}$ is defined, be it real numbers, complex numbers or some other ring.
The problem with your calculations is that you use the rule $\sqrt{a}\sqrt{b}=\sqrt{ab}$ which may not be valid, depending on which convention from the bulleted list above we use.
While the rule $(\sqrt{a})^2 = a$ is always true, almost a tautology, as you mention yourself, $\sqrt{a^2}=a$ may be false, depending on which solution(s)/"root(s)" the $\sqrt{\quad}$ symbol "picks".
