# Integration of PDF's to find valid constant

I'm studying probability theory and came across and exercise problem that I would like to ask help with. Here's the specific problem that is in question:

Let $$X$$ and $$Y$$ have joint PDF

$$f_{X, Y}(x, y) = cxy$$ for $$(0 \lt x \lt y \lt 1)$$. Find $$c$$ to make this a valid PDF.

It's honestly a simple problem, but I am struggling to grasp some techniques regarding the integration of the joint PDF, which is leading me to get an incorrect answer.

My approach

Since a PDF must integrate to $$1$$ and must be nonnegative in order to be valid,

\begin{align} \int \int f_{X, Y}(x, y) & = \int_{y=x}^{y=1} \int_{x=0}^{x=y} cxy\ dxdy \\ & = \int_{y=x}^{y=1}\frac{c}{2}y^3dy \\ & = \frac{c(1-x^4)}{8} \end{align}

Therefore, I concluded that $$c = \frac{8}{1-x^4}$$. However, the solution that I was given has taken a different approach of switching the order of integration and also using different integration limits, leading to a completely different result.

Correct solution

\begin{align} \int \int f_{X, Y}(x, y) & = \int_{x=0}^{x=1} \left( \int_{y=x}^{y=1} cxy\ dy \right) dx \\ & = \int_{x=0}^{x=1} \frac{cx-cx^3}{2} dx \\ & = \frac{c}{4} \\ \end{align}

This gives us $$c = 4$$.

I have two specific questions:

1. Why did the correct solution switch the order of integration?

2. The limits of integration that I set were based on the initial condition of $$(0 \lt x \lt y \lt 1)$$. That's why I had the limits for $$x$$ set to $$x = 0$$ and $$x = y$$. However, the correct solution set it to $$x = 0$$ and $$x = 1$$. Why is this so? Is there something that I missed?

Any feedback is appreciated. Thank you.

EDIT

The "correct" solution is actually incorrect. The last integral calculation should give us $$\frac{c}{8}$$, leading us to $$c = 8$$, not $$4$$.

Your integral needs to reflect the constraints $$0 < x,y <1$$ and $$x. If you think about it, this means that x could take any value in (0,1) and moreover, for any such x, y can take any value in (x,1) and that’s why your solution is not correct and their solution is. In your solution you are fixing x, but what even is the value of x you are fixing it to?
• That's what I initially thought, but if we take into account the constraint that $x \lt y$, then wouldn't it make more sense to set the integration limit as $y$? I'm having trouble understanding why $x$ would be able to take on any value in interval $(0, 1)$ when it's constrained by the value of $y$. – Seankala Nov 18 '18 at 13:05
• Are you saying that because the value of $y$ is not yet determined, $x$ may take on any value in $(0, 1)$? – Seankala Nov 18 '18 at 13:06
• What matters is that the set {$0<x<y<1$} can be written as {$0<x<1$, $x<y<1$} – Sorin Tirc Nov 18 '18 at 13:19