Calculate square root of $i \Leftrightarrow z^2=i$ Let $z = r(\cos\theta+i\sin\theta)$. In my notes there was this example to calculate the square roots of $i$. What was done was:
$z = r(\cos\theta+i\sin\theta)\\z^2 = r^2(\cos(2\theta)+i\sin(2\theta))\\=\cos(\frac{\pi}{2})+i\sin(\frac{\pi}{2})\\\Leftrightarrow r=1 \ \ \ \ ∧ \ \ \ \ \ 2\theta=\frac{\pi}{2}+2\pi k,\ k\in \mathbb{Z},\ \theta\in[0,2\pi)\\\Leftrightarrow r=1 \ \ \ \ ∧ \ \ \ \ \  \theta=\frac{\pi}{4}+k\pi , \ k=0,1$
Im not entirely understand what they did above, what does the 2 lines below actually tell us? $\Leftrightarrow r=1 \ \ \ \ ∧ \ \ \ \ \ 2\theta=\frac{\pi}{2}+2\pi k,\ k\in \mathbb{Z},\ \theta\in[0,2\pi)\\\Leftrightarrow r=1 \ \ \ \ ∧ \ \ \ \ \  \theta=\frac{\pi}{4}+k\pi , \ k=0,1$
I thought to calculate the square roots of iyou let $z=x+iy$ and work out $x,y$ from $(x+iy)^2=i$? 
Also, how did they get that $r^2(\cos(2\theta)+i\sin(2\theta))=\cos(\frac{\pi}{2})+i\sin(\frac{\pi}{2})$?
 A: You can do it from $(x+iy)^2=i$, as follows: $$\displaylines{x^2+2ixy-y^2=i\cr x^2-y^2=0,\qquad2xy=1\cr y=\pm x,\qquad2x^2=\pm1\cr }$$ but $2x^2=-1$ is impossible for $x$ real, so $y=x$ and $2x^2=1$, yielding two solutions, $x+iy=\pm(\sqrt2/2+i\sqrt2/2)$. 
It's good to know the other way, as it will work better for some other problems. In general, the more ways you know to do a problem, the better. 
A: 
How did they get that $r^2(\cos(2\theta)+i\sin(2\theta))=\cos(\frac{\pi}{2})+i\sin(\frac{\pi}{2})$?  

This whole problem is easiest to do via Euler's identity: $$e^{i\theta} = \cos(\theta) + i\sin(\theta).$$  Now, any complex number $z$ can be
expressed as $z=re^{i\theta}$ where $r$ is some real
number and $0 \leq \theta < 2\pi$.  It follow that 
$z^2 = r^2e^{i2\theta} = r^2(\cos(2\theta)+i\sin(2\theta))$, and so if we want to solve the equation $z^2 = i$, then we have
$$z^2 = r^2e^{i2\theta} = r^2(\cos(2\theta)+i\sin(2\theta)) = i.$$
Now, $r^2\cos(2\theta)+ir^2\sin(2\theta) = 0 + i$ means that
$r^2\cos(2\theta) = 0$ and $r^2\sin(2\theta) = 1$. The latter equation
shows us that $r \neq 0$ and hence it must be that 
$\cos(2\theta) = 0$, giving $2\theta = \pi/2$ and so $\sin(2\theta) = 1$. Substituting $\sin(2\theta) = 1$ into 
the latter equation
reduces it to $r^2 = 1$, and so $r = \pm 1$.
Also,  since $2\theta = \pi/2$, we get $\theta = \pi/4$.
Hence, the two square roots of $i$ are 
$$i^{1/2} = \pm\left(\cos(\pi/4) + i\sin(\pi(4)\right) = \pm \frac{1+i}{\sqrt{2}}$$  
A: $i=1(\cos(\frac{\pi}{2})+i\sin(\frac{\pi}{2}))$ and we want $z^2=i$, so $r^2(\cos(2\theta)+i\sin(2\theta))=1(\cos(\frac{\pi}{2})+i\sin(\frac{\pi}{2}))$.  Then use that $r_1(\cos\theta_1+i\sin\theta_1)=r_2(\cos\theta_2+i\sin\theta_2)\implies r_1=r_2\wedge\theta_1=\theta_2+2\pi k,k\in\mathbb{Z}$.
This gives $r^2=1\wedge2\theta=\frac{\pi}{2}+2\pi k,k\in\mathbb{Z}$.  Since $r$ is a nonnegative real number, $r=1$; dividing both sides of $2\theta=\frac{\pi}{2}+2\pi k$ by 2 gives $\theta=\frac{\pi}{4}+\pi k$; picking values of $k$ starting from $k=0$ and stopping when we've gone full around gives $k=0,1$ (also, we should expect exactly 2 numbers whose square is $i$).
