# Integral of $x^h(1-x)^t$

This relates to the problem of calculating the probability of a coin's bias given an observed sequence of flips consisting of h head, and t tail flips. If the coin bias is unknown but known to be uniformly distributed over the interval [0,1], then the expectation for the bias (x) is given by summing the probability function over all possible values of the bias:

$\Bbb E[x] = \int _0^1 x^h (1-x)^t dx$

I believe the result is:

$\Bbb E[x] = \frac{h!t!}{(h+t+1)!}$

But I don't know how to derive that result. I'm trying to use integration of parts and not getting very far.

• Can you use the beta function? Oct 8, 2016 at 20:23
• If $t$ and $h$ are non-negative integers, successive integration by parts does the trick. The proposed solution needs a factorial on the denominator. Oct 8, 2016 at 20:34

Integrate by parts with $u=x^h$ and $v=-\frac1{t+1}(1-x)^{t+1}$.
Repeat until the remaining Integral is $\int_0^1 (1-x)^{t+h}\,dx$
$$\int\limits_{0}^{1} x^{h} (1-x)^{t} \mathrm{d}x = \mathrm{B}(h+1, t+1)$$ where $\mathrm{B}(x,y)$ is the beta function, defined as $$\mathrm{B}(x,y) = \int\limits_{0}^{1} z^{x-1} (1-z)^{y-1} \mathrm{d}z$$ for $\Re x \gt 0$ and $\Re y \gt 0$. Since $h$ and $t$ represent coin flips, our expression in terms of the beta function is valid.