The Generalized Fourier Series Method