# Expected value of Uniform distribution

Suppose $X$ is an uniform random variable: $X \sim U(a,b)$.

I know how to compute $E(X)$, but what if I want to compute: $E(X^\gamma)$ where $\gamma > 0$?

• If $\gamma$ is integer, you may directly use the mgf, see en.wikipedia.org/wiki/Uniform_distribution_(continuous) Mar 3, 2016 at 16:10
• If this is a home work, you need to show your work, what have you done so far. Mar 3, 2016 at 16:12
• The moment generating function should do the trick. If my interpretation is correct, would the answer be: $E(X^\gamma) = \frac{1}{\gamma+1} \sum_{i=0}^\gamma a^i b^{\gamma-i}$? Mar 3, 2016 at 16:22

By LOTUS, if $f_X (x) = \frac{1}{b-a}$ and $g(X) = x^\gamma$,
$\mathbb{E}[g(X)]= \displaystyle\int_{-\infty}^{\infty}g(x)f(x)\,dx = \frac {1}{b-a}\displaystyle\int_{-\infty}^{\infty} x^\gamma \,dx = \frac {1}{b-a}\displaystyle\int_{a}^{b} x^\gamma \,dx$.
• And since $\gamma > 0$, this would solve to $(b^{\gamma+1} - a^{\gamma+1})/((\gamma+1)(b-a))$. Mar 3, 2016 at 16:48