$X$ and $Y$ have the the jpdf $$f(x,y)=\begin{cases}1/4,& 0<x,y<2\\0,&\text{ otherwise.} \end{cases}$$ Find $\mathbb{E}(XY)$.
So the region of non-zero probability is an infinite rectangle on $[0,\infty]\times[-\infty,2]$. So I get the integral $\int_0^{\infty}\int_{-\infty}^{2}1/4xy dy dx$. However, then I get $\int_0^{\infty}[xy^2/8]_{y={-\infty}}^{2}$ which is something divergent. What am I missing?
We have $$E[XY]=E[E[XY\mid X]]=\frac12\int_0^2E[YX\mid X=x]\ dx$$
and $$E[XY\mid X=x]=E[xY]=xE[Y]=x$$
because $X$ and $Y$ are independent, $X$ and $Y$ are both uniform over $[0,2]$ and $E[X]=E[Y]=1.$
So,
$$E[XY]=\frac12\int_0^2x\ dx=\frac14\left[x^2\right]_0^2=1.$$