# Counting electromagnetic modes in a rectangular cavity and boundary conditions

The electric field in a cubical cavity of side length $L$ with perfectly conducting walls is

$E_x = E_1 \cos(n_1 x \pi/L) \sin(n_2 y \pi/L) \sin(n_3 z \pi/L) \sin(\omega t)$ $E_y = E_2 \sin(n_1 x \pi/L) \cos(n_2 y \pi/L) \sin(n_3 z \pi/L) \sin(\omega t)$ $E_z = E_3 \sin(n_1 x \pi/L) \sin(n_2 y \pi/L) \cos(n_3 z \pi/L) \sin(\omega t)$

with $E_1 n_1 + E_2 n_2 + E_3 n_3 = 0$.

In counting the number of modes, the counting is restricted to non-negative values of $n_1$, $n_2$ and $n_3$. Is there a simple way to show that

a) any mode in which one or more of the $n_1$, $n_2$ and $n_3$ are negative, can be written as a linear combination of the modes that are included in the counting and

b) the modes that are included in the counting are all independent?

Also, is the perpendicular component of the magnetic field on the surface of a plane conductor required to be zero? The vanishing electric field in the conductor only implies that the the time derivative of the perpendicular component of the magnetic field vanishes.

-

a) Yes, you don't even need to look for linear combinations. By substituting either of the mode numbers by their opposite value, only signs of the quantities involving it in a sine change, which is mathematically equivalent to choosing different $\{E_i\}$ with the original $\{n_j\}$.

b) The modes are all mutually orthogonal (in terms of the $L^2$ scalar product), which automatically implies linear independence.

Finally, about the magnetic field: theoretically, the perpendicular component at a conductive wall could be constant. However, when one is looking for harmonic oscillating modes, this would correspond to zero frequency. There sure are nonzero constant solutions, e.g., a homogeneous magnetic field penetrating the whole box, but we generally are not interested in those for a variety of reasons.

Hope this helps!

-