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$.