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?
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]$.