Source: https://www.math.hkust.edu.hk/~amoy/math1013/nup2-math1013-2016-lectureslides-week10optimization.pdf