# How do we determine the marginal mean using the joint PDF?

I'm reading chapter 4 of DeGroot and either I missed it or he didn't explain it but I am not seeing how, given a joint distribution f(X, Y), how do we find E[X] and E[Y]. I have learned how to find E[r(X, Y)] where r(X, Y) is a real function involving X and Y. But I don't know how to find E[X] and E[Y] give f(X, Y). Do we just treat one or the other as a constant and just $$\int x f(X, Y) dx$$?

Thanks.

Your suggested approach would find the conditional mean of, in this case, $$X$$ given $$Y$$, typically written $$\mathbb{E}[X|Y]$$. In order to find the marginal mean, we need to integrate $$Y$$ out of the expression $$\mathbb{E}[X|Y]$$ (this is known as the Law of Iterated Expectation, see for example https://brilliant.org/wiki/law-of-iterated-expectation/.)
$$\begin{split} \mathbb{E}[X] = \mathbb{E}_Y[\mathbb{E}[X|Y]] &=& \int_Y\mathbb{E}[X|Y=y]f(y)dy \\ &=& \int_Y\left[\int_Xxf(x|y)dx \right] f(y)dy\\ &=&\int_Y\int_Xxf(x,y)dxdy \end{split}$$
where the last step follows from $$f(x,y) = f(x|y)f(y)$$.