Given a matrix A, how to find B such that AB=BA [duplicate]

Solution 1:

Note that the determinant of $A$ is $-2$, so your matrix is invertible i.e. there exists some matrix $B=A^{-1}$ such that $AB=BA=I$. If I calculated this correctly $$B = \begin{pmatrix} 1 & 1/2& -1/2\\ 1 & -2 &1 \\ -1 & 3/2 & -1/2 \end{pmatrix}.$$

Solution 2:

As Alex Becker said, we could use any scalar multiple of $I$ or $A^n$ where $A^n = A\cdot A \dots A$ where $A$ is multiplied by itself $A$ times. We could also use $A^{-1}$ or $(A^{-1})^n$.

Suppose we have any matrices $B$ and $C$ that satisfy $AB=BA$ and $AC=CA$. Then, $A(c_1 B + c_2 C) = c_1 A B + c_2 A C = c_1 BA + c_2 CA = (c_1 B + c_2 C)A$.

From this we conclude that the collection of all matrices that commute with $A$ (under matrix multiplication) forms a vector space, since any linear combinations of matrices that commute with $A$ will also commute with $A$.