I am trying to establish the following partial sum equivalence: $$\sum_{n=1}^{N}\cos (n\pi u) = \frac{1}{2}\left[\frac{\sin(N+\frac{1}{2})\pi u}{\sin(\pi u)/2} - 1\right]$$
with a hint that the series $$x + x^2 + x^3 + \ldots x^m= \frac{1-x^{m+1}}{1-x}$$
My approach is to represent $$\cos(n\pi u) = \frac{1}{2}\left[e^{in\pi u} + e^{-in\pi u}\right]$$ and then letting $x = e^{i\pi u}$ I can reduce this to $$\cos(n\pi u) = \frac{1}{2}\left[x + x^2 + \ldots x^{N} + x^{-1} + x^{-2} + \ldots x^{-N}\right]$$ Now, I notice that the first and last terms sum to $$x + \frac{1}{x^N} = \frac{x^N + 1}{x^N}$$ likewise, the second and the second-to-last sum to $$x^2 + \frac{1}{x^{N-1}} = \frac{x^N + 1}{x^{N-1}}$$ so that the first sum is $x$ multiplied by the second. Now let $$a = \frac{1 + x^N}{x^N}$$ and we reduce this series to $$\cos(n\pi u) = \frac{1}{2}\left[a\left(1 + x + x^2 + \ldots x^{N-1}\right)\right]$$ which is equivalent to $$a\left[\frac{x}{1-x}\right]$$ Then, using the value of $a$, I get $$\cos(n\pi u) = \frac{1}{2}\left[\frac{x^2}{1-x}\right]$$
I am, however, not sure if I have proceeded in the right direction. Thanks