Computing $\sum{\frac{1}{m^2+n^2}}$ I want to prove that $\sum_{1\leq m^2+n^2\leq R^2}{\frac{1}{m^2+n^2}}=2\pi\log R+O(1)$ as $R\rightarrow\infty$.
For this, I'm trying to approximate the sum by using the integral $\int_{1\leq r\leq R}{\frac{1}{x^2+y^2}}dxdy=\int_{0}^{2\pi}\int_{1}^{R}{\frac{1}{r}}drd\theta=2\pi\log R$
How can I show that $\sum_{1\leq m^2+n^2\leq R^2}{\frac{1}{m^2+n^2}}=\int_{1\leq r\leq R}{\frac{1}{x^2+y^2}}dxdy$ as $R\rightarrow\infty$ rigorously?
Any help will be appreciated.

$$
\begin{align}
\sum_{m,n=1}^R\frac1{m^2+n^2}
&=2\sum_{m=1}^R\sum_{n=1}^m\frac1{m^2+n^2}-\sum_{n=1}^R\frac1{2n^2}\\
&=2\sum_{m=1}^R\frac1m\sum_{n=1}^m\frac{\frac1m}{1+\left(\frac nm\right)^2}-\sum_{n=1}^R\frac1{2n^2}\\
\end{align}
$$
Comparing the Riemann sum $\sum\limits_{n=1}^m\frac{\frac1m}{1+\left(\frac nm\right)^2}$ and the integral $\int_0^1\frac{\mathrm{d}x}{1+x^2}$, we see that
$$
\sum_{n=1}^m\frac{\frac1m}{1+\left(\frac nm\right)^2}=\frac\pi4+O\left(\frac1m\right)
$$
Since $\sum\limits_{m=1}^n\frac1m=\log(n)+O(1)$, and $\sum\limits_{n=1}^\infty\frac1{2n^2}=\frac{\pi^2}{12}$, we get that
$$
\sum_{m,n=1}^R\frac1{m^2+n^2}=\frac\pi2\log(R)+O(1)\tag{1}
$$
Furthermore, since $\log(R/\sqrt2)=\log(R)+O(1)$,
$$
\sum_{m,n=1}^{R/\sqrt2}\frac1{m^2+n^2}=\frac\pi2\log(R)+O(1)\tag{2}
$$
The sum over the terms where $m=0$ or $n=0$ is handled by
$$
\sum_{m=1}^\infty\frac1{m^2}=\frac{\pi^2}6=O(1)\tag{3}
$$
Since
$$
\overbrace{\left\{1\le m,n\le R/\sqrt2\right\}}^{(2)}\subset\left\{1\le m^2+n^2\le R^2\text{ and }m,n\ge1\right\}\subset\overbrace{\left\{1\le m,n\le R\right\}}^{(1)}
$$
and accounting for the four quadrants and the four borders where $m=0$ or $n=0$, we get
$$
\sum_{1\le m^2+n^2\le R^2}\frac1{m^2+n^2}=2\pi\log(R)+O(1)
$$
