I'm reading Introduction to Probability Models by Sheldon Ross, 12th edition. On page 57, it says:
It is often important to be able to calculate the distribution of $X + Y$ from the distributions of $X$ and $Y$ when $X$ and $Y$ are independent. Suppose first that $X$ and $Y$ are continuous, $X$ having probability density $f$ and $Y$ having probability density $g$. Then, letting $F_{X+Y}(a)$ be the cumulative distribution function of $X + Y$, we have
$$ F_{X+Y}(a) = P(X + Y \leq a) $$ $$ = \int_{x+y \leq a} f(x) g(y) \, dx \, dy $$ $$ = \int_{-\infty}^{\infty} f(x) \left( \int_{-\infty}^{a - x} g(y) \, dy \right) dx $$ $$ = \int_{-\infty}^{\infty} F_Y(a - x) f(x) \, dx $$
The cumulative distribution function $F_{X+Y}$ is called the convolution of the distributions $F_X$ and $F_Y$ (the cumulative distribution functions of $X$ and $Y$, respectively).
But, we must note that, $X+Y$ is a random variable. I think $X+Y$ is not necessarily continuous. It may be discrete as well. Let $Z=X+Y.$
If $Z$ is continuous then, let's assume that $f_{Z}$ is the probability density function. Under this assumption, we must have, $P\{Z\leq a\}=P\{X+Y\leq a\}=\int_{-\infty}^af_Z(z)dz.$
If $Z$ is discrete then, let's assume that $F_Z$ and $p_z$ is the cumulative distribution function and the probability mass functiom of $Z$ respectively. Under this assumption, we have, $P\{Z\leq a\}=F_Z(a)=\sum_{x\leq a:p(x)>0}p(x).$
But I don't get how do they write the equation,
$$ F_{X+Y}(a) = P(X + Y \leq a) $$ $$ = \int_{x+y \leq a} f(x) g(y) \, dx \, dy $$ $$ = \int_{-\infty}^{\infty} f(x) \left( \int_{-\infty}^{a - x} g(y) \, dy \right) dx $$ $$ = \int_{-\infty}^{\infty} F_Y(a - x) f(x) \, dx $$
Can you please help me understand, how did they write the above equation?