Quantile expectation formula (source code)

= Quantile expectation formula
{title2=$\mathbb EX=\int_0^1F^\leftarrow(u)\,du$}

For an integrable real random variable with distribution function $F$, the generalized inverse $F^\leftarrow(u)=\inf\{x:F(x)\geq u\}$ sends a uniform random variable on $(0,1)$ to the distribution $F$. This follows from $F^\leftarrow(u)\leq x$ if and only if $u\leq F(x)$. Equality of laws proves both the expectation formula and absolute integrability of the quantile. Atoms and flat pieces of $F$ cause no problem.