Beta distribution, find the general expression for $E(X^{r}(1-X)^{s})$. I have the following question given to me about the beta distribution. I have been stuck on this one for hours now. 
Let $X$ have a beta distribution with parameters $\alpha$ and $\beta$, let $r$ and $s$ be given positive numbers.
Find the general expression for $E(X^{r}(1-X)^{s})$.
Beta distribution form I have been using is:
$$\frac{\Gamma (\alpha +\beta )}{\Gamma (\alpha )\Gamma (\beta )}x^{\alpha -1}(1-x)^{\beta -1}\qquad\alpha >0, \beta >0$$
$x$ is between $0$ and $1$.
 A: This is essentially an exercise in integration. If $X$ has a Beta($\alpha$,$\beta$) distribution then the expected value you're trying to calculate can be written as: 
$$ \int_{0}^{1} x^r (1-x)^s \frac{\Gamma (\alpha +\beta )}{\Gamma (\alpha )\Gamma (\beta )}x^{\alpha -1}(1-x)^{\beta -1} dx = \int_{0}^{1}\frac{\Gamma (\alpha +\beta )}{\Gamma (\alpha )\Gamma (\beta )}x^{r+\alpha -1}(1-x)^{s+\beta -1} dx $$
The trick is to multiply by constants so that the integrand is another beta density, which we know integrates to 1. The constants required will all be $\Gamma$ functions: 
$$ E(X^r (1-X)^s ) = \frac{\Gamma (\alpha +\beta )}{\Gamma (\alpha )\Gamma (\beta )} \cdot \frac{\Gamma (\alpha+r )\Gamma (\beta+s )}{\Gamma (\alpha +\beta+r+s )}\int_{0}^{1} \underbrace{\frac{\Gamma (\alpha +\beta+r+s )}{\Gamma (\alpha+r )\Gamma (\beta+s )} x^{r+\alpha -1}(1-x)^{s+\beta -1}}_{{\rm Beta}(\alpha+r, \beta+s) \ \ {\rm density}}dx $$
So the integral equals 1, since it's a probability density. Therefore, 
$$ E(X^r (1-X)^s ) = \frac{\Gamma (\alpha +\beta )}{\Gamma (\alpha )\Gamma (\beta )} \cdot \frac{\Gamma (\alpha+r )\Gamma (\beta+s )}{\Gamma (\alpha +\beta+r+s )} $$
I hope this helps!
