How can I show that for each $x\in (0,2\pi)$, there is a number $C(x)>0$ such that $|\sum^n_{k=1}\cos(kx)|\leq C(x)$, independent of $n$.
I know that \begin{align} 2\sin(\frac{x}{2})\sum^n_{k=1}\cos(kx)=\sum^n_{k=1}\sin((k+\frac{1}{2})x)-\sin((k-\frac{1}{2})x) \end{align}
Any help is much appreciated!
You are essentially done. Note that $$\left|\underbrace{\sum^n_{k=1}\left(\sin\left(k+\frac{1}{2}\right)x-\sin\left(k-\frac{1}{2}\right)x\right)}_{\text{telescoping sum}}\right| = \left|\sin\left(N+\frac{1}{2}\right)x-\sin\frac{x}{2}\right| \leqslant 2$$
Thus,
$$\left|\sum^n_{k=1}\cos kx\right|\leqslant \frac{1}{\left|\sin(\frac{x}{2})\right|}$$