# Find the closed-form expression for an expression with finite and infinite sum

I'm trying to find the closed-form expression for the following equation: $$E[D] = \sum_{i=1}^{11}(11-i)(1-p)^{i-1}p + \sum_{i=12}^{\infty}(i-11)(1-p)^{i-1}p$$

My initial thought was to distribute the $$(1-p)^{i-1}p$$ in each sum into the $$(11-i)$$ or $$(i-11)$$, so that we have the following equation: $$E[D]= 11p\sum_{i=1}^{11}(1-p)^{i-1} - p\sum_{i=1}^{11}i(1-p)^{i-1} + p\sum_{i=12}^{\infty}i(1-p)^{i-1} - 11p\sum_{i=12}^{\infty}(1-p)^{i-1}$$ but I'm not sure where to go from here. Can anyone help me figure out how to get rid of the summations?

If you split up the polynomials of order 10, the leftover has the format $$\sum_{i=1}^\infty i(1-p)^{i-1} = 1/p^2$$, the standard binomial expansion:
$$E/p = \sum_{i=1}^{11} (11-i) (1-p)^{i-1} + \sum_{i\ge 12} (i-11)(1-p)^{i-1}$$ $$= -\sum_{i=1}^{11} (i-11) (1-p)^{i-1} + \sum_{i\ge 12} (i-11)(1-p)^{i-1}$$ $$= -2\sum_{i=1}^{11} (i-11) (1-p)^{i-1} + \sum_{i\ge 1} (i-11)(1-p)^{i-1}$$ $$= -2\sum_{i=1}^{11} (i-11) (1-p)^{i-1} + \sum_{i\ge 1} i(1-p)^{i-1} -11 \sum_{i\ge 1} (1-p)^{i-1}$$ $$= -2\sum_{i=1}^{11} (i-11) (1-p)^{i-1} + \frac{1}{p^2} -\frac{11}{p}$$