How does invertibility of matrix B affect the answer? Let $V$ be vector space of $2\times2$ order matrices and let $T\in L(V,V)$ be defined as
$T(A)=AB-BA$, where $B$ is $2\times2$ order invertible matrix.
Then find $\dim{\ker{T}}$.  
I took an arbitrary matrix $B=\left[\begin{matrix}a&b\\c&d\end{matrix}\right]$, with condition $ad\neq bc$.
Then, using values of $T(e_{ij})$, I found the following $4\times4$ order transformation matrix :-
$$\left[\begin{matrix}0&c&-b&0\\b&d-a&0&-b\\-c&0&a-d&c\\0&-c&b&0\end{matrix}\right]$$
Am I correct this far ?
If yes, then how to use $ad\neq bc$ to find its rank (and subsequently the nullity) ?
Also, I would like see how the answer would have been different, had the matrix $B$ been singular.  
 A: Hint Notice that by definition $\ker T$ consists of all of the $2 \times 2$ matrices that commute with $B$.
If we take the basis of $V$ to be the standard one, then I believe the given matrix representation $$[T] = \begin{pmatrix}0&c&-b&0\\b&d-a&0&-b\\-c&0&a-d&c\\0&-c&b&0\end{pmatrix}$$ of $T : V \to V$, $T(A) = A B - B A$, $B := \pmatrix{a&b\\c&d}$, is correct.
We can now analyze $[T]$ to determine its kernel, which clearly depends on the choices of $a, b, c, d$. First, the last column is a multiple of the first column, so $[T]$ is degenerate and $\dim \ker T \geq 1$. In fact, the cofactor matrix $\operatorname{cof} T$ is zero, so all of the $3 \times 3$ minors of $[T]$ have determinant zero, and thus $\dim \ker T \geq 2$.

 Suppose that $\dim \ker T \geq 3$, so that all of the $2 \times 2$ minors have determinant zero. In particular, since the upper-right, middle, and lower-left $2 \times 2$ minors respectively have determinants $b^2, -(a - d)^2, c^2$, we have $a = d, b = c = 0$---equivalently that $B = \lambda I$ for some constant $a$---and this makes $[T] = 0$. 

Thus, we can conclude:


*

*If $B = \lambda I$ (that is, if $B$ is a scalar matrix) then $[T] = 0$ and $\dim \ker T = 4$.

*If $B \neq \lambda I$ for any $a$, then $\dim \ker T = 2$.


Notice that both of these statements are independent of whether $B$ is invertible.
Though we've now resolved the problem, it's instructive to describe $\ker T$ in the second case. We find
$$\ker [T] = \left\{\pmatrix{\lambda + \mu a\\\mu b\\\mu c\\\lambda + \mu d} \right\},$$
or in matrix notation,
$$\ker T = \{\lambda I + \mu B : \lambda, \mu \in \Bbb F\} = \operatorname{span}\{I, B\}.$$
In other words, every matrix that commutes with a $2 \times 2$ (nonscalar) matrix $B$ is a linear combination of the matrices that obviously commute with $B$, namely, the identity $I$ and $B$ itself.
