Variance of Continuous Uniform Distribution

Theorem
Let $X \sim \operatorname U \left[{a \,.\,.\, b}\right]$ for some $a, b \in \R$, $a \ne b$, where $\operatorname U$ is the continuous uniform distribution.

Then:


 * $\operatorname{var} \left({X}\right) = \dfrac {\left({b - a}\right)^2} {12}$

Proof
From the definition of the continuous uniform distribution, $X$ has probability density function:


 * $\displaystyle f_X \left({x}\right) = \begin{cases} \frac 1 {b - a} & a \le x \le b \\ 0 & \text{otherwise} \end{cases}$

From Variance as Expectation of Square minus Square of Expectation:


 * $\displaystyle \operatorname{var} \left({X}\right) = \int_{-\infty}^\infty x^2 f_X \left({x}\right) \rd x - \left({\mathbb E \left[{X}\right]}\right)^2$

So:

Also see

 * Variance of Discrete Uniform Distribution