First, denote $f_1*f_2$ for the convolution product of functions, that is
$f_1*f_2(x) := \int_0^T f_1(t) f_2(x-t) \, dt \underset{_{u=x-t}}{=} \int_0^T f_1(x-u) f_2(u) \, du = f_2*f_1(x)$
Now for $k \in \mathbb{R}$, write $z^k(t) = e^{j k \omega_0 t}$ (for $k$ integer this is an actual power of $z$, otherwise this is a slight abuse of notation) and $s_k(t) = \sin(k \omega_0 t)$. Your partial sum is
$s_n = \sum_{k = -n}^n f * z^k = f * \sum_{k = -n}^n z^k$
Now, we compute the sum (usually called Dirichlet kernel). You can check that
$\sum_{k = -n}^n z^k = \frac{z^{n+1}-z^{-n}}{z-1} = \frac{z^{n+1/2}-z^{-n-1/2}}{z^{1/2}-z^{-1/2}} = \frac{s_{n+1/2}}{s_{1/2}}$
In the end, you get
$s_n(x) = \int_0^T f(x-t) \frac{s_{n+1/2}}{s_{1/2}}(t) \, dt \underset{_{u=-t}}{=} \int_0^T f(x+u) \frac{s_{n+1/2}}{s_{1/2}}(u) \, du$
And averaging yields
$s_n(x) = \int_0^T \frac{f(x+t) + f(x-t)}{2} \frac{s_{n+1/2}}{s_{1/2}}(t) \, dt$