Large regime asymptotics of sum Can we give an asymptotic description of the behaviour of the sum
$$F(x):=\sum_{\{n_1,n_2 \in \mathbb Z: n_1^2+n_2^2\le x\}}   (n_1+n_2)^2 $$
for large $x$?
I was thinking of rewriting this as a Riemann sum 
$$F(x):=\left(\sum_{\{n_1,n_2 \in \mathbb Z: n_1^2+n_2^2 \le x\}}  1 \right) \times \frac{1}{\sum_{\{n_1,n_2 \in \mathbb Z: n_1^2+n_2^2 \le x\}}1  }\sum_{\{n_1,n_2 \in \mathbb  Z: n_1^2+n_2^2 \le x\}}   (n_1+n_2)^2 $$
but did not get anywhere with this.
EDIT: My apologies, it is $n_1^2+n_2^2$ in the summation index not $(n_1+n_2)^2.$ Please let me know if you have any questions.
 A: $F(x) = \frac{\pi}{2}x^2+O(x^{3/2})$.
$$F(x) = \sum_{(n_1,n_2) : n_1^2+n_2^2 \le x} n_1^2+n_2^2+2n_1n_2.$$ Note that $\sum_{(n_1,n_2) : n_1^2+n_2^2 \le x} n_1n_2 = 0$ since we can pair up the terms $(n_1,n_2)$ and $(n_1,-n_2)$. We're left with $2\sum_{(n_1,n_2) : n_1^2+n_2^2 \le x} n_1^2$. We get a factor of $4$ by restricting to $n_1,n_2 \ge 0$. So we have $$8\sum_{n_1 \le \sqrt{x}} n_1^2\sum_{n_2 \le \sqrt{x-n_1^2}} 1 = 8\sum_{n_1 \le \sqrt{x}} n_1^2\left[\sqrt{x-n_1^2}+O(1)\right],$$ where, e.g., "$n_1 \le x$" means "$1 \le n_1 \le x$". Now, using the general $\sum_{n \le t} n^2 \sim \frac{1}{3}t^3$, we have $$8\sum_{n_1 \le \sqrt{x}} n_1^2 = O(x^{3/2}),$$ so ignore the $O(1)$ term above. We're left with $$8x^2\sum_{n_1 \le \sqrt{x}} \left(\frac{n_1}{\sqrt{x}}\right)^2\sqrt{1-\left(\frac{n_1}{\sqrt{x}}\right)^2}\frac{1}{\sqrt{x}},$$ which I wrote in this way so that it is basically the Riemann integral $8x^2\int_0^1 t^2\sqrt{1-t^2}dt$, which gives $\frac{\pi}{2}x^2$. The convergence of the sum to the Riemann integral can of course be justified fairly easily.
A: The easiest way to get the desired estimate is
\begin{align*}
&\int_{-\sqrt{x}}^{\sqrt{x}} \; \int_{-\sqrt{x-n_1^2}}^{\sqrt{x-n_1^2}} \; (n_1+n_2)^2 \, \mathrm{d}n_2 \, \mathrm{d}n_1  \\
&= \int_{-\sqrt{x}}^{\sqrt{x}} \; \frac{2}{3} (x+2n_1^2) \sqrt{x-n_1^2} \,\mathrm{d}n_1  \\
&= \frac{\pi}{2} x^2  \text{.}
\end{align*}
We might wonder if this estimate is even close to the true value of $F$.

Looking at the second line in the display, a guess at the error term is $O(x^{3/2})$.  (This method of guessing is usually wildly pessimistic.)  Plotting residuals, this seems feasible on $x \in [0,1000]$, but seems pessimistic as we push out further, to $x = 10\,000$.  (The dashed orange lines are $\pm x^{3/2}$.)


Continuing to larger $x$, we see that $O(x^{3/2})$ continues to be pessimistic...

