<s>[INST] Let $A=[1 2 0 1 ]$. Find all $2×2$ matrices B, $B≠O_2$ and $B≠I_2$ such that $AB=BA$. 
Let $A=[1 2 0 1 ]$. Find all $2×2$ matrices B, $B≠O_2$ and $B≠I_2$ such that $AB=BA$

Explain your answer.
I know two ways to find B
A) As det of A is 1, it is invertible. So A = B (inverse) 
B) Or by assigning a,b,c,d as four elements of B matrix and then solving for AB=BA
But the question says to find all 2×2 matrices B. Is there any way i can find all possible matrices for B such that AB=BA?
 [/INST] So $$A = \begin{pmatrix}1&2 \\ 0&1 \end{pmatrix}$$
If $$B = \begin{pmatrix}a&b \\ c&d \end{pmatrix}$$
From $$\begin{pmatrix}1&2 \\ 0&1 \end{pmatrix} \begin{pmatrix}a&b \\ c&d \end{pmatrix}          =  \begin{pmatrix}a&b \\ c&d \end{pmatrix} \begin{pmatrix}1&2 \\ 0&1 \end{pmatrix}$$
 we have $$ a+2c = a\implies c=0$$
and $$b+2d = 2a+b \implies a=d$$
so $$B = \begin{pmatrix}a&b \\ 0&a \end{pmatrix}$$
Now you have two more equations, but from them you do not get any new information so we are done. 
</s>