A two-dimensional unsteady potential flow outside an elastic partially cavitating wing is analyzed numerically by using the Birnbaum equation on the hydrofoil chord and the Lagrange--Cauchy integral on the cavity. The angle of attack has a small periodic perturbation, and cavity thickness and length also take perturbations. Wing vibration is considered to be vibration of a variable thickness beam with two clamp bolts near the beam center. A monofrequency flow perturbation induces monofrequency flexural vibration of a noncavitating wing, but the vibration of a cavitating wing has multifrequency. Computation of NACA-16009 hydrofoil vibration was made for various free-stream speeds, module of elasticity, fluid, and wing densities, and as a result, three frequency bands of a vibration increase are determined. The low-frequency band is connected with a cavity volume oscillation. There is a considerable influence of cavity length on vibration. The high-frequency band is connected with elastic resonances of the wing. A solitary resonance was found in the middle band. This resonance has a nonlinear dependence on the loss coefficient and does not have a dependence on cavity dimensions and wing elasticity. This resonance appearance is connected with an interaction of lift and media inertia forces.