I am trying to understand the following:
Let $X$ and $Y$ be independent and exponential random variables with parameter $1$, so $f_X(x) =e^{-x} $ and $f_Y(y) =e^{-y} $. Let $Z=X+Y, X<Y$ and $Z=X-Y, X\geq Y$. Determine the pdf of $Z$.
The solution to the exercise first calculates the cdf $F_Z(z)=P(Z\leq z, X<Y)+P(Z\leq z, X\geq Y)$ and then takes its derivative to obtain $f_Z(z)=\frac{e^{-z}}{2}(1+z)$.
This is fine but it is a bit long so I would like to do the exercise by computing the convolution to obtain $f_Z(z)$ directly, so I did: $f_Z(z)=\int_{0}^{z}e^{-x}e^{-(z-x)}dx=ze^{-z}$ for the $X<Y$ part but when doing the $X\geq Y$ part I get $f_Z(z)=\int_{0}^{x}e^{-z-y}e^{-y}dy=\frac{1}{2}(e^{-z}-e^{-z-2x})$ which is wrong.
Could someone please explain to me what I am doing wrong?
Thanks