Let $a,b$ be in a group $G$. Show $(ab)^n=a^nb^n$ $\forall n\in\mathbb{Z}$ if and only if $ab=ba$.
Hint:
- Use $(ab)^{-1} = b^{-1}a^{-1}$ (you have $n \in \mathbb{Z}$, so it works for negative numbers too).
- Another approach would be to manipulate $abab = aabb$.
I hope this helps $\ddot\smile$
$ab=ba\Rightarrow (ab)^n=\underbrace{ab.ab.ab\cdots ab}_{n\text{ times}}=a(ba)(ba)(ba)\cdots(ba).b=a^nb^n$ replacing $ba$ by $ab$.
Conversely $(ab)^n=a^nb^n,~~\forall n$, so $(ab)^2=a^2b^2$. Multiplying this equation on the right by $b^{-1}$ and on the left by $a^{-1}$, then we have get $ab=ba$.
Groups satisfying the condition $(ab)^n = a^n b^n$ are known as $n$-abelian groups. The following is known:
Let $G$ be a group and suppose that there exist three consecutive positive integers $n$ for which $G$ is $n$-abelian. Then $G$ is a commutative group.
For a nice proof, see Howard E. Bell, Mathematics Magazine, Vol. 55, No. 3 (May, 1982).