# Solving second-degree diophantine equation

I'm interested in the following Diophantine equation:

$$y^2 - y - x^2 + x = 2xy$$

I've managed to find some solutions like $$(6, 15)$$ and $$(35, 85)$$, but I need some general method of solving this type of equations. As I understood, it's a hyperbola, which makes it harder to study.

Any help?

• I think you meant $x^2$ where you typed $x^x$ Commented Jun 9, 2020 at 17:11

Solution is:

$$x=m(1-2n)$$

$$y=mn$$

Where:

$$m=(3n-1)/(n^2+2n-1)$$

For, $$n=(5/12)$$ we have:

$$(x,y)=(6,15)$$

The equation can be solved for either variable in terms of the other by $$y$$ is easier than x.

$$y = \frac{\pm\sqrt{8 x^2 + 1} + 2 x + 1}{2}\rightarrow$$ $$x\in\{0,1,6,35,204,1189,5008,40391...\}\implies y\in\{1,3,15,85,493,2871,16731,97513...\}$$

I believe these are all the integer pairs for $$x\le100000$$.

• cf. oeis Commented Jun 9, 2020 at 17:53

$$y^2 - y - x^2 + x = 2xy \implies (2 y - 2 x - 1)^2 - 2 (2 x)^2 = 1$$

This Pell equation.

gp-code:

pell_d2c1()=
{
D= 2; C= 1;
Q= bnfinit('x^2-D, 1);
fu= Q.fu[1]; \\print("Fundamental Unit: "fu);
N= bnfisintnorm(Q, C); \\print("Fundamental Solutions (Norm): "N"\n");
for(i=1, #N, ni= N[i];
for(j=0, 48,
s= lift(ni*fu^j);
X= abs(polcoeff(s, 0)); Y= abs(polcoeff(s, 1));
if(X^2-D*Y^2==C,
x= Y/2; y= (X+2*x+1)/2;
if(x==floor(x) & y==floor(y),
print("("x", "y")")
)
)
)
)
};


Some first solutions:

(0, 1)
(1, 3)
(6, 15)
(35, 85)
(204, 493)
(1189, 2871)
(6930, 16731)
(40391, 97513)
(235416, 568345)
(1372105, 3312555)
(7997214, 19306983)
(46611179, 112529341)
(271669860, 655869061)
(1583407981, 3822685023)
(9228778026, 22280241075)
(53789260175, 129858761425)
(313506783024, 756872327473)
(1827251437969, 4411375203411)
(10650001844790, 25711378892991)
(62072759630771, 149856898154533)
(361786555939836, 873430010034205)
(2108646576008245, 5090723162050695)
(12290092900109634, 29670908962269963)
(71631910824649559, 172934730611569081)
(417501372047787720, 1007937474707144521)

• Nice, how did you come up with this difference of squares? Also, what kind of language is this? Commented Jun 9, 2020 at 20:02
• Like that. And this lang of pari/gp calculator. Commented Jun 9, 2020 at 21:21
• It's interesting to note that quotient of those solutions approach $\frac{1}{1 + \sqrt2}$ Commented Jun 10, 2020 at 8:22