Given X and Y as two independent random variables following $U(0,1)$ and We are required to obtain the distribution of $Z = X + Y$. The answer is given as follows:
$$f(z) = \begin{cases} z & \text{for $0 < z < 1$} \\ 2-z & \text{for $1 \le z < 2$} \\ 0 & \text{otherwise.} \end{cases}$$
I generally get confused in these types of problems when there is a split in the support of the distribution of interest. Here, I know one thing for sure that $Z$ will have values ranging from 0 to 2. I am not able to understand how do we think through the splitting of these z values into 0 to 1 and then 1 to 2.
Let me show you how would I have approached this problem.
Let $$U = X + Y \text{ and } V = Y,$$
then I can write $$X = U - V \text{ and } Y = V.$$
I am trying to find the joint distribution of U and V by jacobian transformation. The value of jacobian will be 1.
$|J| = 1$
Now, we can write:
$f(u,v) = g(x,y)|J| = g(x,y) = g(u-v,v) = 1,\text{ for } 0<u-v<1, 0<v<1$
Now, to get the marginal of $U$, I would need to integrate this joint with respect to $v$. We can see that v takes value from 0 to 1 but at the same time $v>u-1$. So, we can integrate the above joint density with respect to $v$ from $u-1$ to 1 and we get $f(u) = 2-u$.
Now, I have a question here that where exactly in the above steps, I would have thought of splitting that support of z and why? Any help would be appreciated.