Linear Algebra · Undergraduate

Coordinates and Change of Basis

Quick answer

A basis gives every vector a unique list of coordinates: the weights that build it from the basis vectors. In the basis B = {b₁, b₂}, the vector (5, 1) = 3b₁ + 2b₂ has coordinates [x]_B = (3, 2). The matrix P_B with the basis vectors as columns converts B-coordinates to standard ones, and its inverse converts back. Changing between two bases multiplies by one matrix, and a transformation A becomes P⁻¹AP in the new basis, often a much simpler matrix.

What you'll learn

  • Find the coordinates of a vector relative to a basis
  • Convert coordinates with P_B and its inverse
  • Build the change-of-coordinates matrix between two bases
  • Rewrite a linear transformation in a new basis as P⁻¹AP

The same vector, different coordinates

The standard coordinates of x=(5,1)\mathbf{x} = (5, 1) say ”55 steps along e1\mathbf{e}_1, 11 step along e2\mathbf{e}_2”. Any other basis gives another way to reach the same point. With

B={b1=[11], b2=[1−1]}\mathcal{B} = \left\{ \mathbf{b}_1 = \begin{bmatrix} 1\\ 1 \end{bmatrix},\ \mathbf{b}_2 = \begin{bmatrix} 1\\ -1 \end{bmatrix} \right\}

we have x=3b1+2b2\mathbf{x} = 3\mathbf{b}_1 + 2\mathbf{b}_2, so the coordinates of x\mathbf{x} relative to B\mathcal{B} are

[x]B=[32][\mathbf{x}]_{\mathcal{B}} = \begin{bmatrix} 3\\ 2 \end{bmatrix}

A basis guarantees these weights exist (the vectors span) and are unique (the vectors are independent), so every basis is a complete, unambiguous coordinate system.

The conversion matrix

Put the basis vectors into the columns of PB=[b1b2]P_{\mathcal{B}} = \begin{bmatrix} \mathbf{b}_1 & \mathbf{b}_2 \end{bmatrix}. Then PB[x]B=3b1+2b2=xP_{\mathcal{B}}[\mathbf{x}]_{\mathcal{B}} = 3\mathbf{b}_1 + 2\mathbf{b}_2 = \mathbf{x}:

x=PB[x]B[x]B=PB−1x\mathbf{x} = P_{\mathcal{B}}[\mathbf{x}]_{\mathcal{B}} \qquad [\mathbf{x}]_{\mathcal{B}} = P_{\mathcal{B}}^{-1}\mathbf{x}

PBP_{\mathcal{B}} is invertible because its columns are independent, as in the inverse of a matrix.

Why a transformation becomes P⁻¹AP

Let AA be a transformation’s matrix in standard coordinates. To apply it to a vector given in B\mathcal{B}-coordinates and get the answer in B\mathcal{B}-coordinates, go around three sides of a square: convert to standard coordinates with PP, apply AA, convert back with P−1P^{-1}. So the same transformation, described in the basis B\mathcal{B}, has the matrix P−1APP^{-1}AP. Two matrices related this way are similar: they are one transformation seen in two coordinate systems, so they share a determinant, a trace and eigenvalues.

The payoff is choosing B\mathcal{B} well. For A=[2112]A = \begin{bmatrix} 2 & 1\\ 1 & 2 \end{bmatrix} and the basis above,

P−1AP=[3001]P^{-1}AP = \begin{bmatrix} 3 & 0\\ 0 & 1 \end{bmatrix}

In these coordinates AA stretches the first axis by 33 and leaves the second alone. That is the idea behind diagonalization, and the basis that does it is made of eigenvectors.

Worked examples

Common mistakes

Practice problems

  1. Find the coordinates of (2,5)(2, 5) in the basis C={(1,0),(1,1)}\mathcal{C} = \{(1, 0), (1, 1)\}.

    Answer

    (−3,5)(-3, 5)

    Full solution

    c1(1,0)+c2(1,1)=(2,5)c_1(1, 0) + c_2(1, 1) = (2, 5) gives c2=5c_2 = 5 and c1+c2=2c_1 + c_2 = 2, so c1=−3c_1 = -3.

  2. With B={(1,1),(1,−1)}\mathcal{B} = \{(1, 1), (1, -1)\}, which vector has [x]B=(4,−1)[\mathbf{x}]_{\mathcal{B}} = (4, -1)?

    Answer

    (3,5)(3, 5)

    Full solution

    4(1,1)−1(1,−1)=(3,5)4(1, 1) - 1(1, -1) = (3, 5).

  3. Find PB←CP_{\mathcal{B}\leftarrow\mathcal{C}} for the bases of Example 2.

    Answer

    [121120]\begin{bmatrix} \tfrac{1}{2} & 1\\ \tfrac{1}{2} & 0 \end{bmatrix}

    Full solution

    It is the inverse of PC←B=[021−1]P_{\mathcal{C}\leftarrow\mathcal{B}} = \begin{bmatrix} 0 & 2\\ 1 & -1 \end{bmatrix}, whose determinant is −2-2. Equivalently, its columns are the B\mathcal{B}-coordinates of (1,0)(1, 0) and (1,1)(1, 1).

  4. Find the matrix of the shear [1101]\begin{bmatrix} 1 & 1\\ 0 & 1 \end{bmatrix} in the basis B={(1,1),(1,−1)}\mathcal{B} = \{(1, 1), (1, -1)\}.

    Answer

    [1.5−0.50.50.5]\begin{bmatrix} 1.5 & -0.5\\ 0.5 & 0.5 \end{bmatrix}

    Full solution

    P−1=12[111−1]P^{-1} = \tfrac{1}{2}\begin{bmatrix} 1 & 1\\ 1 & -1 \end{bmatrix} and AP=[201−1]AP = \begin{bmatrix} 2 & 0\\ 1 & -1 \end{bmatrix}. Multiplying gives the result. Not every basis makes a matrix simpler.

  5. Two matrices are similar. One has determinant 66 and trace 55. What are the determinant and trace of the other?

    Answer

    66 and 55

    Full solution

    det⁡(P−1AP)=det⁡A\det(P^{-1}AP) = \det A, and the trace is also unchanged. Similar matrices describe the same transformation.

  6. Find the coordinates of p(t)=4+3t+t2p(t) = 4 + 3t + t^2 in the basis {1, 1+t, 1+t+t2}\{1,\ 1 + t,\ 1 + t + t^2\}.

    Answer

    (1,2,1)(1, 2, 1)

    Full solution

    c3=1c_3 = 1, c2+c3=3c_2 + c_3 = 3 gives c2=2c_2 = 2, and c1+c2+c3=4c_1 + c_2 + c_3 = 4 gives c1=1c_1 = 1.

  7. Explain why the reflection in Example 3 is diagonal in the basis B\mathcal{B}.

    Answer

    Both basis vectors are eigenvectors: one lies on the mirror, eigenvalue 11, and one is perpendicular to it, eigenvalue −1-1.

    Full solution

    A transformation’s matrix in a basis of eigenvectors is diagonal, with the eigenvalues on the diagonal.

  8. A student computes [x]B[\mathbf{x}]_{\mathcal{B}} for x=(5,1)\mathbf{x} = (5, 1) as PBx=(6,4)P_{\mathcal{B}}\mathbf{x} = (6, 4). What went wrong?

    Answer

    PBP_{\mathcal{B}} converts the other way. The coordinates are PB−1x=(3,2)P_{\mathcal{B}}^{-1}\mathbf{x} = (3, 2).

    Full solution

    Check: 6(1,1)+4(1,−1)=(10,2)6(1, 1) + 4(1, -1) = (10, 2), not (5,1)(5, 1).

Frequently asked questions

What are the coordinates of a vector in a basis?

The unique weights c₁, …, cₙ with x = c₁b₁ + … + cₙbₙ. They are written as the coordinate vector [x]_B.

How do you find coordinates in a new basis?

Put the basis vectors in the columns of P_B. Then x = P_B[x]_B, so [x]_B = P_B⁻¹x, or solve the system P_B c = x by row reduction.

What is the change-of-coordinates matrix from B to C?

P_{C←B} = P_C⁻¹P_B. Its columns are the C-coordinates of the vectors of B, and it turns [x]_B into [x]_C.

How does a linear transformation look in a new basis?

If A is its matrix in standard coordinates and P = P_B, its matrix in B-coordinates is P⁻¹AP. Matrices related this way are called similar.

Why change basis at all?

A well-chosen basis can make a transformation diagonal, or line up with the geometry of a problem, so that its action is simple to read and compute with.

What to learn next