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$. Let $G$ be a group and $a,b\in G$.  Show $(ab)^n=a^nb^n$ for all $n\in\mathbb{Z}$ if and only if $ab=ba$.
I don't known where to start. It seems trivially.
 A: 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).
A: $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$.
A: 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$
A: $(ab)^n=a^n b^n\implies (ba)^{n-1}=a^{n-1}b^{n-1}\implies b^{n-1}a^{n-1}=a^{n-1}b^{n-1}$. 
Now put $n=2$. 
This proves $G$ is abelian if $(ab)^n=a^n b^n$. 
Proving that $(ab)^n= a^n b^n$ if $G$ is abelian is elementary. 
A: The reverse direction can be done via straightforward induction too. Assume that $ab=ba$, let $P(n)$ be the statement that $(ab)^n = a^nb^n$, the base case is satisfied evidently. The inductive hypothesis; assume that for some $k \in \mathbb{N}$ we have that $(ab)^k = a^kb^k$. We want to show that $(ab)^{k+1} = a^{k+1}b^{k+1}$, and to do this you could technically do another induction to show that for commuting elements $a,b \in G$ we have that $ab^{k+1} = b^{k+1}a$ for all $k \in \mathbb{N}$, but it's as straightforward as this one so I'll omit it. Continuing from the inductive hypothesis it's straightforward to see that
$$
\begin{align}
(ab)^k(ab) &= a^kb^kab \\
(ab)^{k+1} &= a^kab^kb \\
&=a^{k+1}b^{k+1}.
\end{align}
$$
To show this works for negative integers you can just modify the inductive statement to $P(-n)$; specifically $(ab)^{-n} = a^{-n}b^{-n}$ and then induct on positive integers again.
A: By taking n=2, we have $(ab)^2=a^2b^2$, which implies $abab=aabb$ and thus $ba=ab$. The converse is trivial.
