# Approximate a series with finite number of terms

How it is possible to approximate:

$$\sum_{i=1}^{NR}{i\cdot \left( \dfrac{1}{1-p} \right)^i}$$

-
Yes, sorry. $p \in [0,1]$ and $NR$ positive integer, bounded to a given value, 10000 for example. –  Claudio Fiandrino May 17 '12 at 8:25

## 1 Answer

Let $x = \dfrac1{1-p}$ and let $n = NR$. Then we are interested in the sum $\displaystyle \sum_{i=1}^{n} i x^i$.

\begin{align} \sum_{i=1}^{n} i x^i & = x \left(\sum_{i=1}^{n} i x^{i-1} \right)\\ & = x \left( \sum_{i=1}^{n} \frac{d x^i}{dx} \right)\\ & = x \frac{d}{dx} \left( \sum_{i=1}^{n} x^i\right)\\ & = x \frac{d}{dx} \left( x\left(\frac{x^n - 1}{x-1} \right) \right)\\ & = x \left( \frac{nx^{n+1} - (n+1)x^n + 1}{(x-1)^2} \right) \end{align}

Replacing $x$ by $\dfrac1{1-p}$ and $n$ by $NR$, we get that the solution is $$\left( \frac{NR}{p} - \frac1{p^2} + \frac1p \right) \left( \dfrac1{1-p}\right)^{NR} + \frac1{p^2} - \frac1p$$

-