Notes/The Black-Scholes Model: Pricing Options with Partial Differential Equations
Back to Notes

The Black-Scholes Model: Pricing Options with Partial Differential Equations

Options pricing from first principles: the Black-Scholes PDE derivation (intuition), closed-form solution, the Greeks (delta, gamma, theta, vega), and why volatility is the only unknown.

2025-08-24AI-Synthesized from Personal NotesSource2700+ words of raw notesEnrichmentsCode blocks, Interactive charts, GraphicsPipelineMulti-pass AI review · Score: 99/100
Share
Quantitative FinanceBlack ScholesOptionsGreeks

Terminology

Term Definition
Option A contract giving the holder the right (not obligation) to buy or sell an asset at a fixed price on or before a specified date
Call Option An option to buy the underlying asset at the strike price $K$. Payoff at expiry: $\max(S_T - K, 0)$
Put Option An option to sell the underlying asset at the strike price $K$. Payoff at expiry: $\max(K - S_T, 0)$
Strike Price ($K$) The fixed price at which the option holder can buy (call) or sell (put) the underlying asset
Underlying ($S$) The asset (stock, index, commodity) on which the option is written. Its current price is $S$ and its price at expiry is $S_T$
Volatility ($\sigma$) The annualized standard deviation of the underlying's log-returns. The single unknown parameter in Black-Scholes
Risk-Free Rate ($r$) The continuously compounded return on a riskless investment (e.g., Treasury bills) over the option's lifetime
Time to Expiry ($T - t$) The remaining time (in years) until the option expires. Often written as $\tau = T - t$
Greeks Partial derivatives of the option price with respect to its inputs: delta ($\Delta$), gamma ($\Gamma$), theta ($\Theta$), vega ($\mathcal{V}$), rho ($\rho$)
Geometric Brownian Motion (GBM) The stochastic process $dS = \mu S\,dt + \sigma S\,dW$ used to model stock prices, where $dW$ is a Wiener process increment
Implied Volatility The value of $\sigma$ that, when plugged into the Black-Scholes formula, reproduces the observed market price of an option
PDE (Partial Differential Equation) An equation involving partial derivatives of an unknown function with respect to multiple variables. The Black-Scholes PDE relates the option price to time and the underlying price

What & Why

An option is a bet on the future. You pay a premium today for the right to buy or sell an asset at a fixed price later. The question that haunted finance for decades: what is that premium worth?

In 1973, Fischer Black, Myron Scholes, and Robert Merton answered it. Their insight was that you can construct a portfolio of the option and the underlying stock that is perfectly hedged: its value changes are deterministic, not random. Since a riskless portfolio must earn the risk-free rate (otherwise arbitrage exists), this constraint pins down the option price exactly. The result is the Black-Scholes formula, and it earned Scholes and Merton the 1997 Nobel Prize in Economics.

The formula matters for three reasons. First, it gives a closed-form price for European options, meaning you can compute it in microseconds. Second, it reveals that the option price depends on only five inputs: the stock price $S$, the strike price $K$, time to expiry $\tau$, the risk-free rate $r$, and volatility $\sigma$. Of these, four are directly observable. Only volatility is unknown, which is why options trading is fundamentally a bet on volatility. Third, the partial derivatives of the formula (the Greeks) tell traders exactly how their position's value changes when market conditions shift, enabling precise risk management.

For computer scientists, Black-Scholes connects stochastic calculus, PDEs, and numerical methods. The pricing formula involves the cumulative normal distribution function $\Phi$, which itself requires numerical approximation. Computing Greeks is an exercise in automatic differentiation. And when the closed-form breaks down (American options, exotic payoffs), you fall back to Monte Carlo simulation, finite difference methods, or binomial trees, all core computational techniques.

How It Works

The Setup: Geometric Brownian Motion

Black-Scholes assumes the stock price follows geometric Brownian motion:

$dS = \mu S\,dt + \sigma S\,dW$

where $\mu$ is the expected return (drift), $\sigma$ is volatility, and $dW$ is a Wiener process increment (a random shock with $dW \sim \mathcal{N}(0, dt)$). The key property: percentage changes in $S$ are normally distributed, so $S$ itself is log-normally distributed and can never go negative.

The Hedging Argument (PDE Derivation Intuition)

Let $V(S, t)$ be the option price as a function of stock price and time. Construct a portfolio $\Pi$ that is long one option and short $\Delta$ shares of stock:

$\Pi = V - \Delta \cdot S$

The change in portfolio value over a small time step is:

$d\Pi = dV - \Delta \cdot dS$

Using Ito's lemma (the chain rule for stochastic calculus), the change in $V$ is:

$dV = \frac{\partial V}{\partial t}dt + \frac{\partial V}{\partial S}dS + \frac{1}{2}\frac{\partial^2 V}{\partial S^2}\sigma^2 S^2\,dt$

The extra second-derivative term (compared to ordinary calculus) appears because $dW^2 = dt$ in Ito calculus. Now choose $\Delta = \frac{\partial V}{\partial S}$. This cancels the $dS$ terms:

$d\Pi = \left(\frac{\partial V}{\partial t} + \frac{1}{2}\sigma^2 S^2 \frac{\partial^2 V}{\partial S^2}\right)dt$

The randomness ($dW$) has vanished. The portfolio is riskless over the infinitesimal interval $dt$. A riskless portfolio must earn the risk-free rate, so $d\Pi = r\Pi,dt$. Substituting and rearranging gives the Black-Scholes PDE:

$\frac{\partial V}{\partial t} + \frac{1}{2}\sigma^2 S^2 \frac{\partial^2 V}{\partial S^2} + rS\frac{\partial V}{\partial S} - rV = 0$

Notice: the drift $\mu$ does not appear. The option price is independent of the expected return on the stock. This is the risk-neutral pricing principle: under the hedging argument, the stock's drift is replaced by the risk-free rate $r$.

$\frac{\partial V}{\partial t} + \frac{1}{2}\sigma^2 S^2 \frac{\partial^2 V}{\partial S^2} + rS\frac{\partial V}{\partial S} - rV = 0$

Derived from these five steps: 1. Stock follows GBM dS = muS dt + sigmaS dW 2. Build hedged portfolio Pi = V(S,t) - (dV/dS) * S 3. Apply Ito's lemma to dV extra second-derivative term appears 4. Delta hedge cancels dW randomness eliminated, portfolio is riskless 5. Riskless portfolio earns rate r drift mu disappears (risk-neutral pricing) Solve with V(S,T) = max(S-K, 0) to get the BS formula

The Closed-Form Solution

Solving the PDE with the boundary condition $V(S, T) = \max(S - K, 0)$ for a European call gives:

$C = S\,\Phi(d_1) - K e^{-r\tau}\Phi(d_2)$

where $\tau = T - t$ is time to expiry and:

$d_1 = \frac{\ln(S/K) + (r + \sigma^2/2)\tau}{\sigma\sqrt{\tau}}, \qquad d_2 = d_1 - \sigma\sqrt{\tau}$

$\Phi(\cdot)$ is the cumulative standard normal distribution function. For a European put, put-call parity gives:

$P = K e^{-r\tau}\Phi(-d_2) - S\,\Phi(-d_1)$

The formula has an elegant interpretation. The term $S,\Phi(d_1)$ is the expected value of receiving the stock (weighted by the probability of exercise under the stock-price measure). The term $K e^{-r\tau}\Phi(d_2)$ is the present value of paying the strike (weighted by the risk-neutral probability of exercise). The call price is the difference between what you expect to receive and what you expect to pay.

The gap between the Black-Scholes price (blue curve) and intrinsic value (dashed orange) is the time value of the option. It is largest when the option is at-the-money ($S \approx K$) and shrinks as expiry approaches.

The Five Inputs

The Black-Scholes price depends on exactly five parameters:

Black-Scholes Inputs BS Formula S (stock price) K (strike price) tau (time to expiry) r (risk-free rate) sigma (volatility) THE ONLY UNKNOWN C or P (option price)

Four of the five inputs ($S$, $K$, $\tau$, $r$) are directly observable from market data. Only $\sigma$ must be estimated. This is why options traders say they "trade volatility": the option price is just a translation of a volatility view into dollar terms.

The Greeks

The Greeks are partial derivatives of the option price with respect to each input. They quantify how sensitive the option is to changes in market conditions.

Delta ($\Delta$): sensitivity to the underlying price.

$\Delta_{\text{call}} = \Phi(d_1), \qquad \Delta_{\text{put}} = \Phi(d_1) - 1$

Delta ranges from 0 to 1 for calls and -1 to 0 for puts. An at-the-money call has $\Delta \approx 0.5$: a $1 move in the stock changes the option price by about $0.50. Delta is also the hedge ratio: to delta-hedge, hold $\Delta$ shares per option.

Gamma ($\Gamma$): sensitivity of delta to the underlying price (the second derivative).

$\Gamma = \frac{\phi(d_1)}{S\sigma\sqrt{\tau}}$

where $\phi$ is the standard normal PDF. Gamma is highest for at-the-money options near expiry. High gamma means delta changes rapidly, requiring frequent rehedging.

Theta ($\Theta$): sensitivity to time (time decay).

$\Theta_{\text{call}} = -\frac{S\phi(d_1)\sigma}{2\sqrt{\tau}} - rKe^{-r\tau}\Phi(d_2)$

Theta is almost always negative for long options: the option loses value as time passes, all else equal. This is the "cost of insurance."

Vega ($\mathcal{V}$): sensitivity to volatility.

$\mathcal{V} = S\phi(d_1)\sqrt{\tau}$

Vega is always positive for both calls and puts: higher volatility increases option value. Vega is largest for at-the-money options with long time to expiry.

Delta follows an S-curve (the cumulative normal), transitioning from near-zero for deep out-of-the-money options to near-one for deep in-the-money options. Vega peaks at-the-money where uncertainty about exercise is greatest.

Implied Volatility

In practice, traders do not plug in a volatility estimate and compute a price. They observe the market price and invert the formula to find the implied volatility: the $\sigma$ that makes Black-Scholes match the market.

$C_{\text{market}} = \text{BS}(S, K, \tau, r, \sigma_{\text{implied}}) \implies \text{solve for } \sigma_{\text{implied}}$

This inversion has no closed-form solution. It requires a numerical root-finding algorithm (Newton-Raphson works well because vega provides the derivative). The implied volatility surface, plotted across strikes and expiries, reveals the market's view of future uncertainty. The characteristic "volatility smile" (implied vol is higher for far out-of-the-money options) shows where Black-Scholes assumptions break down: real stock returns have fatter tails than the normal distribution predicts.

If Black-Scholes were perfectly correct, implied volatility would be flat across all strikes (a horizontal line). The smile shape tells us the market prices in crash risk (left side) and momentum risk (right side) that the log-normal model ignores.

Complexity Analysis

Operation Time Space Notes
BS closed-form price $O(1)$ $O(1)$ Fixed number of arithmetic ops + one $\Phi$ evaluation
$\Phi(x)$ (CDF approximation) $O(1)$ $O(1)$ Rational approximation (Abramowitz & Stegun), ~6 multiplies
All Greeks for one option $O(1)$ $O(1)$ Reuse $d_1$, $d_2$, $\Phi(d_1)$, $\phi(d_1)$ across all Greeks
Implied vol (Newton-Raphson) $O(k)$ $O(1)$ $k \approx 4$-$6$ iterations for machine precision convergence
Price $n$ options (vectorized) $O(n)$ $O(n)$ Embarrassingly parallel, ideal for GPU/SIMD
Monte Carlo pricing $O(m \cdot s)$ $O(s)$ $m$ paths, $s$ time steps per path. Error $\propto 1/\sqrt{m}$

The Black-Scholes closed form is $O(1)$: a fixed number of floating-point operations regardless of input values. This makes it extraordinarily fast. A modern CPU can price tens of millions of options per second. The bottleneck in production systems is not the formula itself but the implied volatility inversion, which requires iterative root-finding. Even so, Newton-Raphson converges quadratically: each iteration roughly doubles the number of correct digits, so 4-6 iterations suffice for double-precision accuracy.

For portfolios of $n$ options, pricing is $O(n)$ and trivially parallelizable. Each option is independent, making this an ideal workload for GPUs. CUDA implementations routinely price millions of options in milliseconds.

When the closed form does not apply (American options, path-dependent exotics), Monte Carlo simulation with $m$ paths and $s$ steps costs $O(m \cdot s)$. The convergence rate is $O(1/\sqrt{m})$, meaning you need 100x more paths to get 10x more accuracy. Variance reduction techniques (antithetic variates, control variates using the BS price as a baseline) can dramatically improve this rate.

Implementation

Black-Scholes Call and Put Prices

FUNCTION normalCDF(x):
    // Abramowitz & Stegun rational approximation (error < 7.5e-8)
    INPUT: x (float)
    OUTPUT: cumulative probability Phi(x)

    IF x < 0 THEN
        RETURN 1 - normalCDF(-x)
    END IF

    t ← 1 / (1 + 0.2316419 * x)
    poly ← t * (0.319381530
            + t * (-0.356563782
            + t * (1.781477937
            + t * (-1.821255978
            + t * 1.330274429))))
    RETURN 1 - (1 / SQRT(2 * PI)) * EXP(-x * x / 2) * poly


FUNCTION normalPDF(x):
    INPUT: x (float)
    OUTPUT: standard normal density phi(x)

    RETURN (1 / SQRT(2 * PI)) * EXP(-x * x / 2)


FUNCTION blackScholesCall(S, K, tau, r, sigma):
    INPUT: S (stock price), K (strike), tau (time to expiry in years),
           r (risk-free rate), sigma (volatility)
    OUTPUT: European call option price

    d1 ← (LN(S / K) + (r + sigma^2 / 2) * tau) / (sigma * SQRT(tau))
    d2 ← d1 - sigma * SQRT(tau)

    RETURN S * normalCDF(d1) - K * EXP(-r * tau) * normalCDF(d2)


FUNCTION blackScholesPut(S, K, tau, r, sigma):
    INPUT: S (stock price), K (strike), tau (time to expiry in years),
           r (risk-free rate), sigma (volatility)
    OUTPUT: European put option price

    d1 ← (LN(S / K) + (r + sigma^2 / 2) * tau) / (sigma * SQRT(tau))
    d2 ← d1 - sigma * SQRT(tau)

    RETURN K * EXP(-r * tau) * normalCDF(-d2) - S * normalCDF(-d1)

Computing the Greeks

FUNCTION computeGreeks(S, K, tau, r, sigma):
    INPUT: S, K, tau, r, sigma (same as above)
    OUTPUT: record { delta, gamma, theta, vega, rho }

    d1 ← (LN(S / K) + (r + sigma^2 / 2) * tau) / (sigma * SQRT(tau))
    d2 ← d1 - sigma * SQRT(tau)

    phi_d1 ← normalPDF(d1)
    Phi_d1 ← normalCDF(d1)
    Phi_d2 ← normalCDF(d2)

    // Delta: dC/dS
    delta ← Phi_d1

    // Gamma: d^2C/dS^2
    gamma ← phi_d1 / (S * sigma * SQRT(tau))

    // Theta: dC/dt (per year, divide by 365 for daily)
    theta ← -(S * phi_d1 * sigma) / (2 * SQRT(tau))
             - r * K * EXP(-r * tau) * Phi_d2

    // Vega: dC/d(sigma) (per 1 unit change in sigma)
    vega ← S * phi_d1 * SQRT(tau)

    // Rho: dC/dr
    rho ← K * tau * EXP(-r * tau) * Phi_d2

    RETURN { delta, gamma, theta, vega, rho }

Implied Volatility via Newton-Raphson

FUNCTION impliedVolatility(marketPrice, S, K, tau, r):
    INPUT: marketPrice (observed option price), S, K, tau, r
    OUTPUT: implied volatility sigma

    // Initial guess: Brenner-Subrahmanyam approximation
    sigma ← SQRT(2 * PI / tau) * (marketPrice / S)

    maxIterations ← 20
    tolerance ← 1e-10

    FOR i ← 1 TO maxIterations DO
        price ← blackScholesCall(S, K, tau, r, sigma)
        greeks ← computeGreeks(S, K, tau, r, sigma)
        vegaVal ← greeks.vega

        IF ABS(vegaVal) < 1e-15 THEN
            BREAK    // vega too small, avoid division by zero
        END IF

        diff ← price - marketPrice
        IF ABS(diff) < tolerance THEN
            RETURN sigma
        END IF

        // Newton step: sigma_new = sigma - f(sigma) / f'(sigma)
        sigma ← sigma - diff / vegaVal
    END FOR

    RETURN sigma

Real-World Applications

  • Options market making: market makers use Black-Scholes (and its extensions) to quote bid/ask prices on thousands of options simultaneously. The Greeks tell them how to hedge their inventory in real time, adjusting stock positions as delta changes
  • Risk management (Value-at-Risk): banks compute portfolio-level Greeks to estimate how much they could lose from adverse market moves. Delta and gamma give first- and second-order exposure to the underlying; vega captures volatility risk
  • Employee stock options: companies use Black-Scholes to value stock options granted to employees for accounting purposes (ASC 718 / IFRS 2). The formula determines the expense recognized on the income statement
  • Convertible bond pricing: convertible bonds embed an option to convert debt into equity. Pricing them requires Black-Scholes-style models that account for credit risk, dilution, and call provisions
  • Real options analysis: the framework extends beyond financial markets. A startup's option to pivot, a mining company's option to open or close a mine, or a tech company's option to expand into a new market can all be valued using the same PDE logic
  • Implied volatility as a fear gauge: the VIX index is computed from S&P 500 option implied volatilities. It measures the market's expectation of 30-day volatility and is widely used as a barometer of investor anxiety
  • High-frequency trading: HFT firms price options in nanoseconds using FPGA or GPU implementations of Black-Scholes. The $O(1)$ closed form makes this feasible at extreme speeds

Key Takeaways

  • The Black-Scholes model prices European options by constructing a riskless hedge: a portfolio of the option and $\Delta$ shares of stock that eliminates randomness, forcing the option price to satisfy a PDE
  • The closed-form solution $C = S\Phi(d_1) - Ke^{-r\tau}\Phi(d_2)$ is $O(1)$ to compute, making it one of the most efficient pricing formulas in finance
  • Of the five inputs ($S$, $K$, $\tau$, $r$, $\sigma$), only volatility $\sigma$ is unobservable. Options trading is fundamentally a bet on volatility
  • The Greeks (delta, gamma, theta, vega) are partial derivatives that quantify risk exposure. Delta hedging eliminates first-order price risk; gamma measures how quickly the hedge drifts
  • Implied volatility, found by inverting the formula via Newton-Raphson, reveals the market's consensus forecast of future uncertainty. The volatility smile shows where the model's assumptions break down