What is the sum of $\sum\limits_{i=1}^{n}ip^i$?
Solution 1:
Start with $f(p)=\sum_{i=1}^n p^i=\frac {p(p^n-1)}{p-1}$
your answer is $\ pf'(p)$ (compute it both ways...)
Solution 2:
$$\sum_{k=1}^n kp^k=\frac{p(np^{n+1}-(n+1)p^n+1)}{(p-1)^2}\tag{*}$$
Proof by induction:
- $n=1$: $ p=\frac{p(p^{1+1}-(1+1)p^1+1)}{(p-1)^2}=\frac{p(p^{2}-2p+1)}{(p-1)^2}=p$
- $$ \begin{eqnarray} (n+1)p^{n+1}+\sum_{k=1}^n kp^k&=&(n+1)p^{n+1} + \frac{p(np^{n+1}-(n+1)p^n+1)}{(p-1)^2}\\ &=&\frac{(n+1)p^{n+1}(p^2-2p+1)}{(p-1)^2} + \frac{p(np^{n+1}-(n+1)p^n+1)}{(p-1)^2}\\ &=&\frac{np^{n+3}+p^{n+3}-np^{n+2}-2p^{n+2}+p}{(p-1)^2}\\ &=&\frac{p((n+1)p^{n+2}-(n+1+1)p^{n+1}+1)}{(p-1)^2}\\ &=&\sum_{k=1}^{n+1} kp^k \end{eqnarray} $$
If $p=1$, we expect $\sum_{k=1}^n k\cdot 1^k= \frac12 n(n+1)$: Since the RHS of $(*)$ gives $\frac00$, when we insert $p=1$, we apply L'Hospital's rule two times: $$ \lim_{p\to 1} \frac{p(np^{n+1}-(n+1)p^n+1)}{(p-1)^2} =\lim_{p\to 1} \frac{n(n+2)p^{n+1}-(n+1)^2p^{n}+1}{2(p-1)}\\ =\frac12 \lim_{p\to 1} (n(n+1)(n+2)p^{n}-n(n+1)^2p^{n-1})\\ =\frac12 n(n+1) \underbrace{\lim_{p\to 1} p^{n-1}((n+2)p-(n+1))}_{=1}\\ $$ If $n\to \infty$, the series converges due to ratio test ($\lim_{n\to \infty}\left|\frac{(k+1)}{k}p\right|<1$), when $|p|<1$. You'll get $$ \sum\limits_{k=1}^\infty kp^k = \frac p{(p-1)^2}+\underbrace{\lim_{n\to \infty} \frac{np^{n+2}-(n+1)p^{n+1}}{(p-1)^2}}_{=0} = \frac p {(p-1)^2} $$