# Finding integer solutions to a quadratic equation in 2 variables

We have an equation $x^2+4y^2-2xy-2x-4y-8=0$. Find all integer pairs $(x,y)$ satisfying this equation. I did some research on my own, and found that the above equation describes an ellipse. But I'm not sure how it helps.

Is there any systematic way to solve this?

• solve your equation for $x$ or $y$ – Dr. Sonnhard Graubner Aug 19 '17 at 17:38
• – Bill Dubuque Aug 19 '17 at 18:11
• you can use this site to find the solution or select a step by step to get to the solution. The site also provides the theory behind it. alpertron.com.ar/QUAD.HTM – user25406 Aug 19 '17 at 20:47

## 2 Answers

You can write your equation as $$(x-y-1)^2+3(y-1)^2=12.$$ That means $|y-1|\le\sqrt{12/3}=2$, it's rather straightforward to check those few values.

Hint: as an equation in $x$ the reduced discriminant of $x^2-2x(y+1)+4y^2-4y-8=0$ is:

$$\frac{1}{4} \Delta = (y+1)^2-(4y^2-4y-8)=-3y^2+6y+9=-3(y+1)(y-3)$$

For integer solutions, the reduced discriminant must be a perfect square.

• Can this method be somehow extended to quadratic equations in 3 variables? 4 variables? And above? – Mainak Roy Aug 24 '17 at 16:08
• @MainakRoy You can always consider the equation to be a quadratic in one of the variables, with coefficients in terms of the other variables. Then you can calculate the discriminant which will be a function of the other variables, and try to find when it's a perfect square. In the given case, that was easy because the discriminant had an obvious factorization. In the general case it may or may not be as easy. – dxiv Aug 24 '17 at 17:01