Optimization and Critical Points