Source: https://www.epfl.ch/schools/sb/research/math/wp-content/uploads/2019/07/IntroductionCalcVar2019.pdf