Let $X$, $Y$ be random variables with joint density
$f_{(X,Y)}(x,y)= \frac{2}{(1+x)^3}\mathbb{1}_{\{0<y<x\}}$.
Let us further define $\tilde{Y}=XU$ where $U$ is a uniform random variable over $(0,1)$, independent of $X$ and $Y$.
(a) Determine the conditional distribution of $Y$ given $X$ and that of $X$ given $Y$.
(b) Justify the following statement: for each bounded and measurable function $\phi: \mathbb{R}^2 \longrightarrow \mathbb{R}$ we have that $\mathbb{E}[\phi(X,Y)]=\mathbb{E}[\phi(X,\tilde{Y})]$.
Here is my solution (I will put also part (a) for the computations):
(a) First we have to compute the marginal distributions of $X$ and $Y$, given the joint distribution $f_{(X,Y)}(x,y)$.
\begin{equation*} \begin{split} &f_X(x)= \int_{-\infty}^{+\infty} f(x,y)\,dy= \int_{-\infty}^{+\infty} \frac{2}{1+x^3} \mathbb{1}_{\{0<y<x\}}\,dy=\\ &=\int_0^x \frac{2}{1+x^3}dy= \frac{2x}{1+x^3}\mathbb{1}_{\{0<x\}} \end{split} \end{equation*}
\begin{equation*} \begin{split} &f_Y(y)= \int_{-\infty}^{+\infty} f(x,y)\,dx= \int_{-\infty}^{+\infty} \frac{2}{1+x^3} \mathbb{1}_{\{0<y<x\}}\,dx=\\ &=\int_y^{+\infty} \frac{2}{1+x^3}\,dx= \frac{1}{(1+y)^2} \mathbb{1}_{\{0<y\}} \end{split} \end{equation*}
Now we can determine the conditional density of $Y$ given $X$ and that of $Y$ given $X$.
\begin{equation*} h(x|y)=\frac{f(x,y)}{f_Y(y)}= \frac{2/(1+x)^3}{1/(1+y)^2}= 2\frac{(1+y)^2}{(1+x)^3}\mathbb{1}_{\{0<y<x\}} \end{equation*}
\begin{equation*} g(y|x)=\frac{f(x,y)}{f_X(x)}= \frac{2/(1+x)^3}{2x/(1+x)^3}= \frac{1}{x}\mathbb{1}_{\{0<y<x\}} \end{equation*}
(b) We first compute the joint density of $(X,\tilde{Y})$ through a change of variable. Since $\tilde{Y}=XU$ we obtain that \begin{equation*} X=X \\ U=\frac{\tilde{Y}}{X} \end{equation*}
and the respective Jacobian is:
\begin{equation*} J= \begin{vmatrix} 1 & 0 \\ -\frac{\tilde{y}}{x^2} & \frac{1}{x} \end{vmatrix} = \frac{1}{x}. \end{equation*} Hence the joint density of $(X,\tilde{Y})$ with the change of variable becomes:
\begin{equation*} f_{(X,\tilde{Y})}(x,\tilde{y})=\frac{1}{x} f_{(X,U)}(x,u)=\frac{1}{x} f_X(x) f_U(u)= \frac{2}{(1+x)^3}\mathbb{1}_{\{0<\tilde{y}<x\}}. \end{equation*}
Let's now compute the expectation required:
\begin{equation*} \begin{split} &\mathbb{E}[\phi(X,\tilde{Y})]= \int_{\mathbb{R}^2} \phi(x,\tilde{y}) f_{(X,\tilde{Y})}(x,\tilde{y}) dx d\tilde{y} = \\ &=\int_0^{+\infty} \int_0^x \phi(x,\tilde{y}) \frac{2}{(1+x)^3} d\tilde{y} dx \overset{*}= \\ &=\int_0^{+\infty} \int_0^x \phi(x,y) \frac{2}{(1+x)^3} dy dx = \mathbb{E}[\phi(X,Y)] \end{split} \end{equation*}
where in the $\overset{*}=$ we used the change of variable $\tilde{y}=y$.
Now, my question is about the part (b): am I truly allowed to use the change of variable $\tilde{y}=y$? Since $\tilde{Y}=XU$, does it mean that I am setting the equality also for the random variables $\tilde{Y}=Y$ (that is not true)? Or am I really doing only a change of the parameter in the integral?
Thank you!