Let, $A = \begin{bmatrix} 1 & 0 & 0 \\ 0 & 1& 0 \\ 0 & 0 & -1 \end{bmatrix}$ . Then find $ S= \{B \in M_{3\times3}(\Bbb R) :AB=BA\}$ .
My attempt:
Bare computation yielded$$\left\{B\in M_{3\times3}(\Bbb R)\,\middle|\,B = \begin{bmatrix} c_1 & c_2 & 0 \\ c_3 & c_4& 0 \\ 0 & 0 & c_5 \end{bmatrix} , c_1,c_2,c_3,c_4,c_5 \in \Bbb R\right\} \subseteq S$$ but I am having trouble showing the reverse inclusion (if it is true!).
I was also tempted to use eigenvalues and eigenspaces to reach some conclusion by looking at the diagonal form of $A$ (displaying its eigenvalues), but can't get my way through!
Thanks in advance for help.
Yes, the reverse inclusion is true. Note that if$$B=\begin{pmatrix}b_{11}&b_{12}&b_{13}\\b_{21}&b_{22}&b_{23}\\b_{31}&b_{32}&b_{33}\end{pmatrix},$$then$$AB-BA=\begin{pmatrix}0&0&2b_{13}\\0&0&2b_{23}\\-2b_{31}&-2b_{32}&0\end{pmatrix}.$$Therefore, $AB=BA$ if and only if $b_{13}=b_{23}=b_{31}=b_{32}=0$.