A transverse magnetic field formulation of the finite-element method for solving lightwave propagation in optical guides has been implemented. The method requires that the interface boundary conditions for E(Z) and H(Z) be imposed, and this is performed by solving the vector wave equation in the null space of the boundary operator. Results for a three-layer ridge waveguide, even with a very coarse mesh, compare well with published values. In addition, results for a lossless multiple-quantum-well ridge guide, again using a coarse mesh, show excellent agreement with results from a variable mesh semivectorial finite-difference program.