From Level Sets to Integrals
For a nonnegative function, its integral can be computed by adding up the sizes of its superlevel sets. A superlevel set at height \(t\) is the set of points where the function is strictly greater than \(t\). The layer-cake formula turns that description into a one-dimensional integral over the height variable. In explicit calculations, the main work is to find the superlevel sets correctly, including the ranges where they are empty or equal to the whole domain.
Unless a worked example specifies a different domain, take \((X,\mathcal{M},\mu)\) to be a sigma-finite measure space, and let \(f:X\to[0,\infty]\) be measurable. The integral is the nonnegative Lebesgue integral, so it may be infinite. The layer-cake identity below is the standard formula used in the earlier material on tail integrals; its proof also explains exactly why the level-set calculation is valid.
Proof. On the product of \((X,\mathcal{M},\mu)\) and \((0,\infty)\) with Lebesgue measure \(m\), define \(H(x,t)=\chi_{\{(x,t):0<t<f(x)\}}(x,t)\). This is product-measurable: its set of value \(1\) is the countable union, over positive rational \(q\), of \(\{x:f(x)>q\}\times(0,q)\). For each fixed \(x\), the set of \(t>0\) with \(t<f(x)\) has Lebesgue measure \(f(x)\), including when \(f(x)=0\) or \(f(x)=\infty\). For each fixed \(t>0\), the section in \(x\) is exactly \(\{x:f(x)>t\}\). The function \(H\) is nonnegative, so Tonelli’s theorem applies on these sigma-finite measure spaces and permits either order of integration. Integrating first in \(t\) gives \(\int_X f\,d\mu\); integrating first in \(x\) gives the right-hand side of the identity. \(\square\)
Indicators and Powers on a Bounded Interval
Worked Example: An Indicator of a Set
Let \(E=[1,3]\subset\mathbb{R}\), use Lebesgue measure \(m\) on \(\mathbb{R}\), and set \(f=5\chi_E\). Find the level sets and compute the integral.
For \(0\le t<5\), the strict inequality \(f(x)>t\) holds precisely when \(x\in E\). For \(t\ge5\), it holds nowhere, including at \(t=5\), since \(f=5\) on \(E\) rather than \(f>5\). The interval \(E=[1,3]\) has length \(3-1=2\). Thus the level-set measure is \(2\) for \(0\le t<5\), and \(0\) for \(t\ge5\). The value at the single height \(t=0\) does not affect the integral over heights, so $$ \int_{\mathbb{R}}5\chi_{[1,3]}\,dm=\int_0^5 2\,dt=2\cdot5=10. $$ Check: the simple-function definition gives \(5m([1,3])=5(3-1)=10\), the same value.
The same calculation works for any measurable set of finite measure: if \(c\ge0\), then the level sets of \(c\chi_E\) are \(E\) for \(0\le t<c\) and empty for \(t\ge c\). Consequently its integral is \(c\mu(E)\). If \(c=0\) or \(\mu(E)=0\), both the level-set integral and the function integral are zero; no positive-height interval contributes when \(c=0\).
Proof. For \(t=0\), the strict superlevel set is \((0,A]\), of measure \(A\). If \(0<t<A^\alpha\), then \(x^\alpha>t\) is equivalent to \(x>t^{1/\alpha}\), so the level set is \((t^{1/\alpha},A]\) and its measure is \(A-t^{1/\alpha}\). For \(t\ge A^\alpha\), the level set is empty: at \(t=A^\alpha\), even the endpoint \(x=A\) has value equal to, not greater than, the threshold. Therefore the layer-cake formula gives $$ \int_{[0,A]}x^\alpha\,dm =\int_0^{A^\alpha}(A-t^{1/\alpha})\,dt =A^{\alpha+1}-\frac{(A^\alpha)^{1+1/\alpha}}{1+1/\alpha}. $$ Since \((A^\alpha)^{1+1/\alpha}=A^{\alpha+1}\) and \(1/(1+1/\alpha)=\alpha/(\alpha+1)\), the last expression is \(A^{\alpha+1}-\frac{\alpha}{\alpha+1}A^{\alpha+1}=\frac{A^{\alpha+1}}{\alpha+1}\), as claimed. \(\square\)
Worked Example: A Square on a Finite Interval
On \([0,2]\) with Lebesgue measure, take \(f(x)=x^2\). Its values range from \(0\) to \(4\). For \(0<t<4\), the condition \(x^2>t\) on this domain is \(x>\sqrt{t}\), so the level set is \((\sqrt{t},2]\), of measure \(2-\sqrt{t}\). At \(t=0\) the level set is \((0,2]\), also of measure \(2\); at \(t=4\) and above it is empty. Thus $$ \int_{[0,2]}x^2\,dm =\int_0^4(2-\sqrt{t})\,dt =2\cdot4-\left[\frac{2}{3}t^{3/2}\right]_0^4 =8-\frac{2}{3}\cdot8 =\frac{8}{3}. $$ Check: direct integration gives \([x^3/3]_0^2=2^3/3-0^3/3=8/3\). The direct calculation confirms the level-set result.
Exponential Functions and Threshold Ranges
Proof. The function is positive and strictly decreasing. For \(0<t<1\), solving \(e^{-\lambda x}>t\) gives \(x<\lambda^{-1}\ln(1/t)\); the level set is \([0,\lambda^{-1}\ln(1/t))\), of measure \(\lambda^{-1}\ln(1/t)\). For \(t\ge1\), the level set is empty. At \(t=0\), it is the whole half-line, of infinite measure, but a value at just this one height does not change the Lebesgue integral in \(t\). The layer-cake formula therefore reduces the answer to $$ \int_0^1\frac{1}{\lambda}\ln(1/t)\,dt =\frac{1}{\lambda}\int_0^1-\ln(t)\,dt. $$ For \(0<\varepsilon<1\), the integral from \(\varepsilon\) to \(1\) is \([ -t\ln(t)+t]_\varepsilon^1=1+\varepsilon\ln(\varepsilon)-\varepsilon\). As \(\varepsilon\downarrow0\), both \(\varepsilon\) and \(\varepsilon\ln(\varepsilon)\) tend to zero, so the integral is \(1\). This proves the formula. \(\square\)
Worked Example: An Exponential with Rate Three
For \(f(x)=e^{-3x}\) on \([0,\infty)\), with Lebesgue measure, the superlevel set for \(0<t<1\) is \([0,\frac13\ln(1/t))\), of measure \(\frac13\ln(1/t)\). The set is empty for \(t\ge1\). Hence $$ \int_{[0,\infty)}e^{-3x}\,dm =\frac13\int_0^1-\ln(t)\,dt =\frac13\cdot1 =\frac13. $$ Check: the antiderivative of \(e^{-3x}\) is \(-e^{-3x}/3\). Its integral from \(0\) to \(R\) is \((1-e^{-3R})/3\), which tends to \((1-0)/3=1/3\) as \(R\to\infty\).
On a finite interval, the level sets also have a range below the minimum value of the function. That range must be included, even though the level sets there are constant.
Worked Example: A Decreasing Exponential on a Finite Interval
Use Lebesgue measure on \([0,\ln 2]\) and let \(f(x)=e^{-2x}\). The function decreases from \(1\) to \(e^{-2\ln2}=1/4\). If \(0\le t<1/4\), every point in the interval satisfies \(f(x)>t\), so the level set has measure \(\ln2\). If \(1/4\le t<1\), solving the strict inequality gives \(x<-\frac12\ln t\); intersecting with the domain gives a set of measure \(-\frac12\ln t\). At \(t=1/4\), this set is \([0,\ln2)\), whose measure is still \(\ln2\); at \(t=1\) the level set is empty. Thus $$ \int_{[0,\ln2]}e^{-2x}\,dm =\int_0^{1/4}\ln2\,dt+\int_{1/4}^1-\frac12\ln t\,dt. $$ The first integral is \((\ln2)/4\). For the second, use the antiderivative \(\frac12(-t\ln t+t)\): $$ \int_{1/4}^1-\frac12\ln t\,dt =\frac12-\frac12\left(\frac14\ln4+\frac14\right) =\frac38-\frac{\ln2}{4}, $$ where \(\ln4=2\ln2\). Adding the two contributions gives \(3/8\). Check: direct integration gives \([-\frac12e^{-2x}]_0^{\ln2}=\frac12(1-e^{-2\ln2})=\frac12(1-1/4)=3/8\).
A Common Pitfall: Omitting Low Levels
For the finite-interval exponential, a tempting but incorrect calculation is to use only the formula \(-\frac12\ln t\) for levels \(1/4\le t<1\) and to assign level-set measure zero below \(1/4\). That would give \(3/8-\frac{\ln2}{4}\), not \(3/8\). The error is not in evaluating the integral over the stated range: it is the omission of the levels \(0<t<1/4\), where the superlevel set is the whole interval \([0,\ln2]\). Their contribution is \((\ln2)(1/4)=\frac{\ln2}{4}\), exactly the missing amount.
In each calculation, first identify the full range of heights, then solve the strict inequality \(f(x)>t\), and only then integrate the measure of the resulting set. Endpoints often have measure zero in the height integral, but they still help identify the correct ranges. On a finite interval, in particular, thresholds below the minimum function value usually contribute the measure of the entire domain.
Check Your Understanding
For each question, identify the superlevel sets before evaluating the layer-cake integral.
- On \([0,3]\) with Lebesgue measure, find the level sets of \(4\chi_{[1,2]}\) and compute its integral.
- Use the layer-cake formula to compute \(\int_{[0,1]}x^3\,dm\), stating what happens at \(t=0\) and \(t=1\).
- For \(\lambda>0\), find the superlevel sets of \(e^{-\lambda x}\) on \([0,\infty)\) and evaluate the resulting height integral.
- On \([0,1]\), describe the level sets of \(e^{-x}\) for \(0<t\le e^{-1}\) and for \(e^{-1}<t<1\). Which range has the whole interval as its level set?
- In the indicator calculation, why does the level \(t=c\) contribute nothing for \(c\chi_E\), even when \(E\) has positive measure?