# How to find marginal distribution from joint distribution with multi-variable dependence?

One of the problems in my textbook is posed as follows. A two-dimensional stochastic continuous vector has the following density function:

$$f_{X,Y}(x,y)= \begin{cases} 15xy^2 & \text{if 0 < x < 1 and 0 < y < x}\\ 0 & \text{otherwise}\\ \end{cases}$$

Show that the marginal density functions $f_X$ and $f_Y$ are:

$$f_{X}(x)= \begin{cases} 5x^4 & \text{if 0 < x < 1}\\ 0 & \text{otherwise}\\ \end{cases}$$

$$f_{Y}(y)= \begin{cases} \scriptsize{\frac{15}{2}}\normalsize y^2(1-y^2) & \text{if 0 < y < 1}\\ 0 & \text{otherwise}\\ \end{cases}$$

I understand how the density function $f_X$ is calculated, by integrating $f_{X,Y}$ from $0$ to $x$ with respect to $y$. I’m however totally lost on $f_Y$, where is the $(1-y^2)$ coming from? If I integrate from $0$ to $1$ with respect to $x$ then I only get $\scriptsize{\frac{15}{2}}\normalsize y^2$, and why is the range $0 < y < 1$?

I’ve graphed the support for $X,Y$, all values where $f_{X,Y}>0$ are colored blue: As you correctly pointed out in your question $f_{Y}(y)$ is calculated by integrating the joint density, $f_{X,Y}(x,y)$ with respect to X. The critical part here is identifying the area on which you integrate. You have already clearly showed graphically the support of the joint distribution function $f_{X,Y}(x,y)$. So, now, you can note that the range of $X$ in the shaded region is from $X=y$ to $X=1$ (i.e. graphically, you can visualize horizontal lines, parallel to the x-axis, going from the diagonal line $Y=X$ to the vertical line at $X=1$).
Thus, the lower and upper limits of the integration are going to be $X=y$ and $X=1$. Thus, the solution to the problem is as follows:
$$f_{Y}(y)= \int_{y}^{1} f_{X,Y}(x,y) dx= \int_{y}^{1} 15xy^{2} dx=15y^{2}\int_{y}^{1} x dx=15y^{2}\left(\frac{1}{2}x^2\Big|_y^1\right)\\=\frac{15}{2}y^2(1-y^2).$$