On the Generalization of Mathews' Problem of the Vibrations of a Beam on Elastic Foundation