Question: > 
> Show that $(xy)^n=x^ny^n$ if $xy=yx$. 
> 
> 
> 

I assume I will need 3 different cases: $n < 0$, $n=0$, and $n > 0$.

For the $n > 0$ case, can I use induction? For the base case I'll show that if $n=$1 then $(xy)^1=x^1y^1$ which will give us xy=xy so the base case is satisfied. Then I'll assume that the statement is true for n+1. Is that on the right track? 

For $n=0$, is it just trivial? that $(xy)^0=x^0y^0$ and when talking about groups $x^0=1$ so we will have $1=$1 which is true. 

For $n < 0$, I was advised to use $(xy)^n=((xy)^{-1})^{-n}$. I'm not exactly sure how to go about this step. 

I don't think I completely understand the part where this only works when $xy=yx$. 

Any suggestions or help would be great! Thanks!

Answer: 
The answer of Ishfaag is right, but I want to review some points about this problem.

There are a lot of attempts for generalizing the concept of abelian groups and one of them is $n$-abelian groups. A group $G$ is said to be $n$-abelian if $(xy)^n = x^ny^n$ for all $x,y \in G$. It is also easy to see that a group $G$ is $n$-abelian if and only if it is $(1-n)$-abelian. The idea of $n$-abelian is proposed by Levi in $1944$. As the friends said, $G$ is an abelian group if and only if $2$-abelian. $n$-abelian have been the subject of many investigations, for instance, [Alperin](http://cms.math.ca/cjm/v21/cjm1969v21.1238-1244.pdf), [Delizia-Tortora](http://www.theoryofgroups.ir/?_action=articleInfo&article=474) and [Baer](http://www.ams.org/journals/proc/1953-004-01/S0002-9939-1953-0053109-X/S0002-9939-1953-0053109-X.pdf).
It's simpler if you use two proofs by induction.

**Lemma.** If $xy=yx$, then $xy^n=y^nx$, for all $n\in\mathbb{N}$.

*Proof.* The base $n=0$ is obvious: $xy^0=x=y^0x$. Suppose the result holds for $n$; then
\begin{align}
xy^{n+1}&=xy^{n}y &&\text{(by definition)}\\
&=y^nxy &&\text{(by induction hypothesis)}\\
&=y^nyx &&\text{(by hypothesis)}\\
&=y^{n+1}x &&\text{(by definition)}
\end{align}
which ends the proof.

**Theorem.** If $xy=yx$, then $(xy)^n=x^ny^n$, for all $n\in\mathbb{N}$.

*Proof.* The base $n=0$ is obvious: $(xy)^0=1=x^0y^0$. Suppose the result holds for $n$; then
\begin{align}
(xy)^{n+1}&=(xy)^n(xy) &&\text{(by definition)}\\
&=(x^ny^n)(xy) &&\text{(induction hypothesis)}\\
&=x^n(xy^n)y \\
&=x^n(xy^n)y &&\text{(by the lemma)}\\
&=(x^nx)(y^ny)\\
&=x^{n+1}y^{n+1}
\end{align}
which ends the proof.

For $n<0$, set $g=x^{-1}$, $h=y^{-1}$ and $m=-n$; then
$$
gh=x^{-1}y^{-1}=(yx)^{-1}=(xy)^{-1}=hg
$$
so the theorem can be applied to $g$ and $h$. Now
$$
(xy)^n=((xy)^{-1})^m=(hg)^m=h^mg^n=y^nx^n.
$$