Following Coordinates Through Two Maps
When one linear map feeds into another, the output of the first map is the input of the second. A coordinate calculation must reflect that route: first convert the input into the coordinates used by the first map, then apply its matrix, and finally apply the matrix for the second map. The order matters, and the coordinate system used between the maps matters just as much as the matrix sizes.
Let \(V\), \(W\), and \(U\) be finite-dimensional vector spaces over \(\mathbb{R}\), with ordered bases \(\mathcal{B}\), \(\mathcal{C}\), and \(\mathcal{D}\), respectively. For a linear map \(T:V\to W\), its representing matrix \([T]_{\mathcal{C}\leftarrow\mathcal{B}}\) is defined by the coordinate equation \([T(\mathbf{v})]_{\mathcal{C}}=[T]_{\mathcal{C}\leftarrow\mathcal{B}}[\mathbf{v}]_{\mathcal{B}}\) for every \(\mathbf{v}\in V\). The basis written on the right of the arrow is the input-coordinate basis; the basis written on the left is the output-coordinate basis.
The dimensions make the route visible. If \(\dim V=n\), \(\dim W=m\), and \(\dim U=p\), then \([T]_{\mathcal{C}\leftarrow\mathcal{B}}\) is an \(m\times n\) matrix, while \([S]_{\mathcal{D}\leftarrow\mathcal{C}}\) is a \(p\times m\) matrix. Their product is \(p\times n\), the required shape for a map from \(V\) to \(U\).
Proof. Take any \(\mathbf{v}\in V\). By the definition of the representing matrix for \(S\), applied to \(T(\mathbf{v})\in W\), and then the definition for \(T\), we have $$ [S(T(\mathbf{v}))]_{\mathcal{D}} = [S]_{\mathcal{D}\leftarrow\mathcal{C}}[T(\mathbf{v})]_{\mathcal{C}} = [S]_{\mathcal{D}\leftarrow\mathcal{C}}[T]_{\mathcal{C}\leftarrow\mathcal{B}}[\mathbf{v}]_{\mathcal{B}}. $$ This holds for every \(\mathbf{v}\), so the product represents \(S\circ T\). To see that the representing matrix is unique, apply any two matrices satisfying this equation to each basis vector \(\mathbf{b}_j\) in \(\mathcal{B}\). Since \([\mathbf{b}_j]_{\mathcal{B}}=\mathbf{e}_j\), their \(j\)th columns must agree. This is true for every column, so the matrices are equal. \(\square\)
Computing and Checking a Composition
Worked Example: Standard Coordinates from R² to R³ and Back to R²
Suppose \(T:\mathbb{R}^2\to\mathbb{R}^3\) and \(S:\mathbb{R}^3\to\mathbb{R}^2\) have standard-coordinate matrices $$ \mathbf{A}= \begin{bmatrix} 1&2\\ 0&1\\ 1&-1 \end{bmatrix}, \qquad \mathbf{B}= \begin{bmatrix} 1&0&1\\ 2&1&0 \end{bmatrix}. $$ Find the standard-coordinate matrix of \(S\circ T\), then check it on \(\mathbf{x}=\begin{bmatrix}1\\-1\end{bmatrix}\).
The first map has a \(3\times2\) matrix and the second a \(2\times3\) matrix, so the composition has a \(2\times2\) matrix. Multiply in the order \(\mathbf{B}\mathbf{A}\): $$ \mathbf{B}\mathbf{A} = \begin{bmatrix} 1&0&1\\ 2&1&0 \end{bmatrix} \begin{bmatrix} 1&2\\ 0&1\\ 1&-1 \end{bmatrix} = \begin{bmatrix} 1+0+1&2+0-1\\ 2+0+0&4+1+0 \end{bmatrix} = \begin{bmatrix} 2&1\\ 2&5 \end{bmatrix}. $$ Thus the matrix of \(S\circ T\) is \(\begin{bmatrix}2&1\\2&5\end{bmatrix}\).
Apply the maps successively to the chosen vector: $$ T(\mathbf{x})=\mathbf{A}\mathbf{x} = \begin{bmatrix} 1(1)+2(-1)\\ 0(1)+1(-1)\\ 1(1)+(-1)(-1) \end{bmatrix} = \begin{bmatrix}-1\\-1\\2\end{bmatrix}, \qquad S(T(\mathbf{x}))=\mathbf{B} \begin{bmatrix}-1\\-1\\2\end{bmatrix} = \begin{bmatrix}1\\-3\end{bmatrix}. $$ Now apply the product matrix directly: $$ (\mathbf{B}\mathbf{A})\mathbf{x} = \begin{bmatrix}2&1\\2&5\end{bmatrix} \begin{bmatrix}1\\-1\end{bmatrix} = \begin{bmatrix}2-1\\2-5\end{bmatrix} = \begin{bmatrix}1\\-3\end{bmatrix}. $$ Both routes give the same output coordinates.
The check follows the definition of composition rather than merely repeating the matrix multiplication. The intermediate vector is first computed using \(T\), and that result is then used as the input to \(S\). Matching the two outputs confirms the product on this chosen input; the composition rule proved above guarantees the equality for every input.
The Intermediate Basis Must Match
The product formula uses the same ordered basis \(\mathcal{C}\) for the output coordinates of \(T\) and the input coordinates of \(S\). This is what lets the coordinates \([T(\mathbf{v})]_{\mathcal{C}}\) pass directly from the first matrix to the second. The spaces and bases need not be standard: the requirement is that both matrices describe the intermediate vector in the same basis.
Worked Example: Composition with Nonstandard Bases
Let \(V=W=U=\mathbb{R}^2\), but choose ordered bases \(\mathcal{B}=(\mathbf{b}_1,\mathbf{b}_2)\), \(\mathcal{C}=(\mathbf{c}_1,\mathbf{c}_2)\), and \(\mathcal{D}=(\mathbf{d}_1,\mathbf{d}_2)\), where \(\mathbf{b}_1=(1,1)\), \(\mathbf{b}_2=(1,-1)\), \(\mathbf{c}_1=(1,0)\), \(\mathbf{c}_2=(1,1)\), \(\mathbf{d}_1=(1,1)\), and \(\mathbf{d}_2=(0,1)\). Suppose $$ [T]_{\mathcal{C}\leftarrow\mathcal{B}} = \begin{bmatrix}1&2\\0&1\end{bmatrix}, \qquad [S]_{\mathcal{D}\leftarrow\mathcal{C}} = \begin{bmatrix}2&1\\1&1\end{bmatrix}. $$ Find the composition matrix and check it on the vector with \(\mathcal{B}\)-coordinates \(\begin{bmatrix}2\\-1\end{bmatrix}\).
The middle basis is \(\mathcal{C}\) in both matrices, so multiply: $$ [S\circ T]_{\mathcal{D}\leftarrow\mathcal{B}} = \begin{bmatrix}2&1\\1&1\end{bmatrix} \begin{bmatrix}1&2\\0&1\end{bmatrix} = \begin{bmatrix} 2(1)+1(0)&2(2)+1(1)\\ 1(1)+1(0)&1(2)+1(1) \end{bmatrix} = \begin{bmatrix}2&5\\1&3\end{bmatrix}. $$ For the chosen input, the first map gives $$ [T(\mathbf{v})]_{\mathcal{C}} = \begin{bmatrix}1&2\\0&1\end{bmatrix} \begin{bmatrix}2\\-1\end{bmatrix} = \begin{bmatrix}2-2\\-1\end{bmatrix} = \begin{bmatrix}0\\-1\end{bmatrix}. $$ The second map then gives $$ [S(T(\mathbf{v}))]_{\mathcal{D}} = \begin{bmatrix}2&1\\1&1\end{bmatrix} \begin{bmatrix}0\\-1\end{bmatrix} = \begin{bmatrix}-1\\-1\end{bmatrix}. $$ Applying the composition matrix directly gives $$ \begin{bmatrix}2&5\\1&3\end{bmatrix} \begin{bmatrix}2\\-1\end{bmatrix} = \begin{bmatrix}4-5\\2-3\end{bmatrix} = \begin{bmatrix}-1\\-1\end{bmatrix}, $$ as required.
For an additional check in the original coordinates, the input vector is \(\mathbf{v}=2\mathbf{b}_1-\mathbf{b}_2=(1,3)\). The intermediate coordinates \((0,-1)\) represent \(-\mathbf{c}_2=(-1,-1)\). The final coordinates \((-1,-1)\) represent \(-\mathbf{d}_1-\mathbf{d}_2=(-1,-2)\). Thus the coordinate calculation also tracks the actual vectors.
Proof. The coordinate vector of \(\mathbf{b}_j\) in \(\mathcal{B}\) is the \(j\)th standard coordinate vector \(\mathbf{e}_j\). The composition formula gives $$ [S(T(\mathbf{b}_j))]_{\mathcal{D}} = [S]_{\mathcal{D}\leftarrow\mathcal{C}}[T]_{\mathcal{C}\leftarrow\mathcal{B}}\mathbf{e}_j. $$ Multiplication by \(\mathbf{e}_j\) selects the \(j\)th column of the product. Hence that column is exactly the stated coordinate vector. \(\square\)
Rectangular Products and a Further Check
Composition is not restricted to maps between spaces of the same dimension. The intermediate dimension determines the shared inner matrix size, while the domain and final codomain determine the outer dimensions. This shape check is useful before doing any arithmetic: if the number of columns in the second map's matrix does not match the number of rows in the first map's matrix, the proposed product does not describe that composition.
Worked Example: A Composition from R² Through R³ to R
Let \(T:\mathbb{R}^2\to\mathbb{R}^3\) and \(S:\mathbb{R}^3\to\mathbb{R}\), in standard coordinates, have matrices $$ \mathbf{A}= \begin{bmatrix} 1&2\\ 0&-1\\ 2&1 \end{bmatrix}, \qquad \mathbf{B}= \begin{bmatrix}2&1&-1\end{bmatrix}. $$ The product \(\mathbf{B}\mathbf{A}\) has size \(1\times2\). Compute it and verify it on \(\mathbf{x}=\begin{bmatrix}3\\2\end{bmatrix}\).
Each entry comes from multiplying the row of \(\mathbf{B}\) by a column of \(\mathbf{A}\): $$ \mathbf{B}\mathbf{A} = \begin{bmatrix} 2(1)+1(0)+(-1)(2)& 2(2)+1(-1)+(-1)(1) \end{bmatrix} = \begin{bmatrix}0&2\end{bmatrix}. $$ First apply \(T\): $$ \mathbf{A}\mathbf{x} = \begin{bmatrix} 1(3)+2(2)\\ 0(3)+(-1)(2)\\ 2(3)+1(2) \end{bmatrix} = \begin{bmatrix}7\\-2\\8\end{bmatrix}. $$ Then apply \(S\): $$ \mathbf{B}(\mathbf{A}\mathbf{x}) = \begin{bmatrix}2&1&-1\end{bmatrix} \begin{bmatrix}7\\-2\\8\end{bmatrix} = 14-2-8 = 4. $$ The product matrix gives the same scalar: $$ (\mathbf{B}\mathbf{A})\mathbf{x} = \begin{bmatrix}0&2\end{bmatrix} \begin{bmatrix}3\\2\end{bmatrix} = 0(3)+2(2) = 4. $$
Common Mistake: Reversing the Order
Matrix multiplication acts from right to left on a coordinate column. If \(T\) is applied first and \(S\) second, the matrix of the composition is the matrix for \(S\) multiplied on the left by the matrix for \(T\). Reversing the order may still produce a valid matrix product, but it describes a different calculation.
For a concrete error, use standard-coordinate matrices $$ \mathbf{P}= \begin{bmatrix}1&1\\0&1\end{bmatrix} \quad\text{for }T, \qquad \mathbf{Q}= \begin{bmatrix}2&0\\1&1\end{bmatrix} \quad\text{for }S. $$ A wrong calculation reverses the product: $$ \mathbf{P}\mathbf{Q} = \begin{bmatrix}3&1\\1&1\end{bmatrix}. $$ For \(\mathbf{x}=\begin{bmatrix}1\\0\end{bmatrix}\), this reversed product gives \(\begin{bmatrix}3\\1\end{bmatrix}\). But the maps act in this order: $$ T(\mathbf{x})=\mathbf{P}\mathbf{x}=\begin{bmatrix}1\\0\end{bmatrix}, \qquad S(T(\mathbf{x}))=\mathbf{Q}\begin{bmatrix}1\\0\end{bmatrix} =\begin{bmatrix}2\\1\end{bmatrix}. $$ The correct product is $$ \mathbf{Q}\mathbf{P} = \begin{bmatrix}2&2\\1&2\end{bmatrix}, \qquad (\mathbf{Q}\mathbf{P})\mathbf{x} = \begin{bmatrix}2\\1\end{bmatrix}. $$ The direct check identifies the reversal: \(\mathbf{P}\mathbf{Q}\) applies the matrices in the opposite order.
A separate check is needed even when the sizes permit multiplication: the intermediate coordinates must refer to the same ordered basis. A matrix product is not justified merely because the two matrices have compatible numerical dimensions. Always read the basis labels at the arrows, then verify the computed product on a chosen coordinate vector by applying the maps one at a time.
Check Your Understanding
For each question, keep track of the coordinate basis at every stage, and use a direct substitution check where requested.
- If \([T]_{\mathcal{C}\leftarrow\mathcal{B}}\) is \(4\times2\) and \([S]_{\mathcal{D}\leftarrow\mathcal{C}}\) is \(3\times4\), what is the size of \([S\circ T]_{\mathcal{D}\leftarrow\mathcal{B}}\)?
- For \(\mathbf{A}=\begin{bmatrix}1&0\\2&1\end{bmatrix}\) representing \(T\) and \(\mathbf{B}=\begin{bmatrix}1&1\\0&2\end{bmatrix}\) representing \(S\), compute the matrix of \(S\circ T\).
- Using the matrices in question 2, check the composition on \(\mathbf{x}=\begin{bmatrix}1\\-1\end{bmatrix}\) by both routes.
- In one sentence, explain why the same ordered basis must be used for the intermediate coordinates of both maps.
- What does the \(j\)th column of the composition matrix represent in terms of the basis vector \(\mathbf{b}_j\)?