# Change of Basis

Page
Change of Basis – HMC Calculus Tutorial

Let $V$ be a vector space and let $S = \{{\bf v_1,v_2, \ldots, v_n}\}$ be a set of vectors in $V$. Recall that $S$ forms a basis for $V$ if the following two conditions hold: Let $V$ be a vector space and let $S = \{{\bf v_1,v_2, \ldots, v_n}\}$ be a set of vectors in $V$. Recall that $S$ forms a basis for $V$ if the following two conditions hold:

Let $S = \lbrace {\bf v}_1 , {\bf v}_2 , \dots , {\bf v}_n \rbrace$ be a non-empty set of vectors. If $k_1 {\bf v}_1 + k_2 {\bf v}_2 + \dots + k_n {\bf v}_n = 0$ only when $k_1 , k_2 , \dots , k_n = 0$, then $S$ is linearly independent.

Let $V$ be a vector space and let $\lbrace {\bf v}_1 , {\bf v}_2 , \dots , {\bf v}_n \rbrace$ be a set of elements in $V$. If every vector in $V$ can be expressed as a linear combination of ${\bf v}_1 , {\bf v}_2 , \dots , {\bf v}_n$ then $\lbrace {\bf v}_1 , {\bf v}_2 , \dots , {\bf v}_n \rbrace$ spans $V$.

If $S = \{{\bf v_1,v_2, \ldots, v_n}\}$ is a basis for $V$, then every vector ${\bf v} \in V$ can be expressed uniquely as a linear combination of ${\bf v_1,v_2, \ldots, v_n}$: $${\bf v} = c_1{\bf v_1} + c_2{\bf v_2} + \cdots + c_n{\bf v_n}.$$ Think of $\left[\begin{array}{c} c_1\\ c_2\\ \vdots \\ c_n \end{array}\right]$ as the coordinates of ${\bf v}$ relative to the basis $S$. If $V$ has dimension, which is the number of vectors needed to form a basis. $n$, then every set of $n$ linearly independent vectors in $V$ forms a basis for $V$. In every application, we have a choice as to what basis we use. In this tutorial, we will desribe the transformation of coordinates of vectors under a change of basis.

We will focus on vectors in $R^2$, although all of this generalizes to $R^n$. The standard basis in $R^2$ is $\left\{\left[{1 \atop 0} \right],\left[{0 \atop 1}\right]\right\}$. We specify other bases with reference to this rectangular coordinate system.

Let $B=\{{\bf u,w}\}$ and $B’=\{{\bf u’,w’}\}$ be two bases for $R^2$. For a vector ${\bf v} \in V$, given its coordinates $[{\bf v}]_B$ in basis $B$ we would like to be able to express ${\bf v}$ in tems of its coordinates $[{\bf v}]_{B’}$ in basis $B’$, and vice versa.

Suppose the basis vectors ${\bf u’}$ and ${\bf w’}$ for $B’$ have the following coordinates relative to the basis $B$:

\begin{eqnarray*} ~[{\bf u’}]_B & = & \left[\begin{array}{c} a \\ b \end{array}\right] \qquad \\ ~[{\bf w’}]_B & = & \left[\begin{array}{c} c \\ d \end{array}\right]. \qquad \end{eqnarray*}

This means that \begin{eqnarray*} {\bf u’} & = & a{\bf u} + b{\bf w} \\ {\bf w’} & = & c{\bf u} + d{\bf w} \end{eqnarray*}

The change of coordinates matrix from $B’$ to $B$ $$P = \left[\begin{array}{cc} a & c \\ b & d \\ \end{array} \right]$$ governs the change of coordinates of ${\bf v} \in V$ under the change of basis from $B’$ to $B$. $$[{\bf v}]_B = P[{\bf v}]_{B’} = \left[\begin{array}{cc} a & c \\ b & d \\ \end{array} \right][{\bf v}]_{B’}.$$ That is, if we know the coordinates of ${\bf v}$ relative to the basis $B’$, multiplying this vector by the change of coordinates matrix gives us the coordinates of ${\bf v}$ relative to the basis $B$.

Suppose vector ${\bf v}$ has coordinates $\left[{x’ \atop y’}\right]_{B’}$ relative to the basis $B’ = \{ {\bf u’,w’} \}$. This means that $${\bf v} = x'{\bf u’} + y'{\bf w’}.$$ Substituting ${\bf u’} = a{\bf u} + b{\bf w}$ and ${\bf w’} = c{\bf u} + d{\bf w}$ into this, \begin{eqnarray*} {\bf v} & = & x'(a{\bf u} + b{\bf w}) + y'(c{\bf u} + d{\bf w}) \\ & = & (ax’ + cy’){\bf u} + (bx’+dy’){\bf w}. \end{eqnarray*} That is, \begin{eqnarray*} [{\bf v}]_{B} & = & \left[\begin{array}{c} ax’ + cy’ \\ bx’+dy’ \end{array}\right] \\ & = & \left[\begin{array}{cc} a & c \\ b & d \end{array} \right]\left[\begin{array}{c} x’ \\ y’ \end{array}\right] \\ & = & \left[\begin{array}{cc} a & c \\ b & d \end{array} \right][{\bf v}]_{B’}. \end{eqnarray*}

The transition matrix $P$ is invertible.

If a square matrix ${\bf A}$ has an inverse ${\bf A}^{-1}$, it is said to be invertible.

It can be shown that ${\bf A}$ is invertible if and only if $\det{\bf A} \neq {\bf 0}$.

For a $2 \times 2$ matrix ${\bf A} = \left[ \begin{array}{cc} a & b \\ c & d \end{array} \right], \, {\bf A}^{-1} = \frac{1}{ad-bc} \left[ \begin{array}{cc} d & -b \\ -c & a \end{array} \right].$

In fact, if $P$ is the change of coordinates matrix from $B’$ to $B$, the $P^{-1}$ is the change of coordinates matrix from $B$ to $B’$: $$[{\bf v}]_{B’} = P^{-1}[{\bf v}]_B$$

###### Example

Let $B = \left\{\left[{1 \atop 0} \right],\left[{0 \atop 1}\right]\right\}$ and $B’ = \left\{\left[{3 \atop 1} \right],\left[{-2 \atop 1}\right]\right\}$. The change of basis matrix form $B’$ to $B$ is $$P = \left[\begin{array}{cc} 3 & -2 \\ 1 & 1 \end{array}\right].$$ The vector ${\bf v}$ with coordinates $[{\bf v}]_{B’} = \left[ {2 \atop 1} \right]$ relative to the basis $B’$ has coordinates $$[{\bf v}]_B = \left[ \begin{array}{cc} 3 & -2 \\ 1 & 1 \end{array}\right]\left[\begin{array}{c} 2 \\ 1 \end{array}\right] = \left[\begin{array}{c} 4 \\ 3 \end{array}\right]$$ relative to the basis $B$. Since $$P^{-1} = \left[\begin{array}{cc} \frac{1}{5} & \frac{2}{5} \\ -\frac{1}{5} & \frac{3}{5} \end{array}\right],$$ we can verify that $$[{\bf v}]_{B’} = \left[\begin{array}{cc} \frac{1}{5} & \frac{2}{5} \\ -\frac{1}{5} & \frac{3}{5} \end{array}\right]\left[\begin{array}{c} 4 \\ 3 \end{array}\right] = \left[\begin{array}{c} 2 \\ 1 \end{array}\right]$$ which is what we started with.

In the following example, we introduce a third basis to look at the relationship between two non-standard bases.

###### Example

Let $B” = \left\{ \left[ {2 \atop 1} \right],\left[ {1 \atop 4} \right]\right\}$. To find the change of coordinates matrix from the basis $B’$ of the previous example to $B”$, we first express the basis vectors $\left[ {3 \atop 1} \right]$ and $\left[ {-2 \atop 1} \right]$ of $B’$ as linear combinations of the basis vectors $\left[ {2 \atop 1} \right]$ and $\left[ {1 \atop 4} \right]$ of $B”$: \begin{eqnarray*} \mbox{Set }\left[ \begin{array}{c} 3 \\ 1 \end{array}\right] & = & a\left[\begin{array}{c} 2 \\ 1 \end{array}\right] + b\left[\begin{array}{c} 1 \\ 4 \end{array}\right] \\ \left[\begin{array}{c} -2 \\ 1 \end{array}\right] & = & c \left[\begin{array}{c} 2 \\ 1 \end{array}\right] + d\left[\begin{array}{c} 1 \\ 4 \end{array}\right] \end{eqnarray*} and solve the resulting systems of r $a,b,c,$ and $d$: \begin{eqnarray*} \left[ \begin{array}{c} 3 \\ 1 \end{array}\right] & = & \frac{11}{7} \left[\begin{array}{c} 2 \\ 1 \end{array}\right] – \frac{1}{7}\left[\begin{array}{c} 1 \\ 4 \end{array}\right] \\ \left[\begin{array}{c} -2 \\ 1 \end{array}\right] & = & \frac{-9}{7}\left[\begin{array}{c} 2 \\ 1 \end{array}\right] + \frac{4}{7}\left[\begin{array}{c} 1 \\ 4 \end{array}\right] \end{eqnarray*} Thus, the transition matrix form $B’$ to $B”$ is $$\left[\begin{array}{cc} \frac{11}{7} & \frac{-9}{7} \\ \frac{-1}{7} & \frac{4}{7} \end{array}\right].$$ The vector ${\bf v}$ with coordinates $\left[ {2 \atop 1} \right]$ relative to the basis $B’$ has coordinates $$\left[\begin{array}{cc} \frac{11}{7} & \frac{-9}{7} \\ \frac{-1}{9} & \frac{4}{7} \end{array}\right]\left[\begin{array}{c} 2 \\ 1 \end{array}\right] = \left[\begin{array}{c} \frac{13}{7} \\ \frac{2}{7} \end{array}\right]$$ relative to the basis $B”$. This is, back in the standard basis, $$[ {\bf v} ]_B = \frac{13}{7}\left[\begin{array}{c} 2 \\ 1 \end{array}\right] + \frac{2}{7}\left[\begin{array}{c} 1 \\ 4 \end{array}\right] = \left[\begin{array}{c} 4 \\ 3 \end{array}\right],$$ which agrees with the results of the previous example.

#### Rotation of the Coordinate Axes

Suppose we obtain a new coordinate system from the standard rectangular coordinate system by rotating the axes counterclockwise by an angle $\theta$. The new basis $B’ = \left\{{\bf u’, v’}\right\}$ of unit vectors along the $x’$- and $y’$-axes, respectively, has coordinates \begin{eqnarray*} ~[{\bf u’}]_B & = & \left[\begin{array}{c} \cos\theta \\ \sin\theta \end{array}\right] \\ ~[{\bf v’}]_B & = & \left[\begin{array}{c} -\sin\theta \\ \cos\theta \end{array} \right] \end{eqnarray*} in the original coordinate system.

Thus, $P = \left[ \begin{array}{cc} \cos\theta & -\sin\theta \\ \sin\theta & \cos\theta \end{array}\right]$ and $P^{-1} = \left[ \begin{array}{cc} \cos\theta & \sin\theta \\ -\sin\theta & \cos\theta \end{array}\right]$. A vector $\left[ {x \atop y} \right]_B$ in the original coordinate system has coordinates $\left[ {x’ \atop y’} \right]_{B’}$ given by $$\left[\begin{array}{c} x’ \\ y’ \end{array}\right]_{B’} = \left[\begin{array}{cc} \cos\theta & \sin\theta \\ -\sin\theta & \cos\theta \end{array}\right]\left[\begin{array}{c} x \\ y \end{array}\right]_{B}$$ in the rotated coordinate system.

###### Example

The vector $[{\bf v}]_{B}= \left[ {3 \atop 2} \right]$ in the original coordinate system has coordinates $$[{\bf v}]_{B’} = \left[\begin{array}{cc} \frac{\sqrt{2}}{2} & \frac{\sqrt{2}}{2} \\ -\frac{\sqrt{2}}{2} & \frac{\sqrt{2}}{2} \end{array}\right]\left[\begin{array}{c} 3 \\ 2 \end{array}\right] = \left[\begin{array}{c} \frac{5\sqrt{2}}{2} \\ -\frac{\sqrt{2}}{2} \end{array}\right]$$ in the coordinate system formed by rotating the axes by $45^{\circ}$.

In the following Exploration, set up your own basis in $R^2$ and compare the coordinates of vectors in your basis to their coordinates in the standard basis.

Exploration

#### Key Concepts

Let $B = \{{\bf u,v}\}$ and $B’ = \{ {\bf u’, v’} \}$ be two bases for $R^2$. If $[{\bf u}]_{B}= \left[ {a \atop b} \right]$ and $[{\bf v}]_{B}= \left[ {c \atop d} \right]$, then $P = \left[\begin{array}{cc} a & c \\ b & d \end{array}\right]$ is the

change of coordinates matrix

from $B’$ to $B$ and $P^{-1}$ is the change of coordinates matrix from $B$ to $B’$. That is, for any ${\bf v} \in V$, \begin{eqnarray*} ~[{\bf v}]_{B} & = & P[{\bf v}]_{B’} \\ ~[{\bf v}]_{B’} & = & P^{-1}[{\bf v}]_{B}. \end{eqnarray*}