Let $G$ be a group and $a,b\in G$.
given that $(ab)^k=a^k b^k$ and $(ab)^{k+2}=a^{k+2} b^{k+2}$ for some $k\in \mathbb N$. prove that $G$ is abelian.
So far my attempt was: $(ab)^{k+2}=(ab)(ab)^k(ab) \Longrightarrow a^{k+2}b^{k+2}=(ab)a^kb^k(ab) \Longrightarrow a^kb^k=b^{-1}a^{k+1}b^{k+1}a^{-1}$
and from here I'm stuck. I noticed there was a similar question but there was given that also $(ab)^{k+1}=a^{k+1}b^{k+1}$ which is missing in my question.
thanks for your help.