# How exactly is the domain of the marginal probability density function determined from a joint density function?

Given the following joint density function

$$f_{X,Y}(x,y) = \begin{cases} 3x, & \text{if 0\lt y \lt x \lt 1} \\ 0, & \text{otherwise} \end{cases}$$.

We're then asked to find the marginal probability density function of Y.

[ so for $$y\not\in (0,1)$$ the marginal density of Y:

$$f_Y(y)=\int_{-\infty}^{\infty} 0 dx =0$$

then, for $$y\in(0,1)$$ and $$0\lt y \lt x \lt 1$$, the joint pdf is: $$f_{X,Y}(x,y)=3x$$ and $$0$$ otherwise.

Thus $$f_Y(y)=\int_{1}^{y} 3x dx =\frac{3}{2}-\frac{3}{2}y^2$$.]

and finally we end up with: $$f_{Y}(y) = \begin{cases} \frac{3}{2} - \frac{3}{2}y^2, & \text{if 0.

My questions is: Why exactly is it "if $$0 \lt y \lt 1$$"?

Is it because this is the range of the random variable Y such that the joint pdf is not zero and hence the marginal pdf of y is not zero?

$$X$$ and $$Y$$ are constrained by $$0. For a given value of $$X$$, $$Y$$ is restricted to $$(0,X)$$ but as $$X$$ varies the only restriction you have on $$Y$$ is $$0. So the density of $$Y$$ is supported by $$(0,1)$$.