Evaluating $ \lim\limits_{n\to\infty} \sum_{k=1}^{n^2} \frac{n}{n^2+k^2} $

Recall that for any decreasing function $f:\mathbb{R}\to\mathbb{R}$ and any $N>1$ we have $$ \int\limits_1^{N+1}f(x)dx\leq \sum\limits_{k=1}^{N}f(k)\leq \int\limits_0^N f(x)dx $$ After substitutions $N=n^2$, $f(x)=n/(n^2+x^2)$ and simple computations we have $$ \arctan\frac{n^2+1}{n}-\arctan \frac{1}{n}\leq\sum\limits_{k=1}^{n^2}\frac{n}{n^2+k^2}\leq\arctan n $$ Lets take a limit $n\to\infty$, then from sandwich lemma it follows $$ \lim\limits_{n\to\infty}\sum\limits_{k=1}^{n^2}\frac{n}{n^2+k^2}=\frac{\pi}{2} $$

P.S. First solution was not rigor enough.


Hint: $$\int_0^a f(x) dx \approx \sum_{k=0}^{na} \frac{1}{n}f\left(\frac{k}{n}\right)$$ Use $f(x) = \frac{1}{1+x^2}$.

Addendum: Fortunately, $f(x)$ is strictly decreasing, therefore the error is bounded by $\frac{f(0)-f(a)}n$, which again is $<\frac1n$, independent of $a$. This last observation allows us to use $a=n$ without spoiling convergence to $\int_0^\infty f(x) dx$.


Using $x=k/n$ and $\mathrm{d}x=1/n$ $$ S_m(n)=\sum_{k=0}^{mn}\frac{n}{n^2+k^2}=\sum_{k=0}^{mn}\frac{1}{1+(k/n)^2}\frac1{\vphantom{k^2}n}\tag{1} $$ is a Riemann Sum for $$ I_m=\int_0^m\frac{\mathrm{d}x}{1+x^2}\tag{2} $$ For any $m$ and $n$, we have $$ \sum_{k>mn}\frac{n}{n^2+k^2}\le\sum_{k>mn}\frac{n}{k(k-1)}=\frac1m\tag{3} $$ which implies that $$ S_m(n)\le S_\infty(n)=\lim_{m\to\infty}S_m(n)\le S_m(n)+\frac1m\tag{4} $$ Since $$ I_\infty=\lim\limits_{m\to\infty}I_m=\int_0^\infty\frac{\mathrm{d}x}{1+x^2}\tag{5} $$ for any $\epsilon>0$, there is an $m_\epsilon\ge\frac1{\large\epsilon}$ so that for $m\ge m_\epsilon$, $$ I_\infty-\epsilon\le I_m=\lim_{n\to\infty}S_m(n)\le I_\infty\tag{6} $$ Finally, there is an $n_\epsilon\ge m_\epsilon$ so that for $n\ge n_\epsilon$, $$ I_\infty-2\epsilon\le S_{m_\epsilon}(n)\le I_\infty+\epsilon\tag{7} $$ Since $m_\epsilon\ge\frac1{\large\epsilon}$, $(4)$ and $(7)$ yield that for $n\ge n_\epsilon$ $$ I_\infty-3\epsilon\le S_n(n)\le I_\infty+2\epsilon\tag{8} $$ Since $\epsilon$ was arbitrary, we get that $$ \lim_{n\to\infty}S_n(n)=I_\infty\tag{9} $$ which translates to $$ \lim_{n\to\infty}\sum_{k=0}^{n^2}\frac{n}{n^2+k^2}=\int_0^\infty\frac{\mathrm{d}x}{1+x^2}=\frac\pi2\tag{10} $$