Gamma and Beta function proof 
The Beta function is defined by the integral
$$B(\alpha,\beta)=\int_0^1x^{\alpha-1}(1-x)^{\beta-1}\,{\rm d}x~~~~(\operatorname{Re}\alpha,\operatorname{Re}\beta>0)$$
By evaluating $\int_0^\infty\int_0^\infty x^{\alpha-1}e^{-x}y^{\beta-1}e^{-y}\,{\rm d}x\,{\rm d}y$ in two different ways, show that
$$\Gamma(a)\Gamma(\beta)=\Gamma(\alpha+\beta)B(\alpha,\beta)$$

i have a proof of the relation between the gamma function and beta function but after you substitute the first time and swap the integrals why does the function become $x^{\alpha+\beta-1}$ after combinging $x^{\alpha-1}$ and $x^{\beta-1}$ shouldnt it be $x^{\alpha+\beta-2}$?
$$\begin{align*}
\Gamma(\alpha)\Gamma(\beta)&=\int_0^\infty x^{\color{blue}{\alpha-1}}e^{-x}\left(\int_0^\infty y^{\color{blue}{\beta-1}}e^{-y}\,{\rm d}y\right)\,{\rm d}x\\
&=\int_0^\infty x^{\color{blue}{\alpha+\beta-1}}e^{-x}\left(\int_0^\infty t^{\beta-1}e^{-tx}\,{\rm d}y\right)\,{\rm d}x&&(\text{put } y=tx)\\
&=\int_0^\infty t^{\beta-1}\left(\int_0^\infty x^{\alpha+\beta-1}e^{-(t+1)x}\,{\rm d}x\right)\,{\rm d}t\\
&=\int_0^\infty\frac{t^{\beta-1}}{(1+t)^{\alpha+\beta}}\left(\int_0^\infty u^{\alpha+\beta-1}e^{-u}\,{\rm d}u\right)\,{\rm d}t&&\left(\text{put }x=\frac u{1+t}\right)\\
&=\Gamma(\alpha+\beta)\int_0^\infty\frac{t^{\beta-1}}{(1+t)^{\alpha+\beta}}\,{\rm d}t
\end{align*}$$
 A: Let's examine the crucial line in more detail. The substitution $y=tx$ gives
$$\int_0^\infty y^{\beta-1}e^{-y}\,{\rm d}y\stackrel{y=tx}=\int_0^\infty(tx)^{\beta-1}e^{-tx}\color{red}{x}\,{\rm d}t=x^{\beta}\int_0^\infty t^{\beta-1}e^{-tx}\,{\rm d}t$$
As you can see, we have $x^{\beta-1}\cdot x=x^\beta$ from where the additional $-1$ disappears. That's all.
A: I think it's easier if you do it using a story rather than doing complicated integrals.
Imagine two Gamma distributions $X \sim Gamma(a, \lambda)$ and $Y \sim Gamma(b, \lambda)$.
Using these two, compute the joint $f_{T,W}(t,w)$ distribution of:
$T = X + Y$ and $W = \frac{X}{X+Y}$.
As a story, imagine two clerks, working at a bank, both working at the same rate $\lambda$. T is the total wait time for a person that has to deal with both clerks, while W is the fraction the person waits for the first clerk.
Out of the joint distribution, it's going to be clear that this is the product of two indepdendent distributions, one which is $Beta$.
This is also much easier to remember.
