Optical waveguide modes: an approximate solution using Galerkin's method with Hermite-Gauss basis functions