$X, Y$ are continuous uniform random variables and I want to understand how to find $PDF_{X+Y}$ by convolution given various intervals for $X$ and $Y$.
I started with the simplest (I thought) case and read this answer but when both $X,Y\in[0,1]$ even though I do understand why $0<z<2$, I do not understand how we know in advance that we need to break this into 2 cases and how we know that we should consider $0<z<1$, $1<z<2$ (why not, for example, $0<z<1.5$, $1.5<z<2$?)
Now I have another similar problem, where $X\in[0,2]$ and $Y\in[3,4]$. I have a hunch that we need to break it all up into several cases as well, but I have no idea, again, how many cases there should be and what the limits of the intervals are.
How can I know that?
Let me try to explain. Write convolution and look at it: $$f_{X+Y}(z)=\int_{-\infty}^{\infty}f_X(t)\,f_Y(z-t)\,dt$$ We know that $f_X(t)=1$ for $t\in(0,1)$ only (and $0$ otherwise). It restricts integration to interval $(0,1)$: $$f_{X+Y}(z)=\int_0^1 f_X(t)\,f_Y(z-t)\,dt$$ Then look at $f_Y(z-t)$. It equals to $1$ only for the case when $z-t\in(0,1)$, or $z-1<t<z$. Otherwise we have $0$ in the integral.
Conclude that we should integrate over $t\in(0,1)\cap (z-1,z)$. But $z$ is the outer variable, and for different values of $z$ the intersection of the above intervals will be different. First look at the case when they cannot intersect. It is possible either for $z<0$ or for $z-1>1$ (that is $z>2$). Both cases the integration area is empty and $f_{X+Y}(z)=0$.
Next, let $z\in(0,2)$. You can imagine the intersection of intervals $(0,1)\cap (z-1,z)$ by moving the second unit interval from left to right. For small $z>0$ left point $z-1$ is smaller than zero, and the intersection of intervals will be $$(0,1)\cap (z-1,z)=(0,z).$$ It is valid until its right endpoint $z$ is less than $1$. As $z$ became $1$ or greater, $z-1$ became greater than $0$, and $$(0,1)\cap (z-1,z)=(z-1,1).$$
Therefore we have:
for $0<z<1$ the integration area is $(0,z)$
for $1<z<2$ the integration area is $(z-1,1)$.