Could someone help me to derive/understand how we can derive $E[X^2]-E[X]^2$ from $E[(X-E(X))^2]$ in the variance formula of a random variable $X$?

I am writing the formula below:


  • 2
    $\begingroup$ What is your particular difficulty? Can you expand the square in $E[(X-E(X))^2]$? $\endgroup$ Oct 30, 2022 at 10:33
  • $\begingroup$ I think many introductory statistics or probability theory textbooks (and lecture notes) derive the equivalence between the two expressions. You just need to find one to look it up. $\endgroup$ Oct 30, 2022 at 12:37
  • $\begingroup$ The answer that I was looking for was solved below, but thank you very much for your comments! $\endgroup$
    – Sera
    Oct 30, 2022 at 19:17

1 Answer 1



We FOIL the quadratic,

$$E[X^2 -2XE[X]+(E[X])^2]$$

We apply the expectation to each term,

$$E[X^2] -2E[XE[X]]+(E[X])^2$$

In the middle piece, $E[X]$ is a constant number that can be brought out of the expectation.

$$E[X^2] -2E[X]E[X]+(E[X])^2$$

We have that $E[X]E[X]=(E[X])^2$

$$E[X^2] -2(E[X])^2+(E[X])^2$$

We are done, $$E[X^2] -(E[X])^2$$

  • 1
    $\begingroup$ Thank you very much, that's exactly what I was looking for!! $\endgroup$
    – Sera
    Oct 30, 2022 at 19:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.