Complex sentence: John Playfair, then professor of natural philosophy at University of Edinburgh, encouraged her studies, and through him she began a correspondence with William Wallace, with whom she discussed the mathematical problems set in the "Mathematical Repository".
Split into simpler sentences: John Playfair, then professor of natural philosophy at University of Edinburgh, encouraged her studies, and through him she began a correspondence with William Wallace. In this correspondence they discussed the mathematical problems set in the "Mathematical Repository".