Why the Order of Integration Matters
A joint-law problem can often be written as a double integral, but the same quantity may have very different-looking iterated integrals. One order may give constant or simple section limits; the other may require splitting the region into several pieces. Choosing carefully can turn a difficult calculation into a short one.
The choice is not merely an algebraic convenience. An iterated-integral identity needs appropriate measure-theoretic hypotheses. In the density setting used here, we assume the two reference measures are sigma-finite. For signed or complex integrands, we also check absolute integrability before changing order.
A Practical Choice of Order
For a region \(D\subseteq E\times F\), first describe its sections. For a fixed \(x\), the vertical section is \(D_x=\{y:(x,y)\in D\}\); for a fixed \(y\), the horizontal section is \(D^y=\{x:(x,y)\in D\}\). The bounds of these sections determine the two possible iterated integrals.
A useful decision process is to identify the quantity, compare both section descriptions, and then verify the hypotheses for the chosen order. In particular, a nonnegative integrand can be handled by Tonelli's theorem, even if its integral might be infinite. A signed or complex integrand requires absolute integrability for the unrestricted Fubini order switch.
For an expectation, the integrand is the desired function of the two coordinates multiplied by the joint density.
Determine the limits when the first coordinate is fixed and when the second coordinate is fixed. Look for limits that are constant or make the integrand easy to integrate.
Use sigma-finite reference measures. For a signed integrand, establish that the integral of its absolute value is finite before asserting equality of the two orders.
Use the simpler order, retain the section limits throughout, and verify normalization or other probability constraints where relevant.
Marginals and Expectations
Suppose \(U\) and \(V\) have a joint density \(f\) with respect to \(\mu\times\nu\). Integrating out one coordinate gives a density for the other coordinate. The theorem below states this precisely and explains why the section integral is legitimate.
More generally, for a measurable function \(h\), the expectation is calculated from \(\mathbb E[h(U,V)]=\int h(x,y)f(x,y)\,d(\mu\times\nu)(x,y)\), whenever the expectation is defined. For \(h\geq0\), Tonelli permits either order. For a real- or complex-valued \(h\), the standard sufficient condition for changing order is \(\int |h|f\,d(\mu\times\nu)<\infty\).
Worked Example: Marginals on a Triangle
Let the joint density with respect to two-dimensional Lebesgue measure be \(f(x,y)=2\) on \(0<x<y<1\), and \(0\) elsewhere. To check normalization, integrate over the triangle using \(x\) as the inner variable:
For the marginal density of \(V\), fixing \(y\) leaves \(0<x<y\), so \(f_V(y)=2y\) for \(0<y<1\). For the marginal density of \(U\), fixing \(x\) leaves \(x<y<1\), so
The second order is the simpler one for the expectation of \(U\), since its marginal is already available:
The section limits differ: \(0<x<y\) when \(y\) is fixed, but \(x<y<1\) when \(x\) is fixed. Writing the limits explicitly prevents confusing the two marginals.
Choosing an Order for a Transformed Variable
A transformed variable \(T(U,V)\) can be studied through its law: for a measurable set \(C\), its probability is the joint integral of the indicator that \(T(x,y)\in C\). Often the most useful order is the one that makes this preimage simple. A coordinate change can make the same idea especially transparent, provided the transformed region and Jacobian are both handled correctly.
Worked Example: The Difference on an Unbounded Region
Let \(f(x,y)=e^{-x}\) on the region \(0<y<x<\infty\), and let it be zero elsewhere. Its total integral is
The last integral equals \(1\) by integration by parts: its boundary term \(-xe^{-x}\) vanishes at both endpoints, and the remaining integral is \(\int_0^\infty e^{-x}\,dx=1\). Consider \(S=U-V\), which is positive on the support. For a measurable \(C\subseteq(0,\infty)\), use the coordinates \(u=x-y\), \(v=y\). Then \(x=u+v\), \(y=v\), the Jacobian determinant has absolute value \(1\), and the region becomes \(u>0,v>0\). Therefore
The inner integral is \(\int_0^\infty e^{-v}\,dv=1\). Thus \(S\) has density \(e^{-u}\) on \(u>0\). Integrating in \(v\) first is natural because it separates the exponential into \(e^{-u}e^{-v}\) and leaves a constant inner integral. The change of variables is legitimate here on the open quadrant, where it is one-to-one with Jacobian determinant \(1\).
Mixed Counting-and-Lebesgue Integrals
Not every joint law has two continuous coordinates. If one coordinate takes values in a countable set, counting measure provides a reference measure for that coordinate. Counting measure on a countable set is sigma-finite, so it can be combined with Lebesgue measure in the product setup above. The order choice then amounts to deciding whether to sum first or integrate first.
Worked Example: A Countable Coordinate and a Continuous Coordinate
On \(\mathbb N_0\times[0,1]\), use counting measure on \(\mathbb N_0\) and Lebesgue measure on \([0,1]\). Define \(f(n,u)=2^{-(n+1)}\) for \(n\in\mathbb N_0\) and \(0\leq u\leq1\). This is a probability density because
For the expectation of \(NU\), the integrand \(nu f(n,u)\) is nonnegative, so Tonelli's theorem allows either order. Integrating in \(u\) first gives
Here \(\sum_{n=0}^{\infty}n/2^{n+1}=1\), as follows by differentiating the geometric series \(\sum_{n=0}^{\infty}r^n=(1-r)^{-1}\) for \(0<r<1\) and setting \(r=1/2\). Alternatively, summing first gives
Both calculations agree. The use of Tonelli is justified: counting measure on \(\mathbb N_0\) is sigma-finite, Lebesgue measure on \([0,1]\) is finite, and the integrand is nonnegative.
What Must Be Checked Before Switching
The phrase “change the order of integration” is not a license to interchange arbitrary iterated integrals. Two checks matter especially in joint-law calculations.
- Reference measures: In the product-measure results used here, both reference measures are sigma-finite. Countable counting measure and Lebesgue measure are sigma-finite; counting measure on an uncountable set is not. A probability density on a product must not be used to justify a Tonelli or Fubini conclusion if the stated measure hypotheses fail.
- Integrand: A nonnegative measurable integrand satisfies Tonelli's order identity, with infinite values allowed. For a signed or complex integrand, verify absolute integrability before using Fubini to equate the iterated integrals.
- Sections: Set the limits from the region, not from a sketch alone. On a triangle, fixing \(x\) and fixing \(y\) usually produce different limits; on an unbounded region, the limits may extend to infinity.
In probability applications, the density \(f\) itself is nonnegative and has integral \(1\), so it is integrable. But an expectation adds another factor \(h\). If \(h\) is unbounded or changes sign, finiteness of the probability integral alone does not establish \(\int |h|f<\infty\). The absolute-integrability check is the safeguard that makes an order switch valid.
Check Your Understanding
For each question, identify both the useful computational idea and the condition that justifies it.
- For a density supported on \(0<x<y<1\), what are the section limits when computing the marginal density of \(U\)?
- Which theorem permits either order for a nonnegative measurable integrand, and what measure-space hypothesis is being used here?
- For a signed expectation, what integrability condition should be checked before switching the order?
- In the difference example, why do the coordinates \(u=x-y\) and \(v=y\) simplify the region and integrand?
- Why does countable counting measure combined with Lebesgue measure satisfy the sigma-finiteness condition?