Commuting matrices - unclear on steps

I would like to find all matrices that commute with matrix $$A =\begin{pmatrix}1 & -1 \\ 0 & 1 \end{pmatrix}$$

Proposed solution

$\begin{pmatrix}a&b \\c &d\end{pmatrix}\begin{pmatrix}1&-1 \\0 &1\end{pmatrix} = \begin{pmatrix}1& -1\\ 0&1\end{pmatrix}\begin{pmatrix}a&b \\ c&d\end{pmatrix} = \begin{pmatrix}a& -a+b\\ c&-c+d\end{pmatrix}=\begin{pmatrix}a-c& b-d\\ c&d\end{pmatrix}$

$$a=a-c$$

$$-a+b =b-d$$

$$c=c$$

$$-c+d=d$$

So any matrix of the form $\begin{pmatrix}d & 0 \\ 0 & a\end{pmatrix}$

Please could someone review and correct if needs be

Thanks

-
It seems to me there is a sign error $-a+b=b-d$, not $b+d$ as you wrote. –  Julian Kuelshammer Dec 11 '12 at 22:37
The first thing to do is to check to see whether your answer works, that is, whether it commutes with the given matrix. You don't need anyone's help to do that. –  Gerry Myerson Dec 11 '12 at 22:38
Any matrix commutes with the identity... If your answer doesn't contain $I_2$, it cannot be right. –  N. S. Dec 11 '12 at 22:45
Your second equation implies $a = d$. –  Shaun Ault Dec 11 '12 at 22:51
Any matrix commutes with itself, so if your answer doesn't contain $A$, it can't be right. –  Gerry Myerson Dec 11 '12 at 22:52

Somewhat more generally: your matrix is $I - N$ where $N = \pmatrix{0 & 1\cr 0 & 0\cr}$. Every $2 \times 2$ matrix commutes with $I$, so the question is what commutes with $N$. We can write $N = u v^T$ where $u$ and $v$ are nonzero (column) vectors, in this case $\pmatrix{1\cr 0\cr}$ and $\pmatrix{0\cr 1\cr}$. Now $B(u v^T) = (Bu) v^T$ is a matrix whose rows are all scalar multiples of $v^T$ and whose columns are all scalar multiples of $Bu$, while $(uv^T) B = u (v^T B)$ is a matrix whose rows are scalar multiples of $v^T B$ and whose columns are all scalar multiples of $u$. Thus for some scalar $\lambda$, we must have $Bu = \lambda u$ and $v^T B = \lambda v^T$, i.e. $u$ and $v^T$ are right and left eigenvectors of $B$ for the same eigenvalue, and this condition is clearly sufficient as well as necessary. Now if $B$ is such a matrix, $C = B-\lambda I$ satisfies the same conditions with eigenvalue $0$. So the matrices that commutes with $A=I-u v^T$ are those of the form $B=\lambda I + C$ where $Cu = 0$ and $v^T C = 0$, i.e. all rows of $C$ are orthogonal to $u$ and all columns of $C$ are orthogonal to $v$.