I am struggling to find out why the following equality is wrong, $$\sqrt{-i}=i\sqrt{i}$$ I know the above equality is wrong from the following derivation, $$\text{L.H.S.}=\sqrt{-i}=\sqrt{e^{-i\pi/2}}=e^{-i\pi/4}=\frac{1}{\sqrt{2}}(1-i)$$ Whereas $$\text{R.H.S.}=i\sqrt{i}=i\sqrt{e^{i\pi/2}}=ie^{i\pi/4}=i\frac{1}{\sqrt{2}}(1+i)=-\frac{1}{\sqrt{2}}(1-i)$$
Thus $$\text{L.H.S.}\neq \text{R.H.S.}$$
Which is true, however, if we do the calculation in the following way, $\sqrt{-i}=\sqrt{(-1)\times i}=i\sqrt{i}$, then the identity seems to be correct. What am I missing here? I know I have done some silly mistake, Somebody can help me?