Square root and distribution I see two ways of definining the imaginary number $i$, e.g. $i^2 = -1$ or $i = \sqrt -1$.
I always thought the second one was right, yet I saw lots of websites saying that :
$1=\sqrt 1=\sqrt{-1\cdot-1}=\sqrt-1\cdot\sqrt-1=i\cdot i=i^2=-1$
Which would mean it is wrong. However, are we really allowed to write $\sqrt{-1\cdot-1}=\sqrt-1\cdot\sqrt-1$ ? I always thought that $\sqrt{a\cdot b}=\sqrt a\cdot\sqrt b \iff a,b \ge 0$, yet I cannot find any explicit rule about that in my books. Is there any ?
 A: The issue here is that the square root function does not easily extend beyond the non-negative reals. The issue is that, on the complex plane, what $\sqrt{-1}$ is intended to mean is ambiguous; the square of either $i$ or $-i$ is -1, and there's no particular reason to choose one over the other as the principal square root of $-1$. This contrasts with the non-negative reals, among which every number has a single square root, and thus the operation is well defined.
Typically, to get around this issue, one defines the principal square root in terms of the argument; that is, we represent a complex number in terms of modulus and argument, that is $x=re^{i\theta}$, where $\theta$ lies in some specified range, usually $(-\pi,\pi]$ and $r$ is a non-negative real. Then, $\sqrt{re^{i\theta}}=\sqrt{r}e^{\frac{1}2i\theta}$ - that is, we halve the argument and take the well-defined square root of the non-negative modulus r.
This has the issue that if we try to equate $\sqrt{-1}\sqrt{-1}=\sqrt{-1\cdot-1}$, we can expand to modulus and arguments:
$$\sqrt{-1}\sqrt{-1}=\sqrt{e^{i\pi}}\sqrt{e^{i\pi}}=e^{\frac{1}2i\pi}\cdot e^{\frac{1}2i\pi}=-1$$
But when we expand the left hand:
$$\sqrt{e^{i\pi}\cdot e^{i\pi}}=\sqrt{e^{2i\pi}}$$
We'd like the square root of this to be $e^{i\pi}$ - half the argument. However, the argument $2\pi$ is not in the given range - in fact, we consider the argument to be 0, instead, since $e^{2i\pi}=1$. Thus, this square root works out to $\sqrt{e^0}=e^0$.
The problem thus occurs exactly when the arguments of a and b sum a value outside of the range $(-\pi,\pi]$, because then we get the argument back into range by adding or subtracting $2\pi$ from the argument - but when we later halve the argument, this yields a different answer than were the square roots taken separately, thus the arguments halved then added with no other correction.
