<s>[INST] Explanation of this hint involving the summation of cosine and sine I have this question

Let $n \ge 2$ be an integer.  Prove that $$\sum_{k=0}^{n-1}\cos(\frac{2k\pi}{n}) = 0 = \sum_{k=0}^{n-1}\sin(\frac{2k\pi}{n})$$

I was given the hint to

Set $z = \cos(\frac{2\pi}{n}) + i\sin(\frac{2\pi}{n})$, so $z^n=1$.  Now write this as $(z-1)(z^{n-1}+z^{n-2}+...+z^2+z+1)=0$ and go from there...

I get that $(z-1)(z^{n-1}+z^{n-2}+...+z^2+z+1)=0$ is just an expansion and rearrangement of $z^n=1$, but what I don't understand is, why set $z = \cos(\frac{2\pi}n) + i\sin(\frac{2\pi}{n})$ and how do we know that $z^n=1$
 [/INST] When you set $z:=\text{cis}\left( \dfrac{2\pi}{n} \right)$  you win all the solutions to $z^n-1=0$, in factorization, using one of  moivre law's ($\text{cis}^m(x)=\text{cis}(m.x)$),
$$ (z-1)\cdot \sum_{k=0}^{n-1} \text{cis}\left( \dfrac{2\pi}{n} \cdot k\right) = 0 + 0.\text{i} $$
If $z \neq 1$, we have that crazy sum are $0$. But the real part of this sum is $0$ and the imaginary part also is $0$.
The real part of $\displaystyle \sum_{k=0}^{n-1} \text{cis}\left( \dfrac{2\pi}{n} \cdot k\right) $ are $\displaystyle \sum_{k=0}^{n-1} \cos\left( \dfrac{2\pi}{n} \cdot k\right) = 0$ and imaginary part are $\displaystyle \sum_{k=0}^{n-1} \sin\left( \dfrac{2\pi}{n} \cdot k\right) = 0$. $\Box$
</s>