Your definition (ab=ba) of a commuting element does hold here.
It is important as elements don't have to commute inside a group. This proof only holds when elements do commute.
This is a simple theorem I have read online:
With the following proof:Let G be a group and let be commuting elements of finite orders m, n, respectively,
where . Then is the trivial subgroup.
The question is: What does "commuting element" mean? If it's the ordinary meaning (Like in ab=ba).Let . Then |x| is a divisor of |g| and of |h|, and so |x| is a divisor of
gcd(|g|,|h|)=1. Thus x is the identity of G.
What is the role in the proof and why cannot the above theorem be proven for non-commuting elements?
the hypothesis that g and h commute is not needed, here. <g>∩<h> is a subgroup of <g> and <h>. by lagrange, its order is a common divisor of <g> and <h>, and thus of |g| and |h|.
but this means that |<g>∩<h>| divides gcd(|g|,|h|) = gcd(m,n) = 1, so |<g>∩<h>| = 1, that is: <g>∩<h> is trivial.
the condition that gh = hg may be important, however, in something else that the uses the proof, or that the proof builds upon. without knowing the context, i cannot say for sure.