Source: http://math.lyceedebaudre.net/sites/default/files/Exercices/PremiereS/Fonction%20de%20reference_correction.pdf