Is it true that the order of $ab$ is always equal to the order of $ba$?

How do I prove that if $a$, $b$ are elements of group, then $o(ab) = o(ba)$?

For some reason I end up doing the proof for abelian(ness?), i.e., I assume that the order of $ab$ is $2$ and do the steps that lead me to conclude that $ab=ba$, so the orders must be the same. Is that the right way to do it?

Solutions Collecting From Web of "Is it true that the order of $ab$ is always equal to the order of $ba$?"

Here’s an approach that allows you to do some hand-waving and not do any calculations at all. $ab$ and $ba$ are conjugate: indeed, $ba=a^{-1}(ab)a$. It is obvious (and probably already known at this point) that conjugation is an automorphism of the group, and it is obvious that automorphisms preserve orders of elements.

Hint: Suppose $ab$ has order $n$, and consider $(ba)^{n+1}$.

Another hint is greyed out below (hover over with a mouse to display it):

Notice that $(ba)^{n+1} = b(ab)^na$.

If $(ab)^n=e$ then $(ab)^na=a$. Since $(ab)^na=a(ba)^n$, $(ba)^n=e$. This proves that the order of $ba$ divides the order of $ab$. By symmetry, the order of $ab$ divides the order of $ba$. Hence the order of $ab$ and the order of $ba$ coincide.

By associativity, $(ab)^p=a(ba)^{p-1}b$ for $p\geqslant 1$. If $(ab)^p=e$ then $a(ba)^{p-1}b=e$, so $a(ba)^p=a$ and $(ba)^p=e$. We conclude that for $p\geqslant 1$,
$$(ab)^p=e\Leftrightarrow (ba)^p=e.$$