$X$ and $Y$ are distributed according to the joint PDF $$ f_{X,Y} (x,y) = \{ \begin{array}{lr} \frac{3}{7}x & : 1 \leq x \leq 2, 0 \leq y \leq x\\ 0 & : otherwise \end{array} $$
The random variable $Z$ is defined by $Z = Y - X$. Determine the PDF $f_{Z}(z)$.
The solution to this problem first determines the CDF then differentiates to determine the PDF. We are given that
$$ f_{X,Y} (x,y) = \{ \begin{array}{lr}\\ \int_{x = -z}^{x=0} \int_{y=0}^{y=x+z} \frac{3}{7}x dy dx & : -2 \leq z \leq -1\\ \int_{x = -z}^{x=1} \int_{y=0}^{y=x+z} \frac{3}{7}x dy dx & : -1 < z \leq 0 \end{array} $$
I have a few questions.
Why is my integration bound not y=0 to y=1. I suspect this has to do with the values of z and also some bound of integration concept. I should know this, but could someone provide some intuition as to why this is?
I understand intuitively that $Z$ is dependent on values $X,Y$ which is the reason we want to consider the joint PDF $f_{X,Y}(x,y)$. I can see why we want to use the CDF then differentiate to find PDF approach. However, I'm so lost as to how we get our bounds for our integrals. Could I bother someone to step through the thought process of how I should attack this problem? Thanks.
Geez, this problem has seriously been bothering me for days!