Frequently the cross-section of a longitudinally homogeneous dielectri
c waveguide may be decomposed into rectangles with constant permittivi
ty. For points inside these rectangles the wave equation for modal fie
lds is solved analytically by expanding into functions with harmonic o
r exponential dependence on the transverse coordinates. Minimization o
f a least-squares expression for the remaining misfit on the boundary
lines allows us to determine propagation constants and fields for guid
ed modes. Semivectorial calculations for two sets of rib waveguides an
d the centre sections of a directional coupler and an MMI device show
very good agreement with results found in the literature.