Proof (convergence of Fourier series for a smooth function)

For simplicity, take $L = 2\pi$. Assume $f$ is smooth. Fix $\theta_0 \in [-\pi, \pi)$.

Note that $$ \begin{align*} (S_N f)(\theta_0) &= \sum_{|n|\leq N} \hat f_n e^{in\theta_0} \\ &= \sum_{|n|\leq N} \frac{1}{2\pi} \int_{-\pi}^{\pi} f(\theta) e^{in(\theta_0 - \theta)} \d \theta \\ &= \frac{1}{2\pi}\int_{-\pi}^{\pi} \underbrace{\Big(\sum_{n=-N}^{N} e^{in(\theta_0-\theta)}\Big)}_{D_N(\theta-\theta_0)} f(\theta) \d \theta \\ \end{align*} $$ where $D_N(\theta)$ is called the Dirichlet kernel. To compute it, note that it is a geometric sum: if $\theta \in 2\pi\Z$, then we have $d_N(\theta) = 2N+1$, and if otherwise, $$ \begin{align*} \sum_{n=-N}^{N} e^{in\theta} &= e^{-iN\theta} \frac{1 - e^{i(2N+1)\theta}}{1-e^{i\theta}} \\ &= \frac{e^{-i(N+\frac{1}{2})\theta} - e^{i(N+\frac{1}{2})\theta}}{e^{-\frac{1}{2}i\theta} - e^{\frac{1}{2}i\theta}} \\ &= \frac{\sin (N+\frac{1}{2})\theta}{\sin \frac{1}{2}\theta}. \end{align*} $$ So the Dirichlet kernel is defined as $$ \begin{align*} D_N(\theta) = \begin{cases} \dfrac{\sin(N+\frac{1}{2})\theta}{\sin \frac{1}{2}\theta}, &\theta\in\R\setminus 2\pi\Z, \\ 2N + 1, &\theta\in 2\pi\Z. \end{cases} \end{align*} $$

Note that $$ \begin{align*} \int_{-\pi}^{\pi} D_N(\theta) \d \theta = \int_{-\pi}^{\pi} \sum_{n=-N}^{N} e^{in\theta} \d \theta = 2\pi. \end{align*} $$ Therefore $$ \begin{align*} (S_N f)(\theta_0) - f(\theta_0) &= \frac{1}{2\pi} \int_{-\pi}^{\pi} D_N(\theta-\theta_0) f(\theta) \d \theta - \frac{1}{2\pi}\int_{-\pi}^{\pi} D_N(\theta - \theta_0) f(\theta_0) \d \theta \\ &= \frac{1}{2\pi} \int_{-\pi}^{\pi} D_N(\theta - \theta_0) \,(f(\theta) - f(\theta_0)) \d \theta \\ &= \frac{1}{2\pi} \int_{-\pi+\theta_0}^{\pi+\theta_0} D_N(\theta) \,(f(\theta + \theta_0) - f(\theta_0)) \d \theta \\ &= \frac{1}{2\pi} \int_{-\pi}^{\pi} D_N(\theta) \,(f(\theta + \theta_0) - f(\theta_0)) \d \theta \\ &= \frac{1}{2\pi} \int_{-\pi}^{\pi} (\sin(N+\tfrac{1}{2}) \theta) F(\theta; \theta_0)\d \theta \end{align*} $$ where $$ \begin{align*} F(\theta; \theta_0) = \frac{\theta}{\sin \frac{1}{2}\theta} \frac{f(\theta + \theta_0) - f(\theta_0)}{\theta}. \end{align*} $$

If $f$ is smooth, then $\theta\mapsto F(\theta;\theta_0)$ is smooth for any $\theta\in[-\pi, \pi)$.

So we can perform integration by parts to get $$ \begin{align*} &(S_N f)(\theta_0) - f(\theta_0) \\ ={}& \frac{1}{2\pi}\frac{1}{N+\frac{1}{2}}\left(\big[(-\cos(N+\tfrac{1}{2})\theta)\, F(\theta;\theta_0)\big]_{-\pi}^\pi + \int_{-\pi}^{\pi} (\cos(N+\tfrac{1}{2})\theta) \, F'(\theta;\theta_0)\d \theta\right) \\ ={}& \frac{1}{\pi(2N+1)} \int_{-\pi}^{\pi} (\cos(N+\tfrac{1}{2})\theta) F'(\theta;\theta_0) \d \theta \\ \to{}& 0 \text{ as } N\to\infty. \end{align*} $$

(In fact we get uniform convergence.)