Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
$\begingroup$What is the problem you are facing when trying to go through the summation for $EX^2$? Would you please explain so that the community could provide you with a good answer? (...the answer below gives all you need to knock this off)$\endgroup$
$\begingroup$Don't use the formula: you know the variance of $X$, so once you have $E[X]$ all you need to is add its square to the variance to obtain $E[X^2].$$\endgroup$
This is a common exercise many of the textbooks would provide. There is not much to tell here but the approach to ease the derivation is to use the fact that ${n\choose
x}=\frac nx \cdot\frac{n-1}{x-1}{{n-2}\choose{x-2}}$ and writing $x^2=x(x-1) +x$ to utilize the former. You only need to incorporate them in $\mathbb EX^2.$