# Joint Probability Density – Finding E(XY)

calculusintegralprobability

$$Joint \:probability\;f(x,y) = 2/3 \:for\: 0 < x < 1, 0 < y < 2, x < y, and\: 0\: otherwise$$

$$E(XY)=\int_{0}^{1}\int_{x}^{2} \frac{2}{3}xy \:dy \:dx = \frac{7}{12} – (1)$$

$$E(XY)=\int_{0}^{2}\int_{0}^{y} \frac{2}{3}xy \:dx \:dy = \frac{4}{3} – (2)$$

Hello, I am quite new on multivariable calculus so I am a little unsure why the answers for eqn (1) and (2) are different.

From what I recalled from class, there is no difference if we integrate w.r.t x or y first. So I suspect that the limits of my integration for eqn (2) is wrong.

So I am wondering if there is an easy way to correctly remember what are the limits of integration for these types of questions and how would I find E(XY) if I were to integrate w.r.t x first?

Edit: Missed out the $$xy$$ in the integrals

The second integral should be written as two summands: $$E[XY]=\int_0^1\int_0^y \frac{2}{3}xy dxdy+\int_1^2\int_0^1 \frac{2}{3}xy dxdy$$
You can see this by drawing the support region of $$f(x,y)$$. It's bounded by $$x=y$$, $$x=0$$, $$x=1$$ and $$y=2$$ lines. When $$y<1$$, $$x$$ starts from $$0$$ and ends at $$y$$. When $$y>1$$, $$x$$ should end at $$1$$ (instead of $$y$$) because $$y$$ is greater than 1.