On the numerical solution of Sturm-Liouville differential equations