How do you calculate that $\lim_{n \to \infty} \sum_{k=1}^{n} \frac {n}{n^2+k^2} = \frac{\pi}{4}$?

How do you calculate that: $$\lim_{n \to \infty} \sum_{k=1}^{n} \frac {n}{n^2+k^2} = \frac{\pi}{4}$$ ?
In general I would look for a formula for the expression inside the sigma, and then calculate. But I have no idea what kind of formula there is for this expression. Hint?


\begin{align} \lim_{n\to\infty}\sum_{k=1}^n \frac{n}{n^2+k^2}&=\lim_{n\to\infty}\sum_{k=1}^n\frac{1}{n}\cdot \frac{1}{1+\left(\frac{k}{n}\right)^2}\\ &=\int_0^1 \frac{1}{1+x^2}dx \end{align}


Probably off-topic but amazing (at least to me). $$\frac n {n^2+k^2}=\frac{1}{2 (n+i k)}+\frac{1}{2 (n-i k)}$$ $$\sum_{k=1}^n\frac n {n^2+k^2}=\frac{1}{2} i \left(H_{-i n}-H_{i n}-H_{(1-i) n}+H_{(1+i) n}\right)$$ where appears the harmonic numbers. Using their expansion for large values of $n$ leads to $$\sum_{k=1}^n\frac n {n^2+k^2}=\frac{\pi }{4}-\frac{1}{4 n}-\frac{1}{24 n^2}+O\left(\frac{1}{n^4}\right)$$

Using $n=10$, the exact result is $$\frac{5929114840447087}{7801656832544900}\approx 0.7599814972$$ while the above approximation leads to $$\frac{\pi }{4}-\frac{61}{2400}\approx 0.7599814967$$