Source: https://wiki.epfl.ch/mathgeo2/documents/2013/extrema.pdf