# Math Help - Question about variance.

Its a well known fact that

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

but then can you conclude:

Var(X) = E(X^2) - (E(X))^2 = E(X^2) - E( E(X) X ) (because E(X) is a scalar)
= E[X^2 - E(X) X ] = E[ X ( X - E(X) ) ]

by linearity of expectation.

but also Var(X) = E[ (X- E(X))^2 ]

2. It is true that $E[ X ( X - \mu) ]=E(X^2-X\mu)=E(X^2)-\mu^2=V(X)$
It's just like $\sum_{i=1}^n(x_i-\bar x)(y_i-\bar y) =\sum_{i=1}^nx_i(y_i-\bar y)=\sum_{i=1}^n(x_i-\bar x)y_i$