Two words $a$ and $b$ commute if $ab=ba$. 

How to demonstrate that $a$ and $b$ commute if and only if they are powers of 
the same word ?

$ab=ba \Leftrightarrow \exists \space \tau \in \Sigma^{\*} \mid a=\tau^{k} and \space b=\tau^{k'}$

The demonstration in this direction is trivial: 

$\space \exists \space \tau \in \Sigma^{\*} \mid a=\tau^{k} and \space b=\tau^{k'} \Rightarrow ab=ba$

But I don't manage to find an elegant solution for the other direction.