# Finding the density function of the sum of two random variables

Let X, Y have joint pdf: $f(x,y) = \frac{1}{2}(x+y)e^{(-x+y)}$ for $0<x<\infty$ and $0<y<\infty$.

Find the probability density function $f_Z(z)$ for the sum $Z = X+Y$ for all $-\infty<z<\infty$.

I am trying to solve it by finding the marginal distributions $f_x(x)$ and $f_y(y)$, then integrating $\int_{-\infty}^{\infty}f_x(z-y)f_ydy$ to get $f_z(z)$. Is this the right approach?

• Your pdf is plainly incorrect in the term $exp(-x+y)$, as this will explode out for large $y$. Presumably you mean $exp[-(x+y)]$ ... – wolfies Dec 5 '13 at 12:40

The joint density lives in the first quadrant, so $Z\gt 0$. Thus we are only interested in the density of $Z$ for $z\gt 0$.
I would travel via the cdf of $Z$. We want the probability that $X+Y\le z$. For that, we want to integrate $(x+y)e^{-(x+y)}$ over the part of the first quadrant below the line $x+y=z$. Because of the shape of the integrand, it is best to use a transformation, $x+y=u$, $y=v$. (It is somewhat more pleasant to find $\Pr(Z\gt z)$.)
Remark: The following informal idea can be turned into a formal argument. The density function $f_Z(z)$, times $dz$, is roughly the probability that $Z$ lies between $z$ and $z+dz$. Looking at the density function, we see this is approximately $ze^{-z} dz$.