402. Independent random variables $X$ and $Y$ are given by the probability density functions:

$f_{1}(x)=e^{-x} \quad(0 \leqslant x<\infty), \quad f_{2}(y)=(1 / 2) e^{-y / z} \quad(0 \leqslant y<\infty)$.

Find the composition of these laws, i.e., the probability density function of the random variable $Z=X+Y$.
Solution. Since the possible values of the arguments are non-negative, the formula

$$
g(z)=\int_{0}^{2} f_{1}(x) f_{2}(z-x) d x
$$

is applicable.

Therefore,

$$
g(2)=\int_{0}^{2} \mathrm{e}^{-x}\left[\frac{1}{2} \mathrm{e}^{-(2-x) / 2}\right] \mathrm{d} x
$$

After performing elementary transformations, we get

$$
g(z)=\mathrm{e}^{-z / 2}\left[1-\mathrm{e}^{-z / 2}\right]
$$

Here $z \geqslant 0$, since $Z=X+Y$ and the possible values of $X$ and $Y$ are non-negative.

Thus, $g(z)=e^{-z / 2}\left[1-\mathrm{e}^{-z / 2}\right]$ in the interval $(0, \infty)$, and $\boldsymbol{g}(\boldsymbol{z})=0$ outside this interval.

It is recommended to verify that $\int_{0}^{\infty} g(z) d z=1$ for control.