Let $M$ be some large real number and $\delta>0$. I would like to estimate the number of solutions for the inequality


$$|\sqrt{n\_1}+\sqrt{n\_2}-\sqrt{n\_3}-\sqrt{n\_4}|<\delta\sqrt{M},$$


where $n\_i$ are positive integers with $M<n\_i\leq 2M$ for all $1\leq i\leq 4$. Let us denote this quantity by $N(M,\delta)$.


There is a [paper](https://www.degruyter.com/view/j/crll.2006.2006.issue-591/crelle.2006.012/crelle.2006.012.xml) by O.Robert and P.Sargos which provides the bound for a bit more general quantity. In our case their work gives


$$N(M,\delta)\ll M^{2+o(1)}+\delta M^{4+o(1)}.$$


I think, some heuristics suggest that when $\delta\gg 1$ this bound is more or less optimal. But I'm interested in the case when $\delta=o\left(\frac{1}{M}\right)$. So, my question is: can the bound of Robert and Sargos be improved for small $\delta$ and when should we expect that $N(M,\delta)\ll M^{2+o(1)}$? For example, we always have $N(M,M^{-2})\ll M^{2+o(1)}$ but can we do better (i.e. prove this bound for larger $\delta$) or at least are there any conjectures about this?



Number of solutions for the inequality with square roots
For $\delta\geq 1$, the inequality is automatic, hence $N(M,\delta)=M^4$.


For $\delta<1$, the bound by Robert and Sargos is optimal up to the $o(1)$ in the exponent, and actually they mention this right before their Theorem 1. They do not give the proof, but the claim follows easily from their Lemma 1, which is a special case of Lemma 2.1 in Watt: Exponential sums and the Riemann zeta-function II (J. London Math. Soc. 39 (1989), 385-404.). For convenience, I give a proof from scratch, using Watt's ideas.


We assume $\delta<1$. It is clear that
$$N(M,\delta)\geq\sum\_{M<m\_1,m\_2,m\_3,m\_4\leq 2M}\max\left(0,1-\left|\frac{\sqrt{m\_1}+\sqrt{m\_2}-\sqrt{m\_3}-\sqrt{m\_4}}{\delta\sqrt{M}}\right|\right).$$
By Fourier analysis (cf. [triangular function](https://en.wikipedia.org/wiki/Triangular_function)), the $\max(0,\dots)$ term on the right hand side equals
$$\int\_{-\infty}^\infty\left(\frac{\sin\pi t}{\pi t}\right)^2\ e\left(\frac{\sqrt{m\_1}+\sqrt{m\_2}-\sqrt{m\_3}-\sqrt{m\_4}}{\delta\sqrt{M}}\,t\right)dt,$$
where $e(x):=\exp(2\pi ix)$ as customary in analytic number theory. Hence, introducing the exponential generating function
$$ f(x):=\sum\_{M<m\leq 2M}e\bigl(\sqrt{m}x\bigr),$$
we can rewrite the above lower bound as
$$N(M,\delta)\geq\int\_{-\infty}^\infty\left(\frac{\sin\pi t}{\pi t}\right)^2\ \left|f\left(\frac{t}{\delta\sqrt{M}}\right)\right|^4\,dt.$$
The integrand is nonnegative, and for $|t|<\delta/\sqrt{128}$ it exceeds $6M^4/25$. The latter is because, for $|x|<1/\sqrt{128M}$, each term in $f(x)$ has real part exceeding $1/\sqrt{2}$, so that $|f(x)|>M/\sqrt{2}$. We conclude that
$$N(M,\delta)>\frac{2\delta}{\sqrt{128}}\cdot\frac{6M^4}{25}>\frac{\delta M^4}{24}.$$
On the other hand, it is obvious that $N(M,\delta)\geq M^2$, hence we proved for $\delta<1$ that
$$N(M,\delta)>\frac{M^2+\delta M^4}{25}.$$


