$f_{X+Y}(t)$ where $X \sim \mathcal U([a,b])$ and $Y \sim \mathcal U([c,d])$

Let $X$ and $Y$ be i.i.d with $X \sim \mathcal U([a,b])$. I want to determine the probability density function of $f_{X+Y}$ and I obtained the following: $f_{X+Y}(t) = ({1 \over b-a})^2 ((b-t) \boldsymbol{1}_{[0 \le t \le b-a]} + (t-a) \boldsymbol{1}_{[a-b \le t \le 0]})$. Is that correct?

I also want to ask if someone has a general form for $f_{X+Y}(t)$ if $X \sim \mathcal U([a,b])$ and $Y \sim \mathcal U([c,d])$.

• The density of the sum can be computed by convolution: $$f_{X+Y}(t) = \int_{-\infty}^\infty f_X(s)f_Y(t-s)\ \mathsf ds$$ where \begin{align} f_X(t) &= \frac1{b-a}\cdot\mathsf 1_{(a,b)}(t)\\ f_Y(t) &= \frac1{d-c}\cdot\mathsf 1_{(c,d)}(t). \end{align} – Math1000 Jul 24 '18 at 3:08