CDF of function of two random variables I'm a little confused about how to approach the below question:
Q: Let $\,W=Y-X$ and determine the CDF of $W$.

I've read the solution, here, but this was not very clear and I was wanting an approach from calculus if possible (unless this is too messy).
I understand that $w=-1$ is the point that splits the region but am not sure how to set the integrals up - any help appreciated.
 A: The question is to find the cdf of $W$ where $W=Y-X$ in order to do that we know that the joint density of $W$ is given by 
$$ F_{W}(w) = \iint_{D} f_{X,Y}(x,y) dx dy \tag{1}$$
Where the joint density is split into two uniform densities 
$$ f_{X,Y}(x,y) =\begin{align}\begin{cases} \frac{1}{2} &  0 \leq x \leq 1 , 0\leq  y\leq 1  \\ \\ \frac{3}{2}  &  1 \leq x \leq 2 , 0 \leq y \leq 1 \end{cases} \end{align} \tag{2}$$
It notes the following 
$$ P(W \leq w) = P(Y-X \leq w ) =P(Y \leq X +w) \tag{3}$$
Which gives us this picture

While you could use calculus and I actually spent a while preparing an answer with it. There is no point. They are made of triangles it notes that in the answer. 

The probabilities of interest can be calculated by taking advantage of
  the uniform PDF over the two triangles.

Now instead if you actually look at the picture. I am pasting it

The area of a triangle is $A = \frac{1}{2}b \cdot h $
$$ I_{1} = f_{X,Y}(x,y) \frac{1}{2} \frac{(2+w)}{2} (2+w) \tag{4} $$
$$ I_{1} = \frac{3}{2} \frac{1}{2} \frac{(2+w)}{2} (2+w) \tag{5} $$
$$ I_{1} = \frac{3}{2} \frac{1}{2} \frac{(2+w)^{2}}{2} \tag{6} $$
The other region is $1+w$  which would be only $\frac{1}{2}$ for the joint density. It is the triangular region in the middle.
 
$$ I_{2} = f_{X,Y}(x,y) \frac{1}{2} (1+w)(1+w) \tag{7} $$
$$ I_{2} = \frac{1}{2} \frac{1}{2} (1+w)^{2} \tag{8} $$
Look at the top now. See the triangle. The base is $-w$ and the height is $\frac{-w}{2}$
$$ I_{3} = \frac{1}{2}\frac{-w}{2} \cdot -w = \frac{w^{2}}{4}\tag{9} $$
We want the region for $w \in (-1,0)$ so now the area of the whole right side is 
$$ I_{4} = \frac{1}{2} 1 \cdot 1 = \frac{1}{2} \tag{10}$$
If we subtract off the triangle before we get this area 

So we let 
$$ I_{5} = f_{X,Y}(x,y)(I_{4} -I_{3}) \tag{11} $$
$$ I_{5} = \frac{3}{2}(\frac{1}{2} -\frac{w^{2}}{4}) \tag{12} $$
Note this a cumulative density. We just added the region for $I_{1}$ now let's add $I_{2}$ call it $I_{6}$ and make our $F_{W}(w)$ 
$$ I_{6} = I_{2} + I_{5} \tag{13}$$
$$ I_{6} = \frac{1}{2} \frac{1}{2} (1+w)^{2} +   \frac{3}{2}(\frac{1}{2} -\frac{w^{2}}{4}) \tag{14}$$
$$ f_{W}(w) =\begin{align}\begin{cases} 0 &  \textrm{ if }  w < -2  \\ \\ \frac{3}{2} \frac{1}{2} \frac{(2+w)^{2}}{2}  &  \textrm{ if } -2 \leq w \leq -1 \\ \\  \frac{1}{2} \frac{1}{2} (1+w)^{2} +   \frac{3}{2}(\frac{1}{2} -\frac{w^{2}}{4}) & \textrm{ if } -1 < w \leq 0 \\ \\ 1 & \textrm{ if } w > 0  \end{cases} \end{align} \tag{15}$$
fixing this like they did
$$ f_{W}(w) =\begin{align}\begin{cases} 0 &  \textrm{ if }  w < -2  \\ \\ \frac{3}{8} (2+w)^{2}  &  \textrm{ if } -2 \leq w \leq -1 \\ \\  \frac{1}{8}\big(-w^{2} +4w +8 \big) & \textrm{ if } -1 < w \leq 0 \\ \\ 1 & \textrm{ if } w > 0  \end{cases} \end{align} \tag{16}$$
