Given $f(x,y) = 1$, $0
Would anyone be able to explain what they did in the second line, especially how they got $0<u<1$, and $1<u<2$
 A: We are analyzing the inequality. $y+x\leq u\implies y\leq -x+u$. The blue line represents $y = -x+1$. Notice that $0\leq x,y\leq 0$, so the density is $0$ else where. We only consider the square $[0,1]\times[0,1]$. Also keep in mind, we are dealing with a cube. 


*

*The case where $0\leq u\leq 1$.  Then one possibility is as follows,

The green line is $y = -x+u$, where $0\leq u\leq 1$
In other words, we need to integrate the volume "below" the green line.

*Notice that the sum is at most $2$. That is why the second case is $1< u\leq 2$.  One possibility is as follows.

The green line is $y = -x+u$, where $1< u\leq 2$
Notice that we are integrating the volume "below" the green line. But we know the entire volume should integrate to $1$. So instead of integrating the lower-left triangle $+$ the trapezoid in between, we instead consider the complement and integrate the triangle above the green line.


Now it should be clear where the bounds on the integral come from. Also, it is easy to check the answer using basic geometry.
