The story connects with mathematics primarily through a theory, which posits that magic can be understood and controlled through mathematical principles. It discusses how mathematical tools, particularly calculus, can express relationships and channel energy in a precise manner.Overall, the story presents mathematics as a key to unlocking the mysteries of the universe, suggesting that the laws governing both magic and reality can be understood through rigorous scientific inquiry.