Relationship between $\operatorname{ord}(ab), \operatorname{ord}(a)$, and $\operatorname{ord}(b)$ [duplicate]

$\newcommand{\ord}{\operatorname{ord}}$ Note that by commutativity, $(ab)^n=a^nb^n$. If $a^nb^n=1$ then $a^n=(b^{-1})^n\in \langle a\rangle\cap \langle b\rangle \leq \langle a\rangle,\langle b\rangle$ so what can you conclude about $n$ and the orders of $a,b$ which are the orders of $\langle a\rangle,\langle b\rangle$?

ADD The above gives $\ord a,\ord b\mid n$, so their $\rm lcm$ i.e. their product by coprimeness divides $n$. But if $k$ equals the product of the orders it is immediate $(ab)^k=1$.


Note that $(ab)^d=e$ if and only if $m\mid d$ and $n\mid d$.


Here is a proof for $\mathbf{Z}/m\mathbf{Z}$, I believe the proof is nearly identical for an Abelian group $G$. Let $o(a)=h, o(b)=k, o(ab)=r$. We have $(ab)^r\equiv 1\pmod{m}, a^h\equiv 1\pmod{m},$ and $b^k\equiv 1\pmod{m}$. Consider $(ab)^{hk}$. We have $$(ab)^{hk}=a^{hk}b^{hk}=(a^h)^k(b^k)^h\equiv 1\pmod{m},$$ so $o(ab)|hk\implies r|hk$. We also have $b^{rh}\equiv (a^h)^rb^{rh}\equiv (ab)^{rh}\equiv 1\pmod{m}$, so $k|rh$. Since $\gcd(k,h)=1$, $k|r$. Similarly, $h|r$. Thus, there are integers $\alpha,\beta\in\mathbf{Z}$ such that $r=h\alpha=k\beta$. Moreover, by Bézout's lemma, there are integers $x$ and $y$ such that \begin{align*}&\phantom{\implies} xh+yk=1\\ &\implies rxh+ryk = r\\ &\implies k\beta xh+h\alpha yk = r\\ &\implies hk(\beta x+\alpha y) = r,\end{align*} so $hk|r$. Thus we have $r|hk$ and $hk|r$, so $r=hk$, as desired.