Probability density function of $W = X + Y$ where $X \sim \mathrm{Unif}[0,1]$ and $Y \sim \mathrm{Exp}(\lambda)$ are independent random variables? This is the question that I was given:

And this was the provided solution:

I can't seem to make sense of it - firstly, what exactly is the question asking you to do? How did they know to divide the range of $w$ in that way? And why did they use those particular limits for the integrals?
 A: $X$ can take values in $[0,1]$, and $Y$ in $[0,\infty)$, and so $W=X+Y$ can take values in $[0,\infty)$.  But if $W<1$, then there are limitations on the value that $X$ can take.  For example, if $W=0.5$, how could $X>0.5$ when $Y$ cannot be less than zero?  This is precisely what Case 1 is saying: when $W<1$, then $X<W$ as well.  But if $W>1$, then all values of $X$ in its range $[0,1]$ are permissible.  So the convolution is taken by integrating over the permissible ranges of $X$ as defined by the cases.  Finally, the question is asking you to find the complete density function, which can only be found in cases conditioned on the value of $W$.
A: The point is that both random values $X$ and $Y$ yield only positive values. Thus, $X+Y = w$ requires that $X$ yields a value $\geq w$, because otherwise the sum will surely be larger than $w$. 
Note though that the convolution formula deals with that correctly - you just have to be carefull when computing the integral. Let $$
  f_W(w) = \int_0^1 f_X(x)f_Y(w-x) \,dx  \text{.}
$$
unconditionally. Then watch what happens if you evaluate $f_W(\omega)$ with $\omega < 1$. Once $x$ reaches $\omega$, $\omega-x$ becomes zero, and negative afterwards. You thus evaluate $f_Y$ for negative arguments, where its simply zero. But if you aren't carefull, you might have simply replaced $f_Y(w-x)$ with $\lambda e^{-\lambda(w-x)}$, and that function isn't zero for $x > w$!
So all that happens here is that your densities are defined piecewise, i.e. for different ranges of arguments they're represented by different algebraic expressions. When computing the integral, you have to take that into account.
A: A tip: draw a plot of $X$ against $Y$ to find the domain of $W$. Then you will find that you cannot do the integration with only one integral; you need to divide it into two. Since $Y=W-X$, it looks like this:

As you can see, there is a triangle and then an infinite rectangle. The situation is different depending on which one you are considering. The rationale is this: you know that $y \in [0, \infty)$ and that $x\in[0, 1]$. Hence, $w\in[0, \infty)$. Thus, the limits are:
$$
0<x<w, \quad \text{for } w<1\\
0<x<1, \quad \text{for } w>1
$$
Say that $w=0.6$. Then, obviously, $x$ cannot be 0.7 for example. If $w=14$, then $x$ can be anything in its support, that is on the interval 0 to 1.
