Source: https://eric.univ-lyon2.fr/jdarmont/docs/m1idsm-bda-ex2.pdf