Sum of two random variables (distribution) I have a conceptual understanding problem. If we have say random variables $X_1$ and $X_2$ and they are i.i.d. with PDF $f$, and we want to find the distribution of the sum of these variables say, $Y$. Why:


*

*The formula is what I will show, and how does one find a distribution of two random variables combined in general? Or for that matter, n-random variables.

*Why is the second function a function of $y-x_1$? This is my conceptual hurdle.


$$f_Y(y)=\iint f(x_1)f(x_2)\delta (x_1+x_2-y) dx_1 dx_2=\int f(x_1) f(y-x_1) dx_1$$
 A: For any measurable set $G$, an event $\{Y \in G\}$ can be written as
$$\{Y \in G\}=\{X_1+X_2 \in G\}=\{X_1=x, X_2=y-x \text{ for some }x \in \mathbb{R}, y \in G\}.$$
Therefore, by the Fubini theorem, the probability
$$P\{Y \in G\}=\int_\mathbb{R}\int_G f_1(x)f_1(y-x)\,\mathrm{d}y\,\mathrm{d}x=\int_G\int_\mathbb{R} f_1(x)f_1(y-x)\,\mathrm{d}x\,\mathrm{d}y.
$$
In other words, $$P\{Y \in G\}=\int_G f_Y(y)\,\mathrm{d}y$$ for $\displaystyle f_Y(y)=\int_\mathbb{R} f_1(x)f_1(y-x)\,\mathrm{d}x$ and we see that, indeed, $f_Y$ is PDF of $Y$.
A: Suppose the PDFs of two distributions are $f$ and $g$.
The probability that the sum is less than $x$
$$
\iint_{s+t\le x} f(t)\,g(s)\,\mathrm{d}s\,\mathrm{d}t
=\int_{-\infty}^\infty\int_{-\infty}^{x-t} f(t)\,g(s)\,\mathrm{d}s\,\mathrm{d}t
$$
The density is the derivative
$$
\begin{align}
\frac{\mathrm{d}}{\mathrm{d}x}\int_{-\infty}^\infty\int_{-\infty}^{x-t} f(t)\,g(s)\,\mathrm{d}s\,\mathrm{d}t
&=\int_{-\infty}^\infty\frac{\mathrm{d}}{\mathrm{d}x}\int_{-\infty}^{x-t} f(t)\,g(s)\,\mathrm{d}s\,\mathrm{d}t\\
&=\int_{-\infty}^\infty f(t)\,g(x-t)\,\mathrm{d}t
\end{align}
$$
