TITLE: Computing $\lim\limits_{n\to\infty} \Big(\sum\limits_{i = 1}^n \sum\limits_{j = 1}^n \frac1{i^2+j^2}-\frac{\pi}{2} \log(n)\Big)$.
QUESTION [46 upvotes]: In the chatroom we discussed about the asymptotic of $\displaystyle \sum_{i = 1}^n \sum_{j = 1}^n \frac1{i^2+j^2}$, and if we think of the inverse tangent integral, it's easy to see that $\displaystyle \sum_{i = 1}^n \sum_{j = 1}^n \frac1{i^2+j^2}\approx \operatorname{Ti}_2(n)\approx \frac{\pi}{2} \log(n)$ where I used
the well-known relation $\displaystyle \operatorname{Ti}_2(x)-\operatorname{Ti}_2(1/x)=\frac{\pi}{2}\operatorname{sgn}(x) \log|x|$. At this point, @robjohn posed the following  limit
$$\lim_{n\to\infty} \left(\displaystyle \sum_{i = 1}^n \sum_{j = 1}^n \frac1{i^2+j^2}-\frac{\pi}{2} \log(n)\right)$$
that looks like a pretty tough limit. Using $\coth(z)$ one can see the limit is approximately $-\dfrac{\pi^2}{12}$,
but how about finding a way to precisely compute the limit?

REPLY [3 votes]: Here is a way a physicist gets a quick estimation:  
First we note that   
$$\sum_{i = 1}^n \sum_{j = 1}^n \frac1{i^2+j^2}\sim\int_0^{n}\int_0^{n}\frac{dxdy}{x^2+y^2}\;(n \to\infty)$$  
Now, the double integral  $I(n)$, because the integration is elementary I write only the final result:  
$$I(n)=\arctan(n)\ln(n)-\int_1^{n}\frac{\ln x}{1+x^2}dx-\int_{\frac{1}{n}}^{1}\frac{\arctan x}{x}dx$$  
Because the integrals in the last expression are bounded when $n \to\infty$, then  
$$I(n)\rightarrow \frac{\pi}{2}\ln n$$