Limits for the integral of a joint distribution I'm slightly confused on how to calculate the limits of a joint probabibilty distribution (continous case). For example, the following question 

I'm unsure of how the limits for the respective integrals were calculated, and would appreciate if someone could talk me through how to find the limits for the integral in general.
Thanks.
Edit: I understand why the inner integral is from 0 to 1-y, but if I used the same principle to calculate this, shouldn't the outer integral be from 0 to 1-x? I'm simply looking for the highest and lowest values of x and y which satisfy each inequality given in the question.
 A: The region over which the density is positive consists of the set of all $(x,y) \in \mathbb R^2$ such that:  $$\begin{align*}  0 < x &< 1 \\ 0 < y &< 1 \\ x + y &< 1. \end{align*}$$  That is to say, it is the triangle in the Cartesian coordinate plane with vertices $(0,0)$, $(1,0)$, and $(0,1)$, which we can see if we simply plot the lines $$x = 0, \quad x = 1, \quad y = 0, \quad y = 1, \quad x + y = 1.$$
So to integrate the density over this region, we first choose an appropriate order of integration.  The symmetry of the region indicates that it doesn't matter if we integrate first with respect to $x$, or to $y$.  If we first integrate with respect to $y$, then the inner integral is with respect to $y$, and the outer integral is with respect to $x$.  The outer integral then ranges over those values of $x$ that contain some point in the triangular region; thus $0 \le x \le 1$.  For a fixed value of $x$ in this region (think of drawing a vertical line somewhere between $x = 0$ and $x = 1$), the range of $y$ consists of those $y$-values in the region that are intersected with that line.  So the range of $y$ must be $$0 \le y \le 1-x.$$  This establishes that the appropriate integral is $$\int_{x=0}^1 \int_{y=0}^{1-x} f(x,y) \, dy \, dx.$$  If you switch the order of integration, then you get the solution you quoted.

