Source: https://math.unice.fr/~dehon/Ens/L2Mass/Documents/TD-microeco.pdf