Probability of P(X $\le$ U $\le$ Y ) of random independed variables X; Y; U are random independent variables. X; Y are exponential distributed
with $\lambda$  and U $\sim$ Uni[0; 1].
How i find the probability:
P(X $\le$ U $\le$ Y ) 
Thanks
 A: For given positive real numbers $x\leq y\leq 1$, we have that
$
\mathbb P(x\leq U\leq y)=y-x,
$
whereas if $x\leq 1\leq y$ we have $\mathbb P(x\leq U\leq y)=1-x$, and otherwise this quantity is zero. Therefore
$$\mathbb P(X\leq U\leq Y)=\mathbb E[Y-X; X\leq Y\leq 1] + \mathbb E[1-X; X\leq 1\leq Y].$$
Since $X$ and $Y$ are independent, this simplifies to
$$
\mathbb P(X\leq U\leq Y)=\mathbb E[Y-X; X\leq Y\leq 1] + \mathbb E[1-X; X\leq 1] \cdot \mathbb P(Y\geq 1).
$$
The second term is easy to calculate, since $\mathbb P(Y\geq 1)=e^{-\lambda}$ by definition and
$$
\mathbb E[1-X; X\leq 1] =\int_{0}^1(1-x)\ \lambda e^{-\lambda x}\ dx=1+\frac{e^{-\lambda}-1}{\lambda}.
$$
For the first term, we have
$$\begin{align*}
\mathbb E[Y-X; X\leq Y\leq 1]&=\int_0^1\int_0^y(y-x)\ \lambda^2 e^{-\lambda(x+y)}\ dx \ dy\\
&=\int_0^1 e^{-\lambda y}(\lambda y-1)+e^{-2\lambda y} dy\\
&=\frac{1-e^{-2\lambda}}{2\lambda}-e^{-\lambda}.
\end{align*}$$
Therefore
$$
\mathbb P(X\leq U\leq Y)=\frac{1-e^{-2\lambda}}{2\lambda}+e^{-\lambda}\cdot \frac{e^{-\lambda}-1}{\lambda}=\frac{(1-e^{-\lambda})^2}{2\lambda}.
$$
