# Derive probability density function from joint density function.

I have the following problem.

Let $(X,Y)$ be a random vector with joint density function $f(x,y)=8xy$ for $0<x<y<1$.

Find $f_X$ and $f_Y$.

My attempt was:

$f_X(x)=\int_{-\infty}^{\infty}f(x,y)dy=\int_x^1 8xydy=4x(1-x^2)$

the second equality from left to right because $x<y<1$.

But my question is, for what $x's$ is valid to say $f_X(x)=4x(1-x^2)$? because x can't be any number, it depends on "$y$" but $f_X(x)$ should depend only for x terms, right?

Thanks in advance.

• Check your integration: $f_X(x)=4x(1-x^2)$ on $(0,1)$, $f_Y(y)=4y^3$ on $(0,1)$. $x$ and $y$ can be anything in these densities since you integrated the other variable out - the restriction $x<y$ has already been taken care of in integration bounds. – A.S. Nov 11 '15 at 21:35
• I have already fixed. – HeMan Nov 11 '15 at 21:37

## 2 Answers

It doesn't depend on $y$. If you look at the restrictions on your joint density, you see that $x$ takes values between $0$ and $1$. And as a sanity check, you can check that $$\int_0^1 f_X(x)dx = \int_0^1 4x(1 - x^2) dx = 1.$$

Edit: As mentioned in the comments, there was a mistake in your original computation of the integral.

Second edit: As for a formal reason why it does not depend on $y$, it's because of your integration: you've marginalized over $x$ and $y$ does not appear anymore.

For an informal reason, think of it this way: your joint density is supported on $0 < x < y < 1$, and so when looking from above, you see that the density has weight only on a triangle (and not on the full square $[0,1]^2$). When you marginalize, you are not looking at the density from above anymore, but from the sides: you cannot see the triangle anymore, you only see that there is some positive weight all along the segment $[0,1]$.

• I see that sanity check works. But what is the formal reason that makes that $x$ doesn't depend on the $y$ restriction? – HeMan Nov 11 '15 at 21:40
• @Levent Does this help? – M Turgeon Nov 11 '15 at 21:45
• Yes it does! Thanks! – HeMan Nov 11 '15 at 21:46

Clearly the support for the marginal of $X$ is: $(0; 1)$

Because when you "remove" the $y$ you have $0<x<1$

There's no dependence on $y$ because you've 'integrated it out'.

• But why can I remove the condition $0<x<y<1$? That is the part that I don't understand. – HeMan Nov 11 '15 at 21:41
• It is handled by the integration; $f_X(x)$ is the joint density "summed" over all supported values of $Y$ for that particular atom of $X$. Since for each atom of $X$ we've already accounted for its possible $Y$ values, they are not a restriction on the support of the margin. @Levent – Graham Kemp Nov 11 '15 at 22:15