  We analyze the Casimir-Lifshitz effect associated with the electromagnetic
field in the presence of a rectangular waveguide consisting of two distinct
dielectric materials in a (3 + 1)-dimensional spacetime. We employ the surface
mode technique to derive a generalized Lifshitz formula for this specific
geometry. Our formulation accounts for the unique dielectric properties of the
materials composing the waveguide, leading to a precise calculation of the
Casimir-Lifshitz energy. In the asymptotic limit, our results recover the
classical expressions for perfect reflecting boundaries. The behavior of the
force on the rectangular cavity walls admit us to identify the system as a
Casimir-Lifshitz anharmonic oscillator, that may vibrate due only the to vacuum
stress if we allow two parallel non-fixed walls.
