# Determine the expectation E(XY) of Joint PDF

I am practising some exam questions and am failing to understand the problem at hand. I believe I am supposed to take the double integral of the joint PDF that can be calculated by noting that $f_X,_Y(x,y) = f_{X|Y}(x)*f_Y(y)$.

The problem is as such:

The conditional pdf for X given Y = y, is

$f_{X|Y=y}(x) = \begin{cases} 1/y^2, & \text{for 0$\leq$x$\leqy^2$} \\ 0, & \text{otherwise,} \end{cases}$

While the marginal density of Y is

$f_Y(y) = \begin{cases} 4y^3, & \text{for 0$\leq$y$\leq$1} \\ 0, & \text{otherwise.} \end{cases}$

Now I think that X and Y are not independent, this is because looking at the limits of $f_{X|Y}(x)$ it is clear that if y = 0 then x must be 0. Hence, I need to double integrate over the joint pdf to find E(XY), I assume. The problem is how do I determine the limits of my integral?

Thanks for your patience, help and time! It is much appreciated!

The limits of the integral are in fact given to you.   They are: $0\leq y\leq 1$ and $0\leq x\leq y^2$.
\begin{align} \mathsf E(XY) & = \int_{y=0}^1 \int_{x=0}^{y^2} x\,y\; f_Y(y)\;f_{X\mid Y=y}(x)\operatorname d x\operatorname d y \\[1ex] & = \int_{y=0}^1 y\cdot 4y^3/y^2 \int_{x=0}^{y^2} x\operatorname d x\operatorname d y \end{align}
• Thanks Graham, may I ask why we need take the integral of $xy*f_{X|Y}(x)*f_Y(y)$ ? More specifically the $xy$. Thanks again. – orwellian Jun 11 '15 at 8:27
• @Orwellian By definition of expectation: \begin{align}\mathsf E(g(X,Y)) & = \iint_{\mathcal {Y\times X}} g(x,y)\; f_{X,Y}(x,y)\operatorname d x \operatorname d y \\[1ex] & = \iint_{\mathcal {Y\times X}} g(x,y)\; f_{X\mid Y=y}(x)\;f_Y(y)\operatorname d x \operatorname d y \end{align} – Graham Kemp Jun 11 '15 at 8:33
• @Orwellian As $\int x\operatorname d x = \frac 1 2 x^2 +\text{constant}$ then \begin{align}\int _0^{y^2} x \operatorname d x & = \frac {(y^2)^2}2-\frac{0^2}{2} \\[1ex] & = \tfrac 1 2 y^4\end{align} – Graham Kemp Jun 11 '15 at 8:50
• Once again thanks, @Graham! I have a complete solution now but to ensure I fully understand, if I were to find the marginal distribution of X for instance I would simply be doing the following: $\int_{0}^{1} 4y dy$ where 4y is the joint pdf here. Have I got the right idea and limits for this? – orwellian Jun 11 '15 at 9:10
• @Orwellian The marginal distribution of $x$ is the integral of the joint distribution with respect to $y\in[\sqrt x; 1]$. \begin{align} f_X(x) & = \int_{\sqrt{x\;}}^1 f_Y(y)\,f_{X\mid Y=y}(x) \operatorname d y \\[1ex] & = \int_{\sqrt{x\;}}^1 4 y^3\,/y^2 \operatorname d y \\[1ex] & = 4 \int_{\sqrt{x\;}}^1 y \operatorname d y \\[1ex] & = 2 -2 x \end{align} – Graham Kemp Jun 11 '15 at 9:32