Suppose $f\in\mathbf{C^2}(\mathbb{R})$ and is periodic with period $2\pi$. Prove the Fourier series of $f$ converges uniformly in any finite interval. Suppose $f\in\mathbf{C^2}(\mathbb{R})$ and is periodic with period $2\pi$. Prove that the Fourier series of $f$ converges uniformly in any finite interval.
My attempt:
$|a_n~\cos(nx)+b_n~\sin(nx)|\le|a_n|+|b_n|$. So, by M-test, we just need to show $\displaystyle\sum_{n=1}^\infty |a_n|+|b_n|$ converges.
$$\begin{equation}\begin{aligned}
a_n=\frac{1}{\pi} \int_{-\pi}^\pi~f(x)~\cos(nx)~dx &= -\frac{1}{n\pi}\int_{-\pi}^{\pi}~ f'(x)~\sin(nx)~dx \\ &=\frac{1}{n^2\pi}~ f'(x)~\cos(nx)~dx\Bigg|_{-\pi}^{\pi}-\frac{1}{n^2\pi}~f''(x)~\cos(nx)~dx\\
\end{aligned}\end{equation}$$
$$=\frac{1}{n^2\pi}[f(\pi)~\cos(nx)-f(-\pi)~\sin(nx)]+\frac{1}{n^2\pi}\int_{-\pi}^{\pi} f''(x)~\cos(nx)dx$$
$f\in\mathbf{C^2}(\mathbb{R})\Rightarrow |f|,|f''|\leq K$ on $[-\pi,\pi]$ for some $K$. 
We can get $a_n\leq \frac{4K}{n^2}$.
 Similarly, $b_n\leq\frac{4M}{n^2}$. So, $M_n=\displaystyle\sum_{n=1}^\infty |a_n|+|b_n|$ converges. 
So, the Fourier series $\displaystyle\sum_{n=1}^\infty [a_n~\cos(nx)+b_n~\sin(nx)]$  converges unifomly.
Is my proof correct? It seems that for any $x\in \mathbb{R}$, the Fourier series converges uniformly.
Why we cannot conclude that the Fourier series of $f$ converges uniformly on $\mathbb{R}?$ 
 A: First, prove that if $f \in C^{(k)}(\mathbb{R})$ then, you can prove that $\hat{f}(n)$ obeys the following:
$$
\hat{f}(n) = o\left(\frac{1}{|n|^k}\right).
$$
To see why this is true, note that $\hat{f^{(k)}}(n) = (in)^k \hat{f}(n)$. By Riemann-Lebesgue lemma, as $|n|\to\infty$, $\hat{f}(n)\to 0$, we conclude.
Now, given this, we will arrive at result. Let $N^{th}$ partial sum be given by:
$$
S_N(f)(x) = \sum_{k=-N}^N\hat{f}(k)e^{ikx}.
$$
Now, note that for any $N \neq M$, $|S_N(f)(x) - S_M(f)(x)|$ is computed via
$$
|S_N(f)(x) - S_M(f)(x)| = \left|\sum_{M+1\leq |n|\leq N}\hat{f}(n)e^{inx}\right|\leq \sum_{M+1\leq |n|\leq N}|\hat{f}(n)|\underbrace{|e^{inx}|}_{=1} = \sum_{M+1\leq |n|\leq N}|\hat{f}(n)|
$$
and $\sum_{M+1\leq |n|\leq N}|\hat{f}(n)|\to 0$, as $N,M\to \infty$ (this follows from the fact that $\hat{f}(n)$ is a summable sequence, due to characterization above). Hence, $S_N(f)(x)$ converges uniformly.
A: Your proof is (almost) correct - there are some computation errors (your second line does not have the integral, and your third line mysteriously exchanged the derivative by the function and popped up a sine, while also not evaluating $\pi$ and $-\pi$ in them).
And indeed, you have uniform convergence in the entire real line. Just one detail and an observation: this happens because the boundary terms on the integration by parts vanish, and this is due to the fact that the function is $2\pi$-periodic. 
The observation is that it is important to note that this proves the Fourier series converges uniformly, but it doesn't prove that it converges uniformly to $f$. It indeed converges to $f$, but you need the density of the trigonometric functions on $L^2(S^1)$ or something of this nature (for example, density on $C^0(S^1)$ would be enough, since your function is $C^2$)  to prove this.
