# Why is $ab=(a-b)(a+b)$ false when $a,b$ are coprime?

I could not find this, and do not have a background in number theory so sorry if this sounds trivial.

If $a$ and $b$ are coprime integers, why is the statement

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

• ... because solution you are looking for can be found in another set, Rational to be exact, which is no problem since Z to Q is canonically isomorphic. Mar 12, 2017 at 19:27

If both $a$ and $b$ are $\pm 1$ it is easy to see that $ab \neq (a-b)(a+b)$.

If one of them is not $\pm 1$, then it is divisible by some prime $p$. Then $$p| ab =(a-b)(a+b)$$ which means that $p$ divides $(a-b)$ or $p$ divides $(a+b)$. In either case, since $p$ divides one of $a,b$ and divides their sum/difference, it follows that $p$ divides both of them. But then $a,b$ are not coprime.

it becomes $$a^2 - ab - b^2 = 0.$$ If $b \neq 0,$ divide through by $b^2$ and introduce $r = \frac{a}{b},$ this gives $$r^2 - r - 1 = 0$$ So $r$ is either the Golden ratio $$\frac{1 + \sqrt 5}{2}$$ or negative its reciprocal. Put briefly, irrational, contradicting $a,b$ being integers.

It is also possible to use anisotropy in $\mathbb Q_5,$ which is probably what they want. Well, why not. Take $$a^2 - ab - b^2 \equiv 0 \pmod {25}$$ and ASSUME $\gcd(a,b) =1.$ The number $4$ is invertible $\pmod 5$ and $\pmod {25},$ so we change nothing demanding $$4 a^2 - 4ab - 4 b^2 \equiv 0 \pmod {25},$$ $$\left( 2a -b \right)^2 - 5 b^2 \equiv 0 \pmod {25}.$$ It follows that $(2a-b)$ is divisible by $5,$ and then $\left( 2a -b \right)^2$ is divisible by $25.$ In turn, this means $5 b^2$ is divisible by $25,$ so $b^2$ is divisble by $5,$ finally $b$ itself is divisible by $5.$ As $(2a-b)$ is also divisible by $5,$ we find that $a$ is divisible by $5.$ So far, both $a,b$ are divisible by $5.$ This means $5 | \gcd(a,b)$ and $\gcd(a,b) \neq 1$

This is the method I like to show that there is, in fact, no solution of $a^2 - ab - b^2 = 0$ in integers unless both $a,b$ are zero. The lemma that you need to really, really believe, is that, should there be a solution with at least one variable nonzero, then we can divide through by the gcd of those original $a,b$ numbers, divide both by that, resulting in a solution in coprime integers. Our proof of impossibility for coprime integers thus extends to a proof of impossibility at least one variable nonzero, finally to any nonzero solution. The quadratic form name for this argument is "anisotropy." We say that the quadratic form $a^2 - ab - b^2$ is not isotropic in the $5$-adic numbers $\mathbb Q_5$

It is also true that the quadratic form $a^2 - ab - b^2$ is not isotropic in the $2$-adic numbers $\mathbb Q_2.$ This is posted in some earlier answers. One may check, there are just four cases, $a^2 - ab - b^2$ is odd unless both $a,b$ are even. Thus is was enough to use $\pmod 2,$ for this prime it was not even necessary to use $\pmod 4.$

Suppose we have equality, then we have that $$ab = a^2 - b^2$$ or equivalently: $$ab + b^2 = a^2.$$ Since $b \mid (ab + b^2) = a^2$, this would imply that $b$ divides $a^2$. However, since $a,b$ are coprime, so are $b$ and $a^2$. Indeed: if $b, a^2$ are not coprime, we can look at the prime factorization of their greatest common divisor (which would be different from $1$). Then there is a prime $p$ such that $p \mid b$ and $p \mid a^2$. Therefore $p \mid a$, hence $p \mid \text{gcd}(a,b)$, so $a,b$ would not be coprime.

Since we have shown that $b$ divides $a^2$, whereas they have to be coprime, we need that $b = 1$ (or $-1$). However, applying the same reasoning would show that $a$ divides $b^2$, so then also $a = 1$ or $-1$, but clearly this is not possible (since we would never have $ab = a^2 - b^2$).

Therefore, we have a contradiction, so $ab \neq (a -b)(a + b)$.

If $a$ and $b$ are coprime integers and $ab=(a-b)(a+b)$, then either $a$ is even and $b$ is odd or the other way round. In any case, $ab$ would be even while $(a-b)(a+b)$ would be odd, quod est absurdum.

• They can both be odd and coprime, and there is a contradiction in that case too. Mar 7, 2017 at 20:25
• OR $a$ and $b$ are both odd, in which case the RHS is even? Mar 7, 2017 at 20:25
• @DanBrumleve, great minds think alike ☺ Mar 7, 2017 at 20:25
• I discard these trivial cases in the very first sentence of my argument. They cannot be even simultaneously because they are coprime; they cannot be odd simultaneously because in that case the right-hand-side of the equality would be an even number, etc. Mar 7, 2017 at 20:26
• It's no more trivial than the other half of the argument though. You might as well just say the whole question is obvious. Mar 7, 2017 at 20:38

$$a^2-ab-b^2=0$$

Considering the equation as a quadratic equation in $a$, by the Rational Root Theorem $a|b^2$ what is not possible if $a$ and $b$ are coprime.

• Minor quibble: $a\mid b^2$ (and $b\mid a^2$) with $a$ and $b$ coprime if $a=b=1$. But of course that doesn't satisfy the equation $a^2-ab-b^2=0$. Mar 7, 2017 at 20:24
• This is the most elegant solution in my opinion. I had thought of using Rational Root Theorem but didn't carry the logic all the way through. Jul 18, 2017 at 2:29

The equality can be written $a^2=(a+b)b$. Since $a,b$ are coprime, then $a|a+b$. So $a+b=ka$ for some $k$. Then $b=(k-1)a$ and $a|b$, a contradiction.

We may assume without loss of generality that $|a|\geq b$. Then $(a-b)(a+b)=a^2-b^2\geq 0$ and therefore also $ab\geq 0$. Thus $a$ and $b$ have the same sign. Without loss of generality we may assume both are nonnegative. But then $a^2-b^2-ab=(a-b)^2+ab-b^2\geq 0$ with equality only if $a=b=0$. Thus this is not a problem about the arithmetic of quadratic forms after all and the coprime condition is superfluous.