Transformation of random variables exercise

I want to know if my solution to the following exercise is correct:

Let $X$ be a gamma distributed random variable with parameter 2, meaning with distribution $$P_X(\mathrm{d}x)=\mathbb{1}_{\{x>0\}}xe^{-x}\mathrm{d}x$$ And let $U$ be a uniform distributed random variable on $[0,1]$ that is independent of $X$. Define$$Y_1=UX\qquad \text{ and }\qquad Y_2=(1-U)X$$

What's the distribution of $(Y_1,Y_2)$ and prove that $Y_1$ and $Y_2$ are independent with exponential distribution. Determine the parameter.

Solution: The inverse $T^{-1}(y_1,y_2)$ of the transformation $T(x,u)$ is: $$X=Y_1 +Y_2$$ $$U=\frac{Y_1}{Y_1+Y_2}$$ Jacobi matrix of $T^{-1}$ is $$J_{T^{-1}}=\begin{pmatrix}1 & 1\\ \frac{y_2}{(y_1+y_2)^2} & \frac{-y_1}{(y_1+y_2)^2} \end{pmatrix}$$ With $|Det(J_{T^{-1}})|=\frac{1}{(y_1+y_2)}$, the old joined density is $$f_{X,U}=\mathbb{1}_{\{x>0\}}xe^{-x}\mathbb{1}_{[0,1]}(y)$$ and now for the new joint density $$f_{Y_1,Y_2}=f_{X,U}\cdot|Det(J_{T^{-1}})|=f_{X,U}\left(y_1+y_2,\frac{y_1}{y_1+y_2}\right)\frac{1}{(y_1+y_2)}$$ $$=\mathbb{1}_{\{y_1+y_2>0\}}e^{-(y_1+y_2)}\mathbb{1}_{[0,1]}\left(\frac{y_1}{y_1+y_2}\right)\frac{(y_1+y_2)}{(y_1+y_2)}$$ $$=\mathbb{1}_{\{y_1+y_2>0\}}\mathbb{1}_{\left\{\frac{y_1}{y_1+y_2}\right\}\in[0,1]}e^{-(y_1+y_2)}$$

So we have an exponential distribution with parameter $\lambda=1$. Independence follows from $f_{Y_1,Y_2}=f_{Y_1}f_{Y_2}$ $$\mathbb{1}_{\{y_1+y_2>0\}}\mathbb{1}_{\left\{\frac{y_1}{y_1+y_2}\right\}\in[0,1]}e^{-(y_1+y_2)}=\mathbb{1}_{\{y_1>0\}}e^{-y_1}\mathbb{1}_{\{y_2>0\}}e^{-y_2}$$

What confuses me is the indicator function especially $\mathbb{1}_{\left\{\frac{y_1}{y_1+y_2}\right\}\in[0,1]}$ So I don't know if I did this correct.

Thanks a lot for help!

• You did fine, since one has: $$[y_1+y_2>0,\,0<y_1/(y_1+y_2)<1]\iff[y_1>0,\,y_2>0]$$ – Did Jul 10 '16 at 14:15
• @Did thanks a lot! – MarcE Jul 10 '16 at 15:20