Fourier series and boundary value problems