If you're in the US and don't absolutely refuse to buy from them, Amazon has it for under $4 right now. I picked it up on a whim after seeing that price, though I usually buy my Sanderson from local stores.
If you are in Canada, its $12 at Chapters: https://www.chapters.indigo.ca/en-ca/books/the-rithmatist/9780765338440-item.html
$13 ish on Amazon (canada): https://www.amazon.ca/Rithmatist-Brandon-Sanderson/dp/0765338440/
$10ish on Amazon (US): https://www.amazon.com/Rithmatist-Brandon-Sanderson/dp/0765338440/
And various other places. Audio book can be found on Audible.
Have you read any of Brandon Sanderson's stuff? He tends to write very detailed magical systems. If you want a school setting in specific, check out The Rithmatist.
You might also like my own book, Forging Divinity. I also go into a tremendous amount of magic system detail (and magic theory is a big part of the plot), but the story itself is structured differently from Mother of Learning. (It's not a magical school story; more of a fantasy/spy adventure story with three different protagonists.)
Could it have been The Rithmatist by Brandon Sanderson? It's got the same basic plot as what you described. One of the characters is a female, but the main character is a male.