The formula for $\sum_k kx^k$ and the likes of it has been asked a considerable number of dozens of times on this site. Search for it.
– May 22 '17 at 16:09
You know that $\sum_{k=0}^\infty(1-p)^{k}=\frac{1}{p}$. Consider differentiating both sides in $p$.
– Alex R.May 22 '17 at 16:10