# Marginalizing joint PDF of $X, Y$ which is uniform over triangle bounded by ${(0, 0),(0, 1),(1,0)}$. Is solution incorrect?

Let ($$X$$, $$Y$$) be a uniformly random point in the triangle in the plane with vertices $${(0, 0),(0, 1),(1,0)}$$. Find the the marginal PDF of $$X$$.

I disagree with the solution (see answer to Problem 7, Homework 7) to this problem, which claims that the upper limit of integration is $$1-x$$. I think that the upper limit of integration should be $$x$$.

My reasoning:

1. First, we can see that the joint PDF is $$f_{X,Y}(x,y) = 2$$ for $$x \in [0,1]$$ and $$0 \leq y \leq x$$.
2. Marginalizing out $$Y$$ means we're squishing the joint density down onto the $$x$$-axis. We should be integrating the joint PDF from $$0$$ to $$y$$ for each "slice" $$X=x$$ of the joint distribution, but $$y = x$$, so the upper limit of integration is $$x$$:

$$\int_{0}^{x} 2 dy = 2x, \text{for x \in [0, 1]}$$

Sanity check: Plugging in values should show that as $$x$$ approaches $$1$$, the PDF of $$X$$ gets larger for my solution, which is what we would expect since the triangle's height above the $$x$$-axis is greater as $$x$$ approaches $$1$$.

Which is correct and why?

The textbook solution is right If you want to derive the marginal density $$f_X(x)$$ you have to integrate Y, thus

$$f_X(x)=\int_0^{1-x}2dy=2(1-x)\mathbb{1}_{(0;1)}(x)$$

Same reasoning for the other marginal density

$$f_Y(y)=\int_0^{1-y}2dx=2(1-y)\mathbb{1}_{(0;1)}(y)$$

Your reasoning would be right if the triangle's vertices were

$$(0;0)$$, $$(1;0)$$,$$(1;1)$$

• Oh, wow, such a silly mistake -- thanks for taking the time @tommik, that makes complete sense. Oct 17 '20 at 21:03