Why $\sqrt{-1 \cdot {-1}} \neq \sqrt{-1}^2$?
I know there must be something unmathematical in the following but I don't know where it is:
\begin{align} \sqrt{-1} &= i \\\\\ \frac1{\sqrt{-1}} &= \frac1i \\\\ \frac{\sqrt1}{\sqrt{-1}} &= \frac1i \\\\ \sqrt{\frac1{-1}} &= \frac1i \\\\ \sqrt{\frac{-1}1} &= \frac1i \\\\ \sqrt{-1} &= \frac1i \\\\ i &= \frac1i \\\\ i^2 &= 1 \\\\ -1 &= 1 \quad !!? \end{align}
Solution 1:
Between your third and fourth lines, you use $\frac{\sqrt{a}}{\sqrt{b}}=\sqrt{\frac{a}{b}}$. This is only (guaranteed to be) true when $a\ge 0$ and $b>0$.
edit: As pointed out in the comments, what I meant was that the identity $\frac{\sqrt{a}}{\sqrt{b}}=\sqrt{\frac{a}{b}}$ has domain $a\ge 0$ and $b>0$. Outside that domain, applying the identity is inappropriate, whether or not it "works."
In general (and this is the crux of most "fake" proofs involving square roots of negative numbers), $\sqrt{x}$ where $x$ is a negative real number ($x<0$) must first be rewritten as $i\sqrt{|x|}$ before any other algebraic manipulations can be applied (because the identities relating to manipulation of square roots [perhaps exponentiation with non-integer exponents in general] require nonnegative numbers).
This similar question, focused on $-1=i^2=(\sqrt{-1})^2=\sqrt{-1}\sqrt{-1}\overset{!}{=}\sqrt{-1\cdot-1}=\sqrt{1}=1$, is using the similar identity $\sqrt{a}\sqrt{b}=\sqrt{ab}$, which has domain $a\ge 0$ and $b\ge 0$, so applying it when $a=b=-1$ is invalid.
Solution 2:
The simple reason this,
$$\sqrt{\frac{-1}{1}} =\frac{\sqrt{1}}{\sqrt{-1}}$$
is not valid is because of a branch cut that must be taken as a result of the square root function.
Using exponentials:
$$ \tag{1} e^{i\pi} = -1 $$ and thus, $$ \tag{2} e^{-i\pi} = \frac{1}{-1} = -1 $$
However, in the complex plane, these represent a semicircle rotation from $+1 \to -1$ in both anticlockwise and clockwise directions. The fact that both end up at $-1$ on the Real Axis simply conceals the path taken from $+1 \to -1$ in the complex plane.
Now if we think of both (1) and (2) they are two opposite semi-circles that make a circle in the complex plane of radius 1 around the origin:
However, from complex analysis, we know that there must be a branch cut from $0 \to \infty$ somewhere on this circle. Thus, you are crossing a branch cut on the Riemann Surface by doing,
$$ \sqrt{\frac{-1}{1}} \to \frac{\sqrt{1}}{\sqrt{-1}} $$
To correctly, dodge the Branch Cut issues, we can use the exponential form ensuring that we simplify the exponentials inside the square root before taking the square root, $$ \sqrt{\frac{e^{i\pi}}{1}\frac{e^{-i\pi}}{e^{-i\pi}}} = \sqrt{\frac{e^{0}}{e^{-i\pi}}} = \sqrt{\frac{e^{i\pi}}{1}} = i $$ or similarly, $$ \sqrt{\frac{e^{-i\pi}}{1}\frac{e^{+i\pi}}{e^{+i\pi}}} = \sqrt{\frac{e^{0}}{e^{+i\pi}}} = \sqrt{\frac{e^{-i\pi}}{1}} = -i $$ The fact we get two different answers from using (1) and then using (2) to invert the terms inside the square root demonstrate the chaos we give ourselves when crossing Branch Cuts. Morale of Story: Don't Cross Branch Cuts as "Here be multivalued-Dragons" see bottom for picture.
You can also be really sneaky and do two full rotations, which if you look at the picture below, will put you where you started on the Riemann sheet.
See this image for a pictorial representation of the manifold which you are attempting to abuse (This is 3D version of the above and the branch cut can be seen where the sheet intersects itself). This picture also shows why we can take the Branch Cut anywhere as long as it is within one rotation as we can spin the shape in the vertical axis and it will remain the same.
A demonstration of what happens to an unprepared Math Student, (Here called 'Bob') who unknowingly crossed a Branch Cut without being prepared. (credit also to @marios-bounakis for some exciting discussions about Euler identities)
Solution 3:
Isaac's answer is correct, but it can be hard to see if you don't have a strong knowledge of your laws. These problems are generally easy to solve if you examine it line by line and simplify both sides.
$$\begin{align*} \sqrt{-1} &= \hat\imath & \mathrm{LHS}&=i, \mathrm{RHS}=i \\ 1/\sqrt{-1} &= 1/\hat\imath & \mathrm{LHS}&=1/i=-i, \mathrm{RHS}=-i \\ \sqrt{1}/\sqrt{-1} &= 1/\hat\imath & \mathrm{LHS}&=1/i=-i, \mathrm{RHS}=-i \\ \textstyle\sqrt{1/-1} &= 1/\hat\imath & \mathrm{LHS}&=\sqrt{-1}=i, \mathrm{RHS}=-i \end{align*}$$
We can then see that the error must be assuming $\textstyle\sqrt{1}/\sqrt{-1}=\sqrt{1/-1}$.
Solution 4:
As others have mentioned, one approach is to be consistent about using principal roots, and make sure that the identities you're using are actually applicable for manipulating those principal roots. And your mistake there lies in equating the 3rd and 4th lines. But to me, that type of approach feels about as intuitive as memorizing a phone book.
Personally I find it much easier to think of square roots (or roots in general) as set-valued operators. Every number (other than zero) has two square roots, three cube roots, four cube roots, etc (which in general can be complex).
Define the $n^{th}$ root to be the set-valued mapping: $\sqrt[n]x \mapsto \{ y : y^n = x \}$
Examples: \begin{gather} \sqrt{4} \mapsto \{ +2 , -2 \} \\\\ \sqrt{1} \mapsto \{ +1 , -1 \} \\\\ \sqrt{-1} \mapsto \{ -i, +i \} \\\\ \sqrt[3]{1} \mapsto \left\{ 1 , \tfrac{-1 + i \sqrt{3}}{2} , \tfrac{-1 - i\sqrt{3}}{2} \right\} \end{gather}
Then your question can be written as follows (treating multiplication and division as Kronecker products too see all the possible outcomes):
\begin{gather} \sqrt{-1} \mapsto \{ i, -i \} \\\\ \frac{1}{\sqrt{-1}} \mapsto \left\{ \frac{1}{i} , \frac{1}{-i} \right\} \\\\ \frac{1}{\sqrt{-1}} \mapsto \left\{ \frac{1}{i} , \frac{1}{-i} \right\} \\\\ \frac{\sqrt{1}}{\sqrt{-1}} \mapsto \frac{ \left\{ 1 , -1 \right\} }{ \left\{ i , -i \right\} } = \left\{ \frac{1}{i} , \frac{-1}{i} , \frac{1}{-i} , \frac{-1}{-i} \right\} = \left\{ \frac{1}{i} , -\frac{1}{i} \right\} = \left\{ -i , i \right\} \\\\ \sqrt{\frac{1}{-1}} = \sqrt{-1} \mapsto \left\{ i , -i \right\} \\\\ \sqrt{-1} \mapsto \left\{ i , -i \right\} \\\\ \left( \sqrt{-1} \right)^2 \mapsto \left\{ i^2 , \left(-i\right)^2 \right\} = \left\{ -1 , -1 \right\} = \{ -1 \} \end{gather} so \begin{gather} \left( \sqrt{-1} \right)^2 = -1. \end{gather} Also note that \begin{gather} \left( \frac{\sqrt{1}}{\sqrt{-1}} \right)^2 \mapsto \left\{ (-i)^2 , i^2 \right\} = \left\{ -1 , -1 \right\} = -1. \end{gather}