# Method to solve factored quadratic diophantine equations?

Is there a method that can solve all quadratic diophantine equations of the following type

$$X (X + a) = Y (Y + b)$$

where $$a,b$$ are given integers?

• I think they always have finitely many solutions unless $a=b$ or $a=-b$ and that the solutions are the 4 from making both sides zero plus at most a couple extra small solutions. – rain1 May 25 at 5:52

$$X (X + a) = Y (Y + b) \implies (2 X + a)^2 - (2 Y + b)^2 = a^2 - b^2$$

Get finite set solutions of difference of squares $$x^2 - y^2 = a^2 - b^2$$ and check $$X=\frac{x-a}{2}$$ and $$Y=\frac{y-b}{2}$$ as integers.

Above equation shown below:

$$X (X + a) = Y (Y + b)$$

Take, $$[(a+b),(a-b)]=(4mp,4nq)$$

$$X=[(p-q)(n-m)]$$

$$Y=[(q-p)(m+n)]$$

We get:

$$a=2(mp+nq)$$

$$b=2(mp-nq)$$

For, $$(p,q,m,n)=(2,3,5,3)$$ we get:

$$(X,Y,a,b)=(2,8,38,2)$$