Finite-element equations are derived for wave propagation in inhomogeneous waveguides. A variational expression is used for the wavenumber k0. A discretised finite-element equation is found at a point surrounded by four dielectrics, and special cases deduced. The method is applied to the solution of the dominant LSM mode in a dielectric-slab-loaded waveguide.