# Find $P(X>Y)$ if $f_{X,Y}(x,y) = 6e^{-(2x+3y)}$ for $x\geq 0$, and $y\geq 0$

I have a joint PDF of the following form:

$f_{X,Y}(x,y) = 6e^{-(2x+3y)}$ for $x\geq 0$, and $y\geq 0$; and $f_{X,Y}(x,y) = 0$ otherwise.

My goal is to find the probability that $X > Y$. Since I have no clue where to start I've peaked at the solution but am still confused as to why it is set up the way it is:

\begin{align*} P[X\geq Y] &= \int_{0}^\infty \int_{0}^x 6e^{-(2x+3y)} \,dydx\\ &=\int_{0}^\infty 2e^{-2x}\left(-e^{-3y}\bigg|_{y=0}^{y=x}\right)\,dx\\ &=\int_0^\infty \left[2e^{-2x}-2e^{-5x}\right]\,dx \\ &=\frac{3}{5} \end{align*}

Can anybody please explain to me why the first line is set with the inside integral 0 to x? I'm also confused as to how the second line is derived from the first. I tried plugging in the inside integral into wolfram but got a totally different answer.

• $Y$ is smaller or equal to $X$ in case of $P(X\geq Y)$. That´s why $y$ goes from $0$ to $x$ – callculus May 29 '17 at 22:09
• Furthermore to @callculus comment - If you draw out an $x$-$y$ domain with the relationship of $x$ to $y$ then you can quickly see the valid domains. This also allows one to find simpler transformations to make the integral simpler in some cases. – Chinny84 May 29 '17 at 22:19
• Thanks @callculus Could you explain how the second line is derived from the first by any chance? I don't get how the second line is structured. – MarksCode May 29 '17 at 22:27
• Which line are you talking about? within the actually derivation or the from the first line with the problem to the first line of the derivation? . – Chinny84 May 29 '17 at 22:33
• Please use MathJax and type out all images. Formatting tips here. – Em. May 29 '17 at 22:37

To calculate the integral w.r.t $y$ the variable $x$ can be treated like a constant. So it is a good idea to split.
$6e^{-(2x+3y)}=6e^{-2x}\cdot e^{-3y}$
$\int_0^{\infty}6e^{-2x} \left(\int_0^x e^{-3y} \, dy \right)\, dx$
The antiderivative of $e^{-3y}$is $-\frac13 e^{-3y}$
The factor $\frac13$ and the factor 6 can be summarized to $2$
Therefore it remains to insert the limits $0$ and $x$ into $e^{-3y}$