gregory's circumstances did not allow him to accept the mathematical chair at the university of toronto offered in 1841. illness overtook him the next year. incapacitated, he left cambridge in the spring of 1843, and died in edinburgh the following february, at 30 years of age.