Why Basis-Vector Images Give the Columns
A matrix transforms an input by combining its columns, with the input coordinates as coefficients. For a linear transformation, this gives a direct way to build its matrix: find what the transformation does to each standard coordinate vector, then place those output vectors in order as columns. The input coordinates determine how much of each column contributes to the output.
For \(n\in\mathbb{N}\), the standard basis of \(\mathbb{R}^n\) is the ordered list \(\mathcal E_n=(\mathbf e_1,\dots,\mathbf e_n)\), where \(\mathbf e_j\) has a \(1\) in position \(j\) and \(0\) in every other position. For example, \(\mathbf e_1=\begin{bmatrix}1\\0\end{bmatrix}\) and \(\mathbf e_2=\begin{bmatrix}0\\1\end{bmatrix}\) in \(\mathbb{R}^2\). Every \(\mathbf x=\begin{bmatrix}x_1\\ \vdots\\x_n\end{bmatrix}\in\mathbb{R}^n\) can be written as \(x_1\mathbf e_1+\cdots+x_n\mathbf e_n\).
The number of columns is the input dimension \(n\), because there is one column for each input standard basis vector. The number of rows is the output dimension \(m\), because each column is an output vector in \(\mathbb{R}^m\). In practice, calculate the images \(T(\mathbf e_j)\) from the given formula for \(T\); do not assume that the entries in the formula can simply be copied into the matrix in the same arrangement.
Proof. Write \(\mathbf x=\begin{bmatrix}x_1&\cdots&x_n\end{bmatrix}^{\top}\). Since \(\mathbf x=x_1\mathbf e_1+\cdots+x_n\mathbf e_n\), linearity gives \(T(\mathbf x)=x_1T(\mathbf e_1)+\cdots+x_nT(\mathbf e_n)\). By construction, the columns of \(\mathbf A\) are \(T(\mathbf e_1),\dots,T(\mathbf e_n)\). Matrix multiplication by \(\mathbf x\) forms exactly that same linear combination of the columns, so \(\mathbf A\mathbf x=T(\mathbf x)\). \(\square\)
This proposition is the reason the column construction works: the matrix product uses the input coordinates to combine the transformation’s basis-vector images. It also gives a practical check. For a test input \(\mathbf x\), compute \(T(\mathbf x)\) from the formula and \(\mathbf A\mathbf x\) from the matrix. The results should agree.
Proof. The \(j\)th column of \(\mathbf A\) is \(T(\mathbf e_j)\). The entry in row \(i\), column \(j\) is therefore the \(i\)th coordinate of that column vector, which is the \(i\)th coordinate of \(T(\mathbf e_j)\). \(\square\)
Constructing a Matrix from a Formula
For \(T:\mathbb{R}^n\to\mathbb{R}^m\), the standard matrix must have \(m\) rows and \(n\) columns.
Use \(\mathbf e_1,\dots,\mathbf e_n\), each with one \(1\) and all other entries \(0\).
Compute \(T(\mathbf e_j)\) for each \(j\). Each result is an \(m\)-entry column vector.
Use \(T(\mathbf e_j)\) as column \(j\) to form the standard matrix.
Compare the formula’s output with the product of the constructed matrix and the input column.
The transformation must be linear for the column construction to represent it on every input. Linearity means that \(T(a\mathbf u+b\mathbf v)=aT(\mathbf u)+bT(\mathbf v)\) for all input vectors \(\mathbf u,\mathbf v\) and real scalars \(a,b\). It is what allows the formula \(T(x_1\mathbf e_1+\cdots+x_n\mathbf e_n)=x_1T(\mathbf e_1)+\cdots+x_nT(\mathbf e_n)\). The examples below use linear formulas.
Worked Example: A Transformation from R² to R³
Let \(T:\mathbb{R}^2\to\mathbb{R}^3\) be defined by \(T\begin{pmatrix}x\\y\end{pmatrix}=\begin{bmatrix}2x-y\\x+3y\\4y\end{bmatrix}\). Find its standard matrix and check it on \(\mathbf x=\begin{bmatrix}3\\-2\end{bmatrix}\).
The input standard basis vectors are \(\mathbf e_1=\begin{bmatrix}1\\0\end{bmatrix}\) and \(\mathbf e_2=\begin{bmatrix}0\\1\end{bmatrix}\). Substituting the first gives \(T(\mathbf e_1)=\begin{bmatrix}2(1)-0\\1+3(0)\\4(0)\end{bmatrix}=\begin{bmatrix}2\\1\\0\end{bmatrix}\). Substituting the second gives \(T(\mathbf e_2)=\begin{bmatrix}2(0)-1\\0+3(1)\\4(1)\end{bmatrix}=\begin{bmatrix}-1\\3\\4\end{bmatrix}\). Place these two output vectors in order as columns:
Now compute the output from the original formula at \(\mathbf x=\begin{bmatrix}3\\-2\end{bmatrix}\): \(T(\mathbf x)=\begin{bmatrix}2(3)-(-2)\\3+3(-2)\\4(-2)\end{bmatrix}=\begin{bmatrix}8\\-3\\-8\end{bmatrix}\). The matrix product gives
Check: Both calculations give \(\begin{bmatrix}8\\-3\\-8\end{bmatrix}\), as required.
Worked Example: A Transformation from R³ to R²
Let \(S:\mathbb{R}^3\to\mathbb{R}^2\) be defined by \(S\begin{pmatrix}x\\y\\z\end{pmatrix}=\begin{bmatrix}x+2y-z\\3x-y+2z\end{bmatrix}\). Construct its standard matrix and check it on \(\mathbf x=\begin{bmatrix}1\\-2\\3\end{bmatrix}\).
The three standard basis inputs are \(\mathbf e_1=\begin{bmatrix}1\\0\\0\end{bmatrix}\), \(\mathbf e_2=\begin{bmatrix}0\\1\\0\end{bmatrix}\), and \(\mathbf e_3=\begin{bmatrix}0\\0\\1\end{bmatrix}\). Evaluate the formula at each:
Thus the standard matrix has two rows, since outputs have two coordinates, and three columns, one for each input basis vector:
From the formula, the test input gives \(S(\mathbf x)=\begin{bmatrix}1+2(-2)-3\\3(1)-(-2)+2(3)\end{bmatrix}=\begin{bmatrix}-6\\11\end{bmatrix}\). From the matrix,
Check: The formula and matrix product agree. In particular, the negative coefficient of \(z\) in the first output coordinate appears in row 1, column 3, because it is the first coordinate of \(S(\mathbf e_3)\).
Reading Coefficients and Zero Images
For a transformation given coordinate by coordinate, each column can often be assembled by collecting the coefficients of one input variable. This is a shortcut for evaluating the standard basis vectors, not a different rule. For example, if the first output coordinate is \(x+2y\), its coefficients on \(x\) and \(y\) are \(1\) and \(2\), so those are the first-row entries. The second output coordinate supplies the second row. Evaluating the basis vectors is a reliable way to confirm the arrangement, especially when signs or several output coordinates make copying coefficients error-prone.
Worked Example: A Zero Column from a Missing Variable
Let \(U:\mathbb{R}^3\to\mathbb{R}^3\) be defined by \(U\begin{pmatrix}x\\y\\z\end{pmatrix}=\begin{bmatrix}x+2y\\2x+4y\\-y+3z\end{bmatrix}\). Find its standard matrix and check it on \(\mathbf x=\begin{bmatrix}2\\-1\\2\end{bmatrix}\).
Evaluate at \(\mathbf e_1=\begin{bmatrix}1\\0\\0\end{bmatrix}\): \(U(\mathbf e_1)=\begin{bmatrix}1\\2\\0\end{bmatrix}\). At \(\mathbf e_2=\begin{bmatrix}0\\1\\0\end{bmatrix}\): \(U(\mathbf e_2)=\begin{bmatrix}2\\4\\-1\end{bmatrix}\). At \(\mathbf e_3=\begin{bmatrix}0\\0\\1\end{bmatrix}\): \(U(\mathbf e_3)=\begin{bmatrix}0\\0\\3\end{bmatrix}\). Therefore,
The third column has zero entries in its first two positions because \(z\) does not appear in those output coordinates. The formula gives \(U(\mathbf x)=\begin{bmatrix}2+2(-1)\\2(2)+4(-1)\\-(-1)+3(2)\end{bmatrix}=\begin{bmatrix}0\\0\\7\end{bmatrix}\). Multiplication by the matrix gives
Check: The formula and the matrix product both give \(\begin{bmatrix}0\\0\\7\end{bmatrix}\). A zero entry in a column records a zero coordinate of one basis-vector image; a whole zero column would mean that the corresponding basis vector maps to \(\mathbf 0\).
A Common Mistake: Putting Images in Rows
The images are columns, not rows. The column convention matters because the product \(\mathbf A\mathbf x\) combines the columns using the coordinates of \(\mathbf x\). Consider \(V:\mathbb{R}^2\to\mathbb{R}^2\) given by \(V\begin{pmatrix}x\\y\end{pmatrix}=\begin{bmatrix}2x+3y\\x-y\end{bmatrix}\). Its basis-vector images are \(V(\mathbf e_1)=\begin{bmatrix}2\\1\end{bmatrix}\) and \(V(\mathbf e_2)=\begin{bmatrix}3\\-1\end{bmatrix}\). The correct standard matrix is therefore \(\begin{bmatrix}2&3\\1&-1\end{bmatrix}\).
A mistaken arrangement puts the images across rows and gives \(\begin{bmatrix}2&1\\3&-1\end{bmatrix}\). This fails immediately on \(\mathbf e_1=\begin{bmatrix}1\\0\end{bmatrix}\): \(\begin{bmatrix}2&1\\3&-1\end{bmatrix}\begin{bmatrix}1\\0\end{bmatrix}=\begin{bmatrix}2\\3\end{bmatrix}\), but \(V(\mathbf e_1)=\begin{bmatrix}2\\1\end{bmatrix}\). The correction is to place \(V(\mathbf e_1)\) in the first column and \(V(\mathbf e_2)\) in the second. With the correct matrix, \(\begin{bmatrix}2&3\\1&-1\end{bmatrix}\begin{bmatrix}1\\0\end{bmatrix}=\begin{bmatrix}2\\1\end{bmatrix}\), as required.
Another important caution is that basis-vector images alone do not encode an arbitrary formula unless that formula is linear. For instance, \(F:\mathbb{R}^2\to\mathbb{R}^2\), \(F\begin{pmatrix}x\\y\end{pmatrix}=\begin{bmatrix}x\\y+xy\end{bmatrix}\), has \(F(\mathbf e_1)=\begin{bmatrix}1\\0\end{bmatrix}\) and \(F(\mathbf e_2)=\begin{bmatrix}0\\1\end{bmatrix}\). The matrix formed from those columns is the identity matrix, whose product with \(\begin{bmatrix}1\\1\end{bmatrix}\) is \(\begin{bmatrix}1\\1\end{bmatrix}\). But \(F\begin{pmatrix}1\\1\end{pmatrix}=\begin{bmatrix}1\\2\end{bmatrix}\). The mismatch is consistent with the construction’s hypothesis: \(F\) is not linear.
Check Your Understanding
For each linear transformation, calculate the basis-vector images before writing the matrix. Where asked, verify the result on the stated input.
- Find the standard matrix of \(T:\mathbb{R}^2\to\mathbb{R}^2\), \(T\begin{pmatrix}x\\y\end{pmatrix}=\begin{bmatrix}x-4y\\2x+y\end{bmatrix}\).
- For \(S:\mathbb{R}^3\to\mathbb{R}^2\), \(S\begin{pmatrix}x\\y\\z\end{pmatrix}=\begin{bmatrix}2x-z\\x+y+3z\end{bmatrix}\), find the standard matrix and check it on \(\begin{bmatrix}1\\2\\-1\end{bmatrix}\).
- For a map from \(\mathbb{R}^4\) to \(\mathbb{R}^3\), how many rows and columns does its standard matrix have? Explain what determines each number.
- If the third column of a standard matrix is \(\begin{bmatrix}0\\-2\\5\end{bmatrix}\), what is \(T(\mathbf e_3)\)?
- Why can the images of the standard basis vectors be used to represent a linear transformation on every input?