How to calculate the joint PDF given a marginal pdf and a uniform distribution

marginal-distributionprobability distributions

The random vector $(X,Y)$ is uniformly distributed on $[-1,3] \times[-2,5]$
$$f_X(x) = \begin{cases} x\over2 &, 0 \le x \le 2, \\ 0 &, \text{otherwise}\end{cases}$$
a) Determine the joint PDF of X and Y

b) Compute $P((X,Y) \in A$, where $A$ is the interior of the triangle $M(-1,2), N(3,-2), P(3,5)$

My attempt:
For point a) I've thought about using the formula $f_X(x) = $$\int_{-\infty}^\infty {f_{X,Y}(x,y)} \,dy$, since we know that this is $x\over2$, I just need to find the $y$ interval. Theoretically, one solution would be $f_X(x) = $$\int_{0}^x {1\over2} \,dy$ which gives us $x\over2$. I'm not sure if this is right I basically just derivated $x\over2$ and thought which interval would give us this result from the integral. As for point b) I've sketched a drawing and it seems that triangle has an angle of 90 degrees at the B point. However, I believe I need to solve a) in order to be able to solve b). Any ideas?

Best Answer

it is straightforward to go from joint to marginal. If $X$ and $Y$ are not independent, then going from marginal to joint is not possible.

since, $(X,Y)$ is uniformly distributed on $[-1,3] \times[-2,5]$, hence $ {f_{X,Y}(x,y)}=c$ over that rectangular region($c$ is an unknown constant).

also, $\int_{-1}^3\int_{-2}^5 {f_{X,Y}(x,y)} \,dy \,dx=1$

This gives $c=\frac{1}{28}$

Now, to get the marginal density of $X$, integrate out $Y$ as follows

$$f_X(x)=\int_{-\infty}^\infty {f_{X,Y}(x,y)} \,dy=\int_{-2}^5 c \,dy=\frac{1}{4},\forall x\in[-1,3]$$

I could go on, but i guess it is clear now, that the problem has its own problems...