When does $\sqrt{a b} = \sqrt{a} \sqrt{b}$? So, my friend show me prove that $1=-1$ by using this way:
$$1=\sqrt{1}=\sqrt{(-1)\times(-1)}=\sqrt{-1}\times\sqrt{-1}=i\times i=i^2=-1$$
At first sight, I stated "No, $\sqrt{ab}=\sqrt{a}\times\sqrt{b}$ is valid only for $a,b\in\mathbb{R}$ and $a,b\geq0$"
But, I remember that $\sqrt{-4}=\sqrt{4}\times\sqrt{-1}=2i$ which is true (I guess).
Was my statement true? But, $\sqrt{ab}=\sqrt{a}\times\sqrt{b}$ is also valid if one of a or b is negative real number. Why is it not valid for a dan b both negative? If my statement was wrong, what is wrong with that prove?
 A: An alternate way to understand what is happening here is to note that
$$
1=e^{0i}
$$
When we take the square root, we have
$$
1=\sqrt{e^{0i}} = \sqrt{e^{-\pi i}\times e^{\pi i}}
$$
Notice that $e^{-\pi i}=e^{\pi i}=-1$.
Now, since we are working in polar form, we can evaluate the square roots consistently, arriving at
$$
1=e^{-\pi i/2}\times e^{\pi i/2} = -i\times i = 1
$$
Essentially, the problem lies in the "branch cut" that occurs with the square root operation - you must be careful with the evaluation.
To put it another way, $1=e^{2n\pi i}$ for all integer $n$, and the square root function has to respect its specific value (of $n$), as it can take multiple different values depending on that $n$. To get $1=-1$ as in the question, one must simultaneously use $1=e^{0i}$ and $1=e^{2\pi i}$.
A: As you know, the rule $\sqrt{ab}=\sqrt a \sqrt b$ holds for some but not all combinations of $a$ and $b$. Explaining and remembering exactly which those combinations are is usually more trouble than it's worth, so usually the rule we remember is just

It is a sufficient condition for $\sqrt{ab}$ to equal $\sqrt a\sqrt b$ that $a$ and $b$ are both non-negative reals.

As you have noticed, this condition is not necessary, but that does not keep the rule from being useful.
For the purpose of rejecting your friend's fake proof, even the above version is more than you need; all you need to say is

The rule $\sqrt{ab}=\sqrt a\sqrt b$ does not always hold when we extend the $\sqrt{\phantom a}$ function to complex numbers.

It is not your task to prove that the rule fails in the particular case $a=b=-1$ (thought doing so is a simple matter of computation); it is the guy who wants to prove something who has the responsibility for only using rules he knows apply in the context he's using them in. After you've pointed out that the rule has been stretched beyond the domain we know it to work for, it's up to him to figure out whether he can come up with an argument that it should be valid here.
A: The particular step in question is whether or not it is the case that
$$\sqrt{(-1)\times(-1)}\stackrel?=\sqrt{-1}\times\sqrt{-1}$$
In particular, it is questioned whether or not we can have $\sqrt{(-1)^2}=(\sqrt{-1})^2$, and here, the answer is no due to how we interpret the operations.
This is because the $x^2$ operation cancels the $\sqrt x$ operation, but it does not work the other way around, since
$$y=\sqrt x\implies y^2=x,\underbrace{y>0}_{\text{we lose something here}}$$
This means we lose a possible value in the process, since we only take one of the possible values that could be the solution.  On the other hand, regardless of which value a square root is denoted, the squaring operation will take both and make the end result the same.
A: If both are negative,
$$\sqrt{-a} \times \sqrt{-b} = \sqrt{-1}\times \sqrt{-1} \times \sqrt{a} \times \sqrt{b}$$
$$=i^2 \times \sqrt{ab} = -\sqrt{ab}$$
(the rule is not applicable here)
If one of them is negative,
$$\sqrt{-a}\times \sqrt{b} = \sqrt{-1} \times \sqrt{ab} = \sqrt{-ab}$$ (the rule is applicable here)
If you have non-negative real numbers, this rule is easily applicable. If negative numbers come, then you have complex numbers involved. For them, this rule behaves differently. As you have seen above, if both of them are negative, the result is $-\sqrt{ab}$ and not just $\sqrt{ab}$. That's why $1$ is not equal to $\sqrt{(-1)}\times\sqrt{(-1)}$(two complex numbers multiplying) becuase now you have complex numbers involved and as we said, for them rules are different!
So, when you bring negative inside the square root, complex numbers arise. $\sqrt{(-1)}\times\sqrt{(-1)}$ is $-1$. But, $\sqrt{(-1) \times (-1)}$ is simply $1$.
$$\sqrt{(-1)}\times\sqrt{(-1)} \neq \sqrt{(-1) \times (-1)}$$
