# Sum of two random variables uniform on (a,b)

There is much information about the probability density function of the sum of two iid variables which are uniform on [0,1]. I am trying to derive a general probability density formula for the sum of two iid variables, $$X_1$$ and $$X_2$$, which are uniform on $$(a,b)$$. For $$Y = X_1 + X_2$$ I was able to obtain the following formula geometrically: $$f_Y(y) = \begin{cases} \frac{y-2a}{(b-a)^2} & \text{for 2a < y < a+b} \\ \frac{2b-y}{(b-a)^2} & \text{for a+b \le y < 2b} \\ 0 & \text{otherwise.} \end{cases}$$

However, I am trying to arrive at this formula using convolution. I know we start with $$f_Y(y)=\int_{-\infty}^\infty f_{X_1}(x)f_{X_2}(y-x)\,dx.$$ Then because $$f_X(x) = 1$$ if $$a\le x\le b$$ we have $$\int_a^b f_{X_2}(y-x)\,dx$$. I don't really understand where I'm supposed to go from here. Any help or explanation is greatly appreciated.

$$f_{X_1}(x) = \dfrac{1}{b-a}$$ when $$a \leq x \leq b$$ and $$0$$ otherwise so your convolution becomes
$$f_Y(y) = \int_a^b f_{X_2}(y-x) \dfrac{1}{b-a} dx$$
Now this is $$0$$ unless $$a \leq y -x \leq b$$ or stated otherwise, when $$y-b \leq x \leq y-a$$ in which case $$f_Y(\cdot) = 1$$. Can you finish it from here?
• I know this is when I need to break the problem up into two cases, one where $2a \lt y \lt a+b$ and one where $a+b \leq y \lt 2b$. In the example referenced, doing this changes the limits of integration but I'm having trouble understanding where the new limits come from. Commented Oct 23, 2018 at 15:09