You can
put this solution on YOUR website!Off the top of my head I can only think of these cases where commutativity holds:

where I is the identity matrix

where

is the inverse of matrix A
Also, according to
Wolfram Mathworld, "...matrix multiplication is not, in general, commutative (although it is commutative if A and B are diagonal and of the same dimension)."
For instance, if you have matrices diagonal matrices A and B

,
the first product AB is
and the second product BA is
which is the same product as AB. So if you were to do this with general entries of the matrices A and B, you would find that

only if A and B are diagonal matrices and they are both the same size