Source: https://www.ceremade.dauphine.fr/~mula/docs/teaching/optimM1/docs/notes_optim.pdf