We have a generating function
$$G(\eta)$$
so $$G(1)=\Sigma_rP(X=r)=1$$ (I get this) and $$G^\prime(1)=\Sigma_rrP(x=r)=E(X)$$ (I also get this) And I understand why: $$G^{\prime\prime}(1)=\Sigma_rr(r-1)P(x=r)$$ But I don't understand/follow this: $$\Sigma_rr(r-1)P(x=r)=E(X(X-1))$$ Could someone tell me why?
By "unconscious" computation, we have the general formula $$E[f(X)] = \sum_r f(r) P(X=r),$$ so with the special case $f(r)=r(r-1)$ we have $$E[X(X-1)] = \sum_r r(r-1) P(X=r).$$