<s>[INST] Proof for complex numbers and square root Use the polar form of complex numbers to show that every complex number $z\neq0$ has two square roots.
I know the polar form is $z=r(\cos(\alpha)+i \sin(\alpha))$.  I'm just not sure how to do this one.
 [/INST] De Moivre's formula is $(\cos\theta + i\sin\theta)^n = \cos(n\theta) + i\sin(n\theta)$ for any integer $n$. Therefore, if $w = s(\cos\theta + i\sin\theta)$ is a non-zero complex number such that $w^2 = z$, then 
$$s^2(\cos(2\theta) + i\sin(2\theta)) = r(\cos\alpha + i\sin\alpha).$$ 
Therefore $s^2 = r$, so $s = \pm\sqrt{r}$, but $s > 0$, so $s = \sqrt{r}$. 
Furthermore, $\cos(2\theta) = \cos\alpha$, so $2\theta = \alpha + 2k\pi$ where $k \in \mathbb{Z}$, or $2\theta = -\alpha + 2l\pi$ where $l \in \mathbb{Z}$. 
Likewise, $\sin(2\theta) = \sin\alpha$, so $2\theta = \alpha + 2m\pi$ where $m \in \mathbb{Z}$, or $2\theta = \pi - \alpha + 2n\pi$ where $n \in \mathbb{Z}$. 
The only possibility for $2\theta$ that will give both $\cos(2\theta) = \cos\alpha$ and $\sin(2\theta) = \sin\alpha$ is $2\theta = \alpha + 2k\pi$ for some $k \in \mathbb{Z}$. Therefore $\theta = \frac{\alpha}{2} + k\pi$ where there are no restrictions on $k$, other than being an integer. So the complete set of solutions to $w^2 = z$ is 
$$\left\{\sqrt{r}\left(\cos\left(\frac{\alpha}{2}+k\pi\right) + i\sin\left(\frac{\alpha}{2} + k\pi\right)\right) \mid k \in \mathbb{Z}\right\}.$$
However, as $\cos$ and $\sin$ are $2\pi$-periodic, there are many different values of $k$ which gives the same complex number. If $k$ is even, then $k = 2t$ for some $t \in \mathbb{Z}$, so 
\begin{align*}
\sqrt{r}\left(\cos\left(\frac{\alpha}{2}+k\pi\right) + i\sin\left(\frac{\alpha}{2} + k\pi\right)\right) &= \sqrt{r}\left(\cos\left(\frac{\alpha}{2}+2t\pi\right) + i\sin\left(\frac{\alpha}{2} + 2t\pi\right)\right)\\ 
&= \sqrt{r}\left(\cos\left(\frac{\alpha}{2}\right) + i\sin\left(\frac{\alpha}{2}\right)\right).
\end{align*}
If $k$ is odd, then $k = 2t+1$ for some $t \in \mathbb{Z}$, so 
\begin{align*}
\sqrt{r}\left(\cos\left(\frac{\alpha}{2}+k\pi\right) + i\sin\left(\frac{\alpha}{2} + k\pi\right)\right) &= \sqrt{r}\left(\cos\left(\frac{\alpha}{2}+(2t+1)\pi\right) + i\sin\left(\frac{\alpha}{2} + (2t+1)\pi\right)\right)\\ 
&= \sqrt{r}\left(\cos\left(\frac{\alpha}{2}+\pi+2t\pi\right) + i\sin\left(\frac{\alpha}{2} + \pi 2t\pi\right)\right)\\ 
&= \sqrt{r}\left(\cos\left(\frac{\alpha}{2} + \pi\right) + i\sin\left(\frac{\alpha}{2}+\pi\right)\right).
\end{align*}
Using the fact that $\cos(\beta + \pi) = -\cos\beta$ and $\sin(\beta + \pi) = -\sin\beta$ we can simplify this further: 
$$\sqrt{r}\left(\cos\left(\frac{\alpha}{2} + \pi\right) + i\sin\left(\frac{\alpha}{2}+\pi\right)\right) = -\sqrt{r}\left(\cos\left(\frac{\alpha}{2}\right) + i\sin\left(\frac{\alpha}{2}\right)\right).$$
Therefore, the two solutions to $w^2 = z$ are $\pm\sqrt{r}\left(\cos\left(\frac{\alpha}{2}\right) + i\sin\left(\frac{\alpha}{2}\right)\right)$; note that these are distinct, so there are actually two different solutions.

In general, if you were trying to solve $w^n = z$ with $z \neq 0$, you could use the same method as above. When it came to determine which $k$ gave different complex numbers, you'd consider $k$ modulo $n$, i.e. write $k = nt + j$ where $j = 0, 1, \dots, n - 1$. You'd then find $n$ distinct solutions corresponding to the different values of $j$. Usually, you would have to stop here, as there won't be a corresponding trigonometric formula to simplify the complex numbers (as there was above for the phase shift $\pi$).
</s>