TE and TM waves in dielectric guides