A symmetric finite difference method for computing eigenvalues of Sturm-Liouville problems