<s>[INST] Commutative matrices Knowing that $AB=BA$, find the matrices that commute with the matrix
\begin{pmatrix}
  1 & 2 \\
  3 & 4  \\
 \end{pmatrix}
I have assumed that multiplying matrix 
$\begin{pmatrix}
  a & b \\
  c & d \end{pmatrix}
$ by the first one should be equal to multiplying the first one by $\begin{pmatrix}
  a & b \\
  c & d \end{pmatrix}
$
Alright: 
$\begin{pmatrix}
a+2c & b+2d\\
3a+4c & 3b+4d\end{pmatrix}
$
 equals
$\begin{pmatrix}
a+3b & 2a+4b\\
c+3d & 2c+4d\end{pmatrix}
$

so:
$\begin{pmatrix}
a+2c = a+3b => 2c = 3b = 0\\
3a+4c = c +3d => a+c - d=0\\
b+2d = 2a+ 4b => -2a - 3b + 2d = 0\\
3b + 4d = 2c + 4d => 3b - 2c =0\end{pmatrix}
$
I was left with equations from which I have formed another matrix and used Gauss algorithm to evaluate it: 
$\begin{pmatrix} 
1 & 0 & 1 & -1 & 0 \\
-2& -3 &0 &2& 0\\
0 &3 &-2& 0 &0\\
0 &-3& 2& 0 &0\end{pmatrix}
$
I made some changes (r3:=r3+r4; r4:=r4+r3; r2:=r2+2r1) and the upper diagonal matrix is:
$\begin{pmatrix} 
1 & 0 & 1 & -1 & 0 \\
0& -3 &2 &0& 0\\
0 &0 &0& 0 &0\\
0 &0& 0& 0 &0\end{pmatrix}
$

I was left with a set of equations
\begin{eqnarray}
a+ c + d      &=& 0 \\
-3b + 2c &=& 0
\end{eqnarray}
and now I'm stuck. Any help would be highly appreciated! 

EDIT: A is the given matrix. 
 [/INST] You have figured it out. The equations you end up with:
2c=3b

and
a+c=d

are correct. Basically this means that you can specify any TWO values of the matrix arbitrarily and then the remaining two are fixed by the above equations. For example, suppose you want to specify a and b. The, rewrite the equations like this:
c=3b/2

and 
d=a+3b/2

Given, for example, a=2.345 and b=3.14 then
c=1.5*3.14

and
d=2.345+1.5*3.14

Get it?
</s>