Math Core

Lesson 4.6 · Vector Spaces

Change of basis

The standard basis is convenient, but it is often not the natural one. A crystal lattice, a rotated coordinate frame or a polynomial expanded around t=1t = 1 each comes with its own preferred basis. Once a basis is fixed, every vector gets a unique list of coordinates, and a change-of-basis matrix translates coordinates from one basis to another.

Coordinates relative to a basis

The key fact is that a basis gives each vector exactly one address.

Unique representation

If B={b1,…,bn}\mathcal{B} = \lbrace \mathbf{b}_1, \dots, \mathbf{b}_n \rbrace is a basis for VV, then every x\mathbf{x} in VV can be written in exactly one way as

x=c1b1+⋯+cnbn.\mathbf{x} = c_1\mathbf{b}_1 + \cdots + c_n\mathbf{b}_n.

Such weights exist because B\mathcal{B} spans VV. They are unique because if x\mathbf{x} also equals d1b1+⋯+dnbnd_1\mathbf{b}_1 + \cdots + d_n\mathbf{b}_n, subtracting gives (c1−d1)b1+⋯+(cn−dn)bn=0(c_1 - d_1)\mathbf{b}_1 + \cdots + (c_n - d_n)\mathbf{b}_n = \mathbf{0}, and independence forces every ci−di=0c_i - d_i = 0.

Definition

Coordinate vector

The weights c1,…,cnc_1, \dots, c_n are the coordinates of x\mathbf{x} relative to B\mathcal{B}, and the vector

[x]B=[c1⋮cn][\mathbf{x}]_{\mathcal{B}} = \begin{bmatrix} c_1 \\ \vdots \\ c_n \end{bmatrix}

in Rn\mathbb{R}^n is the B\mathcal{B}-coordinate vector of x\mathbf{x}.

In Rn\mathbb{R}^n, collect the basis vectors into the change-of-coordinates matrix PB=[ b1  ⋯  bn ]P_{\mathcal{B}} = [\,\mathbf{b}_1 \;\cdots\; \mathbf{b}_n\,]. The vector equation above says exactly

x=PB [x]B.\mathbf{x} = P_{\mathcal{B}}\,[\mathbf{x}]_{\mathcal{B}}.

Its columns are a basis, so PBP_{\mathcal{B}} is invertible and [x]B=PB−1x[\mathbf{x}]_{\mathcal{B}} = P_{\mathcal{B}}^{-1}\mathbf{x}. In practice you usually solve the system rather than invert.

Worked example: Finding and using coordinates

Let B={(2,1),(−1,1)}\mathcal{B} = \lbrace (2, 1), (-1, 1) \rbrace, a basis for R2\mathbb{R}^2.

(a) Find [x]B[\mathbf{x}]_{\mathcal{B}} for x=(1,5)\mathbf{x} = (1, 5). Solve c1(2,1)+c2(−1,1)=(1,5)c_1(2, 1) + c_2(-1, 1) = (1, 5):

2c1−c2=1,c1+c2=5.2c_1 - c_2 = 1, \qquad c_1 + c_2 = 5.

Adding the equations gives 3c1=63c_1 = 6, so c1=2c_1 = 2 and c2=3c_2 = 3. Thus [x]B=(2,3)[\mathbf{x}]_{\mathcal{B}} = (2, 3). Check: 2(2,1)+3(−1,1)=(1,5)2(2, 1) + 3(-1, 1) = (1, 5).

(b) If [y]B=(−1,4)[\mathbf{y}]_{\mathcal{B}} = (-1, 4), then y=−1(2,1)+4(−1,1)=(−6,3)\mathbf{y} = -1(2, 1) + 4(-1, 1) = (-6, 3).

Picture it this way: the basis vectors (2,1)(2, 1) and (−1,1)(-1, 1) lay down a slanted grid over the plane, and [x]B=(2,3)[\mathbf{x}]_{\mathcal{B}} = (2, 3) says "walk 22 steps along b1\mathbf{b}_1 and 33 steps along b2\mathbf{b}_2."

(2, 1)(-1, 1)(1, 5)y = x/2y = -xOpen in grapher →

Coordinates in other vector spaces

Coordinates work in any vector space with a finite basis, and they turn abstract problems into problems in Rn\mathbb{R}^n. The map x↦[x]B\mathbf{x} \mapsto [\mathbf{x}]_{\mathcal{B}} is linear and one-to-one onto Rn\mathbb{R}^n (an isomorphism), so questions about spans and independence in VV can be answered by the same questions about coordinate vectors.

Worked example: Coordinates of a polynomial

Let B={1,  1+t,  1+t+t2}\mathcal{B} = \lbrace 1,\; 1 + t,\; 1 + t + t^2 \rbrace, a basis for P2\mathbb{P}_2. Find [p]B[p]_{\mathcal{B}} for p(t)=4−t+2t2p(t) = 4 - t + 2t^2.

Write c1+c2(1+t)+c3(1+t+t2)=(c1+c2+c3)+(c2+c3)t+c3t2c_1 + c_2(1 + t) + c_3(1 + t + t^2) = (c_1 + c_2 + c_3) + (c_2 + c_3)t + c_3 t^2 and match coefficients:

c3=2,c2+c3=−1,c1+c2+c3=4.c_3 = 2, \qquad c_2 + c_3 = -1, \qquad c_1 + c_2 + c_3 = 4.

So c3=2c_3 = 2, c2=−3c_2 = -3 and c1=5c_1 = 5, giving [p]B=(5,−3,2)[p]_{\mathcal{B}} = (5, -3, 2).

Changing from one basis to another

Now suppose VV has two bases, B={b1,…,bn}\mathcal{B} = \lbrace \mathbf{b}_1, \dots, \mathbf{b}_n \rbrace and C={c1,…,cn}\mathcal{C} = \lbrace \mathbf{c}_1, \dots, \mathbf{c}_n \rbrace. If you know [x]B=(x1,…,xn)[\mathbf{x}]_{\mathcal{B}} = (x_1, \dots, x_n), then x=x1b1+⋯+xnbn\mathbf{x} = x_1\mathbf{b}_1 + \cdots + x_n\mathbf{b}_n. Taking C\mathcal{C}-coordinates, which is a linear operation,

[x]C=x1[b1]C+⋯+xn[bn]C.[\mathbf{x}]_{\mathcal{C}} = x_1[\mathbf{b}_1]_{\mathcal{C}} + \cdots + x_n[\mathbf{b}_n]_{\mathcal{C}}.

That is a matrix-vector product.

The change-of-basis matrix

There is a unique n×nn \times n matrix PC←B\underset{\mathcal{C} \leftarrow \mathcal{B}}{P} with

[x]C=PC←B [x]Bfor every x in V.[\mathbf{x}]_{\mathcal{C}} = \underset{\mathcal{C} \leftarrow \mathcal{B}}{P}\,[\mathbf{x}]_{\mathcal{B}} \quad \text{for every } \mathbf{x} \text{ in } V.

Its columns are the C\mathcal{C}-coordinate vectors of the B\mathcal{B} basis vectors:

PC←B=[ [b1]C  ⋯  [bn]C ].\underset{\mathcal{C} \leftarrow \mathcal{B}}{P} = \Big[\, [\mathbf{b}_1]_{\mathcal{C}} \;\cdots\; [\mathbf{b}_n]_{\mathcal{C}} \,\Big].

It is invertible, and its inverse is PB←C\underset{\mathcal{B} \leftarrow \mathcal{C}}{P}.

In Rn\mathbb{R}^n you find all the columns at once. Finding [bj]C[\mathbf{b}_j]_{\mathcal{C}} means solving [ c1  ⋯  cn ]y=bj[\,\mathbf{c}_1 \;\cdots\; \mathbf{c}_n\,]\mathbf{y} = \mathbf{b}_j, and these systems share a coefficient matrix. So row reduce

[ c1  ⋯  cn∣b1  ⋯  bn ]  ∼  [ I∣PC←B ].[\,\mathbf{c}_1 \;\cdots\; \mathbf{c}_n \mid \mathbf{b}_1 \;\cdots\; \mathbf{b}_n\,] \;\sim\; [\, I \mid \underset{\mathcal{C} \leftarrow \mathcal{B}}{P} \,].

Worked example: Building a change-of-basis matrix

In R2\mathbb{R}^2, let b1=(1,1)\mathbf{b}_1 = (1, 1), b2=(1,−1)\mathbf{b}_2 = (1, -1), c1=(1,0)\mathbf{c}_1 = (1, 0), c2=(1,1)\mathbf{c}_2 = (1, 1). Find PC←B\underset{\mathcal{C} \leftarrow \mathcal{B}}{P}, then find [x]C[\mathbf{x}]_{\mathcal{C}} when [x]B=(3,1)[\mathbf{x}]_{\mathcal{B}} = (3, 1).

Row reduce [ c1  c2∣b1  b2 ][\,\mathbf{c}_1 \; \mathbf{c}_2 \mid \mathbf{b}_1 \; \mathbf{b}_2\,] with R1−R2R_1 - R_2:

[1111011−1]∼[1002011−1],PC←B=[021−1].\left[\begin{array}{cc|cc} 1 & 1 & 1 & 1 \\ 0 & 1 & 1 & -1 \end{array}\right] \sim \left[\begin{array}{cc|cc} 1 & 0 & 0 & 2 \\ 0 & 1 & 1 & -1 \end{array}\right], \qquad \underset{\mathcal{C} \leftarrow \mathcal{B}}{P} = \begin{bmatrix} 0 & 2 \\ 1 & -1 \end{bmatrix}.

(Check a column: [b2]C=(2,−1)[\mathbf{b}_2]_{\mathcal{C}} = (2, -1) means 2(1,0)−(1,1)=(1,−1)2(1, 0) - (1, 1) = (1, -1). Correct.)

Then

[x]C=[021−1][31]=[22].[\mathbf{x}]_{\mathcal{C}} = \begin{bmatrix} 0 & 2 \\ 1 & -1 \end{bmatrix}\begin{bmatrix} 3 \\ 1 \end{bmatrix} = \begin{bmatrix} 2 \\ 2 \end{bmatrix}.

Both answers describe the same vector: 3(1,1)+1(1,−1)=(4,2)3(1, 1) + 1(1, -1) = (4, 2) and 2(1,0)+2(1,1)=(4,2)2(1, 0) + 2(1, 1) = (4, 2).

Common mistake

The columns of PC←B\underset{\mathcal{C} \leftarrow \mathcal{B}}{P} are the B\mathcal{B} vectors written in C\mathcal{C}-coordinates, not the other way around. The notation reads right to left: it accepts B\mathcal{B}-coordinates on the right and produces C\mathcal{C}-coordinates on the left. In the augmented matrix, the target basis C\mathcal{C} goes on the left of the bar.

Tip

When C\mathcal{C} is the standard basis, [bj]C=bj[\mathbf{b}_j]_{\mathcal{C}} = \mathbf{b}_j, so PC←B\underset{\mathcal{C} \leftarrow \mathcal{B}}{P} is just PBP_{\mathcal{B}}. In general, PC←B=PC−1PB\underset{\mathcal{C} \leftarrow \mathcal{B}}{P} = P_{\mathcal{C}}^{-1}P_{\mathcal{B}}: convert from B\mathcal{B} to standard, then from standard to C\mathcal{C}.

Practice

Practice 1

Let B={(1,1),(1,−1)}\mathcal{B} = \lbrace (1, 1), (1, -1) \rbrace. Find [x]B[\mathbf{x}]_{\mathcal{B}} for x=(5,1)\mathbf{x} = (5, 1). Enter it as (c1,c2)(c_1, c_2).

Enter a point like (2, -3)

Practice 2

Let B={(2,0,1),(0,1,0),(1,0,1)}\mathcal{B} = \lbrace (2, 0, 1), (0, 1, 0), (1, 0, 1) \rbrace and [x]B=(1,−2,3)[\mathbf{x}]_{\mathcal{B}} = (1, -2, 3). Find x\mathbf{x}.

Enter a point like (2, -3)

Practice 3

Let B={(1,0,0),(1,1,0),(1,1,1)}\mathcal{B} = \lbrace (1, 0, 0), (1, 1, 0), (1, 1, 1) \rbrace. Find [x]B[\mathbf{x}]_{\mathcal{B}} for x=(3,−1,2)\mathbf{x} = (3, -1, 2).

Enter a point like (2, -3)

Practice 4

Let B={1,  t−1,  (t−1)2}\mathcal{B} = \lbrace 1,\; t - 1,\; (t - 1)^2 \rbrace, a basis for P2\mathbb{P}_2. Find [p]B[p]_{\mathcal{B}} for p(t)=t2p(t) = t^2.

Enter a point like (2, -3)

Practice 5

B\mathcal{B} and C\mathcal{C} are bases of a vector space VV. What are the columns of PC←B\underset{\mathcal{C} \leftarrow \mathcal{B}}{P}?

Practice 6

Bases B={b1,b2}\mathcal{B} = \lbrace \mathbf{b}_1, \mathbf{b}_2 \rbrace and C={c1,c2}\mathcal{C} = \lbrace \mathbf{c}_1, \mathbf{c}_2 \rbrace of a vector space satisfy b1=2c1+c2\mathbf{b}_1 = 2\mathbf{c}_1 + \mathbf{c}_2 and b2=−c1+3c2\mathbf{b}_2 = -\mathbf{c}_1 + 3\mathbf{c}_2. If [x]B=(1,2)[\mathbf{x}]_{\mathcal{B}} = (1, 2), find [x]C[\mathbf{x}]_{\mathcal{C}}.

Enter a point like (2, -3)

Practice 7

In R2\mathbb{R}^2, let B={(1,2),(2,5)}\mathcal{B} = \lbrace (1, 2), (2, 5) \rbrace and C={(1,1),(1,2)}\mathcal{C} = \lbrace (1, 1), (1, 2) \rbrace. Find PC←B\underset{\mathcal{C} \leftarrow \mathcal{B}}{P}, and use it to find [x]C[\mathbf{x}]_{\mathcal{C}} when [x]B=(2,−1)[\mathbf{x}]_{\mathcal{B}} = (2, -1).

Enter a point like (2, -3)