Mary Somerville primarily learned mathematics through self-directed study, correspondence with a teacher, and guided study with a professional tutor, rather than through formal school instruction.
She began by teaching herself Latin "for the sake of having something to do" , which laid the groundwork for her later studies. After her first husband's death, she "resumed my mathematical studies" independently, working through "plane and spherical trigonometry, conic sections, and Fergusson's 'Astronomy'" . She then attempted to read Newton's "Principia" on her own, initially finding it "extremely difficult" .
This self-study led to a correspondence with Mr. Wallace, a mathematical teacher at the Military College at Marlow. She "solved some of the problems contained in [his journal] and sent them to him, which led to a correspondence, as Mr. Wallace sent me his own solutions in return" . This exchange, where they sometimes "solved the same problem by different methods," culminated in her solving a prize problem and being "awarded a silver medal cast on purpose with my name" .
Finally, advised by Professor Wallace, she engaged his brother, Mr. John Wallace, to "read with me," using the "Mécanique Céleste" as their textbook . She noted that although he was "a good mathematician," she soon found that "I understood the subject as well as he did," and that having taken this resolution "gave me confidence in myself and consequently courage to persevere" .