Assuming $X$ and $Y$ are i.i.d. random variables let $Z = X + Y$ $$ f_X(x) = \begin{cases} \lambda e^{- \lambda x} & x \gt 0 \\ 0 & \text{else} \end{cases} $$
$$ f_Y(y) = \begin{cases} \mu e^{- \mu x} & x \gt 0 \\ 0 & \text{else} \end{cases} $$
Find the density $f_z$ of $Z$.
I have attempted to use convolution with indicator functions, but am yet to get the right answer.
$$ f_X(x) * f_Y(y) = \int_{-\infty}^{\infty} f_X(x)f_Y(z-x) dx \\ = \int_{0}^{\infty} \lambda e^{- \lambda x} 1_{[x \gt 0]} \mu e^{- \mu (z-x)} 1_{[z-x \gt 0]} dx \\ $$ since $z-x \gt 0$ can be written as $z \gt x$ I believe the product of the two indicator functions should be $\text{max}\{0, z\}$, but this is where I become uncertain as I think that would make the integral:
$$ = \lambda \mu e^{-\mu z} \int_{\text{max}\{0,z\}}^{\infty} e^{- \lambda x} e^{\mu x} dx \\ $$
Intuitively, I feel I have messed up as the integral from z to infinity is contained in both the solutions for $z \gt 0$ and $z \lt 0$. More concretely I know I have messed up as evaluating the integral leaves me with:
$$ \begin{cases} \mu \lambda e^{- \mu z } \left[ e^{-x(\lambda - \mu)} \right]_z^\infty & z \gt 0 \\ \mu \lambda e^{- \mu z } \left[ e^{-x(\lambda - \mu)} \right]_0^\infty & z \lt 0 \end {cases} $$
$$ = \begin{cases} \frac{\mu \lambda}{\lambda - \mu} e^{- \lambda z } & z \gt 0 \\ \frac{\mu \lambda}{\lambda - \mu} e^{- \mu z } & z \lt 0 \end {cases} $$ which does not agree with the solution listed in the book I am studying with:
$$ f_Z(x) = \begin{cases} \frac{\mu \lambda}{\mu + \lambda} e^{\lambda x} & x \lt 0 \\ \frac{\mu \lambda}{\mu + \lambda} e^{- \mu x} & x \ge 0 \end{cases} $$
This solution really confuses me, as I do not understand how the convolution of two functions that are strictly equal to 0 when $x \lt 0$ could be a function that has non zero values for $x \lt 0$.
Does anyone have any suggestions on how to fix the integral or intuition on why this convolution works the way it does?
Obviously, the pdf of $Z$ is zero for $Z<0$. Also, since $Z=X+Y$, for any given value of $Z=z$, $X\le z$. Thus, the upper limit of the integral is $z$, not $\infty$. So the pdf of $Z$ for $Z\geq 0$ is
$f_Z(z)=fX(x)∗fY(y)=\int_0^\infty f_X(x)f_Y(z−x)dx=\int_0^z λe^{−λx}μe^{−μ(z−x)}dx$,
that is,
$f_Z(z)=λμe^{-μz}\int_0^z e^{-(λ-μ)x} dx$.
The rest derivation is straightforward. Simply remember to deal with two cases separately, that is, Case I: if $λ = μ$, and Case II: if $λ \neq μ$.