<s>[INST] Limit of the series $\sum_{k=1}^\infty \frac{n}{n^2+k^2}.$ I am trying to evaluate $$\lim_{n\to \infty} \sum_{k=1}^\infty \frac{n}{n^2+k^2}.$$ Now I am aware that clearly $$\lim_{n\to \infty} \sum_{k=1}^n \frac{n}{n^2+k^2} = \int_0^1 \frac{1}{1+x^2}dx = \tan^{-1}(1) = \frac{\pi}{4},$$ but I do not know what to do if each sum is already sent to infinity. Im taking a limit of limits. I suppose I could rewrite my limit as $$\lim_{n\to \infty} \lim_{m\to \infty} \sum_{k=1}^m \frac{n}{n^2+k^2}?$$ But I am unaware if this is helpful at all. Any hints would be appreciated. Obviously, Wolfram calculates this as $\frac{\pi}{2}$ but I am unaware of the steps and logic to get there.
 [/INST] Denote $\displaystyle \mathcal{S}(n) = \sum_{k \ge 1} \frac{n}{n^2+k^2}$. We have
\begin{aligned} \mathcal{S}(n) & = \sum_{k\geq 1}\frac{n}{ n^2+k^2} \\& = \frac{1}{2}\sum_{k\geq 1}\frac{2n }{ n^2+k^2}  \\& = \frac{1}{2}\sum_{k\geq 1} \frac{d}{dn}\log\left(1+\frac{n^2}{k^2}\right) \\& = \frac{1}{2}\frac{d}{dn}  \log \prod_{k\geq 1}\left(1+\frac{n^2}{k^2}\right) \\& = \frac{1}{2}\frac{d}{dn}  \bigg[\log \pi n\prod_{k\geq 1}\left(1+\frac{n^2}{k^2}\right)- \log(\pi n)\bigg] \\& = \frac{1}{2}\frac{d}{dn}  \log \pi n \prod_{k\geq 1}\left(1+\frac{n^2}{k^2}\right)-\frac{1}{2 n}\end{aligned}
Weierstrass factorization for hyperbolic sine is:
$$\sinh \pi z=\pi z \prod_{k=1}^\infty\left(1+\frac{z^2}{k^2}\right)$$
Therefore \begin{aligned} \mathcal{S}(n) & = \frac{1}{2} \frac{d}{dn} \log \sinh \pi n -\frac{1}{2 n} \\&= \frac{1}{2}\pi \coth(n \pi)-\frac{1}{2 n } \end{aligned}
And finally taking the limit as $n \to \infty$
\begin{aligned} \lim_{n \to \infty} \mathcal{S}(n) &= \lim_{n \to \infty} \bigg(\frac{1}{2}\pi \coth(n \pi)-\frac{1}{2 n }\bigg) \\& = \frac{\pi}{2}.\end{aligned}
</s>