The proof in my book starts off by stating:
$Var(X) = E(X^2) - E(X)^2 = E(X(X-1)) + E(X) - E(X)^2$ and proceeds to evaluate those individual terms.
I'm failing to understand $E(X^2) = E(X(X-1)) + E(X)$
I know that $E(X^2) = \sum_{i=1}^n E(X_i) + \sum_{i \neq j} E(X_iX_j)$ for indicator random variaables, but I have not seen the above notation.
\begin{align} E(X^2) &= E(X^2-X+X) \\ &=E(X^2-X)+E(X) \\ &=E(X(X-1))+E(X) \end{align}