Mathematician and scientist, born in Jedburgh, the daughter of a naval officer (Vice-Admiral Sir William Fairfax). Mary was born as her mother journeyed back from London to the family home at Burntisland, where Mary was educated.
William Somerville was her second husband, her first having died shortly after their marriage, and the couple settled in Edinburgh. Their friends included John Playfair (1748 - 1819), John Leslie (1766 - 1832) and David Brewster (1781 - 1868), who encouraged her study of mathematics.
Mary studied algebra and published a series of books, including one on physical geography which became a standard text for more than 50 years. She also translated the works of Laplace and predicted the existence of the planet Neptune. She was a pioneer of women's education and Oxford's first college for women was named in her honour (1879). She died in Naples (Italy).