For which case does AB=BAAB = BAAB=BA necessarily hold for all matrices of that type?
When both AAA and BBB are diagonal
When A=cIA = cIA=cI (scalar multiple of identity) and BBB is any matrix
When both AAA and BBB are upper triangular
Both (a) and (b)