Joint PDF of two random variables in a triangle
Solution 1:
The random variable $(X,Y)$ is uniformly distributed over the region, lets call it $R$, i.e. the pdf $f_{X,Y}(x,y) = k$ for some constant on the region. Now lets integrate over the region
$$\int\int_R f_{X,Y}(x,y)dxdy = \int\int_R k \:dxdy$$
$$\int\int_R f_{X,Y}(x,y)dxdy = k * area(R)$$
$$\int\int_R f_{X,Y}(x,y)dxdy = k * \frac{1}{2}$$
We also know that
$$\int\int_R f_{X,Y}(x,y)dxdy = 1$$
so
$$k * \frac{1}{2} = 1 \Rightarrow k = 2 $$
And we end up with this pdf:
$$f_{X,Y}(x,y) = \begin{cases} 2, & (x,y) \in R \\ 0, & \text{otherwise} \end{cases} $$
Solution 2:
Firstly you need to determine the support $S$ of the random vector $(X,Y)$ $$S=\{(x,y)\in \Bbb R^2: 0\le x\le 1, \; 0\le y\le 1-x\}$$ You should draw a picture (is the only way to solve exercises with two random variables) of this domain. Now, since $(X,Y)$ has uniform distribution, you know that $$f(x,y)=c$$ for some constant $c$ over the support $S$. Two ways to proceed. The first is indeed to observe that the area of this triangle is equal to $1/2$, the other which is more systematic, but does not make use of the special structure of this problem, is to solve $$1=\int_{X}\int_Yf_{XY}(x,y)dydx=\int_{0}^1\int_{0}^{1-x}c\;dydx=c\int_0^11-x\;dx=c\cdot\frac12 \implies c=2$$