# Bounding the number of integer solutions of the following inequality

Let $r\geq 1$ be a real number, $-1\leq x\leq 1$ a real number and $y>2$ a real number. We consider this data to be fixed.

How can I obtain an upper bound on the number of $(a,b,c,d)\in \mathbf{Z}^4$ such that

$$\left(c(x^2-y^2) +(d-a)x-b\right)^2+y^2(2cx+d-a)^2 \leq 2(r-1)y^2;$$ $$ad-bc = 1;$$ $$(a,b,c,d) = (1,0,0,1) \mod 2.$$

To be clear, the quadruple $(a,b,c,d)$ is supposed to satisfy all three conditions. (I edited the question and added the last two conditions.)

Are there any computer packages that can help me do this?

I expanded the entire expression using Maple, but this didn't look very pleasant.

The motivation lies in the bounding the number of matrices $A$ in $\mathrm{SL}_2(\mathbf{Z})$ such that the geodesic distance between the point $x+iy$ and $A\cdot (x+iy)$ is bounded by $r$.

-
If I'm not wrong, isn't that equivalent to counting how many lattice points of $\mathbb Z^2$ lie within a circle of radius $r$ (handwaving speaking)? It feels related... That problem is known to be very hard. I don't understand the $-1 \le x \le 1$ and $y > 2$ constraints though. – Patrick Da Silva Feb 28 '12 at 20:13
It probably is related to the number of lattice points in $\mathbf{Z}^4$ within a circle of radius $r$. The exact number is hard to determine (even though there are explicit formulas), but giving a bound on this number is easy. Namely, the number of integer solutions to $a^2+b^2+c^2+d^2 \leq r$ is bounded by $8\sqrt{r}+8$. – Hoedan Feb 28 '12 at 21:41

There is no upper bound. With $a=d$ and $b=c=0$ you have infinitely many lattice points where the left side is $0$.
You are completely right. There are (fortunately for me!!) some constraints on $a,b,c,d$. Namely, $ad-bc = 1$ and $(a,b,c,d) = (1,0,0,1) \mod 2$ – Hoedan Feb 28 '12 at 21:36
OP mentioned $SL_2(Z)$ so I guess you should've read better., – Patrick Da Silva Feb 29 '12 at 0:07