As part of my statistical mechanics class, I'm trying to go through Kardar's statistical physics of particles and I'm having trouble with this one line:
Consider the sum $X=\displaystyle \sum_{i=1}^N x_i$, where $x_i$ are random variables with a joint PDF of $p(\mathbf{x})$. The PDF of $X$ is:
$p_X(x) = \displaystyle\int d^N\mathbf{x}p(\mathbf{x}) \delta(x-\sum x_i) = \int \prod_{i=1}^{N-1} dx_ip(x_1,\ldots,x_{N-1},x-x_1 - \cdots-x_{N-1})$
My two questions are: why is that first integral the pdf for $X$ and how does that second equality follow?