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.
From https://revisionmaths.com/advanced-level-maths-revision/statistics/expectation-and-variance :
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$
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.$$