Source: http://qed.econ.queensu.ca/pub/students/khans/ECON3473_Assignment1_W07_PartB_C_Sol1.pdf