Consider the roots of unity of $z^n = 1$, say $1, \omega, \ldots, \omega^{n-1}$ where $\omega = e^{i\frac{2\pi}n}$.
It is a well known result that $\sum_{k=0}^{n-1}\omega^k = 0$, but what if we want to consider the alternating sum? I'm interested in
Finding the value of $S = 1 - \omega +\omega^2-\ldots +(-1)^{n-1}\omega^{n-1}$
Keeping in mind that $1, \omega, \ldots, \omega^{n-1}$ are the vertex of a regular $n$-gon in the plane, it is easy to see that when $n$ is even, $S = 0$
The problem arises when $n$ is odd. Here's what I've done so far: Take $x=\frac{2\pi}n$, then
$$S = \sum_{k=0}^{n-1}(-1)^k\omega^k = \sum_{k=0}^{n-1}(-1)^k(\cos kx +i \sin kx)$$
Dealing with the real part, we notice for $k=1,2,\ldots,n-1$ that $$\cos (n-k)x = \cos (2\pi k -kx) = \cos kx$$ Since $n-k$ and $k$ have different parity (remember $n$ is odd), we can see that $$\sum_{k=0}^{n-1}(-1)^k(\cos kx) = 1 + \sum_{k=1}^{n-1}(-1)^k(\cos kx)=1$$
But I have no idea on how to deal with the imaginary part. Asking almighty Wolfram, I got that $$\sum_{k=0}^{n-1}(-1)^k(\sin k\phi)=\sec(\frac \phi2) \sin(\frac {(n-1)(\phi+\pi)}2)\sin(\frac{n(\phi+\pi)}2)$$ Hence $$\sum_{k=0}^{n-1}(-1)^k(\sin kx) = \sec(\frac\pi n)\sin(\frac{\pi(n-1)(2+n)}{2n})\sin(\frac{\pi(2+n)}2)$$
In summary, I've got two questions:
a) How do you deduce the $\sum_{k=0}^{n-1}(-1)^k(\sin k \phi )$ formula?
b) Is there an alternative way to solve the original question?
Thanks in advance
As $(-1)^r\cdot w^r=(-w)^r,$
$$S_{n-1}=\sum_{r=0}^{n-1}(-w)^r=\dfrac{1-(-w)^n}{1-(-w)}$$
If $n$ is odd,
$$S_{n-1}=\dfrac{1-(-1)}{1+w}=\dfrac2{1+\cos\dfrac{2\pi}n+i\sin\dfrac{2\pi}n}=\dfrac{\cos\dfrac{\pi}n-i\sin\dfrac{\pi}n}{\cos\dfrac{\pi}n}$$