# 4.19 Matrix of a composition

Suppose we have two composable linear maps, $S$ and $T$. The composition $T\circ S$ is still linear, as you can check. There should be a connection between the matrix of $T\circ S$ with respect to some bases and the matrices for $T$ and $S$.

###### Theorem 4.19.1.

Let $S:U\to V$ and $T:V\to W$ be linear maps. Let

• $\mathcal{B}=\mathbf{b}_{1},\ldots,\mathbf{b}_{l}$ be a basis of $U$,

• $\mathcal{C}=\mathbf{c}_{1},\ldots,\mathbf{c}_{m}$ be a basis of $V$, and

• $\mathcal{D}=\mathbf{d}_{1},\ldots,\mathbf{d}_{n}$ be a basis of $W$.

Then $[T\circ S]_{\mathcal{D}}^{\mathcal{B}}=[T]^{\mathcal{C}}_{\mathcal{D}}[S]_{% \mathcal{C}}^{\mathcal{B}}$

Here is picture of this situation:

 $\begin{array}[]{lllll}\mathcal{B}&&\mathcal{C}&&\mathcal{D}\\ U&\stackrel{{\scriptstyle S}}{{\to}}&V&\stackrel{{\scriptstyle T}}{{\to}}&W% \end{array}$

This theorem provides some justification for our definition of matrix multiplication: composition of linear maps corresponds to multiplication of matrices.

###### Proof.

Let $[T]_{\mathcal{D}}^{\mathcal{C}}=(t_{ij})$ and $[S]_{\mathcal{C}}^{\mathcal{B}}=(s_{ij})$. We will work out $[T\circ S]_{\mathcal{D}}^{\mathcal{B}}$ using the definition of the matrix of a linear map. For any $1\leqslant c\leqslant l$,

 $\displaystyle(T\circ S)(\mathbf{b}_{c})$ $\displaystyle=T(S(\mathbf{b}_{c}))$ $\displaystyle=T\left(\sum_{k=1}^{m}s_{kc}\mathbf{c}_{k}\right)$ $\displaystyle\text{as }[S]_{\mathcal{C}}^{\mathcal{B}}=(s_{ij})$ $\displaystyle=\sum_{k=1}^{m}s_{kc}T(\mathbf{c}_{k})$ $\displaystyle\text{linearity of }T$ $\displaystyle=\sum_{k=1}^{m}s_{kc}\sum_{i=1}^{n}t_{ik}\mathbf{d}_{i}$ $\displaystyle\text{as }[T]_{\mathcal{D}}^{\mathcal{C}}=(t_{ij})$ $\displaystyle=\sum_{i=1}^{n}\left(\sum_{k=1}^{m}t_{ik}s_{kc}\right)\mathbf{d}_% {i}$ $\displaystyle\text{for finite sums, }\sum_{k}\sum_{i}=\sum_{i}\sum_{k}$

so the $r,c$ entry of $[T\circ S]_{\mathcal{D}}^{\mathcal{B}}$ is $\sum_{k=1}^{m}t_{rk}s_{kc}$, which is the same as the $r,c$ entry of $[T]_{\mathcal{D}}^{\mathcal{C}}[S]_{\mathcal{C}}^{\mathcal{B}}$ by the matrix multiplication formula. ∎