Variance of Continuous Uniform Distribution

Theorem
Let $X \sim \ContinuousUniform a b$ for some $a, b \in \R$, $a \ne b$, where $\operatorname U$ is the continuous uniform distribution.

Then:


 * $\var X = \dfrac {\paren {b - a}^2} {12}$

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


 * $\map {f_X} x = \begin{cases} \dfrac 1 {b - a} & a \le x \le b \\ 0 & \text{otherwise} \end{cases}$

From Variance as Expectation of Square minus Square of Expectation:


 * $\displaystyle \var X = \int_{-\infty}^\infty x^2 \map {f_X} x \rd x - \paren {\expect X}^2$

So:

Also see

 * Variance of Discrete Uniform Distribution