Proof (Fourier coefficients of the derivative)

We integrate by parts: $$ \begin{align*} \hat g_n &= \frac{1}{L} \int_{0}^{L} f'(\theta) e^{-2\pi in\theta/L} \d \theta \\ &= \frac{1}{L}\left(\left[f(\theta) e^{-2\pi in\theta/L}\right]_{0^+}^{L^-} + \frac{2\pi i n}{L} \int_{0}^{1} f(\theta) e^{-2\pi i n\theta/L} \d \theta\right) \\ &= \frac{f(L_-) - f(0_+)}{L} + \frac{2\pi i n}{L} \hat f_n. \end{align*} $$