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'm trying to show that $a^2 \equiv b^2 \mod p$ implies that $a \equiv b \mod p$ and $a \equiv -b \mod p$, where $p$ is prime.

Since $a^2 - b^2 \equiv 0 \mod p$, I know that $(a + b)(a - b) \equiv 0 \mod p$. Then either $a + b \equiv 0 \mod p$ or $a - b \equiv 0 \mod p$.

But I don't know how to show that both are true. Could someone give me a hint?

share|cite|improve this question
It is true that $1^2 \equiv 9^2 \pmod {10}$, but it is not true that $1 \equiv 9 \pmod {10}$ and $1 \equiv -9 \pmod {10}$. Furthermore, it is true that $0^2 \equiv 3^2 \pmod 9$, but it is not true that $0 \equiv 3 \pmod 9$ or $0 \equiv -3 \pmod 9$. Your proof is valid as long as $p$ is prime, but you cannot change the "or" to an "and". – Tanner Swett Mar 13 '12 at 4:04
up vote 2 down vote accepted

You can't show both are true, because they aren't both true. (Unless $p=2$ or $a=b=0$.)

Take e.g. $a=1$ and $b=-1$; these aren't equal except in characteristic two.

share|cite|improve this answer

Hint $\ $ It fails, e.g. odd prime $\rm p\ |\ a-b, a+b\ \Rightarrow\ p\ |\ 2a,2b\ \Rightarrow\ p\ |\ a,b$

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.