## Basis For Subspace Consisting of Matrices Commute With a Given Diagonal Matrix

## Problem 287

Let $V$ be the vector space of all $3\times 3$ real matrices.

Let $A$ be the matrix given below and we define

\[W=\{M\in V \mid AM=MA\}.\]
That is, $W$ consists of matrices that commute with $A$.

Then $W$ is a subspace of $V$.

Determine which matrices are in the subspace $W$ and find the dimension of $W$.

**(a)** \[A=\begin{bmatrix}

a & 0 & 0 \\

0 &b &0 \\

0 & 0 & c

\end{bmatrix},\]
where $a, b, c$ are distinct real numbers.

**(b)** \[A=\begin{bmatrix}

a & 0 & 0 \\

0 &a &0 \\

0 & 0 & b

\end{bmatrix},\]
where $a, b$ are distinct real numbers.