Why Marginal Densities Require Careful Limits
A joint density describes how probability is distributed across pairs of values. A marginal density answers a simpler question: how is probability distributed across the values of just one coordinate, without regard to the other? The calculation is an integration, but its limits are determined by the joint support. If the support has sloping boundaries, the feasible values of the variable being integrated out may depend on the value being retained.
The central task is therefore geometric as well as analytic: fix one coordinate, identify the resulting cross-section of the support, and integrate the joint density across that cross-section. Integrating over an incorrect range can produce a function that looks plausible but does not describe the marginal law.
Definition and General Formula
A joint density is nonnegative and integrates to one. It is often specified only on a support \(D\), with density zero outside \(D\). In that case, the integrals over the whole real line can be shortened to the feasible section of \(D\). For example, if \(D=\{(x,y):a<x<b,\ l(x)<y<u(x)\}\), then \(f_X(x)=\int_{l(x)}^{u(x)}f_{X,Y}(x,y)\,dy\) for \(a<x<b\), and \(f_X(x)=0\) outside that range, up to the choice of values on boundary points. The functions \(l\) and \(u\) need not be constant: that is precisely why the limits can depend on \(x\).
Why the Integration Formula Works
The marginal density formula follows by computing the probability that \(X\) lies in a set, while allowing \(Y\) to take any value. Nonnegativity is important: it permits the order of integration to be changed even when an integral might initially be infinite.
Proof. For each \(x\), define \(g_X(x)\) by the nonnegative integral, allowing the value \(+\infty\) initially. Tonelli’s theorem implies that \(g_X\) is measurable and that for every Borel set \(A\subseteq\mathbb{R}\),
Thus \(g_X\) is a density of \(X\). Taking \(A=\mathbb{R}\) gives \(\int_{\mathbb{R}}g_X(x)\,dx=P(X\in\mathbb{R})=1\). In particular, \(g_X\) can be infinite only on a set of measure zero, so it has a finite version almost everywhere. Interchanging the roles of \(x\) and \(y\) proves the claims for \(g_Y\). Since a density is defined by its integrals over measurable sets, changing its values on a measure-zero set does not change the distribution. \(\square\)
A Reliable Way to Find the Limits
For \(f_X\), hold \(x\) fixed and ask which \(y\)-values put \((x,y)\) inside the support. For \(f_Y\), hold \(y\) fixed and ask which \(x\)-values are feasible. The two answers need not have the same form. A useful calculation sequence is:
Record the inequalities defining where the joint density is nonzero.
For \(f_X\), treat \(x\) as fixed; for \(f_Y\), treat \(y\) as fixed.
Use all support inequalities, including any that make the limits depend on the fixed coordinate.
Integrate the joint density over that range, then verify that the marginal is nonnegative and integrates to one.
Worked Examples
Worked Example: A Uniform Density on a Triangle
Suppose the joint density is \(f_{X,Y}(x,y)=2\) on \(0<x<y<1\), and zero elsewhere. First check normalization: for each \(x\in(0,1)\), the feasible values of \(y\) range from \(x\) to \(1\), so
To find \(f_X\), fix \(x\). The support requires \(x<y<1\), so
It is zero outside \((0,1)\). As a check, \(\int_0^1 2(1-x)\,dx=1\). To find \(f_Y\), instead fix \(y\). The same support now gives \(0<x<y\), hence \(f_Y(y)=\int_0^y 2\,dx=2y\) for \(0<y<1\), and zero otherwise. This also integrates to one: \(\int_0^1 2y\,dy=1\). The lower limit for the first marginal and the upper limit for the second both come from the same sloping boundary \(x<y\).
Worked Example: An Unbounded Support with a Moving Limit
Let \(f_{X,Y}(x,y)=e^{-x}\) when \(x>0\) and \(0<y<x\), and let it be zero elsewhere. The support is unbounded, but each fixed \(x\) has a finite interval of feasible \(y\)-values. Check that the proposed joint density is normalized:
For the last equality, integration by parts gives \(\int_0^\infty xe^{-x}dx=[-xe^{-x}]_0^\infty+\int_0^\infty e^{-x}dx=0+1=1\). Fixing \(x>0\), integrate over \(0<y<x\):
This integrates to one by the calculation above. For \(f_Y\), fix \(y>0\). The inequality \(0<y<x\) means \(x>y\), so
It is zero for \(y\le 0\), and \(\int_0^\infty e^{-y}dy=1\). Notice the change in the integration range: a fixed \(x\) gives a bounded interval for \(y\), while a fixed \(y\) gives an unbounded interval for \(x\).
Worked Example: A Slanted Boundary in Both Marginals
Let \(f_{X,Y}(x,y)=1\) on the region \(0<x<2\), \(x/2<y<1\), and zero elsewhere. For each \(x\), the height of the region is \(1-x/2\), so its area is
Thus the joint density is normalized. At fixed \(x\), integrate from \(y=x/2\) to \(y=1\):
At fixed \(y\), the inequalities \(0<x<2\) and \(x/2<y<1\) imply \(0<y<1\) and \(0<x<2y\). Therefore
Both marginals are zero outside their stated intervals. Their integrals are \(\int_0^2(1-x/2)dx=1\) and \(\int_0^1 2y\,dy=1\). The upper limit \(2y\) in the second calculation is obtained by solving the support inequality \(x/2<y\) for \(x\); it is not the upper limit \(2\) of the original \(x\)-range for every \(y\).
Common Mistakes and Checks
- Using the same bounds for both marginals. The support must be re-examined after fixing the coordinate to retain. In the last example, the \(y\)-range at fixed \(x\) is \(x/2<y<1\), but the \(x\)-range at fixed \(y\) is \(0<x<2y\).
- Integrating over the whole real line without respecting zero density. An integral over all real values is correct only if the density is treated as zero outside the support. Writing just the feasible limits usually makes the calculation clearer.
- Assuming a correct-looking formula is a density. Check nonnegativity and total integral. A marginal obtained from a valid joint density must integrate to one; failure usually signals an incorrect limit or an integration error.
- Expecting a unique value at every point. Marginal densities are determined only almost everywhere. Changing a density at an endpoint, or at any other measure-zero set, does not change probabilities.
These calculations apply to an absolutely continuous joint law with a density over area. The defining formula does not account for probability concentrated on points or curves, since such probability is not represented by an ordinary two-dimensional density.
Check Your Understanding
For each question, identify the feasible range before doing any integration.
- If a joint density is supported on \(0<x<y<3\), what are the integration limits for \(f_X(x)\) and for \(f_Y(y)\)?
- A density is supported on \(x>0\) and \(0<y<2x\). For a fixed \(y>0\), what range of \(x\) is feasible?
- Why does integrating a marginal density to one provide a useful check, but not by itself guarantee that the integration limits were correct?
- Explain why two marginal density formulas that differ only at a single endpoint can describe the same distribution.
- For the joint density in the first worked example, verify the marginal CDF at \(0<t<1\) by integrating the displayed \(f_X(x)\) from \(0\) to \(t\).