I want to prove the fact that $\forall$ random variable $X$ the following condition holds: $D\left[X\right] = E\left[X^2\right] - E\left[X\right]^2$.
Where, $D\left[X\right]$ denotes dispersion of random variable $X$ and $E\left[X\right]$ is an Expected value of $X$.
I've tried some calculations, but unfortunately i got stuck at some point:
From the definition $D\left[X\right] = E\left[(X- E\left[X\right])^2\right] = E\left[X^2- 2\cdot X \cdot E\left[X\right] + E\left[X\right]^2\right] = E\left[X^2\right] - 2 \left[X \cdot E\left[X\right]\right] + E\left[E\left[X\right]^2\right]$