1. Proving variance formula

How does one prove the formula: var(X) = E(X2) − E2(X)?

Thanks!

2. $\displaystyle V(X) = E(X-\mu)^2 = E(X^2 - 2 \mu X + \mu^2)$

$= E(X^2) - 2 \mu E(X) + E(\mu^{2})$

$= E(X^2) - 2 \mu^{2} + \mu^{2} = E(X^2) - \mu^{2}$