I am studying for a probability exam and looking over an old question that goes as follows:
Let $f(x,y)=2e^{-x-y}, 0\le x\le y < \infty$.
From here, I understand that the marginal PDFs of $X$ and $Y$ can be found by taking the integral with respect to the other variable; my confusion, however, is how you know what the endpoints of the integrals are.
For example, the solution given sets the two integrals up as: $$f_X(x)=\int_x^\infty 2e^{-x-y} dy $$ $$f_Y(x)=\int_0^y 2e^{-x-y} dy $$
My question is how do you know which variable is going across what range? Does it come from the fact that we're given: [$0\le x\le y < \infty$] in the problem? Any clarification would be much appreciated. I am more interested in the setup than the actual solution to the integral!
In general, if $f(x,y)$ is the density function of the joint distribution $(X,Y)$, you get densities for the marginal distributions of $X,Y$ in the following way:
$$f_X(x) = \int_{-\infty}^{+\infty} f(x,y) dy $$
$$f_Y(y) = \int_{-\infty}^{+\infty} f(x,y) dx $$
Just remember this by "integrating out the other variable".
Now, in our case $f(x,y) = 2e^{-x-y}, 0 \leq x \leq y$. This means that if $(x,y)$ does not satisfy $0 \leq x \leq y$, then $f(x,y) =0$.
For example, how does one calculate the first integral in this domain?
Fix $x \geq 0$ (for $x< 0$ the integral is trivially $0$). For which $y$ is $f(x,y) \neq 0$ (and thus contributes to the integral?) Well, exactly the $y's$ for which $y \geq x$. Thus
$$f_X(x) = \int_x^\infty f(x,y) dy$$
Similarly, fix $y \geq 0$. For which $x$ is $f(x,y) \neq 0$? Well, exactly those such that $0 \leq x \leq y$. Thus
$$f_Y(y) = \int_0^y f(x,y) dx$$