The Map and Its Coordinate Basis
For fixed \(2\times2\) matrices \(A\) and \(B\), the rule \(X\mapsto AX+XB\) takes a matrix \(X\) as input and returns another \(2\times2\) matrix. To represent this rule by an ordinary matrix, we first need to specify how matrices \(X\) are written as coordinate vectors. The order matters: the columns of the representing matrix will follow the chosen order of basis matrices.
Throughout, the scalars are real, and \(M_{2\times2}(\mathbb{R})\) denotes the vector space of \(2\times2\) real matrices. For \(i,j\in\{1,2\}\), let \(E_{ij}\) be the matrix with a \(1\) in row \(i\), column \(j\), and zeros elsewhere. We use the following fixed ordered basis:
Every \(X=\begin{bmatrix}x_{11}&x_{12}\\x_{21}&x_{22}\end{bmatrix}\) has the decomposition \(X=x_{11}E_{11}+x_{12}E_{12}+x_{21}E_{21}+x_{22}E_{22}\). Each entry of \(X\) is thereby the coefficient of exactly one basis matrix, so this expression is unique. Consequently, the coordinate vector in this ordered basis is \([X]_{\mathcal{B}}=(x_{11},x_{12},x_{21},x_{22})^{\top}\). These coordinates list entries across the first row and then across the second row; that convention is tied to the specified basis order.
The map is linear. Indeed, if \(X,Y\in M_{2\times2}(\mathbb{R})\) and \(r,s\in\mathbb{R}\), distributivity of matrix multiplication gives \(T(rX+sY)=A(rX+sY)+(rX+sY)B=r(AX+XB)+s(AY+YB)=rT(X)+sT(Y)\). Thus a representing matrix is appropriate, and its columns can be computed by applying \(T\) to the four basis matrices.
Proof. Write \(X=x_1E_1+x_2E_2+x_3E_3+x_4E_4\), so \([X]_{\mathcal{B}}=(x_1,x_2,x_3,x_4)^{\top}\). Linearity gives \(T(X)=\sum_{j=1}^{4}x_jT(E_j)\). Taking coordinates preserves sums and scalar multiples, so \([T(X)]_{\mathcal{B}}=\sum_{j=1}^{4}x_j[T(E_j)]_{\mathcal{B}}\). The vectors \([T(E_j)]_{\mathcal{B}}\) are precisely the columns of \(M\), and their weighted sum is the matrix-vector product \(M[X]_{\mathcal{B}}\). \(\square\)
A General Formula for the Representing Matrix
Let the fixed matrices be \(A=\begin{bmatrix}a&b\\c&d\end{bmatrix}\) and \(B=\begin{bmatrix}e&f\\g&h\end{bmatrix}\). For a general input \(X=\begin{bmatrix}x_{11}&x_{12}\\x_{21}&x_{22}\end{bmatrix}\), calculate the two products separately. Their sum is
Collect the coefficients of \(x_{11},x_{12},x_{21},x_{22}\) in that order. This yields the coordinate vector of the output and hence the representing matrix:
Each column has a direct meaning: it records the coordinates of the output when the corresponding input is one matrix unit. For example, the first column is the coordinate vector of \(T(E_{11})\). It is not obtained by reading the entries of \(A\) or \(B\) in isolation; it comes from carrying out both products \(AE_{11}\) and \(E_{11}B\), then adding them. The formula is a useful check, but computing images of the basis matrices is often the clearest way to see why each entry appears where it does.
Worked Representation from Basis Images
Worked Example: A Nondiagonal Pair
Take \(A=\begin{bmatrix}1&2\\0&1\end{bmatrix}\) and \(B=\begin{bmatrix}3&0\\1&-1\end{bmatrix}\). Find the matrix of \(T(X)=AX+XB\) in \(\mathcal{B}\), using basis images.
For \(E_{11}\), the two products are \(AE_{11}=\begin{bmatrix}1&0\\0&0\end{bmatrix}\) and \(E_{11}B=\begin{bmatrix}3&0\\0&0\end{bmatrix}\). Therefore \(T(E_{11})=\begin{bmatrix}4&0\\0&0\end{bmatrix}\), so \([T(E_{11})]_{\mathcal{B}}=(4,0,0,0)^{\top}\).
For \(E_{12}\), multiplication gives \(AE_{12}=\begin{bmatrix}0&1\\0&0\end{bmatrix}\) and \(E_{12}B=\begin{bmatrix}1&-1\\0&0\end{bmatrix}\). Their sum is \(T(E_{12})=\begin{bmatrix}1&0\\0&0\end{bmatrix}\), with coordinate vector \((1,0,0,0)^{\top}\).
For \(E_{21}\), the products are \(AE_{21}=\begin{bmatrix}2&0\\1&0\end{bmatrix}\) and \(E_{21}B=\begin{bmatrix}0&0\\3&0\end{bmatrix}\). Thus \(T(E_{21})=\begin{bmatrix}2&0\\4&0\end{bmatrix}\) and \([T(E_{21})]_{\mathcal{B}}=(2,0,4,0)^{\top}\).
For \(E_{22}\), we obtain \(AE_{22}=\begin{bmatrix}0&2\\0&1\end{bmatrix}\) and \(E_{22}B=\begin{bmatrix}0&0\\1&-1\end{bmatrix}\). Hence \(T(E_{22})=\begin{bmatrix}0&2\\1&0\end{bmatrix}\), whose coordinate vector is \((0,2,1,0)^{\top}\).
Place these four coordinate vectors in order as columns. The resulting representing matrix is
Check: Let \(X=\begin{bmatrix}1&2\\3&4\end{bmatrix}\), so \([X]_{\mathcal{B}}=(1,2,3,4)^{\top}\). The representing matrix gives \((12,8,16,0)^{\top}\). Directly, \(AX=\begin{bmatrix}7&10\\3&4\end{bmatrix}\), \(XB=\begin{bmatrix}5&-2\\13&-4\end{bmatrix}\), and their sum is \(\begin{bmatrix}12&8\\16&0\end{bmatrix}\), with the same coordinate vector.
Worked Example: Diagonal Matrices
Let \(A=\begin{bmatrix}2&0\\0&-1\end{bmatrix}\) and \(B=\begin{bmatrix}3&0\\0&4\end{bmatrix}\). Find the representing matrix and interpret its action on the four entries of \(X\).
Using the general formula, \(a=2,b=0,c=0,d=-1,e=3,f=0,g=0,h=4\). Substituting each value gives
In matrix form, the output is \(T(X)=\begin{bmatrix}5x_{11}&6x_{12}\\2x_{21}&3x_{22}\end{bmatrix}\). For instance, if \(X=\begin{bmatrix}1&2\\3&4\end{bmatrix}\), then \(AX=\begin{bmatrix}2&4\\-3&-4\end{bmatrix}\) and \(XB=\begin{bmatrix}3&8\\9&16\end{bmatrix}\). Adding gives \(\begin{bmatrix}5&12\\6&12\end{bmatrix}\).
Check: The coordinate vector of this output is \((5,12,6,12)^{\top}\). Multiplying the representing matrix by \((1,2,3,4)^{\top}\) gives \((5\cdot1,6\cdot2,2\cdot3,3\cdot4)^{\top}=(5,12,6,12)^{\top}\), as required.
Worked Example: Off-Diagonal Entries Mix Coordinates
Take \(A=\begin{bmatrix}0&1\\1&0\end{bmatrix}\) and \(B=\begin{bmatrix}0&2\\3&0\end{bmatrix}\). Apply the general formula with \(a=d=e=h=0\), \(b=c=1\), \(f=2\), and \(g=3\):
To make the columns concrete, \(T(E_{11})=\begin{bmatrix}0&2\\1&0\end{bmatrix}\), \(T(E_{12})=\begin{bmatrix}3&0\\0&1\end{bmatrix}\), \(T(E_{21})=\begin{bmatrix}1&0\\0&3\end{bmatrix}\), and \(T(E_{22})=\begin{bmatrix}0&1\\3&0\end{bmatrix}\). Their coordinate vectors are, in order, \((0,2,1,0)^{\top}\), \((3,0,0,1)^{\top}\), \((1,0,0,3)^{\top}\), and \((0,1,3,0)^{\top}\), exactly the columns displayed.
Check: For \(X=\begin{bmatrix}1&2\\3&4\end{bmatrix}\), the representing matrix sends \((1,2,3,4)^{\top}\) to \((5,6,13,8)^{\top}\). Direct multiplication gives \(AX=\begin{bmatrix}3&4\\1&2\end{bmatrix}\) and \(XB=\begin{bmatrix}6&2\\12&6\end{bmatrix}\). Their sum \(\begin{bmatrix}9&6\\13&8\end{bmatrix}\) appears not to match the coordinate vector just computed. This discrepancy signals an arithmetic error in the matrix-vector multiplication: its first coordinate is \(0\cdot1+3\cdot2+1\cdot3+0\cdot4=9\), not \(5\). The correct product is \((9,6,13,8)^{\top}\), agreeing with direct multiplication.
Common Pitfall: Reversing the Side of Multiplication
In the last example, the contribution from \(E_{12}B\) is \(\begin{bmatrix}3&0\\0&0\end{bmatrix}\). A tempting but incorrect step is to use \(BE_{12}\) instead: that product is \(\begin{bmatrix}0&0\\0&3\end{bmatrix}\). These are different matrices, so reversing the order changes the map and therefore its representing matrix. The rule is specifically \(AX+XB\): multiply \(A\) on the left of \(X\), and multiply \(B\) on its right.
There is a second related risk: changing the coordinate order partway through a calculation. With \(\mathcal{B}=(E_{11},E_{12},E_{21},E_{22})\), the second coordinate is the \((1,2)\) entry. If instead one lists \(E_{11},E_{21},E_{12},E_{22}\), the coordinate vector and the columns of the representing matrix must both be reordered. A matrix computed for one ordered basis cannot be read as the matrix for another without making that change.
Write the ordered basis and use it for every input and output coordinate vector.
For each basis matrix \(E_{ij}\), calculate \(AE_{ij}\) and \(E_{ij}B\) separately, then add.
Read the four entries of each image in the fixed coordinate order; place that coordinate vector in the corresponding column.
Apply the matrix to one coordinate vector and compare with direct evaluation of \(AX+XB\).
This procedure works because every input matrix is a unique linear combination of the four basis matrices, and linearity carries that combination to the same weighted sum of their images. The representation therefore captures the map on every input, not just on the four basis matrices used to build its columns.
Check Your Understanding
Use the ordered basis \(\mathcal{B}=(E_{11},E_{12},E_{21},E_{22})\) unless a question says otherwise.
- For \(A=\begin{bmatrix}1&0\\2&1\end{bmatrix}\) and \(B=\begin{bmatrix}0&1\\0&2\end{bmatrix}\), write the representing matrix of \(X\mapsto AX+XB\).
- For \(A=\begin{bmatrix}2&0\\0&1\end{bmatrix}\) and \(B=\begin{bmatrix}1&0\\0&3\end{bmatrix}\), state the coefficient multiplying each entry of \(X\) in the output.
- Explain why the columns of the representing matrix are coordinate vectors of images, rather than the images written as \(2\times2\) arrays.
- For \(A=\begin{bmatrix}0&1\\1&0\end{bmatrix}\), \(B=\begin{bmatrix}0&2\\3&0\end{bmatrix}\), and \(X=\begin{bmatrix}1&0\\0&0\end{bmatrix}\), calculate \(AX+XB\) directly and read the same answer from the first column of the representation.
- Give an example of how changing the order of the matrix-unit basis affects the coordinate vector of a matrix.