assume $X$ and $Y$ are independent exponentially distributed RVs ($X, Y$ both $\geq 0$). in deriving $Pr(X > Y)$ i got stuck on the integral.
if $X > Y$ that means $X$ can take on any value $x \in [0, \infty]$ and $y \in [0, x]$, so we integrate the joint pdf with respect to $x$ from 0 to $\infty$ and with respect to $y$ from $0$ to $x$ - right?
$\begin{array} Pr(X > Y) &= \displaystyle\int_{0}^{\infty}\displaystyle\int_{0}^{x}P(X = x, Y = y)dxdy\\ &= \displaystyle\int_{0}^{\infty}\displaystyle\int_{0}^{x}\lambda\mu e^{-\lambda x}e^{-\mu y}dxdy\\ \end{array}$
we rearrange to make it clear which integral goes with $x$ and which with $y$:
$\begin{array} Pr(X > Y) = \displaystyle\int_{0}^{\infty}\lambda e^{-\lambda x}dx\displaystyle\int_{0}^{x}\mu e^{-\mu y}dy\\ \end{array}$
the integral with respect to $x$ is from $[0, \infty]$ of the exponential pdf which is $1$ by definition but that would leave only $\displaystyle\int_{0}^{x}\mu e^{-\mu y}dy$ which looks wrong. what is wrong w/reasoning here?
another try:
$\begin{array} Pr(X > Y) &= \displaystyle\int_{0}^{\infty}\displaystyle\int_{0}^{x}\lambda\mu e^{-\lambda x}e^{-\mu y}dxdy\\ &= \lambda\mu\displaystyle\int_{0}^{\infty}\displaystyle\int_{0}^{x} e^{-\lambda x}e^{-\mu y}dxdy \end{array}$
the inner part could be simplified to $e^{-\lambda x - \mu y}$ but that doesnt look simpler to integrate. can try to separate $dx$ and $dy$ again:
$\begin{array} Pr(X > Y) &= \lambda\mu\displaystyle\int_{0}^{\infty}e^{-\lambda x}dx\displaystyle\int_{0}^{x} e^{-\mu y}dy\\ &= \lambda\mu\displaystyle\int_{0}^{\infty}e^{-\lambda x}dx\left[\displaystyle\frac{-e^{-\mu y}}{\mu}\right]\big|^{x}_{0}\\ &= \lambda\mu\displaystyle\int_{0}^{\infty}e^{-\lambda x}dx\left( \frac{-e^{-\mu x}}{\mu} - \frac{-e^{-\mu 0}}{\mu}\right)\\ &= \lambda\mu\displaystyle\int_{0}^{\infty}e^{-\lambda x}dx\left( \frac{-e^{-\mu x}}{\mu} + 1\right) \end{array}$
this is where im stuck. expected the CDF to of an exp to appear somewhere to make integration simpler. what went wrong in the reasoning/steps?
update: i would like to understand what is wrong with my reasoning which that post that is suggested as duplicate does not do. second, that post doesn't give a formal detailed derivation