https://i.stack.imgur.com/0DZmF.jpg
I'm trying to find the sum of $\cos(\frac{\pi}{k}) + \cos(\frac{2\pi}{k}) + \cos(\frac{3\pi}{k}) + ... + \cos(\frac{n\pi}{k})$
I multiplied it by $2\sin(\frac{\pi}{k})$ and realised that terms sort of cancelled out. I got some formula for the sum but it did not work when I tested it and I dunno why not.
Thanks.