In this paper we present an algorithm for solving the inverse Sturm-Liouville problem with symmetric potential and Dirichlet boundary conditions. The algorithm is based on the Rayleigh-Ritz method for ...