# $\lim \limits_{r \to 1} \frac{k - \frac{N(1-r^k)}{1-r^N}}{r-1} = -\frac{1}{2}k(k-N)$

$$\lim_{r\to 1} \frac{k-\frac{N(1-r^k)}{1-r^N}}{r-1}=-\frac{1}{2}k(k-N)$$

I've found this limit to be tricky. Everytime I take the derivative to apply l'Hopital's rule I get an indeterminant fraction again. But yet the symbolic solver says the limit exists.

• There is a typo in your title, it should be $\frac12 k(N-k)$. – user Aug 6 at 16:47
• need the following two identities to complete: $1-r^n = (1-r)\left(\sum \limits_{i=0}^{n-1}(r^i)\right)$ and $\sum \limits_{n=1}^{N-1} n = \frac{1}{2}N(N-1)$ – pico Aug 6 at 22:28
• Yes these are both true, aren’t you familiar with that? – user Aug 6 at 22:38
• Refer also to en.m.wikipedia.org/wiki/1_%2B_2_%2B_3_%2B_4_%2B_ – user Aug 6 at 22:47

## 2 Answers

We have

$$\frac{k - \frac{N(1-r^k)}{1-r^N}}{r-1}=\frac{ k(1-r)(1+r+\ldots+r^{N-1}) - N(1-r)(1+r+\ldots+r^{k-1) } }{(r-1)(1-r^N)}=$$

$$=\frac{k(1+r+\ldots+r^{N-1})-N(1+r+\ldots+r^{k-1})}{r^N-1}=$$

and by l'Hopital

$$\frac{k(1+2r+\ldots+(N-1)r^{N-2})-N(1+2r+\ldots+(k-1)r^{k-2})}{Nr^{N-1}}$$

$$\to \frac{k\frac{N(N-1)}{2}-N\frac{k(k-1)}{2}}{N}=\frac12\left(kN-k-k^2+k\right)=\frac12k(N-k)$$

Using standard notation for divided differences, we have

\begin{align} \frac{ f'(1) \left(g(r) - g(1)\right) - g'(1)\left(f(r) - f(1)\right)}{ (r - 1)\left(g(r) - g(1)\right)} &= \frac{ f'(1)g[r,1,1]-g'(1)f[r,1,1] }{ g[r,1]} \\ \lim_{r\to 1} \frac{ f'(1) \left(g(r) - g(1)\right) - g'(1)\left(f(r) - f(1)\right)}{ (r - 1)\left(g(r) - g(1)\right)} &= \frac{f'(1)g''(1)-g'(1)f''(1) }{2 g'(1)} \\ \lim_{r\to 1} \frac{ k \left(r^N-1\right) - N\left(r^k -1\right)}{ (r - 1)\left(r^N-1\right)} &= \frac{kN(N-1)-Nk(k-1)}{2N}\text{,} \end{align}

and therefore

$$\lim_{r\to 1} \frac{ k \left(r^N-1\right) - N\left(r^k -1\right)}{ (r - 1)\left(r^N-1\right)} = \frac{k(N-k)}{2}\text{.}$$

• @pico: the equalities are correct as I have written them. To understand where the $r-1$ in the denominator "went", think through what $f[r,1,1]$ and $g[r,1,1]$ in the first equality mean, and consider how the left side can be rearranged to make $f[r,1,1]$ and $g[r,1,1]$ appear. – K B Dave Aug 6 at 17:11