Effects of nonlinearity and dispersion on pulse propagation in optical waveguides