Identity involving partial sums of Fourier series Suppose $f$ is a continuous periodic function and $S_Nf(x) = \sum^N_{n=−N} \hat f(n) e^{inx}$, where $$\hat f(n)= \frac{1}{2\pi}\int_0^{2\pi}f(x)e^{-inx} dx.$$
How can I show that $$\sum_{j=0}^{N-1}S_jf(x)= \int_{-\pi}^{\pi} \frac{\sin^2(\frac{1}{2}Ny)}{\sin^2(\frac{1}{2}y)}f(x-y)dy?$$
Supposedly it can be done using routine trigonometric manipulation, but I don't see it right away. Thank you in advance.

This relies on switching the order of summation and integration.  For one particular value of $S_k$:
$$\begin{align}S_k &= \frac{1}{2 \pi} \int_0^{2 \pi} dx' \: f(x') \sum_{n=-k}^k e^{i k (x-x')} \\ &= \frac{1}{2 \pi} \int_0^{2 \pi} dx' \: f(x') \frac{e^{i (k+1)(x-x')} - e^{-i k (x-x')}}{e^{i (x-x')} -1}\\ &= \frac{1}{2 \pi} \int_0^{2 \pi} dx' \: f(x') \frac{\sin{\left[\left(k+\frac{1}{2}\right)(x-x')\right]}}{\sin{\left[\frac{1}{2}(x-x')\right]}} \end{align}$$
Now we want to evaluate a sum over $k$ of $S_k$:
$$\begin{align}\sum_{k=0}^{N-1} S_k &= \frac{1}{2 \pi} \int_0^{2 \pi} dx' \: f(x') \frac{1}{\sin{\left[\frac{1}{2}(x-x')\right]}}\sum_{k=0}^{N-1}\sin{\left[\left(k+\frac{1}{2}\right)(x-x')\right]}\end{align}$$
Now
$$\begin{align}\sum_{k=0}^{N-1}\sin{\left[\left(k+\frac{1}{2}\right)(x-x')\right]}&= \Im{\left[\sum_{k=0}^{N-1}e^{i\left[\left(k+\frac{1}{2}\right)(x-x')\right]}\right]} \\ &= \Im{\left[e^{i\left[\frac{1}{2}(x-x')\right]} \sum_{k=0}^{N-1}e^{i\left[k(x-x')\right]}\right]}\\ &=\Im{\left[e^{i\left[\frac{1}{2}(x-x')\right]}\frac{e^{i N (x-x')}-1}{e^{i(x-x')}-1}\right]}\\ &= \Im{\left[e^{i N (x-x')/2} \frac{\sin{[N (x-x')/2]}}{\sin{[(x-x')/2}]} \right]} \\ &= \frac{\sin^2{[N (x-x')/2]}}{\sin{[(x-x')/2}]}\end{align}$$
Therefore
$$\sum_{k=0}^{N-1} S_k = \frac{1}{2 \pi} \int_0^{2 \pi} dx' \: f(x') \frac{\sin^2{[N (x-x')/2]}}{\sin^2{[(x-x')/2}]}$$
The stated result follows, save for the factor of $2 \pi$.
