How to figure out the limit of this question I am  trying to solve this question:

Suppose $X$ and $Y$ are random variables with joint density
  $$ f_{X,Y}(x,y) = \left\{ \begin{array} {cc} 
   2 &\text{ for } 0<x<y<1   \\
   0 & \text{ otherwise.}\end{array} \right.  $$
  Find the density function of $Z$ where $Z=X+Y$.

The given solution is:

if $Z=X+Y$ then (from a given theorem earlier), $$f_Z(z)=\int\limits_{-\infty}^{\infty} f_{X,Y}(u,z-u) \,\mathrm{d}x \tag{1}$$ .
Consider the support of $f_{X,Y}$ that is, $\{(x,y):0<x<y<1\}$. In order for the integrand in (1) to take non-zero values we need $0<u<z-u<1$. This implies:
$$\begin{array} {cc} 0<u<\frac{z}{2} & \text{ if } 0<z<1 \\
z-1<u<\frac{z}{2} & \text{ if } 1<z<2 \tag{2}\\
\end{array}$$
  Thus the marginal density for the sum if:
  $$ f_Z(z) = \left\{ \begin{array} {cc} 
   \int\limits_0^\frac{z}{2} 2 \, \mathrm{d}u=z & 0<z<1   \\
   \int\limits_{z-1}^\frac{z}{2} 2 \, \mathrm{d}u= 2-z & 1<z<2 \\
    0 & \text{ otherwise} \end{array} \right.  $$

There two points I need help on:
Question 1
I can understand why we need $0<u<z-u<1$. However, it is not clear to me why this must imply we must divide the integrand into two regions, namely $0<z<1$ and $1<z<2$ and not some other region. In fact, it did not occur to me that I must split the integrand at all. Please help me see why I must perform the integrand in the way it is described in the solution.
Question 2
Having looked at the solution, I tried to redo the question (just accepted that I need to split the integration into two) and tried to obtain the inequalities in (2) but was not successful in getting the second inequality i.e. $z-1<u<\frac{z}{2}$. Instead I got the following:
$$\begin{array}  {cc} 0<z<2 & \Rightarrow& 1<x+y<2 \\
& \Rightarrow & 0<z-1<1 \\ 
& \Rightarrow & 0<u+y-1<u<1 \\
& \Rightarrow & 0<x+y-1<y<1 \\
& \Rightarrow & 0<z-1<u<1 \\
& \Rightarrow & z-1 <u<1
\end{array} $$
Did I make and error somewhere? I know this can't be the answer because then $f_Z(z)$ won't integrate to $1$ from $0<z<2$. But I am not able to find my mistake.
 A: Question 1: You don't have to do it this way. The reason for the splitting is the following: If $z \in (0,1)$, then the condition $z-u<1$ is automatically satisfied, so $$0 < u < z-u < 1 \iff 0<u < u-z.$$ In contrast, for $z \in [1,2)$, we really have to ensure that $z-u<1$, i.e. there is some extra condition.
Question 2: How do you get from $0<z-1<1$ to $0<u+y-1<u<1$....?
Do it step by step: Fix $u \in (0,1)$.


*

*If $z \in (0,1)$, then $z-u<1$ is trivially satisfied (as $u>0$). Consequently, $$u < z-u < 1 \iff u<z-u.$$ The right-hand side is equivalent to $2u<z$, i.e. $u< \frac{z}{2}$.

*Let $z \in (1,2)$. We can split $u<z-u<1$ into two (separate) conditions:


*

*$u<z-u$: As in the first case, this is equivalent to $u< \frac{z}{2}$.

*$z-u<1$: This inequality is equivalent to $1+u > z$, i.e. satisfied if $u>z-1$.


Consequently, $u<z-u<1$ holds if, and only if, $$z-1<u< \frac{z}{2}.$$
Geometric interpretation:



*

*The condition $u<z-u$ corresponds to $u \in (0,1)$ such that the function colored in orange (namely, $f(u)=u$) is below the function colored in green ($f(u)=z-u$).

*The condition $z-u<1$ corresponds to $u \in (0,1)$ such that the function colored in green is below the black dotted line.

*The points $u \in (0,1)$ satisfying both constraints are colored in red.


For $z \in (0,1]$ we see that the second condition is always satisfied (the green line is always below the dotted line) whereas for $z >1$ this is not true anymore.
A: I shall not redo the computations here, but explain "why we must divide the integrand into two regions".
Given the joint density of $f_{(X,Y)}$ the cumulative distribution function $F_Z$ of the random variable $Z:=X+Y$ is given by
$$F_Z(z):=P[X+Y\leq z]=2\>{\rm area}(B_z)\ ,\tag{1}$$
where $$B_z:=\bigl\{(x,y)\>|\>0\leq x\leq y, \ x+y\leq z\bigr\}\ .$$
The factor $2$ in the formla $(1)$ comes from $f_{(X,Y)}(x,y)=2$ in the large triangle, which takes care of the fact that the area of this triangle is ${1\over2}$.

Looking at the above figure we have to realize that ${\rm area}(B_z)$ is not given by a single universal expression in the variable $z$, and that it will be necessary to distinguish cases, the most important one being $z\leq1$ vs. $z\geq1$. Having done the geometry properly it is then an easy matter to compute
$$f_Z(z)={d\over dz}F_Z(z)\ ,$$
and you will obtain the values given in the book.
