# How does a transformation matrix of linear map defined on square matrices look like?

I am quite confused how the transformation matrix looks like in standard basis when the linear map is defined on square matrices.

Given a mapping $$T: M_2(\mathbb{R}) \rightarrow M_2(\mathbb{R})$$ defined as follows:

$$$$T \left( \begin{bmatrix} a & b \\ c & d \end{bmatrix} \right) = \begin{bmatrix} a & b \\ c & d \end{bmatrix} \begin{bmatrix} 1 & 2 \\ 3 & -1 \end{bmatrix},$$$$

show that $$T$$ is linear. Find a transformation matrix in standard basis.

I have successfully proved that T is indeed linear. I know that the standard basis of $$M_2(\mathbb{R})$$ is:

$$$$e_1=\begin{bmatrix} 1 & 0 \\ 0 & 0 \end{bmatrix}, e_2=\begin{bmatrix} 0 & 1 \\ 0 & 0 \end{bmatrix}, e_3=\begin{bmatrix} 0 & 0 \\ 1 & 0 \end{bmatrix}, e_4=\begin{bmatrix} 0 & 0 \\ 0 & 1 \end{bmatrix}$$$$

Applying T on each of the basis vectors gives me: $$$$T(e_1)=\begin{bmatrix} 1 & 2 \\ 0 & 0 \end{bmatrix}, T(e_2)=\begin{bmatrix} 3 & -1 \\ 0 & 0 \end{bmatrix}, T(e_3)=\begin{bmatrix} 0 & 0 \\ 1 & 2 \end{bmatrix}, T(e_4)=\begin{bmatrix} 0 & 0 \\ 3 & -1 \end{bmatrix}$$$$

How to proceed from here?

Hint: $$T(e_1) = e_1 + 2 e_2 + 0 e_3 + 0e_4$$. $$T(e_2) = 3e_1 - e_2 + 0 e_3 + 0e_4$$. etc. Write out each image of the standard basis in terms of the vector space basis. The coefficients of $$T(e_i)$$ will form a column of the matrix representation. Your matrix should have 16 elements.