Find the PDF of the sum of X and Y if the two random variables are independent random variables with the common PDF
\,\displaystyle f_X\left (u\right )=f_Y\left (u\right )= \begin{cases}\frac{1}{4} & 0<u<4 \\ 0 & \text { otherwise }\end{cases}The limits of integration of the PDF of U=X+Y can be computed with the aid of Figure 6.4. When 0 \leq u \leq 4 (see Figure 6.4(a) where f _Y(u-x) is shown in dashed lines), we have that
\,\displaystyle f_U\left (u\right )=\int_{y=-\infty}^{\infty} f_X\left (u-y\right ) f_Y\left (y\right ) d y=\int_{y=0}^u \frac{1}{16} d y=\frac{u}{16}
For \,\displaystyle 4<u<8 (see Figure 6.4(b)), we obtain
\,\displaystyle f_U\left (u\right )=\frac{1}{16} \int_{u-4}^4 d y=\frac{8-u}{16}Thus
\,\displaystyle f_U\left (u\right )= \begin{cases}\frac{u}{16} & 0 \leq u<4 \\ \frac{8-u}{16} & 4 \leq u<8 \\ 0 & \text { otherwise }\end{cases}
The PDF of U is illustrated in Figure 6.5.