Source: https://mathematiques.ac.free.fr/IMG/pdf/Primitives_exos_TES.pdf