How do I find the marginal probability density function of 2 continuous random variables?

Solution 1:

You have the right idea to integrate against $y$ to find the $x$-marginal, and integrate against $x$ to find the $y$-marginal, but you've forgotten to pull out the other variable as a constant:

$$ f_1(x)=\int_0^2f(x,y)dy=\int_0^2\frac{3xy^2}{16}dy=\frac{3x}{16}\int_0^2y^2dy=\frac{3x}{16}\frac{8}{3}=\frac{x}{2} $$

Similarly,

$$ f_2(y)=\int_0^2\frac{3xy^2}{16}dx=\frac{3y^2}{16}\int_0^2 xdx=\frac{3y^2}{16}\cdot 2=\frac{3y^2}{8} $$