Upper bound for the number of solutions of a Diophantine equation Consider the Diophantine equation 
$$k^2 + k - \sigma (\ell^2 + \ell) = m,$$
where  $N \leq k \leq  2 N$, $L \leq \ell  \leq 2 L$, $m \in \mathbb{Z}$ and $\sigma \in \mathbb{R}$. 
For which values of the parameter $\sigma$ is it possible to say that 
the number of solutions of this equation is bounded by $O(\min(N, L)^{\epsilon})$ ? 
To  facilitate progress, I'm going to put this auxiliar lemma. 
$\underline {Lemma}$. For every $\varepsilon > 0$, there exists $C_{\varepsilon} > 0$
such that, for every $m \in \mathbb{Z}$ and $K$ positive integer, 
$$\sharp \{(x, y) \in \mathbb{N}^{2} \mid K \leq x \leq 2 K , x^{2} \pm y^{2} = m \} \leq C_{\varepsilon} K^{\varepsilon}. $$
I would be very grateful for any suggestion!
 A: First of all, you can assume $\sigma\in \mathbb{Q}$. Otherwise, the only solutions there can be are those with $l^2+l=0$ and $k^2+k=m$, and there's certainly only a bounded number of those.
Multiplying by the denominator, we see that we are being asked for a bound on the number of solutions to
$$a (k^2 + k) + b (l^2 + l) = c$$
with $k$, $l$ in dyadic intervals. We multiply both sides by $4$ and add $a+b$ to complete the squares. Thus we reduce our problem to that of bounding the number of solutions to 
$$a k^2 + b l^2 = c$$
with $k$, $l$ in dyadic intervals. Multiplying by $a$ and then replacing $a k$ by $k$, we reduce our problem to that of bounding the number of solutions to 
$$k^2 + d l^2 = n$$
for given $d$ and $n$,
with $k$ and $l$ in dyadic intervals $K<k\leq 2 K$, $L<l\leq 2 L$.
(I take the implied constant in the bound you wish is allowed to depend on $\sigma$. The bound I will give will depend on $d$, though not on $n$.)
For $d>0$, the number of solutions is obviously bounded by the number of ideals of norm $n$ in the ring of integers of $\mathbb{Q}(\sqrt{d})$. That number is bounded by the number of divisors of $n$, which is $O_\epsilon(n^\epsilon) = O_\epsilon(\max(K,L)^\epsilon)$. To obtain the bound $O_\epsilon(\min(K,L)^\epsilon)$, note that, if $L^2 < 2K/3d$, there can be at most one solutions to your equation, as two consecutive values of $k^2$ differ by at least $2 K + 1$, and $d (2 L)^2 - d L^2 = 3 d L^2$.
For $d<0$, you also have to take quadratic units in $\mathbb{Q}(\sqrt{d})$, but, as there is only a logarithmic number of them in a box of given size (the group of units being isomorphic to $\mathbb{Z}$ times bounded torsion), you still get a bound of $O_\epsilon(\max(K,L)^\epsilon)$, and hence of $O_\epsilon(\min(K,L)^\epsilon)$.
The only exception is given by $n=0$ and $d$ of the form $-r^2$, $r$ an integer. Then the number of solutions to $k^2+d l^2 = n$ is evidently infinite, and the number of solutions in a box is linear on the size of the box. It is easy to see that this is the case of $c=-(a+ b)/4$, $a b=-r^2$ in the equation $a (k^2+k) + b (l^2+ l) = c$. That case corresponds to $\sigma\in \mathbb{Q}^2$, $m = (\sigma-1)/4$ (and thus $\sigma\in  \mathbb{Z}^2$) in the original problem.
tl;dr a simple exercise in quadratic number fields
