6.3 The Matrix of a Linear Transformation

Definition 6.3.1. Let \(T\in \mathcal {L}(A,B)\) and let \((x_1,x_2,\dots ,x_n)\) be a basis of \(A\) and \((y_1,y_2,\dots ,y_n)\) be a basis of \(B\). For each \(k=1,2,\dots , n\), we can write \(T_{x_k}\) uniquely as a linear combination of the \(y's\). i.e. \(T_{x_k}=a_{1k}y_1+a_{2k}y_2+\cdots +a_{mk}y_m\) where \(a_{jk}\in \mathbb {F}\).
The coefficients \(a's\) then form an \(m\times n\) matrix \[ \begin {pmatrix} a_{11}&\cdots&a _{1n}\\ \vdots& \ddots& \vdots \\ a_{m1}&\cdots&a _{mn} \end {pmatrix} \] is called the matrix of \(T\) with respect to the bases \((x_1,x_2,\dots ,x_n)\) and \((y_1,y_2,\dots ,y_n)\), written \(M\Big (T,(x_1,x_2,\dots ,x_n),(y_1,y_2,\dots ,y_n)\Big )\) or simply \(M(T)\). Note that the coefficients of \(Tx_k\) occupy the \(k^{\text {th}}\) column.

Remark. Unless stated otherwise, you should assume that the bases in question are standard ones i.e. \(k^{\text {th}}\) basis has \(1\) in the \(k^{\text {th}}\) slot and zeros everywhere.

Example 6.3.2. Define \(T\in \mathcal {L}(\mathbb {F}^{2},\mathbb {F}^3)\) by \(T(x,y)=(x+3y, 2x+5y, 7x+9y)\) determine the matrix of \(T\).

Solution. \(T(1,0)=(1,2,7)\) and \(T(0,1)=(3,5,9)\) so that \(M(T)= \begin {pmatrix} 1&3\\2&5\\7&9\\ \end {pmatrix} \).

Example 6.3.3. Define \(T\in \mathcal {L}(\mathbb {R}^3,\mathbb {R}^2)\) by \(T(x,y,z)=(x+y-z, 2x+z)\). Find the matrix of \(T\) relative to

i.
Standard basis for \(\mathbb {R}^3\).
ii.
\(\mathbb {R}-\)bases \(\alpha =\{(1,0,-1), (1,1,1), (1,0,0)\}\) for \(\mathbb {R}^3\) and \(\beta =\{(1,1), (1,0)\}\) for \(\mathbb {R}^2\).

Solution.

i.
\(M(T)= \begin {pmatrix} 1&1&-1\\2&0&1 \end {pmatrix} \)
ii.
\(T(1,0,-1)=(2,1)=(1,1)+(1,0)\) \(T(1,1,1)=(1,3)=3(1,1)-2(1,0)\)
\(T(1,0,0)=(1,2)=2(1,1)-(1,0)\)

\(M(T,\alpha ,\beta )= \begin {pmatrix} 1&3&2\\1&-2&-1 \end {pmatrix} \)

Theorem 6.3.4. Let \(T:A\longrightarrow B\) and \(L:B\longrightarrow C\) be linear. Then the composition \(L\circ T\) is a linear transformation from \(A\) to \(C\), and its matrix is the product of the matrices: \[M(L\circ T)=M(L)\,M(T),\] where the bases used for \(B\) agree in the two factors.

Proof. Linearity of \(L\circ T\) is immediate: \[ (L\circ T)(x+y)=L\big (T(x)+T(y)\big )=L(T(x))+L(T(y)),\] and similarly \((L\circ T)(\lambda x)=\lambda (L\circ T)(x)\).

For the matrices, let \(\alpha =\{a_1,\dots ,a_n\}\), \(\beta =\{b_1,\dots ,b_m\}\) and \(\gamma \) be bases for \(A\), \(B\) and \(C\). By definition the \(j\)-th column of \(M(T,\alpha ,\beta )\) holds the coordinates of \(T(a_j)\) in \(\beta \), say \(T(a_j)=\sum _k t_{kj}b_k\). Applying \(L\) and using linearity, \[(L\circ T)(a_j)=L\left (\sum _k t_{kj}b_k\right )=\sum _k t_{kj}L(b_k) =\sum _k t_{kj}\sum _i \ell _{ik}c_i=\sum _i\left (\sum _k \ell _{ik}t_{kj}\right )c_i.\] The coefficient of \(c_i\) is \(\sum _k \ell _{ik}t_{kj}\), which is the \((i,j)\) entry of the product \(M(L)M(T)\). So the \(j\)-th column of \(M(L\circ T)\) is the \(j\)-th column of \(M(L)M(T)\) for every \(j\). □

Remark. This is the reason matrix multiplication is defined the way it is. The apparently awkward “rows times columns” rule is exactly what is needed to make the matrix of a composition equal the product of the matrices; had multiplication been defined entrywise, no such statement would be available.

Theorem 6.3.5 (Change of basis). Let \(T\in \mathcal {L}(A,B)\). Let \(\alpha ,\alpha '\) be bases for \(A\) and \(\beta ,\beta '\) bases for \(B\). Then \[M(T,\alpha ',\beta ')=Q^{-1}\,M(T,\alpha ,\beta )\,P,\] where \(P\) is the transition matrix whose columns are the coordinates of the vectors of \(\alpha '\) with respect to \(\alpha \), and \(Q\) is the transition matrix whose columns are the coordinates of the vectors of \(\beta '\) with respect to \(\beta \).

Proof. Write \(I_A\) and \(I_B\) for the identity maps. By definition \(P\) is the matrix of \(I_A\) from the basis \(\alpha '\) to the basis \(\alpha \), and \(Q\) is the matrix of \(I_B\) from \(\beta '\) to \(\beta \). Both are invertible, since the transition matrix in the other direction is an inverse for it.

Now write \(T\) as the composition \[A \xrightarrow {\ I_A\ } A \xrightarrow {\ T\ } B \xrightarrow {\ I_B\ } B,\] reading the first copy of \(A\) with basis \(\alpha '\), the second with \(\alpha \), the first copy of \(B\) with \(\beta \) and the second with \(\beta '\). Applying Theorem 6.3.4 twice, \[M(T,\alpha ',\beta ')=M(I_B,\beta ,\beta ')\,M(T,\alpha ,\beta )\,M(I_A,\alpha ',\alpha ) = Q^{-1}M(T,\alpha ,\beta )P,\] using \(M(I_A,\alpha ',\alpha )=P\) and \(M(I_B,\beta ,\beta ')=Q^{-1}\) — the latter because \(Q\) goes from \(\beta '\) to \(\beta \) and this factor goes the other way. □

Example 6.3.6. For the transformation \(T(x,y,z)=(x+y-z,\ 2x+z)\) of the previous example, use the change of basis theorem to obtain \(M(T,\alpha ,\beta )\) from the standard matrix \(M(T)\), where \(\alpha =\{(1,0,-1),(1,1,1),(1,0,0)\}\) and \(\beta =\{(1,1),(1,0)\}\). Check that it agrees with the matrix found directly.

Solution. Relative to the standard bases the matrix was found to be \[M(T)=\begin {pmatrix}1&1&-1\\2&0&1\end {pmatrix}.\] The transition matrices have the new basis vectors as their columns, written in standard coordinates: \[P=\begin {pmatrix}1&1&1\\0&1&0\\-1&1&0\end {pmatrix},\qquad Q=\begin {pmatrix}1&1\\1&0\end {pmatrix}.\] Since \(\det Q=-1\), \[Q^{-1}=\frac {1}{-1}\begin {pmatrix}0&-1\\-1&1\end {pmatrix} =\begin {pmatrix}0&1\\1&-1\end {pmatrix}.\] Now multiply, right to left. First \[M(T)P=\begin {pmatrix}1&1&-1\\2&0&1\end {pmatrix} \begin {pmatrix}1&1&1\\0&1&0\\-1&1&0\end {pmatrix} =\begin {pmatrix}2&1&1\\1&3&2\end {pmatrix},\] and then \[Q^{-1}M(T)P=\begin {pmatrix}0&1\\1&-1\end {pmatrix} \begin {pmatrix}2&1&1\\1&3&2\end {pmatrix} =\begin {pmatrix}1&3&2\\1&-2&-1\end {pmatrix}.\] This is exactly the matrix obtained earlier by computing \(T\) on each vector of \(\alpha \) and expressing the result in \(\beta \) — as it must be. The point of the theorem is that the second calculation need not be redone from scratch when the bases change: two transition matrices convert the answer already in hand.

Solution. \begin {align*} M(T,\alpha ',\beta ') &= \begin {pmatrix} 1&1\\1&1\\ \end {pmatrix}^{-1} \begin {pmatrix} 1&1&-1\\2&0&1\\ \end {pmatrix} \begin {pmatrix} 1&1&1\\0&1&0\\-1&1&0 \end {pmatrix}\\ &= \begin {pmatrix} 0&1\\1&-1\\ \end {pmatrix} \begin {pmatrix} 2&1&1\\1&3&2\\ \end {pmatrix}\\ &=\begin {pmatrix} 1&3&2\\1&-2&-1\\ \end {pmatrix}\\ \end {align*}

Questions on this section

Stuck on something here? Ask below and it stays attached to this topic.