Session 30 · Unit 3

Linear Transformations and Their Matrices


A linear transformation is a rule for mapping vectors to vectors that respects addition and scalar multiplication — projection and rotation qualify, shifting the plane does not. Once you choose a basis for the inputs and a basis for the outputs, every linear transformation is represented by a matrix, and the rule for building that matrix column by column is the heart of the lecture. Choose the eigenvector basis and the matrix comes out diagonal.

Transformations without coordinates

Linear algebra courses used to begin with this lecture — so in a sense, Strang says, he’s beginning the course again. The idea of a linear transformation makes sense without any matrix at all, and physicists like it better that way: no coordinates, no numbers, just what happens to the whole space. But for most of us, if we’re going to compute anything, we introduce coordinates — and then every linear transformation leads us to a matrix, and everything we’ve done with null spaces, determinants, and eigenvalues comes from that matrix. Behind it all, though, is the coordinate-free idea.

Example 1: projection. Take all of R2\mathbb{R}^2 and a line through the origin. The transformation TT projects every vector onto that line: give it an input v\mathbf{v}, it produces the output T(v)T(\mathbf{v}), the shadow of v\mathbf{v} on the line. A transformation is exactly like a function — the words map or mapping are also used — written

T:R2R2.T : \mathbb{R}^2 \to \mathbb{R}^2.

No coordinates were needed to say that. Strang draws axes out of habit, then apologizes and erases them — “I’m not a physicist” — because the whole point is that the projection is described without them.

Not every transformation earns the name linear. The requirement involves exactly the two operations we can do on vectors — adding and multiplying by scalars:

Projection passes the test: double v\mathbf{v} and its projection doubles; flip v\mathbf{v} to v-\mathbf{v} and the projection flips. Any cc works.

Two non-examples

Shift the whole plane. Fix a vector v0\mathbf{v}_0 and let T(v)=v+v0T(\mathbf{v}) = \mathbf{v} + \mathbf{v}_0 — every vector gets the same fixed vector added on. Perfectly reasonable, perfectly simple, and not linear. Double the input: the output starts at 2v2\mathbf{v} but only goes one v0\mathbf{v}_0 out, not two — so T(2v)2T(v)T(2\mathbf{v}) \neq 2\,T(\mathbf{v}).

There’s a quick test hiding here, a special case worth noticing. Take v=0\mathbf{v} = \mathbf{0} and c=3c = 3 in the scaling rule: T(0)=3T(0)T(\mathbf{0}) = 3\,T(\mathbf{0}), which forces

T(0)=0.T(\mathbf{0}) = \mathbf{0}.

The zero vector can’t move under a linear transformation. The shift moves it to v0\mathbf{v}_0 — disqualified immediately.

Take the length. Let T(v)=vT(\mathbf{v}) = \|\mathbf{v}\|, mapping R3\mathbb{R}^3 to the real numbers R1\mathbb{R}^1. Zero does go to zero, and doubling a vector does double its length. But multiply v\mathbf{v} by 2-2: the length gets multiplied by +2+2, not 2-2. The requirement fails for negative cc, so length is not linear.

Example 2: rotation by 45°. Back to a genuine example. Rotate every vector in the plane by 45°45°. Described with no coordinates at all — and it’s linear: doubling v\mathbf{v} doubles the rotated vector, and rotating v+w\mathbf{v} + \mathbf{w} gives the same answer as rotating each and then adding.

Watching a whole house transform

The book’s cover has the right picture: instead of tracking one vector at a time, take a house in R2\mathbb{R}^2 — a whole outline of points — and watch where all of it goes at once. Under the 45°45° rotation, the whole house rotates and sits there tilted.

Example 3: transformations from a matrix. Every matrix AA produces a linear transformation by the simplest possible rule:

T(v)=Av.T(\mathbf{v}) = A\mathbf{v}.

Linearity is automatic — A(v+w)=Av+AwA(\mathbf{v} + \mathbf{w}) = A\mathbf{v} + A\mathbf{w} and A(cv)=cAvA(c\mathbf{v}) = cA\mathbf{v}. Check and check. Take the particular matrix

A=[1001]A = \begin{bmatrix} 1 & 0 \\ 0 & -1 \end{bmatrix}

and apply it to every point of the house. It’s diagonal and easy to read: the xx-component stays, the yy-component reverses sign. The tip of the roof keeps its xx but drops below the axis — the house lands upside down, door and all.

So the idea of a linear transformation is “kind of the abstract description of matrix multiplication.” The goal of the lecture: understand linear transformations by finding the matrix that lies behind them. And to do that, we have to bring in coordinates — we have to choose a basis.

How much information determines T?

Suppose TT maps R3\mathbb{R}^3 to R2\mathbb{R}^2. (What’s a quick example of such a TT? Multiply by any 2×32 \times 3 matrix — a 2×32 \times 3 matrix eats a vector in R3\mathbb{R}^3 and produces one in R2\mathbb{R}^2. The claim of this lecture is that there are essentially no other examples.)

Now the key question: how much do I have to tell you before you know T(v)T(\mathbf{v}) for every input v\mathbf{v}? If I tell you T(v1)T(\mathbf{v}_1) for one vector, you know one output. Tell you T(v2)T(\mathbf{v}_2) as well — now you know much more than two outputs. By linearity you know TT on every combination of v1\mathbf{v}_1 and v2\mathbf{v}_2: the whole plane they span. (Provided they’re independent — if v2=6v1\mathbf{v}_2 = 6\mathbf{v}_1, the second answer told you nothing new; you already knew it would be 6T(v1)6\,T(\mathbf{v}_1).)

This is exactly what makes coordinates possible. Coordinates come from a basis. The coordinates of v\mathbf{v} are the numbers c1,,cnc_1, \dots, c_n — how much of each basis vector is in v\mathbf{v}. When you write v=(3,2,4)\mathbf{v} = (3, 2, 4) you’ve been silently assuming the standard basis: 33 of the first coordinate vector, 22 of the second, 44 of the third. But nothing forces that choice — the basis might instead be the eigenvectors of some matrix. Change the basis and the coordinates change.

Building the matrix: projection two ways

To turn T:RnRmT : \mathbb{R}^n \to \mathbb{R}^m into a matrix we need two bases: an input basis v1,,vn\mathbf{v}_1, \dots, \mathbf{v}_n and an output basis w1,,wm\mathbf{w}_1, \dots, \mathbf{w}_m. The plan in words: take a vector, find its coordinates in the input basis, multiply by the right matrix AA, and out come the coordinates of T(v)T(\mathbf{v}) in the output basis.

Now do the same projection in the standard basis, projecting onto the 45°45° line with v1=(1,0)\mathbf{v}_1 = (1,0), v2=(0,1)\mathbf{v}_2 = (0,1). The matrix is the projection matrix from Chapter 4, P=aaTaTaP = \dfrac{\mathbf{a}\mathbf{a}^T}{\mathbf{a}^T\mathbf{a}}, which works out to

P=[12121212].P = \begin{bmatrix} \tfrac12 & \tfrac12 \\[2pt] \tfrac12 & \tfrac12 \end{bmatrix}.

Input (1,0)(1, 0) gives output (12,12)(\tfrac12, \tfrac12) — the correct projection — and likewise for (0,1)(0,1). Same transformation, different basis, different matrix: not diagonal, because we chose the handiest basis rather than the great one. It’s still a good matrix — symmetric, with P2=PP^2 = P — but in the eigenvector basis those properties are visible at a glance.

The rule for the matrix, and one more transformation

Here is the general recipe, given the bases.

Why is it right? Check column one. If the input coordinates are (1,0,,0)(1, 0, \dots, 0), the input is v1\mathbf{v}_1 itself, and multiplying AA by that coordinate vector picks out the first column — which is, by construction, exactly the output coordinates of T(v1)T(\mathbf{v}_1). Right on the first basis vector, right on the second, right on all of them — and then, by linearity, right on every vector.

Problems

Work these before revealing the solutions — the lecture’s rule for building matrices is all you need.

Problem 30.1 Linear or not?

For each transformation of the plane, decide whether it is linear. Justify with the two rules or a specific counterexample.

(a) T(v)=v+[11]T(\mathbf{v}) = \mathbf{v} + \begin{bmatrix} 1 \\ 1 \end{bmatrix} (b) T ⁣([xy])=[yx]T\!\left(\begin{bmatrix} x \\ y \end{bmatrix}\right) = \begin{bmatrix} y \\ x \end{bmatrix} (c) T ⁣([xy])=[x2y]T\!\left(\begin{bmatrix} x \\ y \end{bmatrix}\right) = \begin{bmatrix} x^2 \\ y \end{bmatrix}

Show solution

(a) Not linear. T(0)=(1,1)0T(\mathbf{0}) = (1,1) \neq \mathbf{0}, and a linear transformation must send zero to zero. This is the shift from lecture.

(b) Linear. Swapping components respects addition — T(v+w)T(\mathbf{v} + \mathbf{w}) swaps the sums, which equals the sum of the swaps — and T(cv)=cT(v)T(c\mathbf{v}) = c\,T(\mathbf{v}) since cc multiplies both components. In fact T(v)=AvT(\mathbf{v}) = A\mathbf{v} with A=[0110]A = \begin{bmatrix} 0 & 1 \\ 1 & 0 \end{bmatrix}.

(c) Not linear. Take v=(1,0)\mathbf{v} = (1, 0) and c=2c = 2: T(2v)=(4,0)T(2\mathbf{v}) = (4, 0) but 2T(v)=(2,0)2\,T(\mathbf{v}) = (2, 0). Squaring breaks the scaling rule (zero going to zero is not enough).

Problem 30.2 Matrix from a basis rule

A linear transformation T:R2R2T : \mathbb{R}^2 \to \mathbb{R}^2 satisfies

T ⁣([10])=[21],T ⁣([01])=[13].T\!\left(\begin{bmatrix} 1 \\ 0 \end{bmatrix}\right) = \begin{bmatrix} 2 \\ 1 \end{bmatrix}, \qquad T\!\left(\begin{bmatrix} 0 \\ 1 \end{bmatrix}\right) = \begin{bmatrix} -1 \\ 3 \end{bmatrix}.

Find the matrix of TT in the standard basis (inputs and outputs), and compute T ⁣([45])T\!\left(\begin{bmatrix} 4 \\ 5 \end{bmatrix}\right).

Show solution

Column jj of AA is TT applied to the jj-th basis vector, expressed in the output basis — here the standard basis, so the outputs go straight into the columns:

A=[2113].A = \begin{bmatrix} 2 & -1 \\ 1 & 3 \end{bmatrix}.

Then by linearity, T(4,5)=4T(1,0)+5T(0,1)T(4, 5) = 4\,T(1,0) + 5\,T(0,1):

A[45]=4[21]+5[13]=[319].A \begin{bmatrix} 4 \\ 5 \end{bmatrix} = 4\begin{bmatrix} 2 \\ 1 \end{bmatrix} + 5\begin{bmatrix} -1 \\ 3 \end{bmatrix} = \begin{bmatrix} 3 \\ 19 \end{bmatrix}.

Knowing TT on a basis determined TT everywhere.

Problem 30.3 Eigenvector basis vs standard basis

Let TT be the transformation of the plane that reflects every vector across the 45°45° line y=xy = x.

(a) Choose the basis v1=12(1,1)\mathbf{v}_1 = \frac{1}{\sqrt{2}}(1, 1) (on the line) and v2=12(1,1)\mathbf{v}_2 = \frac{1}{\sqrt{2}}(-1, 1) (perpendicular to it), for both inputs and outputs. What is the matrix of TT?

(b) What is the matrix of TT in the standard basis?

Show solution

(a) Reflection leaves the line alone and reverses the perpendicular direction: T(v1)=v1T(\mathbf{v}_1) = \mathbf{v}_1 and T(v2)=v2T(\mathbf{v}_2) = -\mathbf{v}_2. So column one is (1,0)(1, 0) and column two is (0,1)(0, -1):

A=[1001]=Λ.A = \begin{bmatrix} 1 & 0 \\ 0 & -1 \end{bmatrix} = \Lambda.

These basis vectors are the eigenvectors of the reflection, with eigenvalues 11 and 1-1 — the matrix is diagonal because the basis is the good one.

(b) In the standard basis, apply TT to each coordinate vector: reflecting (1,0)(1,0) across y=xy = x gives (0,1)(0,1), and reflecting (0,1)(0,1) gives (1,0)(1,0). Columns:

A=[0110].A = \begin{bmatrix} 0 & 1 \\ 1 & 0 \end{bmatrix}.

Same transformation, two different matrices — one diagonal, one not — depending on the basis.

Problem 30.4 Derivative-style matrix

Let T=ddxT = \dfrac{d}{dx} act on the space of cubics c1+c2x+c3x2+c4x3c_1 + c_2 x + c_3 x^2 + c_4 x^3, with input basis 1,x,x2,x31, x, x^2, x^3 and output basis 1,x,x21, x, x^2.

(a) Find the matrix AA of TT.

(b) Describe the null space of AA and say what it means about derivatives.

Show solution

(a) Apply TT to each input basis vector and expand in the output basis 1,x,x21, x, x^2: T(1)=0T(1) = 0, T(x)=1T(x) = 1, T(x2)=2xT(x^2) = 2x, T(x3)=3x2T(x^3) = 3x^2. Those expansions fill the columns of the 3×43 \times 4 matrix

A=[010000200003].A = \begin{bmatrix} 0 & 1 & 0 & 0 \\ 0 & 0 & 2 & 0 \\ 0 & 0 & 0 & 3 \end{bmatrix}.

Check on coordinates: A(c1,c2,c3,c4)T=(c2,2c3,3c4)TA(c_1, c_2, c_3, c_4)^T = (c_2, 2c_3, 3c_4)^T, the coordinates of c2+2c3x+3c4x2c_2 + 2c_3 x + 3c_4 x^2. Correct.

(b) Ac=0A\mathbf{c} = \mathbf{0} forces c2=c3=c4=0c_2 = c_3 = c_4 = 0 with c1c_1 free: the null space is the line of vectors (c1,0,0,0)(c_1, 0, 0, 0), i.e. the constant polynomials. That is exactly the calculus fact that the derivative kills constants — a function has derivative zero exactly when it is constant. A one-dimensional null space out of a four-dimensional input space, matching rank 33.