Change of Basis – Examples with Solutions

A vector in a vector space can be represented by different coordinate vectors, depending on the basis chosen. This page explains how to move between two bases using a change-of-basis matrix, with worked examples and detailed solutions.

Change of Coordinates Matrices

Given two bases \( A = \{ \mathbf{a}_1, \mathbf{a}_2, \dots, \mathbf{a}_n \} \) and \( B = \{ \mathbf{b}_1, \mathbf{b}_2, \dots, \mathbf{b}_n \} \) of a vector space \( V \), the change-of-coordinates matrix from \(B\) to \(A\) is defined as:

\[ P_{A \leftarrow B} = \begin{bmatrix} [\mathbf{b}_1]_A & [\mathbf{b}_2]_A & \dots & [\mathbf{b}_n]_A \end{bmatrix}, \]

where \( [\mathbf{b}_i]_A \) is the coordinate vector of \( \mathbf{b}_i \) in the basis \( A \).

Similarly, the change-of-coordinates matrix from \(A\) to \(B\) is:

\[ P_{B \leftarrow A} = \begin{bmatrix} [\mathbf{a}_1]_B & [\mathbf{a}_2]_B & \dots & [\mathbf{a}_n]_B \end{bmatrix}. \]

The two matrices are inverses of each other:

\[ P_{B \leftarrow A} = (P_{A \leftarrow B})^{-1}. \]

Key idea. The change-of-basis matrix \( P_{A \leftarrow B} \) converts coordinate vectors from basis \( B \) to basis \( A \). Its columns are the \( B \)-vectors expressed in the \( A \)-basis.
Notation note. The subscript \( P_{A \leftarrow B} \) is read "P from \( B \) to \( A \)" — it converts coordinates from basis \( B \) to basis \( A \).
Special case. If \( A \) is the standard basis \( \{e_1, \dots, e_n\} \), then \( P_{A \leftarrow B} = \begin{bmatrix} \mathbf{b}_1 & \mathbf{b}_2 & \dots & \mathbf{b}_n \end{bmatrix} \) — the matrix whose columns are the \( B \)-vectors themselves.

Applications of Change of Coordinates Matrices

If \( A \) and \( B \) are bases for a vector space \( V \) and \( \mathbf{x} \) is any vector in \( V \), we can convert its coordinates between bases using the change-of-basis matrices:

\[ [\mathbf{x}]_A = P_{A \leftarrow B} [\mathbf{x}]_B \quad \text{and} \quad [\mathbf{x}]_B = P_{B \leftarrow A} [\mathbf{x}]_A. \]

Application. Change-of-basis matrices are used in physics and engineering to switch between coordinate systems (e.g., Cartesian ↔ polar), in computer graphics to rotate between local and global frames, and in numerical linear algebra to simplify systems by transforming to a more convenient basis.

Examples with Solutions

Example 1 — Change of Basis in \(\mathbb{R}^2\)

Given the bases \( A \) and \( B \) for a vector space \( V \):

\[ A = \left\{ \begin{bmatrix} 1 \\ 2 \end{bmatrix}, \begin{bmatrix} -2 \\ -3 \end{bmatrix} \right\}, \qquad B = \left\{ \begin{bmatrix} 2 \\ 1 \end{bmatrix}, \begin{bmatrix} 1 \\ 3 \end{bmatrix} \right\}. \]

(a) Find \( P_{A \leftarrow B} \).   (b) Find \( P_{B \leftarrow A} \).   (c) Show that the two matrices are inverses.

Solution

(a) Find \( P_{A \leftarrow B} \).

By definition, \( P_{A \leftarrow B} = \begin{bmatrix} [\mathbf{b}_1]_A & [\mathbf{b}_2]_A \end{bmatrix} \). Form the augmented matrix \( [A \mid B] \):

\[ \begin{bmatrix} 1 & -2 & | & 2 & 1 \\ 2 & -3 & | & 1 & 3 \end{bmatrix}. \]

Row-reduce to obtain \( [I \mid P_{A \leftarrow B}] \):

\[ \begin{bmatrix} 1 & 0 & | & -4 & 3 \\ 0 & 1 & | & -3 & 1 \end{bmatrix}. \]

Hence

\[ P_{A \leftarrow B} = \begin{bmatrix} -4 & 3 \\ -3 & 1 \end{bmatrix}. \]

(b) Find \( P_{B \leftarrow A} \).

Form the augmented matrix \( [B \mid A] \):

\[ \begin{bmatrix} 2 & 1 & | & 1 & -2 \\ 1 & 3 & | & 2 & -3 \end{bmatrix}. \]

Row-reduce to obtain \( [I \mid P_{B \leftarrow A}] \):

\[ \begin{bmatrix} 1 & 0 & | & \tfrac{1}{5} & -\tfrac{3}{5} \\ 0 & 1 & | & \tfrac{3}{5} & -\tfrac{4}{5} \end{bmatrix}. \]

Hence

\[ P_{B \leftarrow A} = \begin{bmatrix} \tfrac{1}{5} & -\tfrac{3}{5} \\ \tfrac{3}{5} & -\tfrac{4}{5} \end{bmatrix}. \]

(c) Show that the two matrices are inverses.

\[ P_{A \leftarrow B} P_{B \leftarrow A} = \begin{bmatrix} -4 & 3 \\ -3 & 1 \end{bmatrix} \begin{bmatrix} \tfrac{1}{5} & -\tfrac{3}{5} \\ \tfrac{3}{5} & -\tfrac{4}{5} \end{bmatrix} = \begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix}. \]

\[ P_{B \leftarrow A} P_{A \leftarrow B} = \begin{bmatrix} \tfrac{1}{5} & -\tfrac{3}{5} \\ \tfrac{3}{5} & -\tfrac{4}{5} \end{bmatrix} \begin{bmatrix} -4 & 3 \\ -3 & 1 \end{bmatrix} = \begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix}. \]

Example 2 — Change of Basis in a 3-Dimensional Subspace of \(\mathbb{R}^4\)

Given the bases \( A \) and \( B \) for a subspace \( V \) and a vector \( \mathbf{x} \):

\[ A = \left\{ \begin{bmatrix} 1 \\ 1 \\ 0 \\ 0 \end{bmatrix}, \begin{bmatrix} 1 \\ 0 \\ 2 \\ -1 \end{bmatrix}, \begin{bmatrix} 1 \\ -1 \\ -1 \\ 2 \end{bmatrix} \right\}, \quad B = \left\{ \begin{bmatrix} 2 \\ 0 \\ -1 \\ 2 \end{bmatrix}, \begin{bmatrix} 0 \\ 1 \\ 3 \\ -3 \end{bmatrix}, \begin{bmatrix} 3 \\ 1 \\ 4 \\ -2 \end{bmatrix} \right\}, \]

\[ \mathbf{x} = \begin{bmatrix} 5 \\ 2 \\ 6 \\ -3 \end{bmatrix}. \]

(a) Find \( P_{A \leftarrow B} \).   (b) Find \( P_{B \leftarrow A} \).   (c) Find \( [\mathbf{x}]_A \) and \( [\mathbf{x}]_B \).   (d) Verify \( [\mathbf{x}]_A = P_{A \leftarrow B} [\mathbf{x}]_B \) and \( [\mathbf{x}]_B = P_{B \leftarrow A} [\mathbf{x}]_A \).

Solution

(a) Find \( P_{A \leftarrow B} \).

Row-reduce the augmented matrix \( [A \mid B] \):

\[ \begin{bmatrix} 1 & 1 & 1 & | & 2 & 0 & 3 \\ 1 & 0 & -1 & | & 0 & 1 & 1 \\ 0 & 2 & -1 & | & -1 & 3 & 4 \\ 0 & -1 & 2 & | & 2 & -3 & -2 \end{bmatrix} \xrightarrow{\text{RREF}} \begin{bmatrix} 1 & 0 & 0 & | & 1 & 0 & 1 \\ 0 & 1 & 0 & | & 0 & 1 & 2 \\ 0 & 0 & 1 & | & 1 & -1 & 0 \\ 0 & 0 & 0 & | & 0 & 0 & 0 \end{bmatrix}. \]

Hence

\[ P_{A \leftarrow B} = \begin{bmatrix} 1 & 0 & 1 \\ 0 & 1 & 2 \\ 1 & -1 & 0 \end{bmatrix}. \]

Note: the last row of zeros is expected — \(A\) and \(B\) span only a 3-dimensional subspace of \( \mathbb{R}^4 \).

(b) Find \( P_{B \leftarrow A} \).

Row-reduce \( [B \mid A] \):

\[ \begin{bmatrix} 2 & 0 & 3 & | & 1 & 1 & 1 \\ 0 & 1 & 1 & | & 1 & 0 & -1 \\ -1 & 3 & 4 & | & 0 & 2 & -1 \\ 2 & -3 & -2 & | & 0 & -1 & 2 \end{bmatrix} \xrightarrow{\text{RREF}} \begin{bmatrix} 1 & 0 & 0 & | & 2 & -1 & -1 \\ 0 & 1 & 0 & | & 2 & -1 & -2 \\ 0 & 0 & 1 & | & -1 & 1 & 1 \\ 0 & 0 & 0 & | & 0 & 0 & 0 \end{bmatrix}. \]

Hence

\[ P_{B \leftarrow A} = \begin{bmatrix} 2 & -1 & -1 \\ 2 & -1 & -2 \\ -1 & 1 & 1 \end{bmatrix}. \]

(c) Find \( [\mathbf{x}]_A \) and \( [\mathbf{x}]_B \).

To find \( [\mathbf{x}]_A \), row-reduce \( [A \mid \mathbf{x}] \):

\[ \begin{bmatrix} 1 & 1 & 1 & | & 5 \\ 1 & 0 & -1 & | & 2 \\ 0 & 2 & -1 & | & 6 \\ 0 & -1 & 2 & | & -3 \end{bmatrix} \xrightarrow{\text{RREF}} \begin{bmatrix} 1 & 0 & 0 & | & 2 \\ 0 & 1 & 0 & | & 3 \\ 0 & 0 & 1 & | & 0 \\ 0 & 0 & 0 & | & 0 \end{bmatrix} \;\Rightarrow\; [\mathbf{x}]_A = \begin{bmatrix} 2 \\ 3 \\ 0 \end{bmatrix}. \]

To find \( [\mathbf{x}]_B \), row-reduce \( [B \mid \mathbf{x}] \):

\[ \begin{bmatrix} 2 & 0 & 3 & | & 5 \\ 0 & 1 & 1 & | & 2 \\ -1 & 3 & 4 & | & 6 \\ 2 & -3 & -2 & | & -3 \end{bmatrix} \xrightarrow{\text{RREF}} \begin{bmatrix} 1 & 0 & 0 & | & 1 \\ 0 & 1 & 0 & | & 1 \\ 0 & 0 & 1 & | & 1 \\ 0 & 0 & 0 & | & 0 \end{bmatrix} \;\Rightarrow\; [\mathbf{x}]_B = \begin{bmatrix} 1 \\ 1 \\ 1 \end{bmatrix}. \]

(d) Verify the transformation formulas.

\[ P_{A \leftarrow B} [\mathbf{x}]_B = \begin{bmatrix} 1 & 0 & 1 \\ 0 & 1 & 2 \\ 1 & -1 & 0 \end{bmatrix} \begin{bmatrix} 1 \\ 1 \\ 1 \end{bmatrix} = \begin{bmatrix} 2 \\ 3 \\ 0 \end{bmatrix} = [\mathbf{x}]_A. \quad \checkmark \]

\[ P_{B \leftarrow A} [\mathbf{x}]_A = \begin{bmatrix} 2 & -1 & -1 \\ 2 & -1 & -2 \\ -1 & 1 & 1 \end{bmatrix} \begin{bmatrix} 2 \\ 3 \\ 0 \end{bmatrix} = \begin{bmatrix} 1 \\ 1 \\ 1 \end{bmatrix} = [\mathbf{x}]_B. \quad \checkmark \]

More References and Links