Evaluate $\lim\limits_{n\to\infty}\sum\limits_{k=1}^{n}\frac{k}{k^2+n^2}$ $$\lim\limits_{n\to\infty}\sum\limits_{k=1}^{n}\frac{k}{k^2+n^2}$$
I got asked this question in a group, and solved it the following way:
$$\lim\limits_{n\to\infty}\left(
\int\limits_1^{n+1}\frac{x}{x^2+n^2}\space dx\leq \sum\limits_{k=1}^{n}\frac{k}{k^2+n^2}\leq \int\limits_1^n \frac{x}{x^2+n^2}\space dx + f(1)\right)
$$
$$\frac{\ln2}{2}\leq \lim\limits_{n\to\infty}\sum\limits_{k=1}^{n}\frac{k}{k^2+n^2}\leq\frac{\ln2}{2}$$
Therefore:
$$\lim\limits_{n\to\infty}\sum\limits_{k=1}^{n}\frac{k}{k^2+n^2} = \frac{\ln2}{2}$$
The guy who asked me the question said that the answer key said $\frac{\ln\left(\frac{5}{2}\right)}{2}$ but also said that it might be incorrect, so I don't have the answer.
What I want to ask is that how come this sum is not equal to $0$? We were able to use the squeeze theorem because the limit for $f(1)$ goes to zero. Every other value after $f(1)$ also goes to $0$ (even faster?) and that had me thinking about how this summation can be equal to such a value.
Can anyone please explain how this happens? And it would be great if you could also verify or correct my solution.
 A: $$S=\lim_{n \to \infty} \frac{k}{n^2+k^2}=\lim_{n \to \infty} \sum_{k=0}^{n}\frac{1}{n} \frac{k/n}{1+(k/n)^2}=\int_{0}^{1}\frac{x}{1+x^2} dx=\frac{1}{2} \ln(1+x^2)|_{0}^{1}$$ $$=\frac{1}{2} \ln 2$$
A: If you write
$$\frac k {k^2+n^2}=\frac k {(k+i n)(k-in)}=\frac i 2 \left(\frac 1 {k+i n}-\frac 1 {k-i n} \right)$$
$$S_n=\sum_{k=1}^n\frac k {k^2+n^2}=\frac{1}{2} \left(H_{(1-i) n}+H_{(1+i) n}-H_{-i n}-H_{i n}\right)$$ Using asymptotics
$$H_p=\gamma+\log (p)+\frac{1}{2 p}-\frac{1}{12
   p^2}+O\left(\frac{1}{p^4}\right)$$
$$S_n=\frac{\log (2)}{2}+\frac{1}{4 n}-\frac{1}{12
   n^2}+O\left(\frac{1}{n^4}\right)$$
Edit
After @achille hui's comment, I consider the most general case of
$$\Sigma=\sum_{k=a n +b}^{c n+d}\frac k {k^2+n^2}$$ Using the same method, I obtained as asymptotics
$$\Sigma=\frac{1}{2} \log \left(\frac{c^2+1}{a^2+1}\right)+\frac{2 \left(a^2+1\right) c d-2 a b \left(c^2+1\right)+(a+c) (a c+1)}{2\left(a^2+1\right) \left(c^2+1\right) n}+O\left(\frac{1}{n^2}\right)$$ and then the limit only depends on $a$ and $c$ (nothing to do with $b$ and $d$ which only define how is approached the limit).
