  We consider a scalar field in a one-dimensional cavity with a mobile wall.
The wall is assumed bounded by a harmonic potential and its mechanical degrees
of freedom are treated quantum mechanically. The possible motion of the wall
makes the cavity length variable, and yields a wall-field interaction and an
effective interaction among the modes of the cavity. We consider the ground
state of the coupled system and calculate the average number of virtual
excitations of the cavity modes induced by the wall-field interaction, as well
as the average value of the field energy density. We compare our results with
analogous quantities for a cavity with fixed walls, and show a correction to
the Casimir potential energy between the cavity walls. We also find a change of
the field energy density in the cavity, particularly relevant in the proximity
of the mobile wall, yielding a correction to the Casimir-Polder interaction
with a polarizable body placed inside the cavity. Similarities and differences
of our results with the dynamical Casimir effect are also discussed.
