# Let $p$ be a prime. Prove that $p$ divides $ab^p−ba^p$ for all integers $a$ and $b$.

Let $p$ be a prime. Prove that $p$ divides $ab^p−ba^p$ for all integers $a$ and $b$.

(This is not a homework)

-
Hint: It helps to think of it as $ab^p \equiv ba^p \mod p$. – Tara B Mar 24 '12 at 12:47
Oh, I see that while I was laboriously typing my comment on an iPad, people provided actual answers. Oh well. – Tara B Mar 24 '12 at 12:49

1
The variant of Fermat's Theorem that says $x^p\equiv x\pmod{p}$ makes this automatic. – André Nicolas Mar 24 '12 at 16:54

## 4 Answers

KV Raman's answer is quite right, but I'll write my answer anyway because I find it tidier.

$\mathbb{Z}_p^* = \mathbb{Z}_p\setminus \{0\}$ is a cyclic group of order $p-1$ under multiplication, so $a^{p-1} \equiv 1 \mod p$ for all integers not divisible by $p$. If $a$ is divisible by $p$, then $a^n \equiv 0 \mod p$ for all $n$. So we have $a^p \equiv a \mod p$ for $a\in \mathbb{Z}$. (This is Fermat's Little Theorem.)

Now for any integers $a$ and $b$, $$ab^p \equiv ab \equiv a^pb \mod p$$ and so $ab^p - ba^p \equiv 0 \mod p$, which means $p$ divides $ab^p - ba^p$.

-
You got my vote +1 for your proof Tara. – Kirthi Raman Mar 24 '12 at 13:19

1
+1. That's much easier than arranging things such that the $a^{p-1}$ form of Fermat's little theorem applies directly. – Henning Makholm Mar 24 '12 at 13:21

$$ab^p-ba^p = ab(b^{p-1}-a^{p-1})$$

If $p|ab$, then $p|(ab^p-ba^p)$ and also if $p \nmid ab$, then gcd$(p,a)=$gcd$(p,b)=1, \Rightarrow b^{p-1} \equiv a^{p-1} \equiv 1\pmod{p}$ (by Fermat's little theorem).

This further implies that $\displaystyle{p|(b^{p-1}-a^{p-1}) \Rightarrow p|(ab^p-ba^p)}$.

Q.E.D.

-

Hint $\$ little Fermat $\rm\Rightarrow mod\ p\!:\ n^p \equiv n\ \Rightarrow\ f(a,b^p)\equiv f(a,b)\equiv f(a^p,b)\$ for all $\rm\:f\in \mathbb Z[x,y]$

-
-

@Downvoter Will the downvoter please explain? – user21436 Mar 30 '12 at 15:02
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 37, "mathjax_display_tex": 2, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "github"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "english_confidence": 0.8940224647521973, "perplexity_flag": "middle"}