Prove that $T$ is a Linear Transformation , if $T$ is defined by $T(A)=XA-AX$ Let $T : M_{2\times 2} \to M_{2\times 2}$ be defined by 
$$
T(A) =
\begin{pmatrix} 2 & 1 \\ 1 & 2 \end{pmatrix} A
 − A \begin{pmatrix} 2 & 1 \\ 1 & 2 \end{pmatrix}.
$$
How do I prove that $T$ is a linear transformation and then find the basis for the kernel of $T$. The $2\times 2$ matrix multiplied by $A$ confuses me.
 A: Note that the set of all $2\times 2$ matrices is a vector space. $T$ is a function which takes in a $2\times 2$ matrix and gives you back a $2\times 2$ matrix, so it makes sense to ask whether it's a linear transformation. Indeed, using the usual properties of matrix multiplication, this turns out to be the case. Letting $X$ be the matrix used in the definition of $T$, we have
$$T(A+B) = X(A+B)-(A+B)X = XA+XB-AX-AB 
$$$$= (XA-AX)+(XB-BX) = T(A)+T(B)$$
$$T(kA) = X(kA)-(kA)X = k(XA)-k(AX) = k(XA-AX) = kT(A)$$
To find the kernel of $T$, set $T(A) = 0$. This gives us $XA=AX$. Expanding that expression in terms of the components of $A$ gives us the four equations:
$$2A_{11}+A_{21} = 2A_{11}+A_{12}$$
$$2A_{12}+A_{22} = A_{11}+2A_{12}$$
$$A_{11}+2A_{21} = 2A_{21}+A_{22}$$
$$A_{12}+2A_{22} = A_{21}+2A_{22}$$
Simplifying gives us $A_{12}=A_{21}$, $A_{11}=A_{22}$. Solving this system as usual gives us the kernel of $T$. 
A: Linearity is easy to prove.
Now let $A=\begin{pmatrix} a & b\\ c & d \end{pmatrix}$ then $\begin{pmatrix} a & b \\ c & d \end{pmatrix} \begin{pmatrix} 2 & 1 \\ 1 &2\end{pmatrix}=\begin{pmatrix} 2a+b & a+2b \\ 2c+d & c+2d \end{pmatrix}=D_1$
And $\begin{pmatrix} 2 & 1 \\ 1 & 2 \end{pmatrix}A=\begin{pmatrix} 2a+c & 2b+d \\ a+2c & b+2d \end{pmatrix}=D_2$
Thus $T(A)=D_1-D_2=\begin{pmatrix} b-c & a-d \\ d-a &c-b  \end{pmatrix}$
Now let $T(A)=\mathbb{O}_{2\times2}$ then we have that $b=c$ and $a=d$ thus $A \in ker(T)$ iff $A=\begin{pmatrix} a & b \\ b & a \end{pmatrix}$ for $a,b \in \mathbb{R}$.
Thus $Ker(T)=\{a\begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix}+b\begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix}|a,b \in \mathbb{R}\}$ thus $Ker(T)=span(\{\begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix},\begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix}\})$
And you can easily see that $\begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix}$ and $\begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix}$ are linearly independent.
