Mary Somerville was born on 26 December 1780 in a manse at Jedburgh, the home of her mother's sister. She was the fifth child of William George Fairfax, a Lieutenant in Nelson's navy (later a Vice-Admiral) and his second wife, Margaret Charters. Four of the couple's seven children survived. They were brought up in Burntisland where Mary Somerville spent her childhood and adolescence. She attended a school in Musselburgh whose chief aim it was to teach girls to be gracious. Despite the obstacles that were put tin her way she pursued her own interests in mathematics and the classics.
In 1804 she married her cousin Samuel Greig and they went to stay in London, but she was left with two young children when her husband died only three years later at the age of twenty-nine. Mary returned to her parents' home where she continued her studies in algebra and geometry.
In 1812 she married another of her cousins, William Somerville, an army doctor. The couple soon moved to London again where William took up a post as physician at the Chelsea Hospital. Mary Somerville continued her studies and was in her early forties when her scientific interests began to make their mark. In 1831 she published a translation of Laplace's Mécanique Céleste originally intended as one of the publications of the Society for the Diffusion of Useful Knowledge but in the end published by John Murray. This work was soon adopted for courses in Cambridge and made her reputation. It was followed by The Connexion of the Physical Sciences in 1834 and the award of a government pension the following year. Scientists throughout Europe Mary Somerville and her work was widely translated.