This is just the continuous version of the law of total probability:
https://en.wikipedia.org/wiki/Law_of_total_probability[tex]P(A) = \sum_{i=-\infty}^{\infty}P(A|(i-1)d < B\leq id)P((i-1)d< B\leq id)[/tex] (by the law of total probability)
[tex]\approx \sum_{i=-\infty}^{\infty}P(A|B=id)P((i-1)d< B\leq id)[/tex] when [tex]d[/tex] is very small
[tex]\approx \sum_{i=-\infty}^{\infty}P(A|B=id)f_B(id)d[/tex] where [tex]f[/tex] is the pdf for [tex]B[/tex]
Let [tex]b=id[/tex] to get
[tex]P(A)\approx \sum_{b=-\infty}^{\infty}P(A|B=b)f_B(b)d[/tex] where [tex]b[/tex] is incremented in steps of size [tex]d[/tex]
As [tex]d[/tex] gets smaller, the sum essentially becomes an integral, and the approximation becomes exact:
[tex]P(A) = \int\limits_{-\infty}^{\infty}P(A|B=b)f_B(b)db[/tex]
Replacing
[tex]A[/tex] with [tex]X<Y[/tex],
[tex]B[/tex] with [tex]X[/tex],
[tex]b[/tex] with [tex]x[/tex],
[tex]f_B(b)[/tex] with [tex]f_X(x) = \lambda e^{-\lambda x}[/tex] when [tex]x\geq 0[/tex] and [tex]0[/tex] otherwise
gives
[tex]P(X<Y) = \int\limits_0^{\infty}P(X<Y|X=x)\lambda e^{-\lambda x}dx[/tex]
Hope this helped,
R. Baber.