Derivation of the Black-Scholes-Merton PDE › Visualizing the PDE Residual

Michael BrenndoerferNovember 26, 20251 min read
Quantitative FinanceAll chapters
Part 5 of 15Stochastic Calculus and Pricing Theory
Chapter 29Derivation of the Black-Scholes-Merton PDE › Visualizing the PDE Residual
Reading section 10 of 16 · Visualizing the PDE Residual · 1 minSection 10 of 16 · 1 min

Book contents

Section 10 of 16 · 1 min read

Derivation of the Black-Scholes-Merton PDE › Visualizing the PDE ResidualOne section · Sections in this chapter10 / 16 ↓
Reading tools Definitions & inline links

Choose your expertise level to adjust how many terms are explained. Beginners see more tooltips, experts see fewer to maintain reading flow. Hover over underlined terms for instant definitions.

Article links

Make inline references clickable

Let's create a visualization showing the PDE residual across different stock prices for both valid and invalid pricing functions.

In[16]:
Code
S_range = np.linspace(50, 150, 100)
residuals_valid = [
    bs_pde_residual(
        power_derivative_price, S, t_test, r_test, sigma_test, T_test
    )
    for S in S_range
]
residuals_invalid = [
    bs_pde_residual(
        invalid_pricing_function, S, t_test, r_test, sigma_test, T_test
    )
    for S in S_range
]
Out[17]:
Visualization
Line plot comparing PDE residuals showing valid solution near zero and invalid solution with large non-zero values.
Black-Scholes PDE residual across stock prices. The valid solution (power derivative) has near-zero residual everywhere, while the invalid function shows substantial residual, confirming it does not satisfy the PDE.