I am studying Fourier analysis and have been given the following question:
Show that $$\sum_{n=1}^{N} \cos(2n-1)x = \frac {\sin(2Nx)}{2\sin(x)} $$
I used the formula for a finite geometric sum and Euler's formula to get to the following:
$\sum_{n=1}^{N} \cos(2n-1)x = Re (\sum_{n=1}^{N} e^{i(2n-1)x}) = Re (\sum_{n=0}^{N-1} e^{i(2n+1)x}) = Re (e^{ix} \sum_{n=0}^{N-1} (e^{i2x})^n) = .... = Re(\frac{i}{2 \sin{x}}(1-e^{i2xN}))$
I have been stuck here for a while and am unsure how to get to the required $\frac {\sin(2Nx)}{2\sin(x)}$.
What do I do next?
Use the standard trick: factor out $\mathrm e^{iNx}$: $$ i(1-\mathrm e^{2iNx})=i\mathrm e^{iNx}(\mathrm e^{-iNx}-\mathrm e^{iNx})=\mathrm e^{iNx}\frac{\mathrm e^{iNx}-\mathrm e^{-iNx}}i=2\sin x\,\mathrm e^{iNx},$$ whence $$\operatorname{Re}\Bigl(\frac{i}{2 \sin{x}}(1-\mathrm e^{i2xN})\Bigr)= \operatorname{Re}\Bigl(\frac{2\sin Nx\:\mathrm e^{ixN}}{2 \sin Nx}\Bigr) =\frac{2\sin Nx\cos Nx}{2\sin x}.$$