Change of Coordinates

On The Matrix of a Linear Map, one map $T(a_1, a_2) = (a_1 + 2a_2, \ 2a_1 + a_2)$ had two completely different matrices: $\begin{pmatrix} 1 & 2 \\ 2 & 1 \end{pmatrix}$ in the standard basis and $\begin{pmatrix} 3 & 0 \\ 0 & -1 \end{pmatrix}$ in $\beta' = \{(1, 1), (1, -1)\}$. We found the second one by hand. This page builds the machine that converts one into the other, starting with the simplest thing a basis does: give a vector an address.

Every basis draws its own grid on the plane, and every point gets an address on each grid. This page converts addresses from one grid to another with a single matrix, and then uses that to move a map's matrix from one basis to another, which is how a messy matrix can turn out to be a simple stretch or flip in disguise.

The Same Map, Two Matrices widget: the standard grid got twisted, the $\beta'$ grid just got stretched. Same $T$ both times.

Changing Coordinates of a Vector

One vector, two addresses. If you know $[v]_{\beta'}$, how do you get $[v]_\beta$? The trick is to think of "do nothing" as a linear map, the identity $I_\V$, and describe its input in $\beta'$ and its output in $\beta$.

Let $\beta$ and $\beta'$ be ordered bases for a finite-dimensional vector space $\V$, and let $Q = [I_\V]_{\beta'}^\beta$. Then $Q$ is invertible, and for every $v \in \V$,

$$[v]_\beta = Q[v]_{\beta'} \qquad\text{and}\qquad [v]_{\beta'} = Q^{-1}[v]_\beta.$$
Show proof

$I_\V$ is invertible, so its matrix $Q$ is (Invertibility). The matrix of a map turns input coordinates into output coordinates (The Matrix of a Linear Map), so $[v]_\beta = [I_\V(v)]_\beta = [I_\V]_{\beta'}^\beta[v]_{\beta'} = Q[v]_{\beta'}$. Multiplying by $Q^{-1}$ gives the second formula. $\blacksquare$

Let $\beta' = \{v_1', v_2', \ldots\}$ be a basis of $\R^2$ or $\R^3$, and let $Q$ be the matrix with the vectors of $\beta'$ as its columns. Then for every $v$,

$$v = Q[v]_{\beta'} \qquad\text{and}\qquad [v]_{\beta'} = Q^{-1}v.$$
Why it's true (picture)

This is a visual argument, not a formal proof. $[v]_{\beta'} = (c_1, c_2)$ says $v$ is the walk $c_1$ steps of $v_1'$ and $c_2$ of $v_2'$ on the $\beta'$ grid, as in the figure above. Multiplying $Q$ by $(c_1, c_2)$ takes $c_1$ of its first column plus $c_2$ of its second (the column picture), and those columns are $v_1'$ and $v_2'$: the same walk. Going back undoes $Q$, so it takes $Q^{-1}$.

The full proof is in the n version.

That matrix gets a name.

The matrix $Q = [I_\V]_{\beta'}^\beta$ is the change of coordinate matrix that changes $\beta'$-coordinates into $\beta$-coordinates.

The matrix $Q$ with the vectors of $\beta'$ as columns is the change of coordinate matrix that changes $\beta'$-coordinates into standard coordinates. $Q^{-1}$ changes them back.

What's in it? Column $j$ of $[I_\V]_{\beta'}^\beta$ is $[I_\V(v_j')]_\beta = [v_j']_\beta$. So the columns of $Q$ are the vectors of $\beta'$, written in $\beta$-coordinates. When $\beta$ is the standard basis of $\R^n$, that's just the vectors of $\beta'$ themselves, stood up as columns.

So the columns of $Q$ are the basis vectors themselves. That makes going from $\beta'$-coordinates to ordinary ones a single multiplication.

Let $\beta' = \{(1, 1), (1, -1)\}$. Find $Q$, and use it to find $v$ if $[v]_{\beta'} = (3, 2)$.


The columns of $Q$ are the vectors of $\beta'$:

$$Q = \begin{pmatrix} 1 & 1 \\ 1 & -1 \end{pmatrix}, \qquad v = Q[v]_{\beta'} = \begin{pmatrix} 1 & 1 \\ 1 & -1 \end{pmatrix}\begin{pmatrix} 3 \\ 2 \end{pmatrix} = \begin{pmatrix} 5 \\ 1 \end{pmatrix}.$$

So $v = (5, 1)$: the point in the figure, $3(1, 1) + 2(1, -1)$.

Going the other way is where people slip, so it gets its own example.

Let $\beta' = \{(1, 2), (1, 1)\}$ and $v = (4, 1)$. Find $[v]_{\beta'}$.


$Q = \begin{pmatrix} 1 & 1 \\ 2 & 1 \end{pmatrix}$ has $ad - bc = -1$, so $Q^{-1} = \begin{pmatrix} -1 & 1 \\ 2 & -1 \end{pmatrix}$ and

$$[v]_{\beta'} = Q^{-1}\begin{pmatrix} 4 \\ 1 \end{pmatrix} = \begin{pmatrix} -3 \\ 7 \end{pmatrix}.$$

Check: $-3(1, 2) + 7(1, 1) = (4, 1)$. Odd-looking coordinates, but the check never lies.

The direction is the thing to keep straight.

Which way does $Q$ go? Its columns are the $\beta'$ vectors, so it naturally takes "how many of each $\beta'$ vector" and builds the actual vector. To go the other direction, from an actual vector to its $\beta'$-address, you need $Q^{-1}$. If your answer for $[v]_{\beta'}$ came from multiplying by $Q$, check it by walking the grid: it will be wrong.

Drag $v$ and watch both of its addresses update. The purple grid is $\beta'$; the plain grid is standard.

Two Addresses

Same vector, two addresses. Like a house that's "123 Main St" to the mail carrier and "the blue one past the gas station" to my grandma. Both correct. Only one fits on an envelope.

Your turn: convert an address. In free response, type the vector, like 2, 1.

Loading practice engine...

Neither basis has to be standard. Then each column of $Q$ takes one small computation: write a vector of $\beta'$ in $\beta$-coordinates.

Let $\beta = \{(1, 1), (0, 1)\}$ and $\beta' = \{(1, 2), (2, 3)\}$. Find the matrix that changes $\beta'$-coordinates into $\beta$-coordinates.


Write each vector of $\beta'$ with the vectors of $\beta$:

$$(1, 2) = 1(1, 1) + 1(0, 1), \qquad (2, 3) = 2(1, 1) + 1(0, 1).$$

Those coefficient lists are the columns: $Q = \begin{pmatrix} 1 & 2 \\ 1 & 1 \end{pmatrix}$. (In matrix language, $Q = B^{-1}B'$, where $B$ and $B'$ have the two bases as columns: go from $\beta'$ to standard with $B'$, then from standard to $\beta$ with $B^{-1}$.)

Your turn. Type the matrix row by row, like 1, 1; 1, 0.

Loading practice engine...

Changing the Matrix of a Map

The interesting case is a map from a space to itself, described with one basis on both sides.

A linear transformation from a vector space $\V$ into itself is a linear operator on $\V$.

A linear map from a space to itself ($\R^2$ to $\R^2$, or $\R^3$ to $\R^3$) is a linear operator.

Its matrix in a new basis comes from its matrix in the old one by a round trip.

Let $T$ be a linear operator on a finite-dimensional vector space $\V$, let $\beta$ and $\beta'$ be ordered bases for $\V$, and let $Q$ change $\beta'$-coordinates into $\beta$-coordinates. Then

$$[T]_{\beta'} = Q^{-1}[T]_\beta Q.$$
Show proof

Let $I$ be the identity on $\V$. Then $T = IT = TI$, so by the matrix of a composition,

$$Q[T]_{\beta'} = [I]_{\beta'}^\beta[T]_{\beta'}^{\beta'} = [IT]_{\beta'}^\beta = [TI]_{\beta'}^\beta = [T]_\beta^\beta[I]_{\beta'}^\beta = [T]_\beta Q.$$

Multiplying on the left by $Q^{-1}$ gives $[T]_{\beta'} = Q^{-1}[T]_\beta Q$. $\blacksquare$

Let $T$ be a linear operator on $\R^2$ or $\R^3$, let $\beta'$ be a basis, and let $Q$ have the vectors of $\beta'$ as columns. Then

$$[T]_{\beta'} = Q^{-1}[T]Q.$$
Why it's true (picture)

This is a visual argument, not a formal proof. Read $Q^{-1}[T]Q$ right to left as a trip, and follow one column at a time in the figure below: start with an address in $\beta'$-coordinates, turn it into an actual vector with $Q$, move it with $T$, and read the result back on the $\beta'$ grid with $Q^{-1}$. Column $j$ of $[T]_{\beta'}$ is exactly that trip starting from $e_j$.

The full proof is in the n version.

Here is that trip on the map from the top of the page, one column at a time.

The same computation, written out.

Let $T(a_1, a_2) = (a_1 + 2a_2, \ 2a_1 + a_2)$ and $\beta' = \{(1, 1), (1, -1)\}$. Use the formula to find $[T]_{\beta'}$.


$[T] = \begin{pmatrix} 1 & 2 \\ 2 & 1 \end{pmatrix}$ and $Q = \begin{pmatrix} 1 & 1 \\ 1 & -1 \end{pmatrix}$, with $ad - bc = -2$, so

$$Q^{-1} = \frac{1}{-2}\begin{pmatrix} -1 & -1 \\ -1 & 1 \end{pmatrix} = \begin{pmatrix} \tfrac12 & \tfrac12 \\ \tfrac12 & -\tfrac12 \end{pmatrix}.$$

Multiply, right to left:

$$[T]Q = \begin{pmatrix} 3 & -1 \\ 3 & 1 \end{pmatrix}, \qquad Q^{-1}\big([T]Q\big) = \begin{pmatrix} 3 & 0 \\ 0 & -1 \end{pmatrix}.$$

Notice that $[T]Q$ already has the columns $T(1, 1) = (3, 3)$ and $T(1, -1) = (-1, 1)$; multiplying by $Q^{-1}$ just rewrites them in $\beta'$-coordinates.

Matrices related this way come up so often that the relationship gets a name.

Square matrices $A$ and $B$ of the same size are similar if $B = Q^{-1}AQ$ for some invertible matrix $Q$.

So any two matrices of the same operator are similar: they are the same map wearing different coordinates. Anything that belongs to the map itself, and not to the coordinates, has to come out the same.

Similar matrices have the same rank and the same trace.

Show proof

Let $B = Q^{-1}AQ$. Trace: for any $n \times n$ matrices $X$ and $Y$, $\tr(XY) = \sum_i \sum_k X_{ik}Y_{ki} = \sum_k \sum_i Y_{ki}X_{ik} = \tr(YX)$. So $\tr(B) = \tr\big((Q^{-1}A)Q\big) = \tr\big(Q(Q^{-1}A)\big) = \tr(A)$.

Rank: $Q$ is invertible, so $x \mapsto Qx$ is onto and $\col(AQ) = \col(A)$; and $Q^{-1}$ is one-to-one, so it sends $\col(A)$ to a subspace of the same dimension, which is $\col(Q^{-1}AQ)$. Hence $\rank(B) = \rank(A)$. $\blacksquare$

Why it's true (picture)

This is a visual argument, not a formal proof. Similar matrices describe the same move in two coordinate systems. The rank is the dimension of what the move reaches (a point, a line, a plane, or space), and changing coordinates only relabels those outputs, it doesn't flatten or unflatten anything. The trace is less obvious from a picture; the example below checks it, and the n version proves it.

The full proof is in the n version.

Check it on the example above: $\begin{pmatrix} 1 & 2 \\ 2 & 1 \end{pmatrix}$ and $\begin{pmatrix} 3 & 0 \\ 0 & -1 \end{pmatrix}$ both have trace $2$ and rank $2$. The diagonal entries changed completely; their sum didn't.

Here's the question that drives the next chapter: given $A$, can you find a $Q$ that makes $Q^{-1}AQ$ diagonal? When you can, the map is just stretching along the columns of $Q$. Finding those columns on purpose is what eigenvectors are for.

One last trap with the formula.

Order matters in $Q^{-1}AQ$. Written $QAQ^{-1}$, it's a different matrix, describing the trip in the other direction. If your "nice basis" answer comes out ugly, check the order first.

Application: Reflections and Projections

Run the formula backward and it builds matrices that would be painful to find directly. Pick the basis where the map is obvious, write its easy matrix there, and change coordinates back: $[T] = Q[T]_{\beta'}Q^{-1}$.

Find the standard matrix of the reflection across the line $y = 2x$, and of the projection onto that line.


Take $v_1 = (1, 2)$ along the line and $v_2 = (-2, 1)$ square to it. The reflection keeps $v_1$ and flips $v_2$, so in $\beta' = \{v_1, v_2\}$ its matrix is $D = \begin{pmatrix} 1 & 0 \\ 0 & -1 \end{pmatrix}$. With $Q = \begin{pmatrix} 1 & -2 \\ 2 & 1 \end{pmatrix}$ ($ad - bc = 5$), $Q^{-1} = \frac{1}{5}\begin{pmatrix} 1 & 2 \\ -2 & 1 \end{pmatrix}$, and

$$[T] = QDQ^{-1} = \begin{pmatrix} 1 & 2 \\ 2 & -1 \end{pmatrix}\cdot\frac{1}{5}\begin{pmatrix} 1 & 2 \\ -2 & 1 \end{pmatrix} = \frac{1}{5}\begin{pmatrix} -3 & 4 \\ 4 & 3 \end{pmatrix}.$$

Check: $[T](1, 2) = \frac{1}{5}(-3 + 8, \ 4 + 6) = (1, 2)$, on the line, unmoved. The projection keeps $v_1$ and kills $v_2$, so its matrix in $\beta'$ is $\begin{pmatrix} 1 & 0 \\ 0 & 0 \end{pmatrix}$, and the same computation gives $\frac{1}{5}\begin{pmatrix} 1 & 2 \\ 2 & 4 \end{pmatrix}$.

Graphics programs build mirror images and shadows exactly this way: pick the line or plane, write the easy matrix in a basis lined up with it, and convert.

The toolkit for this page: $Q$ has the $\beta'$ vectors (in $\beta$-coordinates) as columns, and $[v]_\beta = Q[v]_{\beta'}$; going back takes $Q^{-1}$. For an operator, $[T]_{\beta'} = Q^{-1}[T]_\beta Q$, matrices related like that are similar, and running it backward, $[T] = Q[T]_{\beta'}Q^{-1}$, builds a map from the basis where it's simple.

Mixed Practice

Every question so far came right after its idea, which is a hint a quiz never gives you. Down here the hint is gone. First, true or false: a claim from anywhere on this page, and you decide whether it holds.

Loading practice engine...

Next, a mixed set: every question type on this page, shuffled. This set is multiple choice.

Loading practice engine...

Made it this far? Time for something with a little heat. You know what $T$ does to a nice basis, and you have to find its plain old standard matrix. Run the formula backward. In free response, type the matrix row by row.

🌶️ SPICY BONUS 🌶️

Loading practice engine...