Solution (source code)

= Solution

Multiply the <probability density function> by $x$ and integrate over its <support>:
$$
\begin{aligned}
\mathbb E[X]&=\frac{\Gamma(\alpha+\beta)}{\Gamma(\alpha)\Gamma(\beta)}\int_0^1x^{\alpha}(1-x)^{\beta-1}\,\mathrm dx\\
&=\frac{\Gamma(\alpha+\beta)}{\Gamma(\alpha)\Gamma(\beta)}\frac{\Gamma(\alpha+1)\Gamma(\beta)}{\Gamma(\alpha+\beta+1)}\\
&=\boxed{\frac{\alpha}{\alpha+\beta}}.
\end{aligned}
$$
The middle equality is the <beta function> integral with parameters $\alpha+1$ and $\beta$; the last uses the recurrence for the <gamma function>. Both parameters are positive, so the integral converges. Equivalently, multiplying the <beta distribution> <probability density function> by $x$ converts its kernel to that of a <beta distribution> <probability density function> with its first parameter increased by one.<NIST Digital Library of Mathematical Functions/5.12 Beta Function>[NIST DLMF §5.12, equation 5.12.1]{ref}