Linear Algebra › Section D · Vector spaces › Topic D.7
Change of basis
The same vector has different coordinates in different bases. A single matrix translates coordinates from one basis to another, and choosing the right basis can turn a messy problem into a simple one.
One vector, many descriptions
"Coordinate systems" showed how a basis \(\mathcal{B}\) gives each vector \(\mathbf{x}\) a coordinate vector \([\mathbf{x}]_{\mathcal{B}}\). A vector space has many bases, and the vector itself does not change when you switch between them; only its description does. Engineers and scientists switch bases all the time, because a problem that is awkward in one coordinate system is often easy in another. This topic answers a precise question: given two bases \(\mathcal{B}\) and \(\mathcal{C}\) of the same n-dimensional space \(V\), how do you turn \([\mathbf{x}]_{\mathcal{B}}\) into \([\mathbf{x}]_{\mathcal{C}}\)?
The change-of-coordinates matrix
Let \(\mathcal{B} = \{\mathbf{b}_1, \ldots, \mathbf{b}_n\}\) and \(\mathcal{C}\) be bases of \(V\). There is a unique n x n matrix \(P_{\mathcal{C} \leftarrow \mathcal{B}}\) such that
Its columns are the \(\mathcal{C}\)-coordinate vectors of the vectors in \(\mathcal{B}\):
The arrow notation reads right to left: the matrix takes \(\mathcal{B}\)-coordinates in and gives \(\mathcal{C}\)-coordinates out, just as \(P_{\mathcal{C} \leftarrow \mathcal{B}}\) multiplies a \(\mathcal{B}\)-vector on its right.
Why the formula holds
Write \(\mathbf{x} = x_1\mathbf{b}_1 + \cdots + x_n\mathbf{b}_n\), so that \([\mathbf{x}]_{\mathcal{B}} = (x_1, \ldots, x_n)\). The coordinate mapping for \(\mathcal{C}\) is linear, so
That is a combination of the vectors \([\mathbf{b}_i]_{\mathcal{C}}\) with weights \(x_i\), which is exactly the matrix with those columns times \([\mathbf{x}]_{\mathcal{B}}\). The columns of \(P_{\mathcal{C} \leftarrow \mathcal{B}}\) are independent, because they are the coordinate vectors of the independent set \(\mathcal{B}\). So the matrix is invertible, and
Computing it in Rⁿ
In \(\mathbb{R}^n\), finding \([\mathbf{b}_i]_{\mathcal{C}}\) means solving \(c_1\mathbf{c}_1 + \cdots + c_n\mathbf{c}_n = \mathbf{b}_i\), a system with coefficient matrix \(P_{\mathcal{C}} = [\mathbf{c}_1 \; \cdots \; \mathbf{c}_n]\). All n systems share that matrix, so solve them together: row reduce the augmented matrix
Algebraically this says \(P_{\mathcal{C} \leftarrow \mathcal{B}} = P_{\mathcal{C}}^{-1}P_{\mathcal{B}}\). The special case where \(\mathcal{C}\) is the standard basis gives \(P_{\mathcal{B}}\) itself, the matrix from "Coordinate systems" that turns \(\mathcal{B}\)-coordinates into standard ones.
Worked example: two bases of the plane
Let \(\mathbf{b}_1 = (3, 1)\), \(\mathbf{b}_2 = (5, 3)\), \(\mathbf{c}_1 = (1, 1)\) and \(\mathbf{c}_2 = (1, 2)\). 1. Find \([\mathbf{b}_1]_{\mathcal{C}}\): \(a + b = 3\) and \(a + 2b = 1\) give \(b = -2\), \(a = 5\). 2. Find \([\mathbf{b}_2]_{\mathcal{C}}\): \(a + b = 5\) and \(a + 2b = 3\) give \(b = -2\), \(a = 7\). 3. So
4. Convert \([\mathbf{x}]_{\mathcal{B}} = (2, 1)\): \(P_{\mathcal{C} \leftarrow \mathcal{B}}(2, 1) = (17, -6)\). 5. Check both descriptions name the same vector: \(2\mathbf{b}_1 + \mathbf{b}_2 = (11, 5)\), and \(17\mathbf{c}_1 - 6\mathbf{c}_2\) is \((17 - 6, 17 - 12) = (11, 5)\).
Going back the other way
To convert \(\mathcal{C}\)-coordinates into \(\mathcal{B}\)-coordinates, invert. In the example \(P_{\mathcal{C} \leftarrow \mathcal{B}}\) has determinant \(-10 + 14 = 4\), so by the 2 x 2 inverse formula
Applying it to \((17, -6)\) gives \(\frac{1}{4}(-34 + 42, \; 34 - 30) = (2, 1)\), recovering the \(\mathcal{B}\)-coordinates. Alternatively, row reduce \([\,\mathcal{B} \mid \mathcal{C}\,]\), with the roles of the two bases swapped. Either way, the two change-of-coordinates matrices undo each other.
Worked example: polynomials
In \(\mathbb{P}_2\), let \(\mathcal{E} = \{1, t, t^2\}\) and \(\mathcal{C} = \{1, \; 1 + t, \; (1 + t)^2\}\). 1. Write each vector of \(\mathcal{C}\) in \(\mathcal{E}\)-coordinates: \(1 \to (1, 0, 0)\), \(1 + t \to (1, 1, 0)\), and \((1 + t)^2 = 1 + 2t + t^2 \to (1, 2, 1)\). 2. These are the columns of
3. If \([p]_{\mathcal{C}} = (2, -1, 3)\), then
4. Check directly:
Why change basis at all
A good basis can make a problem simple. Rotating axes to line up with an ellipse removes the cross term from its equation. An orthonormal basis turns coordinates into dot products. A basis of eigenvectors, the subject of "Diagonalization", turns a complicated matrix into a diagonal one. The tool behind this is similarity: if a transformation of \(\mathbb{R}^n\) has standard matrix \(A\), its matrix relative to a basis \(\mathcal{B}\) is \(P^{-1}AP\), where \(P = P_{\mathcal{B}}\). Matrices related this way are called similar; they describe the same transformation and share its determinant and rank. Computer graphics switches between object, world and camera coordinates, and signal processing switches to a basis of sinusoids.
Common mistakes to avoid
The usual error is reversing the subscripts: \(P_{\mathcal{C} \leftarrow \mathcal{B}}\) has the \(\mathcal{B}\) vectors written in \(\mathcal{C}\)-coordinates as its columns, not the other way round. When row reducing, put the target basis \(\mathcal{C}\) on the left of the bar. Writing the coordinate vectors as rows instead of columns gives the transpose, which is wrong. Always finish with a check like step 5 of the first example: both coordinate vectors must build the same \(\mathbf{x}\). Remember that a change of basis changes descriptions, never the vector.
Key takeaways
For bases \(\mathcal{B}\) and \(\mathcal{C}\) of the same space, \([\mathbf{x}]_{\mathcal{C}} = P_{\mathcal{C} \leftarrow \mathcal{B}}[\mathbf{x}]_{\mathcal{B}}\), where the columns of \(P_{\mathcal{C} \leftarrow \mathcal{B}}\) are \([\mathbf{b}_i]_{\mathcal{C}}\). The matrix is invertible and its inverse is \(P_{\mathcal{B} \leftarrow \mathcal{C}}\). In \(\mathbb{R}^n\), row reduce \([\,\mathcal{C} \mid \mathcal{B}\,]\) to \([\,I \mid P_{\mathcal{C} \leftarrow \mathcal{B}}\,]\), or use \(P_{\mathcal{C}}^{-1}P_{\mathcal{B}}\). For polynomials, write each new basis vector in standard coordinates. In a basis \(\mathcal{B}\), a transformation with standard matrix \(A\) has matrix \(P^{-1}AP\).
Flashcards
Flashcard
Converts B-coordinates into C-coordinates
Test your understanding
Question 1 of 5
B = {b₁, b₂} and C are bases with [b₁]_C = (1, 4) and [b₂]_C = (2, -1). If [x]_B = (3, 1), what is [x]_C?
Question 2 of 5
In Rⁿ, which row reduction produces P_(C←B)?
Question 3 of 5
P_(C←B) has rows (5, 7) and (-2, -2). Which matrix is P_(B←C)?
Question 4 of 5
In P₂, C = {1, 1 + t, (1 + t)²}. What is the third column of P_(E←C), where E = {1, t, t²}?
Question 5 of 5
A transformation of Rⁿ has standard matrix A, and P = P_B for a basis B. What is its matrix relative to B?
