Finding the pdf of $f(x,y) = e^{-x-y}$ where $Z = X+Y$ I am having trouble understanding how to find the pdf $f_Z(z)$ when $f_{X,Y}(x,y) = e^{-x-y}, x,y \space \epsilon(0,\infty)$ where $Z = X+Y$ 
My approach is that 
$$x = x, y = z-x$$
so using transformation
$$f_z(z)=f_{X,Y}(x,z-x)|J|$$
where J is the Jacobian.
From this I calculated 
$$f_Z(z) = e^{-z}$$
but it does not seem to be the correct answer...
What did I do wrong?
The Jacobian that I calculated was 
$$
\left |
\begin{matrix}
\frac{\partial x}{\partial x} =1 & \frac{\partial x}{\partial z} =0  \\
\frac{\partial y}{\partial x} =1 & \frac{\partial y}{\partial z} =-1 \\
\end{matrix} 
\right |
= 1
$$
and I am not confident that this is right.
 A: Approach 1: By the joint density of $(X, Y)$, it can be seen that $X, Y$ i.i.d. $\sim \text{Exp(1)}$, therefore $Z = X + Y$ has $\Gamma(2, 1)$ distribution (this is a property of exponential distribution, see this link). 
Approach 2: Calculate the distribution function of $Z$ directly, for $z > 0$:
\begin{align}
& P[Z \leq z] = P[X + Y \leq z] \\
= & \int_0^z\int_0^{z - x} f_{X, Y}(x, y)dy dx \\ 
= & \int_0^z \int_0^{z - x}e^{-x - y}dy dx \\
= & \int_0^z e^{-x}(1 - e^{-(z - x)})dx \\
= & \int_0^ze^{-x}dx - \int_0^z e^{-z}dx \\
= & 1 - e^{-z} - ze^{-z}.
\end{align}
Therefore,
$$f_Z(z) = \frac{dP[Z \leq z]}{dz} = e^{-z} - (e^{-z} - ze^{-z}) = ze^{-z}$$,
which is the density of $\Gamma(2, 1)$ distribution.
Approach 3: This is your attempt. You may not use $x$ in both the pre-transformation and post-transformation versions. It's better to write the transformation as
$$\begin{cases}
W = X \\
Z = X + Y.
\end{cases}$$
The Jacobian then becomes 
\begin{align}\frac{\partial(x, y)}{\partial(w, z)} = & \det\begin{pmatrix}\partial x / \partial w & \partial x / \partial z \\
\partial y / \partial w & \partial y / \partial z 
\end{pmatrix} \\
= & \det\begin{pmatrix} 1 & 0 \\
-1 & 1 
\end{pmatrix} = 1.
\end{align}
Hence the joint density of $(W, Z)$ is $f_{W, Z}(w, z) = e^{-w - (z - w)} \times 1 = e^{-z}, 0 < w < z < \infty$. Finally, do marginalization (pay attention to the integration range of $W$, which probably is the reason you didn't get the correct answer):
\begin{align}
f_Z(z) = \int_0^z e^{-z} dw = ze^{-z}, 0 < z < \infty.
\end{align}
While Approach 1 might be the most expedient, as a general approach, personally I prefer Approach 2 to Approach 3, which is usually more straightforward.
