There are three independent r.v.'s $U,X,Y$. $U$ is uniform on $(0,1)$ and $X,Y$ are both exponential of parameter $1$. It can be shown that the ratio $Z=\frac{X}{X+Y}$ has a uniform distribution on $(0,1)$.
I am trying to figure out how to compute the expected value of the function $$ g(U, X, Y) = \begin{cases} U (1+X) & \text{if } U \ge \dfrac X {X+Y}, \\[10pt] U(1-X) & \text{if } U < \dfrac X {X+Y}. \end{cases}$$
The conditional events compare two uniform r.v.'s, but the values of the function depend on $U$ (uniform) and $X$ (exponential).