You do understand, don't you that there is no one solution? Given any matrix, there exist an infinite number of matrices that commute with it.
Let's just say that the first matrix is
[tex]\left[\begin{array}{cc}1 & 4 \\ 5 & 2\end{array}\right][/tex]
(for no particular reason- I just made up that matrix)
Multiplying that on both left and right by
[tex]\left[\begin{array}{cc}a & b \\ c & d\end{array}\right][/tex]
gives
[tex]\left[\begin{array}{cc}a+ 4c & 4a+ 2b \\ c+ 5d & 4c+ 2d\end{array}\right]= \left[\begin{array}{cc}a+ 4c & b+ 4d \\ 5a+ 2c & 5b+ 2d\end{array}\right][/tex]
which gives the four equations a+ 5b= a+ 4c, 4a+ 2b= b+ 4d, c+ 5d= 5a+ 2c, and 4c+ 2d= 5b+ 2d. Those equations, of course, are NOT independent. Notice that both the first and fourth equations reduce to the same thing: 5b= 4c. As I said before there exist an infinite number of matrices which will commute with the one given.
We can also reduce 4a+ 2b= b+ 4d to 4a+ b= 4d and the third equation, c+ 5d= 5a+ 2c to 5d= 5a + c. From 5b= 4c, b= 4c/5. Then the second equation becomes 4a+ 4c/5= 4d or a= d- c/5. Putting a= d- c/5 into the last equation, 5d= 5d- c+ c which is automatically satisfied. Essentially that means that I can choose c and d to be anything I want and then solve for a and b.
If I take c= 5, d= 1, I get a= 1- 5/5= 0, b= 4(5)/5= 4. I will leave it to you to show that
[tex]\left[\begin{array}{cc}1 & 4 \\5 & 2\end{array}\right]\left[\begin{array}{cc} 0 & 4 \\ 5 & 1\end{array}\left]= \left[\begin{array}{cc} 0 & 4 \\ 5 & 1\end{array}\left]\left[\begin{array}{cc}1 & 4 \\5 & 2\end{array}\right][/tex].
Or I can take c= 10 (obviously, choosing c a multiple of 5 avoids fractions), d= -2, we have that a= -2-2= -4 and b= 8
[tex]\left[\begin{array}{cc}1 & 4 \\5 & 2\end{array}\right]\left[\begin{array}{cc} -4 & 8 \\ 10 & -2\end{array}\left]= \left[\begin{array}{cc} -4 & 8 \\ 10 & -2\end{array}\left]\left[\begin{array}{cc}1 & 4 \\5 & 2\end{array}\right][/tex].