I got some tedious computation on the way of showing the closed expression for the Dirichlet kernel. I do not understand one step. Perhaps one can help me? Is this somewhat Euler formula?
$$\sum_{n=-N}^{N} e^{inx} = ... = \frac{1-\exp(i(N+1)x}{1-\exp(ix)} + \frac{1-\exp(-iNx)}{1-\exp(-ix)}= \frac{\sin((N+1/2)x}{\sin(x/2)}$$
Question: how can I get the last equality?