# Prove variance in Uniform distribution (continuous)

I read in wikipedia article, variance is $\frac{1}{12}(b-a)^2$ , can anyone prove or show how can I derive this?

## 2 Answers

By the definition of the variance, $\operatorname{Var} X = \mathbb{E}[X^2] - (\mathbb{E} X)^2$.

Since here $\mathbb{E} X = \frac{1}{b-a}\int_{[a,b]}x dx = \frac{a+b}{2}$, and $\mathbb{E} X^2 = \frac{1}{b-a}\int_{[a,b]}x^2 dx = \frac{b^3-a^3}{3(b-a)}=\frac{a^2+ab+b^2}{3}$, it follows that $$\operatorname{Var} X = \frac{a^2+ab+b^2}{3} - \frac{a^2+2ab+b^2}{4} = \frac{a^2-2ab+b^2}{12} =\frac{(b-a)^2}{12}$$

Let $U$ uniform on $[-1,1]$. Then $X = \frac{a+b}2 + \frac{b-a}2 U$ (in law) and $$Var\ X = \frac{(b-a)^2}4 Var\ U\\ Var \ U = EU^2 =\frac 12 \int_{-1}^1x^2dx = \int_{0}^1x^2dx = \frac 13\\ Var\ X = \frac{(b-a)^2}{12}$$

• silly mistake... – mookid Mar 26 '14 at 19:58
• What is justification for EU^2 = (1/2)Integ(-1,1)x^2dx The limits were changed from (-1/2,1/2) to (1,1) and a multiplier of (1/2) put in front of the whole thing? That is not clear. – StephenBoesch Aug 15 '15 at 16:47