Solving the hydrodynamical equations by means of a variational princip
le, we obtain a simultaneous description of the surface and volume mod
es of the valence electrons in a metal. This variational scheme, which
has been previously used in the context of nuclear fluid dynamics, is
applied to describe the dynamics of the valence electrons in a spheri
cal metal cluster and of the valence electrons in the metal surroundin
g a spherical cavity (void). The eigenmodes fulfil the linear energy-w
eighted sum rule (m(1)), the inverse energy-weighted sum rule(m(-1)) a
nd orthogonality relations. The surface modes predicted by Mie (in clu
sters) and by Natta (in cavities) appear in this model as natural solu
tions of the equations of motion and boundary conditions. We have cons
idered a stabilized spherical jellium model. The parameters of the eff
ective interaction are obtained by means of a variational method takin
g into account the experimental values of the density, compressibility
and bulk energy. In the present model we have ignored the diffuseness
of the equilibrium electron density, taking into account, however, th
e surface degrees of freedom of the valence electrons and thus allowin
g them to penetrate into the vacuum (outside of the jellium) when unde
rgoing collective oscillations. The spectra of the excitation energies
, and the electronic transition currents and transition densities are
obtained for spherical clusters and voids.