adapting the Project 3 codes to work for the second-order DE in problem 5.19