given is that $f(x,y)=2$ where $0\leq x\leq 1$ and $0\leq y \leq 1$ and $x+y\leq 1$
Solution:
$$ P(Y\leq X)= \int_0^{\frac12} dx\int_0^x dy2 + \int_{\frac12}^1dx \int_0^{1-x}dy2=\frac12$$
How are the boundaries determined? What is the idea behind summing the two integrals?
There is also an alternative solution: $ P(Y\leq X)= P((X,Y) \in A)$ where $ A:y\leq x$
$$ = \int\int_A f_{x,y}(x,y)dxdy=opp(A) \times 2 =\frac12$$
I have not seen this notation before.
How can this be interpreted?
In both solutions, you need to integrate the function $f(x,y)=2$ over a particular region of the plane, namely the region of points $(x,y)$ satisfying $y \le x$.
Since the joint density $f$ is zero everywhere outside the given constraints on $x$ and $y$, the integral is the same as integrating the constant function $2$ over the region specified by the constraints $0 \le x \le 1$ and $0 \le y \le 1$ and $x + y \le 1$ as well as $y \le x$. If you take some time to draw a picture, you find that this region is a triangle with vertices at $(0,0)$, $(1,0)$, and $(1/2, 1/2)$.
The first integral divides this region into two halves, and integrates over each region separately.
The second integral uses a geometric interpretation to compute the integral. Since the integrand is the constant function $2$, the integral is the volume of the triangular prism with base $A$ (the triangle described above) and height $2$, which is $\text{area}(A) \times 2$.