Solution (source code)

= Solution

Multiplying the <beta distribution> density by $x$ gives a constant multiple of the normalized density with parameters $(p+1,q)$:
$$
x f_{p,q}(x)=\frac p{p+q}f_{p+1,q}(x).
$$
Integrating and using the fact that the latter <probability density function> integrates to one gives
$$
\boxed{\mathbb E[X]=\frac p{p+q}.}
$$
This is a normalization-ratio argument, requiring no explicit integration of the polynomial density.