Fubini's Theorem
When a double integral can be computed in either order, so joint expectations factor into steps you can actually compute.
Why Does This Exist?
Joint distributions, data augmentation averages and variational bounds all nest two integrals: over inputs and over noise, over and . Computing the double integral directly is painful; computing one inner integral then the outer one is routine.
Fubini says the orders agree when the function is integrable over the product. Tonelli extends this to non-negative functions without integrability checks. Without them, swapping integration order is wishful.
This page states the license and its sharp edge. Product structure is in product measures and expectation use in integrals in probability.
The one idea you need first
An iterated integral integrates out one variable at a time: . The double integral integrates against the product measure directly. Fubini equates them.
Think of It Like This
Counting apples in an orchard grid
Rows are , columns are , each cell holds apples . Count row by row then add row totals, or column by column then add column totals. Both give the orchard total.
The equality needs every apple counted once with no infinite smuggling: integrability. Where the analogy stops: apples are finite and non-negative, while general can cancel across signs to fake agreement when .
How It Actually Works
Tonelli: for non-negative measurable on -finite product, in . Fubini: if , the same equality holds in , and almost every section and is integrable.
Counterexample without integrability: on with a checkerboard of and spikes of shrinking width, iterated integrals give one way and the other. Absolute integral diverges, so Fubini stays silent.
Worked example
On with counting measure and : row sums and , total . Column sums and , total . Iterated integrals: both orders. With continuous on : either order.
Watch Out For
Swapping order for non-integrable functions
Symptom: two Monte Carlo estimators integrating in different orders disagree persistently, around versus . Fix: check or non-negativity first; otherwise the swap is unlicensed.
Assuming sections are integrable everywhere
Symptom: evaluating an inner integral at a null-section point where it diverges, then propagating NaN. Fix: Fubini promises integrable sections only almost everywhere; guard the null set explicitly.
The Quick Version
- Tonelli handles non-negative functions with no integrability check.
- Fubini needs , then both iterated orders equal the double integral.
- Without absolute integrability, orders can disagree as signed spikes show.
- Sections are integrable almost everywhere, not everywhere.
- Factor joint expectations into iterated ones only after checking the hypothesis.