[Math] Sum of two uniform independent random variables

convolutionprobability

I would like to find the cdf of $Z=X_1+X_2$, with $X_1\sim U(0,1) $, $X_2\sim U(0,2)$

I always prefer to find the cdf instead of the pdf with convolution, and this time I am having troubles with the last part of the cdf.

I split the cdf $F_Z(a)$ in 3 cases and I found:

$\frac{a^2}{2}-\frac{a^2}{4}\quad 0<a\le 1$

$\frac{a}{2}-\frac{1}{4}\, \quad 1<a\le 2$

$\frac{a}{2}-\frac{a^2}{4}+\frac{3}{4}\quad2<a\le 3$

I am omitting the part for $a\le0$ and $a>3$, but I don't know what to do with the last part of the cdf, I did this:

$\int_{a-2}^1F_{X_2}(a-x_1)dx_1$

I am fully convinced of the boundaries of integration of $X_1$, yet I can't get the correct answer for the last part of the cdf in that way. Any help would be greatly appreciated.

Best Answer

I, too, feel it is easier to write the PDF or the CDF by inspection from the graph, but if you wish to stick with convolution for the CDF, your problem is that you are missing a term that represents the cases where $0 \leq X_1 \leq a-2$, and then $X_2$ can be anything (that is, it is certain that the sum is less than $a$, no matter the value of $X_2$). That is, the proper expression is

$$ F_Z(a) = \int_{x_1=a-2}^1 F_{X_2}(a-x_1) \, dx_1 \color{red}{ + \int_{x_1=0}^{a-2} \, dx_1} \qquad 2 \leq a \leq 3 $$

I think if you carry out that integration, you will get the proper answer of

$$ F_Z(a) = -\frac{a^2}{4} + \frac{3a}{2} - \frac{5}{4} \qquad 2 \leq a \leq 3 $$