I'm having some difficulties with working with integrals. I stumbled upon the following exercise in my probability book:
Let $X$ and $Y$ be independent random variables having, respectively, the gamma distribution with parameters $s$ and $\lambda$, and the gamma distribution with parameters $t$ and $\lambda$. Then $Z=X+Y$ has density function
$\begin{aligned} f_Z(z)=&\int_{-\infty}^\infty f_X(x)f_Y(z-x)\,\mathrm{d}x\\ =&\begin{cases}\int_0^zf_X(x)f_Y(z-x)\,\mathrm{d}x&\text{if }z>0,\\ 0&\text{otherwise.} \end{cases} \end{aligned}$
Right, so far so good. But then they plug in the density functions for $X$ and $Y$, and I don't understand how they do the substitution $y=x/z$.
For $z>0$,
$\begin{align}f_Z(z)=\frac{1}{\Gamma (s)\Gamma (t)}\lambda^{s+t}e^{-\lambda z}\int_0^z x^{s-1}(z-x)^{t-1}\,\mathrm{d}x\end{align}$.
Substitue $y=x/z$ in the last integral to obtain
$\begin{align}f_Z(z)=\frac{1}{\Gamma (s)\Gamma (t)}\lambda^{s+t}\left[\int_0^1y^{s-1}(1-y)^{t-1}\,\mathrm{d}y\right]z^{s+t-1}e^{-\lambda z}.\end{align}$
So I have two questions:
1) How did they come up with $y=x/z$?
2) How does this substitution work? Can I just replace all $x$ by $yz$ and that's it? Or should I apply integration by substitution, in the sense of
$\begin{aligned}\int_{\phi(a)}^{\phi(b)}f(x)\,\mathrm{d}x=\int_a^b f(\phi(t))\phi '(t)\,\mathrm{d}t\end{aligned}.$