Finite Difference Methods for Option Pricing › The Black-Scholes PDE on a Grid
Quantitative FinanceAll chapters Finite Difference Methods for Option Pricing › The Black-Scholes PDE on a GridOne section · Sections in this chapter2 / 14 ↓
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
The foundation of finite difference methods is the Black-Scholes PDE, which is derived using Itô's lemma and the principle of no-arbitrage pricing. Recall that this partial differential equation emerges from the requirement that a perfectly hedged portfolio of an option and its underlying asset must earn the risk-free rate. The equation captures how the option value evolves as time passes and as the underlying asset price fluctuates. For an option with value on an underlying asset with price , the PDE is:
where:
- : option price as a function of asset price and time
- : risk-free interest rate
- : volatility of the underlying asset
- : diffusion term capturing the effect of volatility
- : drift term reflecting the risk-neutral expected return
- : discounting term reflecting the time value of money
Each term in this equation has a clear financial interpretation that helps us understand why the option value must satisfy this relationship. The time derivative captures how the option value changes purely due to the passage of time, with all else held constant. The second derivative term, sometimes called the gamma term, reflects the convexity of the option's payoff and how volatility affects value. When an option has positive gamma, increased volatility raises its expected payoff under risk-neutral pricing. The first derivative term represents the delta exposure, capturing how the option value responds to small changes in the underlying price. Finally, the discounting term ensures that the option value is expressed in present-value terms, consistent with no-arbitrage pricing. This equation, combined with appropriate boundary conditions and a terminal condition at expiration, uniquely determines the option value.
Transforming to a Standard Form
Working directly with the Black-Scholes PDE can be cumbersome because the coefficient in front of the second derivative varies with . This spatial dependence of the coefficients means that the diffusion rate changes across the price grid, which can complicate numerical analysis and introduce additional discretization challenges. A common transformation simplifies the problem by converting to log-price coordinates. The key insight is that if the stock price follows geometric Brownian motion, then the log of the stock price follows arithmetic Brownian motion with constant volatility. Let , so . After applying the chain rule to transform the derivatives:
where:
- : option value
- : asset price
- : log-price coordinate ()
The transformation of the first derivative follows directly from the chain rule. For the second derivative, we must apply the product rule and chain rule together, recognizing that itself depends on . The calculation yields:
where:
- : second derivative (gamma) in price coordinates
- : derivatives in log-price coordinates
Notice how the transformation introduces a correction term: the second derivative in log-coordinates does not simply equal times the second derivative in price coordinates. This correction arises because the log transformation is nonlinear, stretching the coordinate system differently at different price levels. Substituting these transformed derivatives into the Black-Scholes PDE and simplifying yields a much simpler equation:
where:
- : option value
- : time
- : volatility
- : risk-free rate
- : log-price coordinate
This transformed equation has constant coefficients, making it more amenable to finite difference approximations because the same discretization scheme applies uniformly across the entire spatial domain. The coefficient in front of the first derivative is the risk-neutral drift of the log-price process, which should be familiar from the study of the Black-Scholes-Merton model. To keep things clear and practical, we'll focus on the original -coordinate formulation. This makes setting boundary conditions and interpreting results more intuitive.
Setting Up the Computational Grid
To solve the PDE numerically, we must replace the continuous price and time domains with discrete grid points. This process, called discretization, turns the continuous partial differential equation into a system of algebraic equations that a computer can solve. For the asset price , we create a grid from to , where is chosen large enough that the option value is negligible for out-of-the-money options. For time, we work backward from expiration to the current time , which aligns with the natural direction for solving parabolic PDEs with terminal conditions.
The grid points are defined as:
- Price grid: for , where
- Time grid: for , where
Let denote the option value at grid point . This notation uses subscripts for spatial indices and superscripts for temporal indices, a convention that helps distinguish the two dimensions of the problem. Our goal is to compute the option values at (current time) given the terminal condition at (expiration). The backward-in-time solution process mirrors the logic of risk-neutral valuation: we know the option's payoff at expiration and work backward to determine its present value.
import numpy as np
# Set up the discretization grid
S_max = 200.0 # Maximum stock price on grid
M = 100 # Number of price steps
N = 1000 # Number of time steps
T = 1.0 # Time to expiration (years)
K = 100.0 # Strike price
dS = S_max / M
dt = T / N
# Create the grid
S = np.linspace(0, S_max, M + 1)
t = np.linspace(0, T, N + 1)Price step size (dS): $2.00 Time step size (dt): 0.001000 years (0.252 trading days) Grid dimensions: 101 price points × 1001 time points Total grid points: 101,101

The choice of grid parameters involves trade-offs that you must carefully consider. Finer grids (larger and ) provide more accurate solutions but require more computation and memory. The grid must be fine enough to capture the option's behavior near the strike price, where values change most rapidly, but extending the grid too far into deep in-the-money or out-of-the-money regions wastes computational resources. The ratio between and is particularly important for stability, as we'll see when analyzing each scheme.