Isoscalar and isovector density vibrations in a slab with sharp edges are studied in a nonlinear hydrodynamic approach. The frequency shift of the N-phonon excitation due to nonlinear terms is obtained. The frequencies of one-and two-phonon vibrations calculated in the nonlinear hydrodynamic theory are reduced by Ϸ5-30 % for isoscalar and by Ϸ1-8 % for isovector resonances as compared to the linear approximation. The frequency shift is a function of both the slab thickness and the parameters of the nucleon-nucleon interaction. Experimental data on the frequency shift of the N-phonon states due to the nonlinear terms in the case Nу2 may be used for selecting of the set of nucleon-nucleon interaction parameters. ͓S0556-2813͑98͒01902-5͔PACS number͑s͒: 21.60. Ev, 21.65.ϩf, 24.10.Nz, 24.30.Cz