Tutorials › Measure Theory › The Layer-Cake Integral Identity

The Fubini-Tonelli Theorems · Tutorial 408 of 798

The Layer-Cake Integral Identity

Use Tonelli’s theorem on a measurable subgraph to express a nonnegative function’s integral as the integral of the measures of its superlevel sets.

Advanced 11 min read

What You'll Learn

  • Construct and verify measurability of the region below a nonnegative measurable function
  • Prove the layer-cake identity using Tonelli’s theorem
  • Identify the superlevel-set measure function and its measurability
  • Compute layer-cake integrals for continuous and discrete examples
  • Derive the layer-cake formula for positive power moments
  • Recognize common threshold and endpoint errors

From a Function to Its Superlevel Sets

A nonnegative function can be understood through the sizes of its superlevel sets: for each height \(t\), record how much of the domain lies above that height. The layer-cake identity says that integrating these sizes over all heights recovers the integral of the function. Geometrically, the set below the graph has vertical sections whose lengths are the function values and horizontal sections given by superlevel sets.

Let \((X,\mathcal{M},\mu)\) be a sigma-finite measure space, and let \(f:X\to[0,\infty]\) be measurable. Sigma-finite means that \(X\) is a countable union of measurable sets of finite measure. No finiteness assumption is made on \(\mu(X)\) or on \(\int f\,d\mu\), and the value \(+\infty\) is allowed. We use Lebesgue measure \(m\) on \([0,\infty)\). The product measure \(\mu\times m\) is defined on \(\mathcal{M}\otimes\mathcal{B}_{[0,\infty)}\); both factor measures are sigma-finite.

For each \(t\ge0\), the superlevel set is \(\{x\in X:f(x)>t\}\). The inequality is strict. It is useful because the vertical section below the graph at \(x\) is precisely \([0,f(x))\), including when \(f(x)=+\infty\).

Theorem (Layer-Cake Integral Identity): For a sigma-finite measure space \((X,\mathcal{M},\mu)\) and a measurable \(f:X\to[0,\infty]\), the function \(t\mapsto\mu(\{x:f(x)>t\})\) is measurable on \([0,\infty)\), and $$ \int_X f\,d\mu=\int_0^\infty \mu(\{x\in X:f(x)>t\})\,dt. $$ Both sides are defined as nonnegative Lebesgue integrals and may equal \(+\infty\). No assumption that \(f\) is integrable is needed.

Proof. Consider the region below the graph, $$ A=\{(x,t)\in X\times[0,\infty):0\le t<f(x)\}. $$ We first verify that \(A\in\mathcal{M}\otimes\mathcal{B}_{[0,\infty)}\), so that Tonelli’s theorem applies to its indicator. Let \(\mathbb{Q}_{\ge0}\) denote the nonnegative rational numbers. Then $$ A=\bigcup_{q\in\mathbb{Q}_{\ge0}}\bigl(\{x:f(x)>q\}\times[0,q]\bigr). $$ Indeed, if \(0\le t<f(x)\), there is a rational \(q\) with \(t\le q<f(x)\), including when \(f(x)=+\infty\). Conversely, \(t\le q<f(x)\) implies \(0\le t<f(x)\). Each rectangle in the union belongs to the product sigma-algebra: \(\{f>q\}\in\mathcal{M}\) by measurability of \(f\), and \([0,q]\) is Borel. The union is countable, hence measurable.

For fixed \(x\), the section \(A_x=\{t:(x,t)\in A\}\) is \([0,f(x))\) when \(f(x)<\infty\), and is \([0,\infty)\) when \(f(x)=\infty\). Thus \(m(A_x)=f(x)\), with the equality interpreted in \([0,\infty]\). For fixed \(t\), the section \(A^t=\{x:(x,t)\in A\}\) is \(\{x:f(x)>t\}\). Tonelli’s theorem for the nonnegative measurable function \(\chi_A\) now gives $$ \int_X f\,d\mu =\int_X\int_0^\infty\chi_A(x,t)\,dt\,d\mu(x) =\int_0^\infty\int_X\chi_A(x,t)\,d\mu(x)\,dt =\int_0^\infty\mu(\{f>t\})\,dt. $$ Tonelli’s theorem also gives measurability of the inner section integral as a function of \(t\). Its hypotheses hold because the product-measurable integrand is nonnegative and the factor measures are sigma-finite. The identity is valid even if either iterated integral is infinite. \(\square\)

Reading the Identity

The left side adds the function’s values across \(X\). The right side instead adds the measures of horizontal slices of the region below its graph. In particular, the tail function \(t\mapsto\mu(\{f>t\})\) is nonincreasing: if \(s\le t\), then \(\{f>t\}\subseteq\{f>s\}\), so its measure at \(t\) cannot exceed its measure at \(s\). The theorem additionally guarantees that this tail function is measurable, as required for its integral.

Worked Example: A Linear Function on a Finite Interval

Take \(X=[0,1]\), Lebesgue measure \(m\), and \(f(x)=2x\). For \(0\le t<2\), the strict inequality \(2x>t\) is equivalent to \(x>t/2\). Therefore \(\{x\in[0,1]:2x>t\}=(t/2,1]\), whose measure is \(1-t/2\). For \(t\ge2\), the superlevel set is empty: at \(t=2\), the endpoint \(x=1\) gives equality, not strict inequality.

Consequently, the layer-cake integral is $$ \int_0^\infty m(\{2x>t\})\,dt =\int_0^2\left(1-\frac t2\right)dt =\left[t-\frac{t^2}{4}\right]_0^2 =2-\frac{4}{4} =1. $$ Direct integration checks the result: \(\int_0^1 2x\,dx=[x^2]_0^1=1^2-0^2=1\). Thus the layer-cake calculation agrees with the integral of the original function.

Worked Example: A Function on a Finite Counting Space

Let \(X=\{a,b,c\}\) with counting measure, so that the measure of a set is its number of elements. Define \(f(a)=3\), \(f(b)=1\), and \(f(c)=2\). For \(0\le t<1\), all three values are strictly greater than \(t\), so the superlevel set has measure \(3\). For \(1\le t<2\), only the values \(3\) and \(2\) are strictly greater than \(t\), so its measure is \(2\). For \(2\le t<3\), only the value \(3\) is strictly greater than \(t\), so its measure is \(1\). For \(t\ge3\), the set is empty.

The integral of this step function of \(t\) is $$ \int_0^\infty \#\{x:f(x)>t\}\,dt =3(1-0)+2(2-1)+1(3-2) =3+2+1 =6. $$ By the definition of counting measure, \(\int_X f\,d\mu=3+1+2=6\). The thresholds \(t=1,2,3\) are assigned using strict \(>\); changing the value of the tail at these finitely many heights would not change its Lebesgue integral. Here the displayed intervals record the actual strict superlevel sets.

Worked Example: An Integrable Function on an Infinite Interval

Let \(X=[0,\infty)\) with Lebesgue measure and \(f(x)=(1+x)^{-2}\). If \(0<t<1\), then $$ (1+x)^{-2}>t \quad\Longleftrightarrow\quad x<t^{-1/2}-1. $$ The endpoint \(t^{-1/2}-1\) is positive, so the superlevel set has measure \(t^{-1/2}-1\). For \(t\ge1\), the set is empty, since \(f(x)\le1\) for every \(x\ge0\). At \(t=0\), the superlevel set is all of \([0,\infty)\), of infinite measure; this single height has Lebesgue measure zero and does not affect the integral over \(t\).

Using the layer-cake identity, $$ \int_0^\infty m(\{f>t\})\,dt =\int_0^1(t^{-1/2}-1)\,dt =\left[2\sqrt{t}-t\right]_0^1 =2-1 =1. $$ The direct integral gives the same value: $$ \int_0^\infty\frac{1}{(1+x)^2}\,dx =\lim_{R\to\infty}\left[-\frac{1}{1+x}\right]_0^R =\lim_{R\to\infty}\left(1-\frac{1}{1+R}\right) =1. $$ The improper-integral computation is an independent check; the layer-cake identity itself follows from Tonelli and does not require this direct evaluation.

A Power-Moment Version

The same subgraph argument yields a weighted form that is often useful when studying moments. It does not require that \(f^p\) have a finite integral.

Corollary (Layer-Cake Formula for Powers): Let \((X,\mathcal{M},\mu)\) be sigma-finite, let \(f:X\to[0,\infty]\) be measurable, and let \(p>0\). Then $$ \int_X f^p\,d\mu =\int_0^\infty p\,t^{p-1}\mu(\{x:f(x)>t\})\,dt, $$ where either side may be \(+\infty\).

Proof. For each \(y\in[0,\infty]\), $$ y^p=\int_0^\infty p\,t^{p-1}\chi_{\{t<y\}}\,dt. $$ For finite \(y>0\), this follows by integrating \(p\,t^{p-1}\) from \(0\) to \(y\), giving \(y^p-0^p=y^p\). For \(y=0\), both sides are zero. For \(y=+\infty\), the integral over all positive \(t\) is \(+\infty\), matching \(y^p\). Set the weight \(p\,t^{p-1}\) to zero at \(t=0\); its value at that single point does not change a Lebesgue integral. Apply the scalar identity with \(y=f(x)\) and integrate over \(X\). Tonelli’s theorem applies to the nonnegative measurable function \(p\,t^{p-1}\chi_{\{t<f(x)\}}\) on the product space, so the order of integration may be exchanged. The inner integral over \(X\) is \(\mu(\{f>t\})\), which gives the stated formula. \(\square\)

A Common Threshold Error

When finding a superlevel set, solve the strict inequality \(f(x)>t\) before measuring the resulting set. For \(f(x)=2x\) on \([0,1]\), an incorrect calculation might assign measure \(1\) to \(\{2x>t\}\) for every \(0\le t<2\), on the mistaken grounds that the set is nonempty. That would give \(\int_0^2 1\,dt=2\), contradicting \(\int_0^1 2x\,dx=1\). Nonemptiness does not determine measure: for \(0\le t<2\), the set is \((t/2,1]\), so its measure is \(1-t/2\), not \(1\). Integrating this correctly gives \(1\).

The identity also makes an important distinction between finite and infinite integrals transparent. If the tail measures have infinite integral, then \(\int f\,d\mu=+\infty\); the theorem does not require them to be integrable in advance. Conversely, a finite area under the tail function is exactly the condition that \(f\) be integrable. The same interpretation applies to the power formula, with the weight \(p\,t^{p-1}\).

Check Your Understanding

In each question, use strict superlevel sets and identify any endpoint that does not affect the height integral.

  1. For \(f(x)=3x\) on \([0,1]\) with Lebesgue measure, find \(m(\{f>t\})\) for each range of \(t\), then compute the layer-cake integral.
  2. On a three-point space with counting measure, let the function values be \(0,2,4\). Write its tail function on the intervals between its values and verify the identity.
  3. For \(f(x)=e^{-x}\) on \([0,\infty)\), find the superlevel-set measure for \(0<t<1\), and compute its height integral.
  4. Explain why the set \(A=\{(x,t):0\le t<f(x)\}\) is measurable when \(f\) is measurable, using a countable union of measurable rectangles.
  5. State the hypotheses that allow Tonelli’s theorem to be used in the proof of the layer-cake identity, and explain why no assumption \(\int f\,d\mu<\infty\) is required.