Consider the following joint density function $$f_{X,Y}(x,y)=e^{-y}$$ if $0<x<y$ and 0 in other case.
If I want to find the following expectation $$E[X+Y|Y-X]$$
How do I calculate? My attempt is correct?
I know that by definition $$E[X |Y]=\int x f_{X|Y}(x,Y)dx$$
So if I make the following variable change (Is allowed?)
$U=X+Y$ and $V=Y-X$ then the expectation only would be $E[U|V]$ And by above definition I need to find the conditional of U given V. To do this, I try to apply the following equation $$f_{U,V}(u,v)=f_{X,Y}(x=\frac{u-v}{2},v=\frac{u+v}{2})|J|$$
Where the Jacobian is \begin{vmatrix} \frac{\partial x}{\partial u} & \frac{\partial x}{\partial v}\\ \frac{\partial y}{\partial u} & \frac{\partial y}{\partial v} \end{vmatrix}
and that is $\frac{1}{2}$
So the function with new variables is $f_{U,V}(u,v)=\frac{1}{2}e^{\frac{-u-v}{2}}$
So, now we can find the conditional,
$f_{U|V}=\frac{f_{U,V}(u,v)}{f_{V}(v)}$
where $f_{V}(v)=\int_{0}^{\infty} f_{U,V}(u,v)du = \int_{0}^{\infty}\frac{1}{2}e^{\frac{-u-v}{2}}du = \frac{1}{2}e^{-\frac{v}{2}}(2e^{\frac{-0}{2}})$
Is from 0 to $\infty$ because $0<U=x+y$ (is there something wrong here? Somebody told me that in this step there is an error but I don't know)
Finally $$f_{U|V}=\frac{1}{2}e^{-u/2}$$ So $$E[U|V]=\int_{0}^{\infty} u\frac{1}{2}e^{-u/2}du =\frac{1}{2}(0+2(0)e^{-\frac{0}{2}}+4e^{\frac{-0}{2}})=2$$
Please, if I do something wrong or all is wrong and there's another path to get the correct answer let me know please. Technically although I am in a course of probability, I am teaching to myself.
If $U = Y + X, V = Y - X ~$ and $y \gt x \gt 0$,
we have $0 \lt v \lt \infty$ and $v \lt u \lt \infty$
So, $ \displaystyle ~f_V(v) = \frac 12\int_v^{\infty} e^{-(u+v)/2} ~ du = e^{-v}$
$ \displaystyle ~E \left[U \mid V = v\right] = \frac 12\int_v^{\infty} u ~e^{(v-u)/2} ~ du = v + 2$