Source: https://perso.ensta-paris.fr/~manzaner/Cours/Ese41/Exercices_Module2/ExercisesTopic2.pdf