Alternate computation for variance derivation

28 Views Asked by At

How does the third line follow from the second in the following derivation?

$$ \sigma^2 = E[(X-\mu)^2] = E[X^2-2\mu X + \mu^2] \\ = E(X^2)-2\mu E(X)+\mu^2 \\ = E(X^2)-\mu^2 $$