2.8 ended with the option price written as a risk-neutral expectation,

C=e−rT⋅EQ[max⁡(ST−K,0)],C = e^{-rT} \cdot \E^Q[\max(S_T - K, 0)],

and with a Monte Carlo pricer that could estimate that expectation together with an error bar. This page shows that the same expectation can be done exactly. Because the terminal stock price under Geometric Brownian motion (GBM) is lognormal, the expectation becomes an ordinary integral, and that integral collapses into the Black–Scholes formula. The main result is that the Monte Carlo estimate, the integral and the closed form are not three different answers but three ways of looking at the same number. For the base case they all give 18.023, with Monte Carlo alone carrying sampling noise.

What this page shows, and how

Does the integral give the same number as the pricer? Start from 2.8's expectation, evaluate it directly as an integral, then compare the result with the Monte Carlo estimate and the closed form. The three approaches should agree.

What are N(d1)N(d_1) and N(d2)N(d_2)? Derive the two thresholds from the algebra instead of introducing them up front, then measure the quantities they represent on simulated paths.

Where does the put come from? Derive the put from the same machinery, then show that put–call parity follows from a payoff identity and no-arbitrage rather than from the lognormal model.

What does the formula do at its edges? Push volatility, expiry and spot price into limiting cases and verify that the formula converges to the values earlier pages would predict.

What changes when the stock pays dividends? Replace the risk-neutral drift with r−qr - q, show where the dividend yield enters the formula, and rewrite the result in terms of a forward price.

Why can one formula price options on forwards and futures? Express the stock through the forward FF, producing Black-76 and showing that it is a re-spelling of the same argument rather than a new model.

The experiment — what was done

The experiment checks the expectation in several independent ways. The integral was evaluated both as an integral over the lognormal density in SS and as an integral over a standard normal variable after substitution. Both were compared with the closed form and with fresh Monte Carlo runs using 10610^6 exact terminal draws. The comparison of integral and closed form was repeated across a 216-point grid spanning spot, strike, volatility, rate, dividend yield and expiry; the Monte Carlo runs were made at the base case and at two dividend yields.

The page then probes the formula's limits. Volatility is driven towards zero, expiry towards zero, spot is sent towards infinity and towards zero, and the convergence rates at each edge are recorded rather than assumed.

The dividend version of the formula and its Black-76 form are checked against quadrature, simulation and forward-price identities. Finally, the derived formula is tested against an oracle in three layers: live QuantLib calculations on the page grid, the same QuantLib engine used to generate the project's reference values, and all 7,234 rows of the committed golden file.

This is the first study page on which QuantLib appears. The rule is unchanged: QuantLib is the oracle, never a dependency. The page derives the formula independently and then checks that the oracle computes the same result.

Closed form against QuantLib

The closed form of this page against QuantLib, from the committed experiments/2_9_black_scholes_formula.json: results.oracle.live.{version,grid,engine_base_case} and results.oracle.golden.{oracle,cases,edge_cases,tolerance_rule}. The first two rows are absolute errors; the golden rows use the file's own rule, absolute below 1 and relative above it. The delta compared is e−qTN(d1)e^{-qT}N(d_1) for a call, and for a put that less e−qTe^{-qT}.

comparison with the oraclepointsworst price errorworst delta errortolerance
QuantLib 1.43 BlackCalculator at the page's grid, call and put2163.6×10−143.6 \times 10^{-14}1.0×10−151.0 \times 10^{-15}10−1010^{-10}
QuantLib AnalyticEuropeanEngine on a BlackScholesMertonProcess on dates, the golden generator's engine, base case11.4×10−141.4 \times 10^{-14}3×10−163 \times 10^{-16}10−1010^{-10}
golden/bs_vanilla.json grid cases, generated by QuantLib 1.437,2001.2×10−131.2 \times 10^{-13}4.3×10−154.3 \times 10^{-15}the file's: 10−1010^{-10}, relative above 1
its edge cases (one-day, near-zero and very high vol, deep in and out of the money, negative rate, ten-year, tiny and large spot)341.7×10−141.7 \times 10^{-14}1.0×10−141.0 \times 10^{-14}the file's: 10−810^{-8}
·

The integral and its two pieces

The derivation starts exactly where 2.8 stopped:

C=e−rT⋅EQ[max⁡(ST−K,0)].C = e^{-rT} \cdot \E^Q[\max(S_T - K, 0)].

Under the risk-neutral measure, GBM gives

ST=S0⋅e(r−12σ2)T+σT⋅Z,S_T = S_0 \cdot e^{(r - \frac12\sigma^2)T + \sigma\sqrt{T} \cdot Z},

with ZZ a standard normal draw — 2.6's exact draw with rr in the drift slot (2.8) — so the expectation can be expressed as an integral over a single standard normal variable. The pricing problem has become a calculus problem.

The next step is to split the payoff at the strike:

max⁡(ST−K,0)=(ST−K)⋅1{ST>K},\max(S_T - K, 0) = (S_T - K) \cdot \mathbf{1}\{S_T > K\},

which turns the call into two expectations,

C=e−rT⋅EQ[ST⋅1{ST>K}]−K⋅e−rT⋅EQ[1{ST>K}].C = e^{-rT} \cdot \E^Q[S_T \cdot \mathbf{1}\{S_T > K\}] - K \cdot e^{-rT} \cdot \E^Q[\mathbf{1}\{S_T > K\}].

These are the two quantities measured in the next section. The second counts the probability of exercising. The first counts the stock value delivered by the exercising paths. Together they reconstruct the option price. The table below shows that whichever route we take, Monte Carlo, quadrature in SS, quadrature in zz, or the closed form, the answer is 18.023, and the Monte Carlo estimate, 18.011 ± 0.031, agrees within its error bar.

Base-case price, four routes

S0=K=100S_0 = K = 100, r=0.05r = 0.05, σ=0.4\sigma = 0.4, T=1T = 1, q=0q = 0. Seed 20261105, from the committed experiments/2_9_black_scholes_formula.json: results.base.{call,put,d1,d2}, results.integral.base.{call_S_space,call_z_space,put_S_space}, results.integral.grid.{n_points,max_abs_error_call_S_space,max_abs_error_call_z_space,max_abs_error_put,max_abs_error_stock_piece,max_abs_error_strike_piece} and results.mc.q_0.{call,put}.{mean,se_of_mean,error_in_se}. Quadrature is composite Gauss–Legendre, 64 panels of 32 nodes. The formulas in the last column say how each row was computed; they are not measurements.

viewcallputhow
closed form18.022951450213.1458939003S0N(d1)−Ke−rTN(d2)S_0 N(d_1) - K e^{-rT} N(d_2); d1=0.325d_1 = 0.325, d2=−0.075d_2 = -0.075
the integral in SS18.022951450213.1458939003e−rT⋅∫K∞(S−K)⋅f(S) dSe^{-rT} \cdot \int_K^\infty (S - K) \cdot f(S) \,\dd S against the lognormal density; differs from the closed form by 3×10−143 \times 10^{-14}
the integral in zz18.0229514502—e−rT⋅∫−d2∞(S(z)−K)⋅φ(z) dze^{-rT} \cdot \int_{-d_2}^\infty (S(z) - K) \cdot \varphi(z) \,\dd z; 1×10−141 \times 10^{-14}
Monte Carlo, 10610^6 exact draws18.011 ± 0.03113.122 ± 0.017−0.4 s.e. and −1.4 s.e.
across 216 points of (S0,K,r,q,σ,T)(S_0, K, r, q, \sigma, T)≤8×10−14\le 8 \times 10^{-14}≤8×10−14\le 8 \times 10^{-14}the worst ∣quadrature−closed form∣\lvert \text{quadrature} - \text{closed form} \rvert on the grid; both pieces ≤3×10−13\le 3 \times 10^{-13}

What N(d1)N(d_1) and N(d2)N(d_2) mean

The symbols are produced by the algebra rather than assumed at the start.

The first threshold appears when we ask which paths exercise. Writing the exercise condition in terms of the normal variable ZZ produces

Z>−d2,Z > -d_2,

with

d2=(ln⁡(S0/K)+(r−12σ2)T)/(σT).d_2 = (\ln(S_0/K) + (r - \tfrac12\sigma^2)T) / (\sigma\sqrt{T}).

Since the probability that the condition holds is just the area above the threshold,

Q(ST>K)=N(d2).Q(S_T > K) = N(d_2).

So N(d2)N(d_2) is the risk-neutral probability of exercise. In the base case it is 0.470, measured as 0.4707 ± 0.0005 in simulation.

The second threshold appears when evaluating the stock piece. Completing the square shifts the normal distribution by σT\sigma\sqrt{T}, producing

d1=d2+σT.d_1 = d_2 + \sigma\sqrt{T}.

That shift converts the stock piece into

S0N(d1).S_0 N(d_1).

What does N(d1)N(d_1) mean? It is not the risk-neutral probability of exercise. Instead,

N(d1)=EQ[ST⋅1{ST>K}]/EQ[ST].N(d_1) = \E^Q[S_T \cdot \mathbf{1}\{S_T > K\}] / \E^Q[S_T].

It measures how much of the stock's forward value comes from exercising paths. Equivalently, it is the exercise probability under the stock-weighted measure produced by the same exponential reweighting discussed in 2.8.

That weighting favours high-STS_T paths, so

N(d1)>N(d2).N(d_1) > N(d_2).

Here the values are 0.627 and 0.470 respectively.

N(d₁) and N(d₂), measured

The same 10610^6 draws at q=0q = 0, from results.mc.q_0.{exercise_probability,strike_piece,stock_piece,share_measure_probability,E_S_T,conditional_mean_given_itm,call}, beside the closed forms in results.base and the bump delta results.delta.{bump_delta,N_d1,h}. The share row is a ratio of two means, with its delta-method standard error. The last column names each row's place in the formula, and the conditional mean has none.

quantitymeasured on 10610^6 drawsclosed formin the formula
Q(ST>K)Q(S_T > K) — the probability of exercise0.4707 ± 0.00050.4701N(d2)N(d_2)
K⋅e−rT⋅Q(ST>K)K \cdot e^{-rT} \cdot Q(S_T > K) — the strike piece44.77 ± 0.0544.718Ke−rTN(d2)K e^{-rT} N(d_2)
e−rT⋅EQ[ST⋅1{ST>K}]e^{-rT} \cdot \E^Q[S_T \cdot \mathbf{1}\{S_T > K\}] — the stock piece62.79 ± 0.0762.741S0N(d1)S_0 N(d_1)
EQ[ST⋅1{ST>K}]/EQ[ST]\E^Q[S_T \cdot \mathbf{1}\{S_T > K\}] / \E^Q[S_T] — the share of the stock's value from the exercising paths0.6278 ± 0.00050.6274N(d1)N(d_1)
∂C/∂S0\partial C/\partial S_0 by a central bump of the closed form, h=0.01h = 0.01 — the delta0.627410.62741N(d1)N(d_1)
EQ[ST]\E^Q[S_T] — the forward price105.14 ± 0.04105.127S0erTS_0 e^{rT}
EQ[ST∣ST>K]\E^Q[S_T \mid S_T > K] — the average stock price on the exercising paths140.23 ± 0.06140.304S0erTN(d1)/N(d2)S_0 e^{rT} N(d_1)/N(d_2) — not in the price
the stock piece minus the strike piece18.011 ± 0.03118.023CC

The same quantity is also the delta:

Δ=∂C/∂S0=N(d1),\Delta = \partial C/\partial S_0 = N(d_1),

which links this page directly back to the hedge studied in 2.7.

A useful trap is the conditional mean

EQ[ST∣ST>K].\E^Q[S_T \mid S_T > K].

This equals roughly 140.3 in the base case, but it never appears in the pricing formula. The picture is two densities over the same strike: N(d2)N(d_2) is the area above KK under the QQ-density of STS_T, while N(d1)N(d_1) is the area above the same KK under the stock-weighted density.

The put, and parity

The same derivation can be run on the other side of the strike, producing

P=Ke−rTN(−d2)−S0N(−d1).P = K e^{-rT} N(-d_2) - S_0 N(-d_1).

For the base case the put is worth 13.146.

More important than the formula itself is the parity relationship. Path by path,

max⁡(ST−K,0)−max⁡(K−ST,0)=ST−K.\max(S_T - K, 0) - \max(K - S_T, 0) = S_T - K.

This identity is true regardless of any distributional assumptions. Taking discounted risk-neutral expectations gives

C−P=S0−Ke−rT.C - P = S_0 - K e^{-rT}.

The value is 4.877 in the base case.

Put–call parity, three yields

From results.base.{call_minus_put,forward_no_arbitrage}, results.parity.grid_max_abs_error and, on the same draws as the call and the put, results.mc.q_*.parity.{per_path_identity_max_abs,mc_difference.{mean,se_of_mean,error_in_se}}, with results.mc.q_*.forward_no_arbitrage and results.mc.q_0.E_S_T.sd. The q=0.03q = 0.03 and q=0.08q = 0.08 rows are separate runs of 10610^6 draws each, with the drift r−qr - q.

parity on the base casevaluenote
closed form: C−PC - P4.877118.0230 − 13.1459; across the 216-point grid ∣C−P−(S0e−qT−Ke−rT)∣≤3×10−14\lvert C - P - (S_0 e^{-qT} - K e^{-rT}) \rvert \le 3 \times 10^{-14}
no-arbitrage: S0−Ke−rTS_0 - K e^{-rT}4.87712.8's forward, no model
per path: max ∣(call payoff−put payoff)−(ST−K)∣\lvert (\text{call payoff} - \text{put payoff}) - (S_T - K) \rvert on 10610^6 draws0an identity, exact in floating point too
Monte Carlo: the call's estimate minus the put's on the same draws4.889 ± 0.042+0.3 s.e.; the s.e. is the forward's (the sd⁡\sd of e−rTSTe^{-rT}S_T is 41.6), larger than the call's 0.031
with q=0.03q = 0.03: C−PC - P, and S0e−qT−Ke−rTS_0 e^{-qT} - K e^{-rT}1.9216; Monte Carlo 1.958 ± 0.040+0.9 s.e.
with q=0.08q = 0.08−2.8113; Monte Carlo −2.832 ± 0.038−0.5 s.e.; the forward below the strike, the put dearer than the call

The key point is that parity does not require the lognormal model. It follows from no-arbitrage and the payoff identity alone. The D6 pricer makes this visible: the vertical separation between the call and put curves is always the forward line.

D6Black–Scholes pricer and Greeks
price
18.0230
payoff now
0.0000
price − payoff
18.0230
moneyness S/K
1.000
Greekraw ∂as quoted
delta ∂V/∂S0.6274090.6274 per 1.00 of spot
gamma ∂²V/∂S²0.0094600.0095 delta per 1% of spot
vega ∂V/∂σ37.8419830.3784 per vol point
theta ∂V/∂t−9.804296−0.0269 per day
rho ∂V/∂r44.7179950.004472 per basis point
∂V/∂q−62.740946−0.006274 per basis point
Type

The curve meets the payoff only at expiry. Shorten the expiry and watch it fold onto the kink; that folding, per day, is theta. The curve's slope at the marked spot is delta (0.627) and its curvature is gamma; the two are why a hedged book is never quite hedged between rebalances, which is what D5 measures. The price sits 18.02 above the payoff — what the remaining optionality is worth. Every number on this page comes from the same code the library's C++ mirrors, held to the QuantLib golden file to 1e−10.

The edges

A pricing formula earns trust at its limits before it earns trust in the middle.

As volatility tends to zero, uncertainty disappears and the terminal stock price collapses onto the forward. The option therefore converges to

max⁡(S0−Ke−rT,0).\max(S_0 - K e^{-rT}, 0).

As expiry tends to zero there is no time left for movement, so the option converges to its intrinsic value,

max⁡(S0−K,0).\max(S_0 - K, 0).

As spot tends to infinity, both N(d1)N(d_1) and N(d2)N(d_2) approach one. The call converges to the forward value,

S0−Ke−rT.S_0 - K e^{-rT}.

As spot tends to zero, both probabilities vanish and the option price vanishes with them.

The call as σ → 0

The closed form at K=100K = 100, r=0.05r = 0.05, T=1T = 1, from results.limits.sigma_to_0.rows.{S0_90,S0_95.123,S0_100,S0_110}.rows[*].{x,call,gap,gap_over_sigma} and results.limits.sigma_to_0.{kink_slope_measured,kink_slope_expected}. Each column heading names its limit, max⁡(S0−Ke−rT,0)\max(S_0 - K e^{-rT}, 0); 95.123 is Ke−rTK e^{-rT}, the spot at which the forward equals the strike. The bracketed figures are the gap to the limit, or the formula for the slope.

σ→0\sigma \to 0S0=90→0S_0 = 90 \to 0S0=95.123S_0 = 95.123 (F=KF = K) →0\to 0at F=KF = K: C/σC/\sigmaS0=100→4.877S_0 = 100 \to 4.877S0=110→14.877S_0 = 110 \to 14.877
σ=0.4\sigma = 0.412.249715.078837.7018.023024.7413
0.11.68063.793337.936.805015.2101
0.012.4×10−92.4 \times 10^{-9}0.3794837.9484.87706 (+5×10−8+5 \times 10^{-8})14.8771
10−310^{-3}00.03794937.9494.8770614.8771
10−610^{-6}03.79×10−53.79 \times 10^{-5}37.949 (Ke−rTT/2π=37.949K e^{-rT}\sqrt{T}/\sqrt{2\pi} = 37.949)4.8770614.8771
The call as T → 0

The closed form at K=100K = 100, r=0.05r = 0.05, σ=0.4\sigma = 0.4, from results.limits.T_to_0.rows.{S0_90,S0_100,S0_110}.rows[*].{x,call,gap,gap_over_sqrtT,N_d1,N_d2} and results.limits.T_to_0.{kink_slope_measured,kink_slope_expected}. Each column heading names its limit, max⁡(S0−K,0)\max(S_0 - K, 0). The bracketed figure is the formula for the slope. S0→∞S_0 \to \infty and S0→0S_0 \to 0 are in results.limits.{S0_to_inf,S0_to_0}.

T→0T \to 0S0=90→0S_0 = 90 \to 0S0=100→0S_0 = 100 \to 0at S0=KS_0 = K: C/TC/\sqrt{T}N(d1)⋅N(d2)N(d_1) \cdot N(d_2) at S0=KS_0 = KS0=110→10S_0 = 110 \to 10
T=1T = 112.249718.023018.020.627 · 0.47024.7413
0.11.45395.283616.710.541 · 0.49112.1073
0.010.00521.620416.200.513 · 0.49710.0616
10−410^{-4}00.1598315.980.5013 · 0.499710.0005
10−610^{-6}00.01596015.960 (S0σ/2π=15.958S_0\sigma/\sqrt{2\pi} = 15.958)0.5001 · 0.500010.000005

The tables do more than confirm the limits. They measure the rates of convergence. At the kinks, convergence slows to linear in σ\sigma and proportional to T\sqrt{T}, giving precise benchmark slopes that a correct implementation must reproduce. The D6 pricer shows the call curve collapsing onto its payoff as expiry approaches zero.

A dividend yield, and Black-76

With a continuous dividend yield qq, the holder of the stock receives cash flows that the option holder does not. Under the risk-neutral measure the stock price therefore drifts at

r−q.r - q.

Repeating the derivation changes the stock term to

S0e−qTN(d1),S_0 e^{-qT} N(d_1),

and replaces rr by r−qr - q inside d1d_1 and d2d_2.

The result is a cheaper call and a dearer put. At q=0.03q = 0.03 the call falls from 18.023 to 16.211.

The next step is to write everything through the forward price

F=S0e(r−q)T.F = S_0 e^{(r - q)T}.

The formula becomes

C=e−rT⋅[F⋅N(d1)−K⋅N(d2)],C = e^{-rT} \cdot [F \cdot N(d_1) - K \cdot N(d_2)],

with d1=(ln⁡(F/K)+12σ2T)/(σT)d_1 = (\ln(F/K) + \tfrac12\sigma^2 T)/(\sigma\sqrt{T}) and d2=d1−σTd_2 = d_1 - \sigma\sqrt{T}.

This is Black-76. The important observation is that rr disappears from d1d_1 entirely and survives only in the discount factor. The dividend yield disappears into the forward. What looked like a new formula is really the same derivation written in terms of a traded forward price.

Dividend yield, three spellings

S0=K=100S_0 = K = 100, r=0.05r = 0.05, σ=0.4\sigma = 0.4, T=1T = 1 at three yields, from results.dividends.q_rows.q_*.{q,F,S0_e_qT,closed_form_call,black76_call,closed_form_d1,black76_d1,closed_form_put,forward_no_arbitrage} and, from 10610^6 draws at each yield, results.mc.q_*.call.{mean,se_of_mean}. The monotonicity across the grid is results.dividends.{call_decreasing_in_q_everywhere,put_increasing_in_q_everywhere}.

qqdrift r−qr - qS0e−qTS_0 e^{-qT}F=S0e(r−q)TF = S_0 e^{(r - q)T}closed form with S0e−qTS_0 e^{-qT}Black-76 with FFd1d_1 (both)Monte Carlo, drift r−qr - qputforward S0e−qT−Ke−rTS_0 e^{-qT} - K e^{-rT}
0+0.05100.000105.12718.02295118.0229510.32518.011 ± 0.03113.1464.877
0.03+0.0297.045102.02016.21072716.2107270.25016.229 ± 0.02914.2891.922
0.08−0.0392.31297.04513.49156113.4915610.12513.494 ± 0.02716.303−2.811

The oracle checks then confirm that every spelling produces the same value: Black–Scholes with dividends, Black-76, quadrature and QuantLib to machine precision, and the simulation within its standard error.

Into 2.10

This page produced the pricing formula. The next page asks how that price changes when the inputs move.

Delta has already appeared as N(d1)N(d_1), first as a hedge ratio in 2.7 and now as a derivative of the formula itself. 2.10 differentiates the remaining pieces and introduces the rest of the Greeks: the delta's own sensitivity to spot, and the price's to volatility, time and the rate. The D6 pricer displays these quantities; the next step is to understand what each one measures, why traders watch it, and how it emerges directly from the formula derived here.

Check

The Black–Scholes call price C = S₀N(d₁) − Ke^(−rT)N(d₂) is:

In the formula, N(d₂) = 0.470 here. It is:

N(d₁) = 0.627 here, above N(d₂) = 0.470. N(d₁) is:

Put–call parity, C − P = S₀ − Ke^(−rT) = 4.88 here, holds:

With S₀ = 100, K = 100, r = 0.05, T = 1, as σ → 0 the call price tends to:

A stock pays a continuous dividend yield q = 3 %. Compared with q = 0, the call price (18.02):