I want to show that the following pointwise limit holds: $$\frac{\sum_{n=1}^N\cos(nx)}{N(x^2+1)}\to\begin{cases} 1, & x=0 \\ 0 & x\neq0 \end{cases}$$ The case $x=0$ is easy: we have, for any $\varepsilon>0$: $$\frac{1}{N}\left\vert\sum_{n=1}^N\cos(nx)-N\right\vert=\left\vert\frac{N}{N}-1\right\vert=0<\varepsilon$$ for any $N$. However, I'm more troubled by the case where $x\neq0$. One issue is that we might have that $x$ is a multiple of $2\pi$, in which case we would have: $$\frac{1}{N(x^2+1)}\left\vert\sum_{n=1}^N\cos(nx)\right\vert=\frac{N}{N(x^2+1)}=\frac{1}{x^2+1}$$ for any $N$, in which case we can't make the above arbitrarily small for $x$ fixed.
Graphically, the pointwise limit seems to hold, but I could be mistaken. Any thoughts?
It doesn't converge to zero for $x=2\pi$ for example:
$\frac{1}{N((2\pi)^2+1)}\cdot \sum\limits_{n=1}^N\cos(n\cdot 2\pi)= \frac{1}{N((2\pi)^2+1)}\cdot \sum\limits_{n=1}^N1=\frac{1}{(2\pi)^2+1}$