A Spectral Galerkin Approximation Of The Porous Medium Equation