Theory of dielectric optical waveguides