# Why do we take a function of x as the limit of integration over y while calculating the marginal pdf of x?

I searched through similar questions but couldn't find one answering my question. I know the following is the way of finding marginal pdf from joint pdf. $$f_x(x)= \int_{-\infty}^{\infty} f_{x,y}(x,y) dy$$

But while solving a problem I realised that after this step we take a function of x as one of the limits, why so? If we do so aren't we violating the method above?

Why aren't we simply taking the limits of y from 0 to 1.(This is consistent with the method)

The problem I'm talking about: • Marginal of $X$ is just $f_X(x)=\int f_{X,Y}(x,y)\,dy$, where the limits of integration is determined from the support of $(X,Y)$. Yes, in general you can take the entire real line as the domain of integration, but only consider that part where the joint density is non-zero. – StubbornAtom Mar 22 at 17:09
• Exactly then why we take a function of x as one of the limits? – Adarsh Kumar Mar 22 at 17:11
• Here, the support of the joint density shows that there is dependency between $x$ and $y$, so you must account for that while finding the marginals. – StubbornAtom Mar 22 at 17:33
• $f(x,y)$ is defined on all of $\mathbb{R}^2$. But, it's nonzero on a specific subset, specified by the first line of the parametric formulation for $f(x,y)$. So the integral can be reduced to the region on which $f(x,y)$ is nonzero, which is a function of $x$. – Alex R. Mar 22 at 17:58
• $$f_X(x)= \int_{-\infty}^{\infty} f_{x,y}(x,y) dy = \int_{0}^{x^2} \frac{5x^2}{2} dy = \begin{cases} 5x^4/2 & -1 \leq x \leq 1 \\ 0 & \text{otherwise} \end{cases}$$ – Martijn Weterings Mar 22 at 19:36

## 1 Answer

In your example, $$f_{X,Y}(x,y)= \frac{5x^2}{2}$$ for $$-1 \leq x \leq 1, 0 \leq y \leq x^2$$ and zero otherwise. Applying the formula you listed for the marginal pdf of $$x$$, we get $$f_X(x) = \int_{-\infty}^{\infty} f_{X,Y}(x,y) dy = \int_{-\infty}^{0} 0dy + \int_{0}^{x^2} \frac{5x^2}{2} dy+ \int_{x^2}^{\infty}0dy=\int_{0}^{x^2} \frac{5x^2}{2} dy,$$ if $$-1 \leq x \leq 1$$ and zero otherwise.