Physical applications of second-order linear differential equations that admit polynomial solutions