Prove that: $\left|\left\{ \langle a,b \rangle\in \mathbb{N}\times\mathbb{N}:a^2+b^2\le n \right\}\right|=\frac{\pi}{4}n+O(\sqrt{n})$
I heard something about that the number of lattice points under the graph of a function is asymptotically equal to the area under the graph, but I don't understand it. I tried to estimate the cardinality of this set by simple for me operations that is:
for a given $a$, every $b$ is ok iff $b^2\le n-a^2$, so for a given $a$ we have $\left\lfloor\sqrt{n-a^2}\right\rfloor +1$ lattice points, then the cardinality is equal to: $\displaystyle\sum_{a=0}^{\lfloor\sqrt{n}\rfloor}\left( \left\lfloor\sqrt{n-a^2}\right\rfloor +1 \right)$, but I don't know to get the result $\frac{\pi}{4} n + O(\sqrt{n})$ from this. I tried to use integrals to estimate this sum, but nothing useful occurred.