How to find the smallest $a,b ∈ N$ that solve a single equation

51 Views Asked by At

Im trying to find a method that solves the equality of two quadratic equations with the constraint of $a$ and $b$ being natural numbers, the only way I know is trying value per value, but I was wondering if there is a faster way.

The equation: $$a^2+a = b^2+19b-12$$

The solution I found is a=5, b=2.

Thank you very much.

1

There are 1 best solutions below

0
On BEST ANSWER

Expanding on lhf's comment, if $a^2+ua = b^2+vb+w$ then $4a^2+4ua = 4b^2+4vb+4w$ so $(2a+u)^2-u^2 =(2b+v)^2-v^2+4w $ so $(2a+u)^2-(2b+v)^2 =u^2-v^2+4w$ or $u^2-v^2+4w =(2a+u+2b+v)(2a+u-2b-v) $.

All solutions come from factoring $u^2-v^2+4w = pq$, and solving $p = 2a+u+2b+v, q = 2a+u-2b-v $.

This gives $p+q =4a+2u$ so $a = \dfrac{p+q-2u}{4} $ and $p-q =4b+2v$ so $b = \dfrac{p-q-2v}{4} $.

This has $u=1, v=19, w = -12$ so $u^2-v^2+4w = 1-19^2-48 =-408 =-2^3*3*17 $.

Look at all the factorizations, remembering that $p$ and $q$ can be negative as well as positive and 4 must divide the two expressions.