Lay's Linear Algebra

Chapter 4: Vector Spaces

4.6 Change of basis

Study guide for Linear Algebra and Its Applications (David C. Lay, 6th edition)

Independent study guide. Not affiliated with or endorsed by Pearson.

Big idea

Two people describe the same vector with two different bases and get two different columns of numbers. The translation between their columns is a single matrix, fixed once and for all by the two bases. Multiply one person’s coordinates by that matrix and you get the other person’s.

Building the matrix is easier than it sounds. Its columns are the coordinate vectors of the first basis, written in the second basis. Once you have translated the handful of basis vectors, everything else follows by linearity, because a vector is a combination of the basis vectors and coordinates respect combinations.

The matrix is always invertible, and its inverse translates the other way. That is worth stating because it removes the need to build a second matrix from scratch: compute one direction, invert it, and you have both.

Decoder

The change-of-coordinates matrix from $\mathcal{B}$ to $\mathcal{C}$ has as its columns the $\mathcal{C}$-coordinate vectors of the vectors in $\mathcal{B}$.

The subscript notation packs the direction into the symbol. Write $P_{\mathcal{C} \leftarrow \mathcal{B}}$ and read the arrow as “takes $\mathcal{B}$-coordinates to $\mathcal{C}$-coordinates”. So $[\mathbf{x}]_{\mathcal{C}} = P_{\mathcal{C} \leftarrow \mathcal{B}}\,[\mathbf{x}]_{\mathcal{B}}$, with the $\mathcal{B}$ on the input side, next to the vector it consumes.

The build rule points the opposite way from the arrow, and that is the part people get backwards. To convert into $\mathcal{C}$, the columns are expressed in $\mathcal{C}$, and the things being expressed are the vectors of $\mathcal{B}$. One column per vector of $\mathcal{B}$, in order.

Definitions and results

Change-of-coordinates matrix. Let $\mathcal{B} = \{\mathbf{b}_1, \dots, \mathbf{b}_n\}$ and $\mathcal{C} = \{\mathbf{c}_1, \dots, \mathbf{c}_n\}$ be bases for the same vector space $V$. The matrix

$$ P_{\mathcal{C} \leftarrow \mathcal{B}} = \begin{bmatrix} [\mathbf{b}_1]_{\mathcal{C}} & [\mathbf{b}_2]_{\mathcal{C}} & \cdots & [\mathbf{b}_n]_{\mathcal{C}} \end{bmatrix} $$

satisfies $[\mathbf{x}]_{\mathcal{C}} = P_{\mathcal{C} \leftarrow \mathcal{B}}\,[\mathbf{x}]_{\mathcal{B}}$ for every $\mathbf{x}$ in $V$.

Why the columns are enough. Write $\mathbf{x} = x_1\mathbf{b}_1 + \cdots + x_n\mathbf{b}_n$, so $[\mathbf{x}]_{\mathcal{B}} = (x_1, \dots, x_n)$. Taking $\mathcal{C}$-coordinates is linear, so $[\mathbf{x}]_{\mathcal{C}} = x_1[\mathbf{b}_1]_{\mathcal{C}} + \cdots + x_n[\mathbf{b}_n]_{\mathcal{C}}$, which is the matrix times the coordinate column.

Invertibility and the reverse direction. $P_{\mathcal{C} \leftarrow \mathcal{B}}$ is invertible, and

$$ \left(P_{\mathcal{C} \leftarrow \mathcal{B}}\right)^{-1} = P_{\mathcal{B} \leftarrow \mathcal{C}} $$

The columns are $\mathcal{C}$-coordinates of a basis, so they are independent, so the square matrix is invertible.

Composing changes. Through a third basis $\mathcal{D}$, the matrices multiply in the order the arrows chain: $P_{\mathcal{D} \leftarrow \mathcal{C}} \, P_{\mathcal{C} \leftarrow \mathcal{B}} = P_{\mathcal{D} \leftarrow \mathcal{B}}$. Converting to $\mathcal{B}$ and back gives the identity.

The standard basis case. In $\mathbb{R}^n$ with $\mathcal{E}$ the standard basis, $P_{\mathcal{E} \leftarrow \mathcal{B}}$ is just the matrix whose columns are the vectors of $\mathcal{B}$, since a vector written in standard coordinates is its own coordinate column. That matrix was called $P_{\mathcal{B}}$ in the previous section, so the two notations describe the same object.

Computing it by row reduction in $\mathbb{R}^n$. Form the matrix with the vectors of $\mathcal{C}$ as the first block of columns and the vectors of $\mathcal{B}$ as the second, and row reduce:

$$ \begin{bmatrix} \mathbf{c}_1 \; \cdots \; \mathbf{c}_n & \mathbf{b}_1 \; \cdots \; \mathbf{b}_n \end{bmatrix} \rightarrow \begin{bmatrix} I & P_{\mathcal{C} \leftarrow \mathcal{B}} \end{bmatrix} $$

This solves all $n$ systems at once. It is the same trick as computing an inverse by reducing $[A \;\; I]$, with the identity block replaced by the basis you are converting from.

Why bother changing basis. The standard basis is convenient but it is not always the one a problem is written in. A basis chosen to suit the situation can turn a messy matrix into a diagonal one, or make a geometric operation obvious that was hidden in the original coordinates. The cost of switching is one matrix multiplication in each direction, and the change-of-coordinates matrix is what makes that cost fixed rather than paid again for every vector.

Nothing moves. A change of basis is a change of description, not a change of vector. The arrow, the polynomial or the matrix you started with is untouched; only the list of numbers naming it is different. That is why the same signal can be described by two people with two coordinate columns and neither is wrong, and why both descriptions must rebuild the same object when you check them.

Sanity check to run. Pick one vector, convert its coordinates with the matrix, and rebuild the vector from both coordinate columns. If the two rebuilds agree, the matrix is pointing the right way. Building the transpose or the inverse by mistake is common, and this check catches both in one line.

Worked examples

A change of basis in $\mathbb{R}^2$

Let

$$ \mathcal{B} = \left\{ \begin{bmatrix} 1 \\ 2 \end{bmatrix}, \begin{bmatrix} 3 \\ 5 \end{bmatrix} \right\}, \qquad \mathcal{C} = \left\{ \begin{bmatrix} 1 \\ 0 \end{bmatrix}, \begin{bmatrix} 1 \\ 1 \end{bmatrix} \right\} $$

Translate each vector of $\mathcal{B}$ into $\mathcal{C}$-coordinates. For the first, solve $a\mathbf{c}_1 + b\mathbf{c}_2 = (1, 2)$: the second coordinate gives $b = 2$, and the first gives $a + 2 = 1$, so $a = -1$. Thus $[\mathbf{b}_1]_{\mathcal{C}} = (-1, 2)$.

For the second, solve $a\mathbf{c}_1 + b\mathbf{c}_2 = (3, 5)$: the second coordinate gives $b = 5$, and the first gives $a + 5 = 3$, so $a = -2$. Thus $[\mathbf{b}_2]_{\mathcal{C}} = (-2, 5)$. Stack them as columns:

$$ P_{\mathcal{C} \leftarrow \mathcal{B}} = \begin{bmatrix} -1 & -2 \\ 2 & 5 \end{bmatrix} $$

Check with a vector. Suppose $[\mathbf{x}]_{\mathcal{B}} = (2, 1)$, so $\mathbf{x} = 2(1,2) + (3,5) = (5, 9)$. The matrix predicts $[\mathbf{x}]_{\mathcal{C}} = (-1 \cdot 2 - 2 \cdot 1,\; 2 \cdot 2 + 5 \cdot 1) = (-4, 9)$. Rebuild from that: $-4(1,0) + 9(1,1) = (-4 + 9,\; 9) = (5, 9)$. Same vector, so the matrix is correct and pointing the right way.

The same matrix by row reduction

Put the vectors of $\mathcal{C}$ on the left and the vectors of $\mathcal{B}$ on the right:

$$ \begin{bmatrix} 1 & 1 & 1 & 3 \\ 0 & 1 & 2 & 5 \end{bmatrix} $$

The left block needs one operation: subtract row two from row one.

$$ \begin{bmatrix} 1 & 0 & -1 & -2 \\ 0 & 1 & 2 & 5 \end{bmatrix} $$

The right block is now $\begin{bmatrix} -1 & -2 \\ 2 & 5 \end{bmatrix}$, matching the matrix built column by column. For bigger bases this route is far less work, since it handles every column in one reduction.

Reversing the direction

The inverse of $P_{\mathcal{C} \leftarrow \mathcal{B}}$ converts $\mathcal{C}$-coordinates back into $\mathcal{B}$-coordinates. The determinant is $(-1)(5) - (-2)(2) = -5 + 4 = -1$, so

$$ P_{\mathcal{B} \leftarrow \mathcal{C}} = \frac{1}{-1}\begin{bmatrix} 5 & 2 \\ -2 & -1 \end{bmatrix} = \begin{bmatrix} -5 & -2 \\ 2 & 1 \end{bmatrix} $$

Check the product:

$$ \begin{bmatrix} -1 & -2 \\ 2 & 5 \end{bmatrix}\begin{bmatrix} -5 & -2 \\ 2 & 1 \end{bmatrix} = \begin{bmatrix} 5 - 4 & 2 - 2 \\ -10 + 10 & -4 + 5 \end{bmatrix} = \begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix} $$

And check it on the earlier vector: $P_{\mathcal{B} \leftarrow \mathcal{C}}(-4, 9) = (20 - 18,\; -8 + 9) = (2, 1)$, which is the $\mathcal{B}$-coordinate column we started with.

Two polynomial bases

In $\mathbb{P}_2$ let $\mathcal{B} = \{1,\; t - 1,\; (t-1)^2\}$ and let $\mathcal{C} = \{1, t, t^2\}$ be the standard basis. Write each vector of $\mathcal{B}$ in $\mathcal{C}$-coordinates: $1$ gives $(1, 0, 0)$; $t - 1$ gives $(-1, 1, 0)$; and $(t-1)^2 = 1 - 2t + t^2$ gives $(1, -2, 1)$. So

$$ P_{\mathcal{C} \leftarrow \mathcal{B}} = \begin{bmatrix} 1 & -1 & 1 \\ 0 & 1 & -2 \\ 0 & 0 & 1 \end{bmatrix} $$

Check it on $p(t) = 3 - 2t + t^2$, whose $\mathcal{B}$-coordinates are $(2, 0, 1)$. The matrix gives $(2 - 0 + 1,\; 0 + 0 - 2,\; 1) = (3, -2, 1)$, which is the standard coordinate column of $p$. The matrix is triangular, so its determinant is $1$ and it is invertible, as every change-of-coordinates matrix must be.

Practice

Build the matrix from coordinate columns or by row reduction, apply it in the stated direction, and invert it for the other one.

Practice

Generated problems for this section, graded instantly.

Videos

Watch the explanation of why the matrix is built from the columns of one basis expressed in the other, and the segment on translating back with the inverse. The direction confusion the video calls out is the same one that costs marks here.

Change of basis | Chapter 13, Essence of linear algebra

3Blue1Brown

Quiz

Five items on building, applying, and reversing a change-of-coordinates matrix.

Quiz

5 problems with a score at the end.