I have a joint density of $\pi(x,y) = 2e^{-x-y}$, where $0\leq x \leq y$
and conditional distribution is $\pi(y|x) = e^{x-y}$, where $0\leq x \leq y$
and want to solve for $E(XY^2|X=5)$
Let $X = h(X)$, then $E(XY^2|X=5) = E(h(X)Y^2|X=5)= \int_{5}^{\infty} h(X)y^2\cdot\pi_{Y|X}(Y|X=5)\, dy$ $=h(X)\int_{5}^{\infty}y^2\cdot e^{5-y}\,dy = 37\cdot h(X) = 37X$
Really puzzled about 2 points here. What was done above essentially means that $E(h(X)Y^2|X=5) = h(X)E(Y^2|X=5)$ but I haven't come across this so far... And $E(XY^2|X=5)=37X$, which still has a random variable X in it, which is weird because we already have that $X=5$, so there shouldn't be any X terms floating around.
Apologies if this was a stupid question. I pondered over it for a while now, and need the insight of others.