Let $X,Y$ be independent randomly distributed continuous variables with the following PDF
$f_X(x) = \frac{\lambda}{2}e^{-\lambda\mid x \mid}$ for $x \in \mathbb{R}$
$f_Y(y) = \lambda^2ye^{-\lambda y}$
What's the PDF of the sum distribution $Z = X + Y$?
My working:
I've found out that $X \sim Laplace(0,\frac{1}{\lambda})$ and $Y \sim Gamma(2,\frac{1}{\lambda})$.
I'm willing to apply the following formula (which I think is the correct way to go):
$f_Z(z) = \int_\mathbb{R} f_X(x)f_Y(z-x) dx$.
So I calculate $f_X(x)f_Y(z-x)$ (using MATLAB) and I get
$f_X(x)f_Y(z-x) = -\frac{1}{2}(\lambda^3e^{-\lambda\mid x \mid}e^{\lambda(x-z)}(x - z)$.
Now, when I integrate with respect to x, I dont get any sensible results, and I assume that's because I'm not getting the integration limits correctly.
How are the appropiate integration limits found?
long calculations to me (I am not familiar with long calculations) but easy exercise:
Set $Z=X+Y$ and $U=Y$. After verifying that Jacobian is 1, the joint density of $(U,Z)$ is
$$f_{UZ}(u,z)=\frac{\lambda^3}{2}ue^{-\lambda u}e^{-\lambda|z-u|}$$
Now to get $f_Z(z)$ you have to integrate in $du$. To do that observe that:
IF $Z<0$ the expression inside the module is always $<0$ thus
$$f_{UZ}(u,z)=\frac{\lambda^3}{2}e^{\lambda z}\cdot ue^{-2\lambda u}$$
and
$$f_Z(z)=\frac{\lambda^3}{2}e^{\lambda z}\int_0^{\infty} ue^{-2\lambda u}du=\frac{\lambda}{8}e^{\lambda z}$$
IF $Z>0$ you have to integrate accordingly splitting the module...
After some easy but tedious calculations the result is the following:
$$ f_Z(z) = \begin{cases} \frac{\lambda}{8}e^{\lambda z}, & \text{if $z<0$ } \\ \frac{\lambda^3}{4}e^{-\lambda z}\left[z^2+\frac{2\lambda z+1}{2\lambda^2}\right], & \text{if $z\geq 0$ } \end{cases}$$
Just as an example, setting $\lambda=1$ this is the resulting density