Source: http://www.lama.univ-savoie.fr/~raibaut/siteweb-L2/TD2-Solutions.pdf