# Compute marginal PDF from joint PDF

The joint PDF of $X$ and $Y$ are given by $$f(x,y)=3y, for 0<y<1, 0<x<y$$

As usual, I tried to find the marginal PDF of X by $$\int_{0}^{1}f(x,y) dy$$ However, this gives me 1.5 which is greater than 1.

How can I approach the problem?

• You missed the $x<y$ part. Also, a pdf may take values greater than $1$. Dec 2, 2016 at 1:33
• @user251257 how to include $x<y$? Dec 2, 2016 at 1:44
• you obviously computed $\int_0^1 f(x,y) dy = \int_0^1 3y\, dy$. But what is, say $f(1/2, 1/4)$? Dec 2, 2016 at 1:49
• @user251257 should be 0? Dec 2, 2016 at 2:14
• Yes. So what are the correct integral bounds? Dec 2, 2016 at 2:15

To fully formulate this problem, it is helpful to introduce the indicator function defined in the following way:
$$I_A(x) = \begin{cases} 1 \quad \text{if x \in A}\\ 0 \quad \text{if x \notin A} \end{cases}$$ Thus, the joint PDF of $X$ and $Y$ can be written as: $$f(x, y) = 3 y I_{(0, y)}(x) I_{(0, 1)}(y) = 3 y I_{(x, 1)}(y) I_{(0, 1)}(x)$$ The marginal PDF of $X$ is given by: $$f(x) = \int_{-\infty}^{+\infty} f(x, y) \; d y = \int_{-\infty}^{+\infty} 3 y I_{(x, 1)}(y) I_{(0, 1)}(x) \; d y = I_{(0, 1)}(x) \int_{-\infty}^{+\infty} 3 y I_{(x, 1)}(y) \; d y = I_{(0, 1)}(x) \int_{x}^{1} 3 y \; d y = I_{(0, 1)}(x) \bigg ( \frac{3}{2}y^2 \bigg ) \Bigg |_x^1 = \frac{3}{2} (1 - x^2) I_{(0, 1)}(x)$$ Write this in the usual way, we have: $$f(x) = \begin{cases} \frac{3}{2} (1 - x^2) \quad \text{if 0 < x < 1}\\ 0 \quad \text{otherwise} \end{cases}$$ It is not hard to verify that $f(x)$ is a PDF.

Remark: Always remember to analyze the range of random variables first. A general way to do this is using the indicator function to extend the range of random variables to the entire real line(for a certain real random variable) and compute the integral with the infinite upper and lower bound. Then, consider the "true" bound(range) of the integral indicated by those indicator functions.

We have to integrate the joint distribution $f_{X,Y}(x,y)$ with respect to $Y$ to get the marginal $f_X(x)$. The limits of integration are:

So it amounts to getting rid of the $y$'s by integrating:

$$f_X(x)=\int_{y=x}^1 3y\,dy=\frac{3}{2}y^2\Big|_x^1=\frac{3}{2}(1 - x^2).$$

This is a valid pdf, because if we integrate it over the domain of $X: 0<x<1:$

$$\int_0^1 \frac{3}{2}(1-x^2)\,dx=1$$