Efficient spectral-Galerkin method I