Matrix multiplication in general is not commutative. Here is an example:
\(A, B \in R^{2 \times 2}\)
When is 2x2 matrix multiplication commutative?
So you get four equations:
You might note that (I) is the same as (IV). So you have those equations:
Case #1: a != d and e != h
Now (I) and (II) are essentially the same. So we only demand that \( bg = cf\) and \(a \neq d\) and \(e \neq h\) for commutative matrix multiplication of \(2 \times 2\) matrices.
Case #2.1: a == d
So you end up with: (\(e = h\) and \(bg = cf\)) or (\(b = c = 0\))
Case #2.2: e == h
So you end up with: (\(a = d\) and \(bg = cf\)) or (\(f = g = 0\))
Special Cases
Matrix multiplication is always commutative if ...
- ... one matrix is the Identity matrix.
- ... one matrix is the Zero matrix.
- ... both matrices are $2 \times 2$ rotation matrices. (basically case #2)
- ... both matrices are Diagonal matrices.
Simultaneous diagonalization
Two matrices \(A, B \in R^{n \times n}\) are called simultaneous diagonalizable \(: \Leftrightarrow\) one matrix \(S \in R^{n \times n}\) exists, such that \(D_A = S^{-1} \cdot A \cdot S\) and \(D_B = S^{-1} \cdot B \cdot S\) with \(D_A\) and \(D_B\) are diagonal matrices.
Statement: \(A, B \in \mathbb{R}^{n \times n}\) are simultaneous diagonalizable \(\Rightarrow A \cdot B = B \cdot A\)
Proof: As A and B are simultaneous diagonalizable, a matrix \(T \in \mathbb{R}^{n \times n}\) exists, such that \(D_A = S^{-1} \cdot A \cdot S\) and \(D_B = S^{-1} \cdot B \cdot S\) with \(D_A\) and \(D_B\) are diagonal matrices.
Statement: \(A \cdot B = B \cdot A \nRightarrow A, B \in \mathbb{R}^{n \times n}\) are simultaneous diagonalizable.
Proof: by Counter-Example
but
is not diagonalizable. \(\blacksquare\)
See also
- When is matrix multiplication commutative? on math.stackexchange.com