Solution (source code)

= Solution

The <conditional density> gives
$$
\mathbb E[Y\mid X=x]=\int_0^\infty yxe^{-xy}\,dy=\frac1x,
$$
using either <integration by parts> or the <expected value> of an <exponential distribution>. Hence
$$
\boxed{\mathbb E[Y\mid X]=\frac1X\quad\text{almost surely}.}
$$
This is a finite value for almost every realization of $X$, but not an integrable <random variable>: $\mathbb E[1/X]=\int_0^\infty e^{-x}/x\,dx=\infty$. Since $Y\geq0$, its <conditional expectation> remains well-defined in the nonnegative, extended-expectation sense; the <tower property of conditional expectation> then gives $\mathbb EY=\infty$.