[en] In this paper a simple method is presented to compute the eigenvalues and the eigenfunctions of second-order linear differential operators, with homogeneous boundary conditions, both in a finite interval and on the semi-line. Our technique overcomes the drawbacks of the method proposed by Calogero to compute the eigenvalues of Sturm-Liouville problems in a finite interval. An estimate of the convergence for the eigenvalues is given in the finite case and numerical test are performed, exhibiting a very fast rate of convergence for the eigenvalues both for the finite interval and the semi-line cases. An excellent convergence for the eigenfunctions is also obtained in both cases