← mapVector Spaces

Change of Basis

⚗ Dr. Möbius, from the lab

A vector doesn't give a damn what coordinates you assign it — it's sitting there in space, fixed, indifferent to your bullshit. The numbers you write down are a story about your chosen grid, not about the vector. Today we learn to switch grids on demand, because the entire endgame of this course is one move: pick the grid that makes your matrix simple. Everything we've built has been runway for this.

THE BIG IDEA

Coordinates are addresses relative to a chosen basis; switching basis is multiplying by a change-of-basis matrix, and a transformation seen in a new basis becomes P⁻¹AP — same map, new costume.

The vector doesn't move; the grid does

Here's the mental reset, and it's a big one. When you write a vector as (35)\begin{pmatrix} 3 \\ 5 \end{pmatrix}, those numbers are not the vector. They're instructions: "go 3 along the first basis vector, 5 along the second." Change which basis vectors you mean, and the same arrow in space gets a different pair of numbers — like the same house having one address on the city grid and another on the county grid. The house never moved. Only the map you're reading it against changed.

In Basis & Dimension we proved a basis turns every vector into a unique coordinate tuple. Now we make the tuples talk to each other across different bases.

The change-of-basis matrix

Let B={b1,b2}\mathcal{B} = \{\, b_1, b_2 \,\} be a new basis of R2\mathbb{R}^2, written in standard coordinates. Stack the new basis vectors as columns:

P=(b1b2).P = \begin{pmatrix} | & | \\ b_1 & b_2 \\ | & | \end{pmatrix}.

This PP is the change-of-basis matrix. Its job is dead simple and worth burning into your skull with a soldering iron: PP takes B\mathcal{B}-coordinates and returns standard coordinates.

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

Why? Because [v]B=(c1c2)[v]_{\mathcal{B}} = \begin{pmatrix} c_1 \\ c_2 \end{pmatrix} means v=c1b1+c2b2v = c_1 b_1 + c_2 b_2, and multiplying PP by that column does exactly that linear combination of the columns of PP — which are the bib_i. (That's the "matrix times vector = combination of columns" decoder ring from Matrix Multiplication.) So PP literally re-assembles the vector in standard coordinates.

To go the other direction — standard coordinates into B\mathcal{B}-coordinates — invert it (a basis is independent, so PP is invertible, from the Invertible Matrix Theorem you just built):

[v]B=P1[v]standard.[\,v\,]_{\mathcal{B}} = P^{-1}\,[\,v\,]_{\text{standard}}.

One matrix, both directions: PP in, P1P^{-1} out.

A transformation in a new basis: B=P1APB = P^{-1}AP

Now the payoff. Suppose a linear map has matrix AA in standard coordinates. What's its matrix in the B\mathcal{B} basis? Call it BB. You want BB to take a vector's B\mathcal{B}-coordinates in and return the output's B\mathcal{B}-coordinates. Build it as a three-step pipeline — translate in, act, translate out:

  1. Translate in. Start with [v]B[v]_{\mathcal{B}}. Multiply by PP to get standard coordinates [v]standard[v]_{\text{standard}}.
  2. Act. Apply AA (which only speaks standard) to get [Av]standard[Av]_{\text{standard}}.
  3. Translate out. Multiply by P1P^{-1} to land back in B\mathcal{B}-coordinates.

Chain them right-to-left:

B=P1AP.B = P^{-1} A P.

Read the order off the pipeline: the rightmost matrix acts first. PP translates in, AA acts, P1P^{-1} translates out. That's not a formula to memorize — it's a sentence, and once you can read it you'll never get the order backwards. I've seen graduate students fuck this up on exams. Don't be that person.

Similar matrices: same map, different clothes

Two matrices AA and BB are similar when B=P1APB = P^{-1}AP for some invertible PP. Similar matrices are not two different maps that happen to resemble each other — they are the exact same linear map viewed from two bases. The map is the actor; AA and BB are two costumes.

Because it's the same damn map underneath, the costumes can't disagree about the map's real properties. Similar matrices share:

  • the determinant: det(P1AP)=det(P1)det(A)det(P)=det(A)\det(P^{-1}AP) = \det(P^{-1})\det(A)\det(P) = \det(A), since det(P1)=1/det(P)\det(P^{-1}) = 1/\det(P) (from Determinants),
  • the rank (it's dim\dim of the image, a basis-free fact),
  • the trace, and — file this away, it detonates next lesson — the eigenvalues.

A property that survives every change of basis is a property of the map, not the grid. Those are the ones worth chasing.

The setup line for everything that follows

Here's where the whole stratum has been heading. You now have a knob — the basis — and a machine, B=P1APB = P^{-1}AP, that recomputes any matrix in any basis you like.

So a natural, almost greedy question: of all possible bases, which one makes the matrix as simple as humanly possible? The simplest a matrix can be is diagonal — pure scaling along the axes, no mixing, no shit. If you can find a basis in which your map is diagonal, you've found the basis in which the map thinks, where its true personality is laid bare and its hundredth power is trivial.

The whole game from here is choosing the basis that makes your matrix diagonal. To play it you need to know which directions the map merely scales — its eigenvectors. That's the next lesson, and it is, without exaggeration, the most important idea in this entire course. Go do the gauntlet first.

🔬 SPECIMENS (worked examples)

Worked example 1 — translating a vector into a new basis

Let B={(11), (11)}\mathcal{B} = \left\{\, \begin{pmatrix} 1 \\ 1 \end{pmatrix},\ \begin{pmatrix} 1 \\ -1 \end{pmatrix} \,\right\}. The vector vv has standard coordinates (42)\begin{pmatrix} 4 \\ 2 \end{pmatrix}. Find [v]B[v]_{\mathcal{B}}.

Stack the basis as columns:

P=(1111).P = \begin{pmatrix} 1 & 1 \\ 1 & -1 \end{pmatrix}.

We need [v]B=P1[v]std[v]_{\mathcal{B}} = P^{-1}[v]_{\text{std}}. First invert PP. Its determinant is (1)(1)(1)(1)=2(1)(-1) - (1)(1) = -2, so

P1=12(1111)=(1/21/21/21/2).P^{-1} = \frac{1}{-2}\begin{pmatrix} -1 & -1 \\ -1 & 1 \end{pmatrix} = \begin{pmatrix} 1/2 & 1/2 \\ 1/2 & -1/2 \end{pmatrix}.

Now apply it:

[v]B=(1/21/21/21/2)(42)=(2+121)=(31).[v]_{\mathcal{B}} = \begin{pmatrix} 1/2 & 1/2 \\ 1/2 & -1/2 \end{pmatrix}\begin{pmatrix} 4 \\ 2 \end{pmatrix} = \begin{pmatrix} 2 + 1 \\ 2 - 1 \end{pmatrix} = \begin{pmatrix} 3 \\ 1 \end{pmatrix}.

Check by reassembling: 3(11)+1(11)=(42)3\begin{pmatrix}1\\1\end{pmatrix} + 1\begin{pmatrix}1\\-1\end{pmatrix} = \begin{pmatrix}4\\2\end{pmatrix}. \checkmark Same vector, new address: (31)B\begin{pmatrix}3\\1\end{pmatrix}_{\mathcal{B}}.

Worked example 2 — a matrix reborn: same beast, beautiful new clothes

A map has standard matrix A=(1203)A = \begin{pmatrix} 1 & 2 \\ 0 & 3 \end{pmatrix}. Find its matrix B=P1APB = P^{-1}AP in the basis B={(10),(11)}\mathcal{B} = \left\{ \begin{pmatrix} 1 \\ 0 \end{pmatrix}, \begin{pmatrix} 1 \\ 1 \end{pmatrix} \right\}.

Stack the basis: P=(1101)P = \begin{pmatrix} 1 & 1 \\ 0 & 1 \end{pmatrix}, with detP=1\det P = 1, so

P1=(1101).P^{-1} = \begin{pmatrix} 1 & -1 \\ 0 & 1 \end{pmatrix}.

Act first: compute APAP (translate in, then act):

AP=(1203)(1101)=(11+203)=(1303).AP = \begin{pmatrix} 1 & 2 \\ 0 & 3 \end{pmatrix}\begin{pmatrix} 1 & 1 \\ 0 & 1 \end{pmatrix} = \begin{pmatrix} 1 & 1+2 \\ 0 & 3 \end{pmatrix} = \begin{pmatrix} 1 & 3 \\ 0 & 3 \end{pmatrix}.

Translate out: multiply by P1P^{-1} on the left:

B=P1(AP)=(1101)(1303)=(13303)=(1003).B = P^{-1}(AP) = \begin{pmatrix} 1 & -1 \\ 0 & 1 \end{pmatrix}\begin{pmatrix} 1 & 3 \\ 0 & 3 \end{pmatrix} = \begin{pmatrix} 1 & 3-3 \\ 0 & 3 \end{pmatrix} = \begin{pmatrix} 1 & 0 \\ 0 & 3 \end{pmatrix}.

Look at that — in this basis the map is diagonal! The off-diagonal 22 was an artifact of the standard grid. Sanity check the invariants: detA=3=detB\det A = 3 = \det B, traceA=4=traceB\operatorname{trace} A = 4 = \operatorname{trace} B. \checkmark Same map; in B\mathcal{B} it's just "scale axis one by 11, axis two by 33." This is exactly the diagonalization trick the next two lessons formalize.

Worked example 3 — the trap: invariants catch the lying student

A student claims (2005)\begin{pmatrix} 2 & 0 \\ 0 & 5 \end{pmatrix} and (3104)\begin{pmatrix} 3 & 1 \\ 0 & 4 \end{pmatrix} are similar. Without finding PP, decide whether they could be — and whether (2005)\begin{pmatrix} 2 & 0 \\ 0 & 5 \end{pmatrix} and (1426)\begin{pmatrix} 1 & 4 \\ 2 & 6 \end{pmatrix} could be.

Similar matrices must share determinant and trace — necessary conditions you can check instantly.

First pair. (2005)\begin{pmatrix} 2 & 0 \\ 0 & 5 \end{pmatrix}: trace=7\operatorname{trace} = 7, det=10\det = 10. (3104)\begin{pmatrix} 3 & 1 \\ 0 & 4 \end{pmatrix}: trace=7\operatorname{trace} = 7, det=12\det = 12. Determinants differ (101210 \ne 12), so they are not similar. The student is wrong — and we never touched PP.

Second pair. (2005)\begin{pmatrix} 2 & 0 \\ 0 & 5 \end{pmatrix}: trace=7\operatorname{trace} = 7, det=10\det = 10. (1426)\begin{pmatrix} 1 & 4 \\ 2 & 6 \end{pmatrix}: trace=1+6=7\operatorname{trace} = 1 + 6 = 7, det=(1)(6)(4)(2)=68=2\det = (1)(6) - (4)(2) = 6 - 8 = -2. Determinants differ (10210 \ne -2), so not similar either.

The trap: matching trace alone does not prove similarity — both invariants (and really, the eigenvalues) must agree. Trace and determinant are necessary filters, cheap and ruthless. Failing either is an instant disqualification; passing both is encouraging but not yet proof.

☠ KNOWN HAZARDS

  • Getting PP vs P1P^{-1} backwards. This is the cardinal sin of change-of-basis. PP has the new basis vectors as columns and converts B\mathcal{B}-coordinates to standard. Going from standard to B\mathcal{B} needs P1P^{-1}. When unsure, test on b1b_1: in B\mathcal{B}-coordinates it's (10)\begin{pmatrix}1\\0\end{pmatrix}, and P(10)=b1P\begin{pmatrix}1\\0\end{pmatrix} = b_1 in standard. Sanity restored.

  • Writing PAP1PAP^{-1} instead of P1APP^{-1}AP. I have seen this mistake so many damn times. Follow the pipeline: the input is in B\mathcal{B}-coordinates, so it must be translated to standard first — multiply by PP on the right. The misordered PAP1PAP^{-1} is the matrix in standard coordinates of a different setup. Read the sentence, don't guess.

  • Thinking similar means "looks similar". Similarity is a precise relation, B=P1APB = P^{-1}AP. The matrices can look wildly different entry-by-entry yet be similar (same map), or look alike yet not be similar. Trust the determinant/trace/eigenvalue invariants, not your eyeballs.

  • Forgetting PP must be invertible. It always is here, because a basis is linearly independent, so its column matrix has rank nn — but if you ever stack vectors that aren't a basis, P1P^{-1} doesn't exist and the whole machine jams.

TL;DR

  • Coordinates are addresses relative to a basis; the vector itself never moves when you change basis.

  • Change-of-basis matrix PP = new basis vectors as columns. [v]std=P[v]B[v]_{\text{std}} = P[v]_{\mathcal{B}} (B\mathcal{B} to standard); [v]B=P1[v]std[v]_{\mathcal{B}} = P^{-1}[v]_{\text{std}} (standard to B\mathcal{B}).

  • A map with standard matrix AA has matrix B=P1APB = P^{-1}AP in the new basis: translate in (PP), act (AA), translate out (P1P^{-1}).

  • Similar matrices (B=P1APB = P^{-1}AP) are the same map in different bases; they share determinant, rank, trace, and (soon) eigenvalues.

  • The endgame: choose the basis that makes the matrix diagonal. That requires eigenvectors — next lesson.

unlocks