Skip to content
AI360Xpert
Beta

Fubini's Theorem

When a double integral can be computed in either order, so joint expectations factor into steps you can actually compute.

Fubini lets a double integral be read row by row or column by column with the same total volume
Fubini lets a double integral be read row by row or column by column with the same total volume

Why Does This Exist?

Joint distributions, data augmentation averages and variational bounds all nest two integrals: over inputs and over noise, over xx and yy. 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: ∫X(∫Yf(x,y) dν) dμ\int_X (\int_Y f(x,y) \, d\nu) \, d\mu. 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 XX, columns are YY, each cell holds apples f(x,y)f(x,y). 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 ff can cancel across signs to fake agreement when ∫∣f∣=∞\int |f| = \infty.

How It Actually Works

Tonelli: for non-negative measurable ff on σ\sigma-finite product, ∫X×Yf=∫X∫Yf=∫Y∫Xf\int_{X \times Y} f = \int_X \int_Y f = \int_Y \int_X f in [0,∞][0,\infty]. Fubini: if ∫X×Y∣f∣<∞\int_{X \times Y} |f| < \infty, the same equality holds in R\mathbb{R}, and almost every section f(x,⋅)f(x,\cdot) and f(⋅,y)f(\cdot,y) is integrable.

Counterexample without integrability: on [0,1]2[0,1]^2 with a checkerboard of +n+n and −n-n spikes of shrinking width, iterated integrals give +1+1 one way and −1-1 the other. Absolute integral diverges, so Fubini stays silent.

Worked example

On {1,2}×{1,2}\{1,2\} \times \{1,2\} with counting measure and f=[[1,2],[3,4]]f = [[1,2],[3,4]]: row sums 33 and 77, total 1010. Column sums 44 and 66, total 1010. Iterated integrals: ∑x∑yf=10\sum_x \sum_y f = 10 both orders. With continuous f(x,y)=xyf(x,y) = x y on [0,1]2[0,1]^2: ∫01∫01xy dxdy=(∫01xdx)(∫01ydy)=0.5×0.5=0.25\int_0^1 \int_0^1 x y \, dx dy = (\int_0^1 x dx)(\int_0^1 y dy) = 0.5 \times 0.5 = 0.25 either order.

Watch Out For

Swapping order for non-integrable functions

Symptom: two Monte Carlo estimators integrating in different orders disagree persistently, around +1+1 versus −1-1. Fix: check ∫∣f∣<∞\int |f| < \infty 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 ∫∣f∣<∞\int |f| < \infty, 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.