I am trying to study from a textbook and encountered the following example:
No matter what I tried, I didn't understand the last step. How did the author change the limits of the integral in such way?
He than continues:
Which is even more odd to me. Where did these ranges come from?
I'd really appreciate your help. I am a probability newbie (obvious ha?) and really wish to learn.
Thanks!


We have $f_{X+Y}(a) = \int_0^1 f_X(a-y)\,dy$, where $f_X(t) = \begin{cases}1&0< t< 1\\ 0&\text{otherwise}\end{cases}$. With a piecewise defined function like this or anything with an absolute value, the way to handle an integral is to split the interval everywhere we change formulas. So then, we look for $y\in (0,1)$ such that $a-y=0$ or $a-y=1$. That means either $y=a$ or $y=a-1$, and at most one of these will be in the interval. So then, four relevant regions:
Nothing particular to do with probability; that's just how we work with integrals of piecewise defined functions.