I am aware that matrix multiplication does not generally follow the commutative law. However, I have identified some cases in which matrix multiplication is commutative, and I would like to inquire if there are any additional cases that I may have missed.
The cases I have considered so far are:
$1.$A and B are both diagonal matrices, including scalar, identity, and null matrices.(both are in the same order)
$2.$A and B are both equal matrices.
I am interested in knowing if there are any other scenarios where matrix multiplication follows the commutative law. Specifically, I would like to explore cases beyond diagonal matrices and matrices that are equal to each other.
I would appreciate any insights or examples you can provide regarding cases where matrix multiplication is commutative. Thank you!
If $A$ is a polynomial in $B$, that is, if $A=\sum_0^nc_jB^j$ for some numbers $c_j$ and $n$, then $AB=BA$.
If $A$ and $B$ are simultaneously diagonalizable, that is, if there is an invertible matrix $P$ such that $P^{-1}AP$ and $P^{-1}BP$ are both diagonal, then $AB=BA$.