Forced vibrations of a nonhomogeneous string