# Prove that $E[(X - m)^2] = E(X^2) - m^2$

I can't figure out why the statement below is true. I am also confused why the first statement uses square brackets but the second statement uses round brackets. Please advise.

The variance of a random variable tells us something about the spread of the possible values of the variable. For a discrete random variable X, the variance of X is written as Var(X).

$Var(X) = E[(X - m)^2]$ where m is the expected value E(X)

This can also be written as:

$Var(X) = E(X^2) - m^2$

• Just google this! Nov 11 '17 at 9:22
• See the 'Definition' section on the Wikipedia page I have linked, starting from "The expression for the variance can be expanded:" Nov 11 '17 at 9:23
• @Mathemagical got here by googling this! Aug 23 '20 at 21:43

If $m=\mathbb E[X]$, then $$\mathbb E[(X-m)^2]=\mathbb E[X^2]-2\underbrace{\mathbb E[X]}_{=m}m+m^2=\mathbb E[X^2]-2m^2+m^2=\mathbb E[X^2]-m^2.$$
• thanks, I was not aware of the identity $m=\mathbb E[X]$