Back to the on-screen lesson ·

Change of basis and similar matrices

The matrix that translates between two bases and which way it points, the conjugation that rewrites a map's matrix, and the quantities that survive it.

Paper packet. Every task here also exists on screen, where it is checked automatically; answers written on paper are not assessed by Nydus. When you are back at a device, enter your answers there.

1. What you will learn

By the end of this lesson you will be able to build the change-of-basis matrix from a new basis and say which direction it translates in, rewrite the matrix of a linear map in a new basis as $P^{-1}AP$ by following a vector through the three stages of the product, show that similarity is an equivalence relation and read each of its classes as one map described in every basis, name the quantities that all similar matrices share and the ones that depend on the description, use an invariant to prove two matrices are not similar, and recognise that choosing a basis of vectors the map leaves on their own lines is what makes a matrix diagonal.

2. Two things you already have

You can take coordinates in a basis, and you can build the matrix of a linear map by applying it to each basis vector. This lesson only asks what happens when the basis in either of those constructions is changed — and the answer, once, rather than rediscovered each time it is needed.

3. The words this lesson uses

For ordered bases $\mathcal{B}$ and $\mathcal{C}$ of the same space, the change-of-basis matrix $P_{\mathcal{C} \leftarrow \mathcal{B}}$ satisfies $[v]_{\mathcal{C}} = P_{\mathcal{C} \leftarrow \mathcal{B}}[v]_{\mathcal{B}}$; its columns are the $\mathcal{C}$-coordinates of the vectors of $\mathcal{B}$. Square matrices $A$ and $B$ are similar when $B = P^{-1}AP$ for some invertible $P$. A quantity that is equal for all similar matrices is an invariant. A matrix is diagonalisable when it is similar to a diagonal matrix.

4. One map, many matrices

A linear map is a fact about vectors. Its matrix is a fact about the map and a basis, so changing the basis changes the matrix while leaving the map alone. The bookkeeping is one formula.

The change-of-basis matrix, and its direction. Let $\mathcal{B} = (b_1, \dots, b_n)$ be a new basis of $\mathbb{R}^n$ and let $P$ be the matrix whose columns are $b_1, \dots, b_n$ in standard coordinates. A vector with $\mathcal{B}$-coordinates $(c_1, \dots, c_n)$ is $c_1b_1 + \dots + c_nb_n$, which is exactly $P$ applied to that column. So

$$P[v]_{\mathcal{B}} = [v]_{\text{standard}}.$$

$P$ built from the new basis converts out of the new basis, and $P^{-1}$ converts into it. This is the sentence to say aloud, because the name pulls the other way and roughly half of all sign and order errors in this subject start here.

Conjugation. Suppose $A$ is the map's matrix in the standard basis and you want its matrix $B$ in $\mathcal{B}$. Follow a vector: it arrives as $[v]_{\mathcal{B}}$; multiply by $P$ to get standard coordinates; apply $A$; multiply by $P^{-1}$ to come back. Therefore

$$B = P^{-1}AP.$$

Read the product from the right and it is that journey in order. Read it left to right and it is nothing at all.

Another way: picture

Two grids over the same plane — the square one and a slanted one — and a single arrow drawn on top. $P$ is the dictionary that translates a slanted-grid address into a square-grid address. To apply a map you already know in square-grid terms to a vector given in slanted-grid terms, you translate, act, and translate back. The arrow and the map never move; only the language does.

Another way: steps

  1. Write $P$: the new basis vectors as columns, in the old coordinates.
  2. Check the direction: $P$ takes new coordinates to old.
  3. The map's matrix in the new basis is $P^{-1}AP$.
  4. Sanity-check with an invariant: the trace and the determinant must come out unchanged.
  5. If the answer looks nothing like $A$, that is expected; if its trace differs from $A$'s, the arithmetic is wrong.

5. Similarity is an equivalence relation

Write $A \sim B$ when $B = P^{-1}AP$ for some invertible $P$. Then:

So the square matrices fall into classes, and each class is one map described in every possible basis. Asking for a canonical form — a diagonal matrix, or failing that a triangular one — is asking for the tidiest member of a class.

This reframes almost everything that follows. "Is $A$ diagonalisable?" means: does $A$'s class contain a diagonal matrix? "What are the eigenvalues?" will turn out to mean: what are the diagonal entries of that member, when it exists? The questions of unit 6 are questions about classes, and that is why their answers do not depend on the basis you happened to start in.

6. What survives, and what does not

Invariants — equal for all similar matrices:

QuantityWhy it survives
determinant$\det(P^{-1}AP) = \det(P)^{-1}\det A \det P = \det A$
trace$\operatorname{tr}(XY) = \operatorname{tr}(YX)$, so $\operatorname{tr}(P^{-1}AP) = \operatorname{tr}(APP^{-1})$
rankmultiplying by an invertible matrix changes no dimension
characteristic polynomialthe determinant argument applied to $A - \lambda I$
invertibility, nullity, eigenvaluesconsequences of the four above

Not invariant — features of the description rather than the map: the individual entries, the column space and the null space as sets, symmetry, and being triangular or diagonal.

The practical use is as a check. Compute $P^{-1}AP$, then add up the diagonal. If the trace has moved, the arithmetic is wrong, and you know that before anything else is built on it. Two matrices with different traces are never similar, which is also the cheapest way to prove that a particular matrix is not diagonalisable to a particular diagonal one.

One warning: equal invariants do not prove similarity. $\begin{pmatrix} 1 & 1 \\ 0 & 1\end{pmatrix}$ and the identity share trace, determinant, rank and characteristic polynomial, and they are not similar — nothing conjugates the identity into anything but itself.

7. The errors this lesson is written against

Getting the direction of $P$ backwards. The matrix whose columns are the new basis vectors takes new coordinates to old ones. Writing $[v]_{\mathcal{B}} = P[v]_{\text{standard}}$ is the single commonest error here, and it produces a plausible-looking answer with no warning at all.

Writing $PAP^{-1}$ when $P^{-1}AP$ is wanted. The two are both conjugations and they describe opposite changes of basis. Deriving it by following a vector from the right takes ten seconds and never comes out backwards.

Building $P$ from rows. The new basis vectors are columns. A transposed $P$ translates between no two bases at all.

Expecting the entries to be recognisable. Similar matrices can look completely unlike each other. Recognition is the wrong check; the invariants are the right one.

Reading equal invariants as similarity. They are necessary and not sufficient, and the shear against the identity is the standing counterexample.

Thinking a change of basis changes the map. It does not change the map, its kernel, its image, its rank or its eigenvalues. It changes the numbers you write down to describe them.

8. A map made simple by the right basis

  1. $A = \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix}$ swaps the coordinates. In the standard basis it is off-diagonal and tells you little.

    Start from the standard description.

  2. Take $\mathcal{B} = ((1, 1), (1, -1))$, so $P = \begin{pmatrix} 1 & 1 \\ 1 & -1\end{pmatrix}$ and $P^{-1} = \tfrac{1}{2}\begin{pmatrix} 1 & 1 \\ 1 & -1\end{pmatrix}$.

    New basis as columns.

  3. $P^{-1}AP = \begin{pmatrix} 1 & 0 \\ 0 & -1\end{pmatrix}$: the swap fixes $(1,1)$ and negates $(1,-1)$, and the diagonal form says so at a glance. Trace $0$ and determinant $-1$ both survived.

    The same map, legibly written.

9. Two matrices that cannot be similar

  1. Could $\begin{pmatrix} 2 & 0 \\ 0 & 3\end{pmatrix}$ and $\begin{pmatrix} 1 & 0 \\ 0 & 4\end{pmatrix}$ be two descriptions of one map?

    Compare invariants before computing.

  2. Traces: $5$ and $5$, equal. Determinants: $6$ and $4$, different.

    One disagreement is enough.

  3. Not similar. No $P$ needs to be hunted for, and none exists — an invariant that disagrees settles the question by itself.

    A negative answer, cheaply.

10. Your turn: $A = \begin{pmatrix} 3 & 1 \\ 0 & 3\end{pmatrix}$. Is it similar to $\begin{pmatrix} 3 & 0 \\ 0 & 3\end{pmatrix}$?

  1. The invariants agree: both have trace $6$, determinant $9$ and the same characteristic polynomial.

    So no invariant rules it out.

  2. But the right-hand matrix is $3I$, and $P^{-1}(3I)P = 3P^{-1}P = 3I$ for every invertible $P$.

    A scalar matrix is alone in its class.

  3. Your turn: work this step out. Its working is at the end of the packet.

    So the only matrix similar to $3I$ is $3I$ itself, and $A$ is not it: not similar. Equal invariants were not enough, exactly as warned.

11. Guided practice

$\mathcal{B} = \{(1, 2),\; (4, 1)\}$ is a basis of $\mathbb{R}^{2}$. Write the matrix $P$ that turns $\mathcal{B}$-coordinates into standard coordinates.

This task has no paper form; do it on a device.

12. Guided practice

A map has matrix $A = \begin{pmatrix} 7 & 0 \\ 0 & 5 \end{pmatrix}$ in the standard basis, and $P = \begin{pmatrix} 1 & 0 \\ 1 & 1 \end{pmatrix}$ turns new coordinates into standard ones. Write $P^{-1}AP$, the matrix of the map in the new basis.

This task has no paper form; do it on a device.

13. Practice

$A = \begin{pmatrix} 4 & 7 \\ 4 & 3 \end{pmatrix}$ and $B = P^{-1}AP$ for some invertible $P$ you are not told. Select every quantity that $A$ and $B$ are guaranteed to share.

This task has no paper form; do it on a device.

14. Practice

A map has matrix $A$ in the standard basis, and the new basis is $\{(1, 4),\; (4, 1)\}$. Put the steps that produce its matrix in the new basis in order.

Number the steps in order (write the number in the box):

15. Practice

$A = \begin{pmatrix} 5 & 3 \\ 5 & 9 \end{pmatrix}$ and $B = P^{-1}AP$ for some invertible $P$. What is the trace of $B$?

Answer:

16. Somewhere new

$T$ reflects the plane in the line $y = 5x$. In which basis is the matrix of $T$ diagonal?

17. Lesson test

Lesson test: one question per skill, one attempt each, no hints. Your answers are checked when you submit.

18. Test question

$\mathcal{B} = \{(1, 3),\; (2, 1)\}$ is a basis of $\mathbb{R}^{2}$. Write the matrix $P$ that turns $\mathcal{B}$-coordinates into standard coordinates.

This task has no paper form; do it on a device.

19. What you can do now

You can change basis in both directions, conjugate a matrix into a new basis, and use trace and determinant as a check. Say in your own words why $P$ built from the new basis converts out of it rather than into it. Next: the vectors a map leaves on their own lines, and how to find them.

Working for the steps left to you

10. Your turn: $A = \begin{pmatrix} 3 & 1 \\ 0 & 3\end{pmatrix}$. Is it similar to $\begin{pmatrix} 3 & 0 \\ 0 & 3\end{pmatrix}$?, step 3

The necessary condition is not sufficient.