How do I correctly choose the bounds of integration when working with a joint probability density function? Given the function $f(x,y) = \frac{1}{x} \quad$  for $\quad 0 < y < x < 1$,
I'm trying to show that this is a valid probability density function. First, we can see that it is non-negative with in given interval. Secondly, I want to show that the double integral of the function within the given bounds yields 1.
My original bounds for the function were: $\int_{0}^{x}\int_{y}^{1}\frac{1}{x}dxdy$. 
Doing it this way gets pretty difficult so we can change the order of integration since the function is continuous within the given bounds (right?). However I still get an incorrect answer, because my bounds were wrong. After checking the solution manual, the correct bounds are: $\int_{0}^{1}\int_{0}^{x}\frac{1}{x}dydx$.
This integral does indeed yeild 1, but I don't understand why when integrating with respect to x, the bounds are from 1 to 0 instead of from 1 to y, since by definition, x is bounded by 1 and y?
 A: I think it's helpful to look at a diagram when you do the integration so you can see what you're trying to integrate. Here is a plot of the region that you are integrating over:

If you want to integrate over this region, you can either go in the order "$dx \thinspace dy$" or "$dy \thinspace dx$". Let's go "$dx \thinspace dy$", like in your solution manual, first. As you correctly started your integral, for a specific value of $y$, $x$ is bounded between $y$ and $1$, and we are doing the integral $\int_{y}^{1} \frac{1}{x} dx$. The range of possible $y$-values is from $0$ to $1$. You are already conditioning on the fact that $x > y$ when you do the first integration, so you can consider the whole range of $y$ and do the integral $\int_{0}^{1} \int_{y}^{1} \frac{1}{x} dx \thinspace dy$. The integral $\int_0^t \int_y^1 \frac{1}{x} dx \thinspace dy$ just covers the region $\{(x, y) : 0 < y < t, y < x < 1\}$.
Alternatively we could do the order "$dy \thinspace dx$". For any value of $x$ we can see from the diagram that $y$ is bounded between $0$ and $x$. And $x$ is bound between $0$ and $1$ so the integral is $$\int_0^1 \int_0^x \frac{1}{x} dy \thinspace dx = \int_0^1 x \frac{1}{x} dx = \int_0^1 1 dx = 1.$$
