Given $f(x,y)$ whats the probability $X>Y$. Limits of double integration I am given $f(x, y)$ and I need to find the probability $X>Y$. What I do not understand is how do I get the limits of integration ($\int^{\infty}_{0} \int^{x}_0$) part. 

 A: It is very convenient that the random variables are called $X$ and $Y$.
Draw and label the usual axes. The joint density function of $X$ and $Y$ "lives" in the first quadrant. We want to find the probability that $X\gt Y$. Draw the line $y=x$. The probability that $X\gt Y$ is the probability that the ordered pair $(X,Y)$ will end up below the line $y=x$. In our case, that means in the first quadrant and below the line $y=x$. 
The joint density is symmetric about $y=x$. The probability of ending up on the line $y=x$ is $0$. It follows that $\Pr(X\gt Y)=\frac{1}{2}$.
But that does not answer your question about integration. So let assume that the problem is a little more complicated, and that the parameters of the two independent exponentials are possibly different, say $\lambda$ for $X$ and $\mu$ for $Y$. The joint density is $\lambda\mu e^{-\lambda x}e^{-\mu y}$ for $x,y\gt 0$.
Call this function $f(x,y)$.  
Let $D$ be the part of the first quadrant that is below the line $y=x$. The required probability is the double integral
$$\iint_D f(x,y) dA =\iint_D f(x,y)\,dy\,dx $$
We want to express the double integral as an iterated integral. So we will integrate first with respect to $y$, and then with respect to $x$, or maybe the other way around.
First with respect to $y$: Now our picture comes handy. Our region $D$ is the part of the first quadrant below $y=x$. So for any $x$, the variable $y$ travels from $y=0$ to $y=x$. Then $x$ travels from $0$ to $\infty$. Our iterated integral is 
$$\int_{x=0}^\infty\left(\int_{y=0}^x f(x,y)\,dy\right)\,dx.$$
First with respect to $x$: Note that in the region $D$, $x$ "starts" at $y$ and goes to $\infty$. Then $y$ travels from $0$ to $\infty$. That yields the integral
$$\int_{y=0}^\infty\left(\int_{x=y}^\infty f(x,y)\,dx\right)\,dy.$$
We can do the integration in either of the two ways. It turns out that integrating first with respect to $x$ makes the algebra somewhat simpler. 
A: Suppose that you a have a new random variable $Z=X-Y$.
You need to find $P\{Z=X-Y>0\}=\iint\limits_{x-y>0} f(x,y)\,dy\,dx$
