Lagrange theorem in a limit of a summation I need to evaluate
$$\lim_{n\to +\infty} \frac{1}{\ln n} \sum_{k=1}^{n-1} \frac{1}{k}$$
The solution of this problem says that
$$\ln n = \int_{1}^{n} \frac{1}{x} \text{d}x=\sum_{k=1}^{n-1} \int_{k}^{k+1} \frac{1}{x} \text{d}x$$
Then Lagrange's theorem is used to say that
$$\sum_{k=1}^{n-1} \int_{k}^{k+1} \frac{1}{x} \text{d}x=\sum_{k=1}^{n-1} \int_{k}^{k+1} \left[\color{red}{\frac{1}{k}-\frac{x-k}{\xi_k^2}}\right]\text{d}x$$
My problem is how the red part is obtained: I know that Lagrange theorem says, for the function $f(x)=\frac{1}{x}$ in the interval $[k,k+1]$ that exists $\xi_k\in(k,k+1)$ such that
$$-\frac{1}{\xi_k^2}=\frac{\frac{1}{k+1}-\frac{1}{k}}{k+1-k}$$
I've done my calculations but I can't get the red part. Can someone explain me where it comes from?
Thanks.
 A: You shouldn't choose $b = k+1$, you should "let it loose" as $b=x$ within the interval $[k,k+1]$. Then, for some $\xi_k \in (k,x)$, you have by the mean value theorem
$$f'(\xi_k) = -\frac 1 {\xi_k^2} = \frac{f(x)-f(k)}{x-k} = \frac{\frac 1 x - \frac1 k}{x-k}. $$
Alternatively, you could expand the function $f$ at $x_0 = k$ as its Taylor polynomial with Lagrange remainder: for $x \in [k,k+1]$ there exists $\xi_k \in (x_0,x)$ such that
$$\frac 1 x = f(x) = f(x_0) + f'(\xi_k)(x-x_0) = \frac 1 k - \frac{1}{\xi_k^2}(x-k). $$
This is essentially the same solution (Lagrange remainder theorem is a generalization of the mean value theorem), but explains the red term in your question a little bit more directly.
A: $$L=\lim_{n \rightarrow \infty} \frac{1}{\ln n} \sum_{k=1}^{n} \frac{1}{k}=
\lim_{n \rightarrow \infty} \frac{1}{\ln n} \sum_{k=1}^{n} \frac{n}{k} \frac{1}{n} =
\lim_{n \rightarrow \infty}\frac{1}{\ln n}  \int_{1}^n \frac{1}{x} dx$$
$$\implies L=\lim_{n \rightarrow \infty} \frac{\ln n}{\ln n}=1.$$
