Let $X$ have a uniform distribution on $(0, a)$ and let $Y$ be independent of $X$ with a uniform distribution $(0, b)$. Let's say that $b$ is greater than $a$.
Q. How can I determined the distribution of $S=X+Y$?
I'm trying to solve this, but I'm having trouble on how to handle the integral limits. I'm not really understanding how to build this problem properly.
First of all, we know that the pdf of $X$ and $Y$ are respectively: $$ f_x(x)=\frac{1}{a}I_{(0,a)}(x) \quad f_y(y)=\frac{1}{b}I_{(0,b)}(y) $$ We want to know the pdf of $S = X + Y$. By using convolution, we get: $$ f_s(s)=\int f_x(s-y)f_y(y)dy $$
Now, we have 3 cases:
$$ f_s(s)=\int_0^s \frac{1}{ab}dy = \frac{s}{ab} $$
$$ f_s(s)=\int_{s-a}^s \frac{1}{ab}dy = \frac{1}{b} $$
$$ f_s(s)=\int_{s-a}^b \frac{1}{ab}dy = \frac{1}{ab}(b+a-s) $$
In order to help visualing these cases:
Therefore, the pdf is: $$ f_s(s) = \frac{s}{ab} I_{(0,a)}(s) + \frac{1}{b} I_{(a,b)}(s) + \frac{1}{ab}(b+a-s) I_{(b,a+b)}(s) $$