I know that the easy way to evaluate the mean and variance of the Binomial distribution is by considering it as a sum of Bernoulli distributions.
However, I was wondering just for fun if there is a way to evaluate them directly. I got the mean easily: it only involves some fiddling around with the binomial coefficient to absorb the 'extra' $k$ in the summation, followed by a direct application of the binomial theorem. However, in the process of evaluating the variance I need to compute a sum of the form:
$$ \sum\limits_{k=0}^{n}k^2 \binom{n}{k} r^k $$
The extra $k$ in the sum now doesn't let me apply my previous trick. Wolfram Alpha has no problem evaluating this sum, but it won't give me a step-by-step solution. Any leads would be appreciated.
The differentiation method is good, but you can if you want extend your method* of fiddling around with the binomial coefficient: $$\eqalign{ \sum_{k=0}^{n}k(k-1) \binom{n}{k} r^k &=\sum_{k=0}^n k(k-1)\frac{n!}{k!\,(n-k)!}r^k\cr &=\sum_{k=2}^n n(n-1)\frac{(n-2)!}{(k-2)!\,(n-k)!}r^k\cr &=n(n-1)\sum_{m=0}^{n-2}\binom{n-2}{m}r^{m+2}\cr &=n(n-1)r^2(1+r)^{n-2}\cr}$$ and now add the formula you have already for $$\sum_{k=0}^nk\binom nk r^k\ .$$