Two different variance formulas?

56 Views Asked by At

Here's the general formula for variance:

$$Var(X) = E[(X - E[X])^2]$$

We can algebraically manipulate this $$E[(X - E[X])^2] = E[(X - E[X])(X - E[X])]$$ $$= E[X^2 - 2XE[X] + E[X]^2]$$ $$= E[X^2] - 2E[X]E[X] + E[X]^2$$ $$= E[X^2] - E[X]^2$$

So $Var(X) = E[X^2] - E[X]^2$

My question is could we also use $E[X(X - E[X])]$ to express variance? If so, why?

$$E[X(X - E[X])] = E[X^2 - XE[X]]$$ $$ = E[X^2] - E[X]E[X]$$ $$ = E[X^2] - E[X]^2$$ $$ = Var(X)$$

It seems odd that $E[(X - E[X])(X - E[X])] = E[X(X - E[X])]$ since one of the $X$'s is centered around zero while the other isn't. Can someone please explain this discrepancy to me?