The joint probability density function for two random variables X and Y is given by $f_{XY}(x,y)=1 $ $(0<x<1), (0<y<1)$.
and the conditional joint PDF is $f_{XY}(x,y | X>Y)=2 $ $(0<x<y<1))$ by bayes' theorem.
Thus, the conditional marginal PDF is $f_{X}(x | X>Y)= \int_{0}^y 2dy=2x $ $(0<x<y<1))$
I'd like to calculate the conditional expectation and I have a little confusion here : whether I should use $E(X|X>Y)=\int_{0}^12xdx$ or $E(X|X>Y)=\int_{y}^12xdx$.
We know that $E[X|X>Y]=\frac{E[X\mathbb{1}_{X>Y}]}{P(X>Y)}$. Therefore, \begin{align} E[X|X>Y] &= \frac{E[X\mathbb{1}_{X>Y}]}{P(X>Y)} \\ &=\frac{\int_0^1\int_0^1x\mathbb{1}_{x\geq y}dxdy}{\int_0^1\int_0^1\mathbb{1}_{x\geq y}dxdy} \\ &= \frac23 \end{align}