Proving a commutator identity for groups From Wikipedia:

If the derived subgroup is central, then
$$(xy)^n = x^ny^n{\left[y,x\right]}^{n \choose 2}.$$

I was able to prove this for the case $n = 2$:
\begin{align*}
(ab)^{-2}a^2b^2[b,a]&= b^{-1}a^{-1}b^{-1}a^{-1}a^2b^2b^{-1}a^{-1}ba\\\
&= b^{-1}a^{-1}b^{-1}aba^{-1}ba\\\
&= b^{-1}[a,b]a^{-1}ba\\\
&= [a,b]b^{-1}a^{-1}ba\\\
&= [a,b][b,a] = 1.
\end{align*}
For $n = 3$ and further my naive approach isn't working, though. I have no idea where the "$n$ choose $2$" comes from, it seems weird.  How to prove this for the general case?
 A: Your proof is fine.  I'll give a version of the proof that is a bit briefer and a conceptual explanation for the result that indicate how the hypothesis is used.

To me this is just a simple induction.
$$\begin{array}{rl}
(ab)^{n+1}
&= ab(ab)^{n} \\ \\
&= ab \left( a^n b^n [b,a]^{\binom{n}{2}} \right) \\ \\
&= a a^n b [b,a]^n b^n [b,a]^{\binom{n}{2}} \\ \\
&= a^{n+1} b^{n+1} [b,a]^{\binom{n+1}{2}}
\end{array}$$
This first line just separates the power.  The second line is the induction hypothesis.  The third line commutes $n$ copies of $a$ past a single copy of $b$, resulting in $n$ copies of $[b,a]$.  The fourth line groups the $a$s together, the $b$s together, and the commutators together, using that $$\binom{n}{2} + n = \binom{n}{2} + \binom{n}{1} = \binom{n+1}{2}.$$

A conceptual way to see this is that $(ab)^n$ requires moving the first $a$ past 0 $b$s, the next $a$ past 1 $b$, the next $a$ past 2 $b$s, etc. until the last $a$ needs to move past $n-1$ of the $b$s, so that we get a total of $$0+1+2+\dots+(n-1) = \binom{n}{2}$$ commutators.  The hypothesis that $[b,a]$ commutes with $a$ and $b$ is only used to avoid higher order commutators.  No matter what, we get those $\binom{n}{2}$ copies of $[b,a]$.
A: By the way, the formula holds in more generality.  Using the commutator identities:
$$[x,yz] = [x,z]z^{-1}[x,y]z,\qquad [xy,z] = y^{-1}[x,z]y[y,z],$$
which can be verified by direct computation.
Theorem. If $a$ and $b$ commute with $[b,a]$, then:

*

*For all integers $n$, $[a^n,b] = [a,b]^n = [a,b^n]$.

*For all integers $n$, $\displaystyle (ab)^n = a^nb^n[b,a]^{n(n-1)/2}$.
Proof.

*

*If $n=0$ or $n=1$, the identity is trivial. Assuming it holds for $k$, we have
$$
\begin{align*}
[a^{k+1},b] &= [aa^k,b]\\
&=a^{-k}[a,b]a^k[a^k,b]\\
&= [a,b][a^k,b]\\
&= [a,b][a,b]^k \\
&= [a,b]^{k+1}.
\end{align*}$$
So the identity $[a^n,b]=[a,b]^n$ holds for all nonnegative integers. If $k\gt 0$, then
$$\begin{align*}
1 &= [a^{k}a^{-k},b] = a^{k}[a^{k},b]a^{-k}[a^{-k},b]\\
&= a^k [a,b]^k a^{-k}[a^{-k},b]\\
&= a^ka^{-k}[a,b]^k[a^{-k},b]\\
&= [a,b]^k[a^{-k},b].
\end{align*}$$
So $[a^{-k},b] = ([a,b]^k)^{-1} = [a,b]^{-k}$, hence the identity holds for all integers.

Finally,
$$[a,b^n] = [b^n,a]^{-1} = ([b,a]^n)^{-1} = ([b,a]^{-1})^{n} = [a,b]^n.$$
This proves 1.
To prove 2, the result holds for $n=0$ and $n=1$. If the result holds for $k$, then
$$\begin{align*}
(ab)^{k+1} &= (ab)(ab)^k\\
&= aba^kb^k[b,a]^{k(k-1)/2}\\
&=aa^kb[b,a^k]b^k[b,a]^{k(k-1)/2}\\
&=a^{k+1}bb^k[b,a^k][b,a]^{k(k-1)/2}\\
&= a^{k+1}b^{k+1}[b,a]^k[b,a]^{1+2+\cdots+(k-1)}\\
&= a^{k+1}b^{k+1}[b,a]^{1+2+\cdots+k}\\
&= a^{k+1}b^{k+1}[b,a]^{(k+1)k/2}.
\end{align*}$$
And if $k\gt 0$, then
$$\begin{align*}
(ab)^{-k} &= ((ab)^k)^{-1}\\
&= \left(a^kb^k[b,a]^{k(k-1)/2}\right)^{-1}\\
&= [b,a]^{-k(k-1)/2}b^{-k}a^{-k}\\
&= b^{-k}a^{-k}[b,a]^{-k(k-1)/2}\\
&= a^{-k}b^{-k}[b^{-k},a^{-k}][b,a]^{-k(k-1)/2}\\
&= a^{-k}b^{-k}[b,a]^{(-k)(-k)}[b,a]^{-k(k-1)/2}\\
&= a^{-k}b^{-k}[b,a]^{-k(-k + (k/2)- (1/2)}\\
&= a^{-k}b^{-k}[b,a]^{-k(-k-1)/2},
\end{align*}$$
proving the formula for all integers. $\Box$
A: I finally found a proof so I'm answering my own question, but I didn't use Derek's hint. It might be around in disguise, though. And the identity is still a bit mysterious to me. My solution might be a bit silly way to do it, but it seems to work.
Assume $a$ and $b$ are elements of some group such that they both commute with $[a,b]$ (and thus they commute with $[b,a]$ too).
First I prove the following identity by induction: $aba^{n-1}b^{-1}a^{-n} = [b,a]^{n-1}\ $ for all $n \geq 1$.
It's pretty clear it holds for $n = 1$. Suppose the statement holds for $n = k$. Then
\begin{align*}
aba^{(k+1)-1}b^{-1}a^{-(k+1)}\ 
&= aba^kb^{-1}a^{-1}a^{-k} \\
&= aba^k[b,a]a^{-1}b^{-1}a^{-k} \\
&= [b,a]aba^{k-1}b^{-1}a^{-k} \\
&= [b,a][b,a]^{k-1} \\
&= [b,a]^{(k+1)-1}\\
\end{align*}
Using this you can prove $(ab)^n = a^nb^n[b,a]^{n \choose 2}$ by induction. Case $n=2$ was proved in my question. Suppose the identity holds for $n = k-1$. Then
\begin{align*}
(ab)^{k}\ 
&= ab(ab)^{k-1} \\
&= aba^{k-1}b^{k-1}[b,a]^{k-1 \choose 2} \\
&= (aba^{k-1}b^{-1}a^{-k})a^{k}b^{k}[b,a]^{k-1 \choose 2} \\
&= [b,a]^{k-1}a^{k}b^{k}[b,a]^{k-1 \choose 2} \\
&= a^{k}b^{k}[b,a]^{{k-1 \choose 2}+(k-1)} \\
&= a^{k}b^{k}[b,a]^{k \choose 2}
\end{align*}
