# Find all matrices that commute with given matrix

Find all $2\times 2$ matrices that commute with

$$\left( \begin{array}{cc} 2 & 3 \\ 1 & 4 \end{array} \right)$$

My progress:

I know that a square matrix commutes with itself, the identity matrix of that order, the null matrix of that order and any scalar matrix of that order.

The answer has been given as:

$$\left( \begin{array}{cc} m & 3n \\ n & m+2n \end{array} \right)$$

I don't understand how they're getting that form. Can someone please explain?

Let's call your matrix $$A = \left( \begin{array}{cc} 2 & 3 \\ 1 & 4 \end{array} \right)$$

We want a matrix $X_{2\times 2} = \begin{pmatrix} a & b\\ c&d\end{pmatrix}$ such that $AX = XA$.

$$AX = \begin{pmatrix} 2a + 3c & 2b+3d\\ a + 4c&b+4d\end{pmatrix}$$

$$XA = \begin{pmatrix} 2a + b&3a + 4b\\2c+d & 3c+4d\end{pmatrix}$$

Now you have a system of equations in four variables:

$$2a + 3c = 2a + b \implies b = 3c$$

$$2b+3d = 3a + 4b$$

$$a + 4c = 2c + d$$

$$b+4d= 3c+4d$$

Solve the system of equations. (Note, if you do Gaussian Elimination, you'll have two of the four rows all zero.)

You need $$\left(\begin{array}{cc}a&b\\c&d\end{array}\right) \left(\begin{array}{cc}2&3\\1&4\end{array}\right)= \left(\begin{array}{cc}2&3\\1&4\end{array}\right)\left(\begin{array}{cc}a&b\\c&d\end{array}\right)$$
Multiply out the matrices; that will give you four equations that connect $a,b,c$ and $d$. Then solve those equations.

If you write down the unknown matrix as $$\begin{bmatrix} a & b \\ c & d \end{bmatrix}$$ Then you want $$\begin{bmatrix} a & b \\ c & d \end{bmatrix} \cdot \begin{bmatrix} 2 & 3 \\ 1 & 4 \end{bmatrix} = \begin{bmatrix} 2 & 3 \\ 1 & 4 \end{bmatrix} \begin{bmatrix} a & b \\ c & d \end{bmatrix}$$ Write out the left and right sides as matrices with entries like 2a + 1b, etc. Set them equal. You get four equations in 4 unknowns. Solve, and you get the answer above.