Differential Equations and Optimization