Find all $2\times 2$ matrices that commutes with the matrix $\pmatrix{a & b\\ c & d}$, with $bc\neq 0$ I want to find all $2\times 2$ matrices that commutes with the matrix $\pmatrix{a & b\\ c & d}$, with $bc\neq 0$.
For this, suppose $\pmatrix{e & f\\ g& h}$ such that
 $\pmatrix{a & b\\ c & d}\pmatrix{e & f\\ g& h}=\pmatrix{e & f\\ g& h}\pmatrix{a & b\\ c & d}$. Equating both sides, we can get the values of $e,f,g,h$. But this way is complicated. Is there any sophisticated way than the above.
 A: The matrix equation $AX-XA=0$ is a special case of the Sylvester matrix equation $AX+XB=C$ for given $A,B,C$. There is indeed a nice way to solve this equation, see the references given above. For $2\times 2$ matrices, studying the system of polynomial equations is a good idea, too. It works quite well, even for matrices in $GL_2(\mathbb{Z})$, where you have Diophantine equations (and then, say $ab=1$ has only the solutions $a=b=1$ or $a=b=-1$).
A: Case 1. You are a scientist. In fact the proof of Yuval Filmus is false. The commutant $C(M)$ of your matrix $M$ is a vector space of dimension $1^2+1^2=2$ or $2^2=4$. Note that $I_2$ and $M$ are in the commutant and form a free system. Moreover $M$ is not scalar and the dimension of $C(M)$ is $<4$, then is $\leq 2$. Conclusion: $C(M)=span\{I_2,M\}$.
Case 2. You are ignorant. Since $M$ is not a scalar matrix, there is $u$ s.t. $\{u,Mu\}$ is a free system. In this new basis, $M$ becomes $M'=\begin{pmatrix}0&r\\1&t\end{pmatrix}$. Then you solve, with hand, the equation $M'X=XM'$ where $X=\begin{pmatrix}x&y\\p&q\end{pmatrix}$ and you find all the matrices in the form $\alpha I_2+\beta M'$.
A: First we have to find out which matrices commute with a Jordan block $\begin{pmatrix}0&1\\0&0\end{pmatrix}$. Since
$$ \begin{pmatrix}0&1\\0&0\end{pmatrix} \begin{pmatrix}x&y\\z&w\end{pmatrix} = \begin{pmatrix}z&w\\0&0\end{pmatrix}, \begin{pmatrix}x&y\\z&w\end{pmatrix} \begin{pmatrix}0&1\\0&0\end{pmatrix} = \begin{pmatrix}0&x\\0&z\end{pmatrix},$$
we find out that $z = 0$ and $x = w$, so the solution space is two-dimensional.
Second, we do the same for a diagonal matrix with two different eigenvalues: $\begin{pmatrix}0&0\\0&1\end{pmatrix}$:
$$ \begin{pmatrix}0&0\\0&1\end{pmatrix} \begin{pmatrix}x&y\\z&w\end{pmatrix} = \begin{pmatrix}0&0\\z&w\end{pmatrix}, \begin{pmatrix}x&y\\z&w\end{pmatrix} \begin{pmatrix}0&0\\0&1\end{pmatrix} = \begin{pmatrix}0&y\\0&w\end{pmatrix},$$
so the constraints are $y=z=0$, and again the solution space is two-dimensional.
Consider now the Jordan form of the given matrix. It is either a Jordan block of dimension 2, a diagonal matrix with different eigenvalues, or a scalar. In the first two cases, the commutator space has dimension 2, and in the last, it has dimension 4. This explains loup blanc's remark, which can be generalized for arbitrary square matrices.
As loup blanc remarks, since scalars commute with all matrices, the only matrices whose Jordan form is scalar are the scalars themselves, and our matrix can't be scalar since $bc \neq 0$. So the commutator must have dimension 2.

See the comments for why this argument unfortunately doesn't work. Though it almost does.
Let $M = \begin{pmatrix} a & b \\ c & d \end{pmatrix}$, where $bc \neq 0$. In particular, $M$ is not a scalar, so its minimal polynomial has degree two. So $I,M,M^2$ are linearly independent, and span a linear space of dimension three of matrices commuting with $M$. Since the center of the matrix algebra consists only of the scalars, you obtain this way all matrices commuting with $M$.
