Hexa Scholar

Where the Black–Scholes formula comes from

If you sell an option, can you trade the stock to cancel its risk?

In the standard model of stock prices, yes, up to a leftover risk. That leftover shrinks toward zero as you trade more often. The money needed to start the hedge is the option's price.

Before you start · 3 quick checks on the normal distribution and Itô's lemma, about 2 min
1 See

You are the hedger

You have sold one call on a $100 stock and collected the premium. The call expires in 3 months. The price is revealed at 8 dates, and at each one you choose how many shares to hold until the next.

How the simulation works
  • The desk sells one European call on one share of a hypothetical stock with \(S_0 = 100\), strike \(K = 100\), maturity \(T = 0.25\) years, risk-free rate \(r = 5\%\) and volatility \(\sigma = 20\%\). It charges the Black–Scholes price.
  • The stock follows geometric Brownian motion with real-world drift \(\mu = 10\%\).
  • Unhedged. The desk receives the premium at \(t = 0\), keeps it in a cash account that earns \(r\), and pays the payoff \((S_T - K)^+\) at \(T\). Its terminal P&L is \(C_0e^{rT} - (S_T - K)^+\).
  • If the call expires worthless, the desk keeps the premium plus interest, \(4.6150\,e^{0.0125} = \$4.6730\) in this example. The loss grows with \(S_T\) above the strike.
  • Hedged. The desk sets its holding to \(\Delta_k = N(d_1)\), evaluated at the current price and remaining maturity, at \(t_k = kT/N\) for \(k = 0,\dots,N-1\), and liquidates at \(T\).
  • The first purchase and every later trade are paid from or into the cash account, which earns or pays \(r\). At \(T\) the desk pays the payoff and sells the shares. The P&L is the cash left at \(T\).
  • \(N\) counts rebalancing intervals over the whole 3-month life. With 63 trading days in 3 months, \(N = 63\) is about one rebalance per day.
  • In the game, \(N = 8\). In the autopilot, each value of \(N\) uses its own 2,000 paths, generated from the seed below. Each game round uses a new path from the same seed.
This seed drives every simulation on the page.
Key point Holding the right number of shares, and resetting it often, shrinks the risk of a sold call. Four times as many resets gives about half the spread.
2 Try

The price does not depend on the expected return

Explorer: reach the goals

Drag the inputs until the goal turns green. The first tile below is the formula price. The second estimates the same number by simulation.

More inputs
What if you price with the expected return μ?

This box averages the payoff with real-world probabilities, using drift \(\mu\), and discounts at \(r\). Compare it with the price.

Key point The price uses the stock price, strike, time, interest rate and volatility. The expected return \(\mu\) does not enter it.
3 Prove

The PDE and the formula

The idea in three steps

  1. Hold some shares plus cash so that the portfolio's value always matches the option's value.
  2. Matching the random parts fixes the share count at \(V_S\). Matching the rest gives an equation in which \(\mu\) cancels.
  3. That equation is the Black–Scholes PDE. Solving it with the payoff at maturity gives the formula.
Itô's lemma refresher

If \(dS = a\,dt + b\,dW\) and \(f(t,S)\) is \(C^{1,2}\), then

\[ df = \Big(f_t + a f_S + \tfrac12 b^2 f_{SS}\Big)\,dt + b f_S\,dW. \]

Intuition: in a Taylor expansion of \(f\), \((dW)^2\) behaves like \(dt\), so the term \(\tfrac12 f_{SS}(dS)^2\) contributes \(\tfrac12 b^2 f_{SS}\,dt\) and does not vanish.

Full derivation: the PDE (7 lines, build it or read it)
Derivation via a replicating portfolio

Assumptions.

  • The stock follows \(dS_t = \mu S_t\,dt + \sigma S_t\,dW_t\), with \(S_0 > 0\).
  • The rate \(r\) and the volatility \(\sigma > 0\) are constant; the strike \(K > 0\) and maturity \(T > 0\) are fixed.
  • No dividends, no transaction costs, continuous trading, no arbitrage. Borrowing and lending at \(r\) are unlimited, and short selling is allowed.
  • The option value is \(V(t,S)\), with \(V \in C^{1,2}\) on \([0,T)\times(0,\infty)\) and \(V\) continuous on \([0,T]\times(0,\infty)\). At \(t = T\) the payoff \((S-K)^+\) is not differentiable at \(S = K\), so smoothness is assumed only before maturity.

Conclusion. \(V\) satisfies

\[ V_t + \tfrac12\sigma^2 S^2 V_{SS} + r S V_S - r V = 0 \quad\text{on } [0,T)\times(0,\infty), \qquad V(T,S) = (S-K)^+. \]

This derivation finds the PDE that a smooth replicating price must satisfy. A complete proof also checks that the resulting strategy is admissible, self-financing, and replicates the payoff at \(T\); see Shreve, Stochastic Calculus for Finance II, ch. 4.

In the simulation of stage 1 the desk is short the call and holds the replicating portfolio, so its P&L is \(X_T - V(T,S_T)\), which is 0 under continuous rebalancing.

Full derivation: the formula (6 lines)
Stated without proof: Feynman–Kac representation

Under the assumptions of the PDE derivation, for the call-price solution of the PDE with at most linear growth in \(S\), the Feynman–Kac representation gives the time-0 price

\[ V(0,S_0) = e^{-rT}\,\mathbb E^{\mathbb Q}\big[(S_T-K)^+\big], \qquad S_T = S_0 \exp\!\Big(\big(r - \tfrac12\sigma^2\big)T + \sigma\sqrt T\,Z\Big), \]

where \(Z \sim N(0,1)\) under the risk-neutral measure \(\mathbb Q\). Write \(\varphi\) and \(N\) for the standard normal density and CDF, and define

\[ d_2 = \frac{\ln(S_0/K) + (r - \tfrac12\sigma^2)T}{\sigma\sqrt T}, \qquad d_1 = d_2 + \sigma\sqrt T. \]
Theorem (Black–Scholes call price)

\(V(0,S_0) = S_0 N(d_1) - K e^{-rT} N(d_2)\).

Scratch work, not part of the proof. For line 4: \[ \sigma\sqrt T z - \tfrac12\sigma^2 T - \tfrac12 z^2 = -\tfrac12\big(z^2 - 2\sigma\sqrt T z + \sigma^2 T\big) = -\tfrac12\big(z - \sigma\sqrt T\big)^2, \] so \(e^{\sigma\sqrt T z - \sigma^2T/2}\,\frac{1}{\sqrt{2\pi}}e^{-z^2/2} = \frac{1}{\sqrt{2\pi}}e^{-(z-\sigma\sqrt T)^2/2}\). The figure uses the explorer's current \(S, K, T, r, \sigma\).
Key point Matching the option with shares and cash forces the Black–Scholes PDE, in which \(\mu\) cancels. Its solution for a call is \(S_0 N(d_1) - K e^{-rT} N(d_2)\).
4 Apply

Problems

All prices are hypothetical.

More problems
Key point The call price comes from five inputs: \(S_0, K, T, r, \sigma\). The delta \(N(d_1)\) is the number of shares that hedges one call.
Level Advanced undergraduate / MFE Prerequisites normal distribution, expectation, partial derivatives, Itô's lemma Time ~45 min

Further reading