Expected value of the gamma distribution I am sure this has been asked before in someway but anyways I need some help with this I have:
\begin{align*}
E[x] & = \int_{0}^{\infty} x \frac{x^{\alpha-1}e^{-x/\beta}}{\beta^\alpha \Gamma(\alpha)}dx\\
&= \frac{1}{\beta^{\alpha}\Gamma(\alpha)}\int_{0}^{\infty}x x^{\alpha-1}e^{-x/\beta}dx\\
&= \frac{1}{\beta^{\alpha}\Gamma(\alpha)}\int_{0}^{\infty} x^{\alpha}e^{-x/\beta}dx
\end{align*}
where do I go from here?
 A: \begin{align}
& \frac 1 {\beta^\alpha\Gamma(\alpha)} \int_0^\infty x^\alpha e^{-x/\beta} \,dx \\[10pt]
= {} & \frac 1 {\beta^\alpha\Gamma(\alpha)} \cdot \beta^{\alpha+1} \int_0^\infty \left( \frac x \beta \right)^\alpha e^{-x/\beta} \, \left( \frac{dx}\beta \right) \\[10pt]
= {} & \frac {\beta^{\alpha+1}} {\beta^\alpha\Gamma(\alpha)} \int_0^\infty u^\alpha e^{-u} \, du \\[10pt]
= {} & \frac \beta {\Gamma(\alpha)} \cdot \Gamma(\alpha+1) \\[10pt]
= {} & \beta\alpha.
\end{align}
A: You already know that the integral of a gamma density over its support is equal to $1$, because it is a PDF:  $$\int_{x=0}^\infty \frac{x^{\alpha-1} e^{-x/\beta}}{\beta^\alpha \Gamma(\alpha)} \, dx = 1,$$ and this is true for any choice of parameters $\alpha, \beta > 0$.  So when you multiply the PDF by $x$, we get:  $$x f_X(x) = \frac{x^\alpha e^{-x/\beta}}{\beta^\alpha \Gamma(\alpha)},$$ which suggests that we should consider $\alpha^* = \alpha + 1$, and write $$x f_X(x) = \frac{x^{\alpha^* - 1} e^{-x/\beta}}{\beta^{\alpha^* - 1} \Gamma(\alpha^* - 1)} = \alpha \beta \cdot \frac{x^{\alpha^* - 1} e^{-x/\beta}}{\beta^{\alpha^*} \Gamma(\alpha^*)}.$$  Now we see that the integral of this is $\alpha \beta$ times the PDF of a gamma density with parameters $\alpha^*$ and $\beta$, therefore the result is $\alpha\beta$.
Note that you can repeat this trick as many times as you like, and you'll get all the raw moments of $X$:  $$\operatorname{E}[X^k] = \frac{\Gamma(\alpha+k)}{\Gamma(\alpha)} \beta^k,$$ and when $k$ is a positive integer, this is $$\alpha(\alpha+1)\cdots(\alpha+k-1)\beta^k.$$
