Deriving Black-Scholes with SageMath

In this post, I build a minimal symbolic Itô calculus layer on top of SageMath and use it to derive the Black–Scholes partial differential equation directly from the stochastic differential equation of the underlying asset. Rather than treating stochastic calculus as a sequence of handwritten manipulations, we encode quadratic variation into an algebraic structure and let the system carry out…