Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I reduced a number theory problem to finding all ordered pairs $(a,b)$ that satisfy the equation $a(a-2) = b(b+2)$ in a certain range. After thinking about this for a while, I figured that either $a = b + 2$, $a = -b$, $a = b = 0$ or $a = 2 \text{ and } b = -2$. It is easy to prove that these values for $a$ and $b$ will all satisfy the equation, but how would I solve this equation had I not come up with these solutions? And how do I know I did not miss one? In short, can this equation be solved (more) rigorously?

Edit: Silly of me I did not recognize that my last two solutions were already covered by my first two.

share|cite|improve this question
up vote 9 down vote accepted

Add $1$ to both sides to get $$a^2 - 2a + 1 = b^2 + 2b + 1$$ i.e. $$(a-1)^2 = (b+1)^2.$$

Hence $a-1 = b+1$ or $a-1 = -b-1$ and these are all solutions.

share|cite|improve this answer
I'd simplify the last expressions to $a=b+2$ or $a=-b$ just to be nice. – JB King May 30 '13 at 21:27
@JBKing Sure, but the OP seemed to have that already. – mrf May 30 '13 at 21:28

Denote $c=b+2$. Then $(a-1)^2=(c-1)^2$ etc.

share|cite|improve this answer

Another approach is to note that $a=b+2$ is an "obvious" solution, then to divide by that solution: $$ \frac{a(a-2)-b(b+2)}{a-(b+2)}=a+b $$ giving $a(a-2)-b(b+2)=(a-(b+2))(a+b)$. Therefore, the solutions are $$ a=b+2\quad\text{and}\quad a=-b $$

share|cite|improve this answer
You divided by 0 when you divided by a-b+2, is there a reason why you didn't get an erroneous result from this? – Ovi May 31 '13 at 0:41
When looking for another solution, $a-(b+2)\ne0$, so it is legal. – robjohn May 31 '13 at 1:32
Oh ok thank you – Ovi May 31 '13 at 10:08

$a(a - 2) = b(b + 2)$

$a^2 - 2a = b^2 + 2b$

$a^2 - b^2 = 2(b + a)$

$(a + b)(a - b) = 2(a + b)$

$(a + b)(a - b - 2) = 0$

share|cite|improve this answer

Put $\, b=x.\, f(x) = x^2\!+\!\color{#c00}2x = a^2\!-\!2a= f(-a)$ has roots $x=-a,\ x'\!=a\!-\!2,$ by $\, x\!+\!x'\!=-\color{#c00}2.$

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.