Quant Memo
Advanced

The Fubini-Tonelli Theorem

The rule that lets you compute a double sum or double integral in either order and get the same answer — and the specific condition that has to hold before you're allowed to swap the order of summation in a risk or pricing calculation.

Prerequisites: Monotone and Dominated Convergence Theorems

You are summing a two-dimensional table of numbers — say, expected loss by (scenario, asset) pair — and you want to know: does it matter whether you sum each row first and then add the row totals, or sum each column first and then add the column totals? Usually not. But "usually" is not "always," and the Fubini-Tonelli theorem is the precise statement of exactly when swapping the order is guaranteed to give the same answer, plus a warning about the cases where it silently doesn't.

The analogy: totalling a spreadsheet two ways

Take a spreadsheet grid of numbers, rows and columns. You can total it by summing along each row, then adding the row-sums; or by summing down each column, then adding the column-sums. For a finite grid of ordinary numbers these two totals are obviously the same — addition doesn't care about order. Fubini-Tonelli extends that obvious fact to infinite grids (infinitely many rows, infinitely many columns, or continuous "rows" and "columns" as in a double integral), where the "obviously" stops being obvious: an infinite grid can have row-sums and column-sums that total to different numbers if the entries are allowed to be both positive and negative.

Writing it down

Consider a function of two variables f(x,y)f(x,y), and the double integral over both variables. Tonelli's part handles non-negative functions: if f(x,y)0f(x,y) \geq 0 everywhere, then

 ⁣ ⁣f(x,y)dxdy=(f(x,y)dy)dx=(f(x,y)dx)dy.\int\!\!\int f(x,y)\, dx\, dy = \int\left(\int f(x,y)\, dy\right) dx = \int\left(\int f(x,y)\, dx\right) dy .

In words: for a non-negative grid, integrate however you like, in whichever order, and you always land on the same total — no extra condition needed.

Fubini's part extends this to functions that can be negative, but only under one guardrail: it applies whenever

 ⁣ ⁣f(x,y)dxdy<.\int\!\!\int |f(x,y)|\, dx\, dy < \infty .

In words: first check that the absolute values sum to something finite (Tonelli already guarantees this check itself doesn't depend on order, since f|f| is non-negative). If that finite check passes, the original signed double integral is also order-independent. If it fails — the absolute values sum to infinity — order can genuinely change the answer, or the integral may not even be well defined.

→ row sums ↓ column sums sum rows, then add sum columns, then add same total — if Σ|entries| < ∞
A finite grid: summing rows-then-total or columns-then-total always agree. Fubini-Tonelli says this stays true for infinite grids exactly when the absolute values sum to something finite.

Worked example 1: joint expectation of independent losses

Two independent loss variables XX and YY, each taking values 1, 2, 3 with equal probability 1/31/3. You want E[XY]E[XY]. Row-first (condition on XX, sum over YY, then over XX): for each fixed xx, E[XYX=x]=xE[Y]=x×2E[XY \mid X=x] = x \cdot E[Y] = x \times 2 (since E[Y]=(1+2+3)/3=2E[Y] = (1+2+3)/3 = 2). Averaging over x=1,2,3x = 1,2,3: E[X2]=2×E[X]=2×2=4E[X \cdot 2] = 2 \times E[X] = 2 \times 2 = 4. Column-first (condition on YY instead): by the identical argument with roles swapped, E[XY]=2×E[X’s mean]=4E[XY] = 2 \times E[X\text{'s mean}] = 4 again. Both orders give E[XY]=4E[XY]=4, and Fubini-Tonelli guarantees this in advance because all nine (x,y)(x,y) pairs are non-negative — Tonelli's part applies with no further check required.

Worked example 2: when the swap actually fails

Consider the doubly-indexed array aij=1a_{ij} = 1 if i=ji = j, aij=1a_{ij} = -1 if i=j+1i = j+1, and aij=0a_{ij}=0 otherwise, for i,j=1,2,3,i, j = 1, 2, 3, \dots. Sum row ii first, then add row totals: each row sums to 00 (its +1+1 cancels the 1-1 from the row below it, except the pattern is arranged so each individual row nets to zero), giving a grand total of 00. Sum column jj first instead: column 1 alone sums to 11 (only the diagonal entry contributes, since there's no row above it to contribute a 1-1), and every subsequent column also nets to 00, giving a grand total of 11. Two different orders, two different answers: 010 \neq 1. Check Fubini's condition: i,jaij=\sum_{i,j} |a_{ij}| = \infty, since there are infinitely many nonzero entries each of size 1. The finiteness check fails, exactly as the theorem warns, and that failure is why order mattered here.

What this means in practice

Fubini-Tonelli is the theorem quietly invoked whenever a quant reorders a nested sum or integral — computing expected P&L by summing over scenarios then assets versus assets then scenarios, or swapping the order of integration in a pricing formula involving two sources of randomness. It is also exactly the justification needed to differentiate under an integral sign, a routine step in deriving Greeks.

Non-negative grids can always be summed in either order (Tonelli). Signed grids can only be safely reordered once you've checked that summing the absolute values gives a finite number (Fubini) — that check is the whole content of the theorem, not a formality.

The classic mistake is swapping the order of an infinite sum or integral involving both positive and negative terms without checking absolute convergence first — assuming that because each individual order "seems to converge," the two orders must agree. As the diagonal-array example shows, they need not: infinite rearrangements of signed series can genuinely change the total, and Fubini's absolute-value check is exactly what rules this out before you trust a swapped calculation.

Related concepts

Practice in interviews

Further reading

  • Billingsley, Probability and Measure (ch. 3, 18)
  • Folland, Real Analysis (ch. 2)
ShareTwitterLinkedIn