So given that $AB=BA$ Now we need to prove that this means $A^mB^n = B^nA^m$ So I attempt this by first proving $AB^n=B^nA$
So first when $n=1$ It is true as given $AB=BA$
Let $AB^n=B^nA$ be true
Now lets prove that $AB^{n+1}=B^{n+1}A$ is true
$AB^{n+1} = AB^nB = (B^nA)B$ as $B^nA = AB^n$
$B^n(AB)$ [By Associative law]
and now as $AB = BA$
$B^n(AB) = B^n(BA) = B^{n+1}A$
By principle of mathematical induction we have $AB^{n} = B^{n}A$
Now by the same way we have prove $A^mB = BA^m$
Hence that $A^mB^n = B^nA^m$
Is this proving logical?? Is there better way to proving this using perhaps
$\sum_{i\neq j}{A_{ij}B_{ji}}$
or more of simple proving or is my proving suitable?