A new method is derived for solving Maxwell's equations for a region o
f space, region I, joined onto region II, which may be a finite dielec
tric or an extended substrate. This is based on a variational principl
e in which a trial field is defined explicitly only in region I, the s
olution of Maxwell's equations in region II being included through an
embedding operator defined on the boundary of region I with II. This o
perator is the inverse of a non-local boundary impedance. The method i
s applied to calculating the normal modes of an array of dielectric sl
abs, semi-infinite dielectrics separated by vacuum, and modes confined
in a three-dimensional box with conducting walls. Plane wave basis fu
nctions are used to expand the electric held in region I, and the meth
od shows excellent convergence in all cases. Approximate solutions of
Laplace's equation can occur, corrupting the solutions of Maxwell's eq
uations with finite frequency. It is shown how these can be suppressed
.