Tutorials › Linear Algebra › Computing with Nonstandard Domain and Codomain Bases

Matrix Representations of Linear Maps · Tutorial 433 of 1000

Computing with Nonstandard Domain and Codomain Bases

Build a map’s matrix in nonstandard domain and codomain bases, then use it to compute outputs from coordinate vectors.

Intermediate 10 min read

What You'll Learn

  • Find each matrix column by expressing a domain basis vector’s image in the codomain basis.
  • Apply a represented matrix to the input’s coordinates in the domain basis.
  • Distinguish coordinate vectors from the vectors they describe.
  • Convert between standard and nonstandard bases using basis matrices.
  • Check computed outputs in both coordinates and the original vector spaces.

Representing a Map in Two Different Bases

A matrix representation depends not only on a linear map but also on the bases used to describe its inputs and outputs. If the domain and codomain use different ordered bases, the columns still record images of domain basis vectors, but each image must be expressed in the codomain basis. Using standard coordinates for one side by mistake can give a matrix with the right shape and the wrong meaning.

Throughout, the scalar field is \(\mathbb{R}\), and all spaces considered here are finite-dimensional. Let \(V\) have ordered basis \(\mathcal{B}=(\mathbf{b}_1,\dots,\mathbf{b}_n)\), and let \(W\) have ordered basis \(\mathcal{C}=(\mathbf{c}_1,\dots,\mathbf{c}_m)\). For \(\mathbf{v}\in V\), its coordinate vector \([\mathbf{v}]_{\mathcal{B}}\) is the column of coefficients in its unique expansion in \(\mathcal{B}\). The same convention defines \([\mathbf{w}]_{\mathcal{C}}\) for \(\mathbf{w}\in W\).

Definition: For a linear map \(T:V\to W\), the matrix \([T]_{\mathcal{C}\leftarrow\mathcal{B}}\in\mathbb{R}^{m\times n}\) is the matrix that sends domain \(\mathcal{B}\)-coordinates to codomain \(\mathcal{C}\)-coordinates: \([T(\mathbf{v})]_{\mathcal{C}}=[T]_{\mathcal{C}\leftarrow\mathcal{B}}[\mathbf{v}]_{\mathcal{B}}\) for every \(\mathbf{v}\in V\).

The arrow in the subscript records the direction: coordinates in \(\mathcal{B}\) go in, and coordinates in \(\mathcal{C}\) come out. To construct the matrix, apply \(T\) to each domain basis vector, then write each result as a combination of the codomain basis vectors. The coefficients of the \(j\)th image, in order, form column \(j\).

Theorem: If \(T:V\to W\) is linear and \(\mathcal{B}=(\mathbf{b}_1,\dots,\mathbf{b}_n)\), \(\mathcal{C}=(\mathbf{c}_1,\dots,\mathbf{c}_m)\) are ordered bases, then \([T]_{\mathcal{C}\leftarrow\mathcal{B}}=\begin{bmatrix}[T(\mathbf{b}_1)]_{\mathcal{C}}&\cdots&[T(\mathbf{b}_n)]_{\mathcal{C}}\end{bmatrix}\). For every \(\mathbf{v}\in V\), this matrix satisfies \([T(\mathbf{v})]_{\mathcal{C}}=[T]_{\mathcal{C}\leftarrow\mathcal{B}}[\mathbf{v}]_{\mathcal{B}}\).

Proof. Write \([\mathbf{v}]_{\mathcal{B}}=(a_1,\dots,a_n)^{\top}\). By the definition of coordinates, \(\mathbf{v}=\sum_{j=1}^n a_j\mathbf{b}_j\). Linearity gives \(T(\mathbf{v})=\sum_{j=1}^n a_jT(\mathbf{b}_j)\). Taking \(\mathcal{C}\)-coordinates preserves sums and scalar multiples: if \(T(\mathbf{b}_j)=\sum_{i=1}^m d_{ij}\mathbf{c}_i\), then \(T(\mathbf{v})=\sum_{i=1}^m(\sum_{j=1}^n d_{ij}a_j)\mathbf{c}_i\). Thus the \(i\)th output coordinate is \(\sum_{j=1}^n d_{ij}a_j\), exactly the \(i\)th entry of the product of the matrix with columns \([T(\mathbf{b}_j)]_{\mathcal{C}}\) and the column \((a_1,\dots,a_n)^{\top}\). This proves both the column construction and the stated coordinate rule. \(\square\)

Compute the Image Columns, Then Apply the Matrix

Worked Example: A Map from \(\mathbb{R}^2\) to \(\mathbb{R}^2\)

Let \(T(x,y)=(2x+y,x-y)\), with domain basis \(\mathcal{B}=((1,1),(1,-1))\) and codomain basis \(\mathcal{C}=((1,0),(1,1))\). Find \([T]_{\mathcal{C}\leftarrow\mathcal{B}}\), then compute \(T(\mathbf{x})\) when \([\mathbf{x}]_{\mathcal{B}}=(4,1)^{\top}\).

First find the image of each domain basis vector. For \(\mathbf{b}_1=(1,1)\), \(T(\mathbf{b}_1)=(3,0)\). Write \((3,0)=a(1,0)+b(1,1)=(a+b,b)\). The second coordinate gives \(b=0\), and the first then gives \(a=3\), so \([T(\mathbf{b}_1)]_{\mathcal{C}}=(3,0)^{\top}\).

For \(\mathbf{b}_2=(1,-1)\), \(T(\mathbf{b}_2)=(1,2)\). Solve \((1,2)=(a+b,b)\): \(b=2\) and \(a=-1\). Hence \([T(\mathbf{b}_2)]_{\mathcal{C}}=(-1,2)^{\top}\). Putting these coordinate columns together gives

$$ [T]_{\mathcal{C}\leftarrow\mathcal{B}} = \begin{bmatrix} 3&-1\\ 0&2 \end{bmatrix}. $$

Now apply the matrix to the given input coordinates:

$$ [T(\mathbf{x})]_{\mathcal{C}} = \begin{bmatrix}3&-1\\0&2\end{bmatrix} \begin{bmatrix}4\\1\end{bmatrix} = \begin{bmatrix}12-1\\2\end{bmatrix} = \begin{bmatrix}11\\2\end{bmatrix}. $$

This says \(T(\mathbf{x})=11(1,0)+2(1,1)=(13,2)\). Check by recovering the input and applying the original rule: \(\mathbf{x}=4(1,1)+(1,-1)=(5,3)\), so \(T(\mathbf{x})=(2\cdot5+3,5-3)=(13,2)\), as required.

The matrix acts on a coordinate vector, not directly on an unlabelled vector. In this example, the column \((4,1)^{\top}\) means \(4\mathbf{b}_1+\mathbf{b}_2\); it is not the standard-coordinate column of the input. Likewise, the output \((11,2)^{\top}\) describes coefficients of \(\mathbf{c}_1,\mathbf{c}_2\), not standard coordinates.

A Rectangular Example with Different Bases

Worked Example: Three Domain Coordinates and Two Codomain Coordinates

Define \(T:\mathbb{R}^3\to\mathbb{R}^2\) by \(T(x,y,z)=(x+2y-z,3x-y+z)\). Use \(\mathcal{B}=((1,0,1),(0,1,1),(1,1,0))\) and \(\mathcal{C}=((1,1),(1,-1))\) to find the matrix and compute the output for input coordinates \((2,-1,3)^{\top}\).

For the first domain basis vector, \(T(1,0,1)=(0,4)\). Writing \((0,4)=a(1,1)+b(1,-1)=(a+b,a-b)\) gives \(a+b=0\) and \(a-b=4\); adding yields \(2a=4\), so \(a=2\), \(b=-2\).

For the second vector, \(T(0,1,1)=(1,0)\). The equations \(a+b=1\), \(a-b=0\) give \(a=b=\tfrac12\). For the third, \(T(1,1,0)=(3,2)\). The equations \(a+b=3\), \(a-b=2\) give \(2a=5\), \(a=\tfrac52\), and \(b=\tfrac12\). Therefore

$$ [T]_{\mathcal{C}\leftarrow\mathcal{B}} = \begin{bmatrix} 2&\tfrac12&\tfrac52\\ -2&\tfrac12&\tfrac12 \end{bmatrix}. $$

Multiply by the input coordinate vector, showing each row calculation:

$$ \begin{bmatrix} 2&\tfrac12&\tfrac52\\ -2&\tfrac12&\tfrac12 \end{bmatrix} \begin{bmatrix}2\\-1\\3\end{bmatrix} = \begin{bmatrix} 4-\tfrac12+\tfrac{15}{2}\\ -4-\tfrac12+\tfrac32 \end{bmatrix} = \begin{bmatrix}11\\-3\end{bmatrix}. $$

Thus the output in standard coordinates is \(11(1,1)-3(1,-1)=(8,14)\). Check the input: \(2(1,0,1)-(0,1,1)+3(1,1,0)=(5,2,1)\). Applying \(T\) directly gives \((5+4-1,15-2+1)=(8,14)\), which agrees.

Converting Through Standard Coordinates

When \(V=\mathbb{R}^n\) and \(W=\mathbb{R}^m\), there is another route to the same matrix. Let \(\mathbf{A}\) be the standard matrix of \(T\), so \(T(\mathbf{x})=\mathbf{A}\mathbf{x}\) for standard-coordinate columns \(\mathbf{x}\). Define the basis matrices \(\mathbf{P}_{\mathcal{B}}=\begin{bmatrix}\mathbf{b}_1&\cdots&\mathbf{b}_n\end{bmatrix}\) and \(\mathbf{P}_{\mathcal{C}}=\begin{bmatrix}\mathbf{c}_1&\cdots&\mathbf{c}_m\end{bmatrix}\). Each basis matrix converts coordinates in its named basis into standard coordinates: \(\mathbf{x}=\mathbf{P}_{\mathcal{B}}[\mathbf{x}]_{\mathcal{B}}\), and \(\mathbf{y}=\mathbf{P}_{\mathcal{C}}[\mathbf{y}]_{\mathcal{C}}\).

Theorem: For finite-dimensional coordinate spaces with ordered bases \(\mathcal{B}\) and \(\mathcal{C}\), and standard matrix \(\mathbf{A}\) for \(T:\mathbb{R}^n\to\mathbb{R}^m\), \([T]_{\mathcal{C}\leftarrow\mathcal{B}}=\mathbf{P}_{\mathcal{C}}^{-1}\mathbf{A}\mathbf{P}_{\mathcal{B}}\).

Proof. A basis matrix has the basis vectors as its columns. Since those columns are a basis, every standard-coordinate vector has a unique coefficient column in that basis. Thus \(\mathbf{P}_{\mathcal{B}}\) converts \(\mathcal{B}\)-coordinates to standard coordinates, and its inverse converts standard coordinates back to \(\mathcal{B}\)-coordinates; the same reasoning applies to \(\mathbf{P}_{\mathcal{C}}\). For any \(\mathbf{v}\in V\), its standard-coordinate column is \(\mathbf{P}_{\mathcal{B}}[\mathbf{v}]_{\mathcal{B}}\). Applying the standard matrix gives standard output coordinates \(\mathbf{A}\mathbf{P}_{\mathcal{B}}[\mathbf{v}]_{\mathcal{B}}\). Converting that output to \(\mathcal{C}\)-coordinates gives \(\mathbf{P}_{\mathcal{C}}^{-1}\mathbf{A}\mathbf{P}_{\mathcal{B}}[\mathbf{v}]_{\mathcal{B}}\). By the coordinate rule in the preceding theorem, the matrix multiplying \([\mathbf{v}]_{\mathcal{B}}\) is precisely \([T]_{\mathcal{C}\leftarrow\mathcal{B}}\). \(\square\)

Worked Example: Verify the Basis-Matrix Conversion

Use the map and bases from the first example. Its standard matrix is \(\mathbf{A}=\begin{bmatrix}2&1\\1&-1\end{bmatrix}\), because \(T(x,y)=(2x+y,x-y)\). The basis matrices are

$$ \mathbf{P}_{\mathcal{B}}= \begin{bmatrix}1&1\\1&-1\end{bmatrix}, \qquad \mathbf{P}_{\mathcal{C}}= \begin{bmatrix}1&1\\0&1\end{bmatrix}, \qquad \mathbf{P}_{\mathcal{C}}^{-1}= \begin{bmatrix}1&-1\\0&1\end{bmatrix}. $$

First multiply \(\mathbf{A}\mathbf{P}_{\mathcal{B}}\), which places the images of the domain basis vectors in standard coordinates:

$$ \begin{bmatrix}2&1\\1&-1\end{bmatrix} \begin{bmatrix}1&1\\1&-1\end{bmatrix} = \begin{bmatrix}3&1\\0&2\end{bmatrix}. $$

Now convert each output column to \(\mathcal{C}\)-coordinates:

$$ \mathbf{P}_{\mathcal{C}}^{-1}\mathbf{A}\mathbf{P}_{\mathcal{B}} = \begin{bmatrix}1&-1\\0&1\end{bmatrix} \begin{bmatrix}3&1\\0&2\end{bmatrix} = \begin{bmatrix}3&-1\\0&2\end{bmatrix}. $$

This matches the directly computed representation. As a check on the inverse used here, \(\begin{bmatrix}1&1\\0&1\end{bmatrix}\begin{bmatrix}1&-1\\0&1\end{bmatrix}=\begin{bmatrix}1&0\\0&1\end{bmatrix}\).

Common Pitfall: Mixing Coordinate Systems

A frequent error is to compute \(T(\mathbf{b}_j)\) in standard coordinates and place those entries directly into the represented matrix, even though the requested codomain basis is nonstandard. In the first example, the standard-coordinate images are \((3,0)\) and \((1,2)\). The incorrect matrix would therefore be \(\begin{bmatrix}3&1\\0&2\end{bmatrix}\). Applying it to the input \((4,1)^{\top}\) gives \((13,2)^{\top}\), but this column is being interpreted as \(\mathcal{C}\)-coordinates; it would describe \(13(1,0)+2(1,1)=(15,2)\), not the actual output \((13,2)\).

The correction is to convert each image to codomain coordinates before inserting it as a column. In the example, \((3,0)\) has \(\mathcal{C}\)-coordinates \((3,0)^{\top}\), while \((1,2)\) has \(\mathcal{C}\)-coordinates \((-1,2)^{\top}\). The correct matrix is \(\begin{bmatrix}3&-1\\0&2\end{bmatrix}\), and it produces output coordinates \((11,2)^{\top}\), which describe \((13,2)\) in \(\mathcal{C}\).

Before using a computed matrix, check both labels: its input must be a coordinate column in the domain basis, and its output must be a coordinate column in the codomain basis. If a standard matrix is available, the formula \(\mathbf{P}_{\mathcal{C}}^{-1}\mathbf{A}\mathbf{P}_{\mathcal{B}}\) provides an independent check. The order matters: first convert the input to standard coordinates, apply the map, then convert the result to codomain coordinates.

Check Your Understanding

For each question, keep track of which basis interprets each coordinate column.

  1. For the first example, what does the coordinate vector \((2,-1)^{\top}\) in \(\mathcal{C}\) represent in standard coordinates?
  2. Suppose a map sends \(\mathbf{b}_1\) to \(2\mathbf{c}_1-\mathbf{c}_2\) and \(\mathbf{b}_2\) to \(\mathbf{c}_1+3\mathbf{c}_2\). Write its matrix in these bases.
  3. For the second example, verify directly that the first column of the computed matrix gives the \(\mathcal{C}\)-coordinates of \(T(1,0,1)\).
  4. Explain why the matrix of a map from an \(n\)-dimensional domain to an \(m\)-dimensional codomain has \(n\) columns and \(m\) rows.
  5. In the basis-matrix conversion formula, state what each of \(\mathbf{P}_{\mathcal{B}}\), \(\mathbf{A}\), and \(\mathbf{P}_{\mathcal{C}}^{-1}\) does to a coordinate column.

Test yourself: Linear Algebra final exam practice

Ready to check what you know? Work a full-length practice final, then open the complete worked solutions.

Want all 1,114 practice problems?

This tutorial covers one topic. Calc Pass covers the full Calculus AB & BC curriculum (the core of Calculus I and II): full review, every practice question, and step-by-step solutions to each one.

QR code to download the Calc Pass app

Get the Calc Pass App

Scan to download and practice on the go, with instant scoring.

Calc Pass Volume 1: 1,114 Practice Questions book cover

Vol. 1: 1,114 Questions

The complete practice question bank, organized by AB & BC topic.

View on Amazon
Calc Pass Volume 2: Solutions Manual book cover

Vol. 2: Solutions Manual

Fully worked solutions to every question in Volume 1.

View on Amazon