A matrix moves every point of the plane, and its columns record where the two basis arrows land.
Yesterday you multiplied a matrix by one vector at a time. Today asks what a matrix does to every vector at once. Read that way, the product is a rule: feed in any x and the matrix hands back Ax, and doing that to every point at once moves the whole plane. The rest of the course leans on this picture of a matrix as a motion, starting tomorrow, when Day 6 runs two motions in a row.
Each section below opens with a problem. Try it before you open the walkthrough, even if you only get partway.
Transformations
Let A=[1011]. Compute Ax for x=(1,2). Then compute A(0,2) and A(3,0). What does A do to a point, in words?
Walk through the solutionHide the walkthrough
By the row rule, A(x1,x2)=(x1+x2,x2). So
A[12]=[32],A[02]=[22],A[30]=[30].
Look at what changed. The second entry, the height, never changes. The first entry grows by the height: (1,2) moved 2 to the right, (0,2) also moved 2 to the right, and (3,0) sits at height 0 and did not move at all. So A slides each point sideways by its height.
Doing that to every point moves the whole grid. This matrix is a shear: the base line stays still and the grid leans over. The grid lines stay straight, parallel and evenly spaced, and the origin stays put.
Transformation
A transformationT from Rn to Rm is a rule that assigns to each vector x in Rn a vector T(x) in Rm. We write T:Rn→Rm. The set Rn is the domain, Rm is the codomain, and T(x) is the image of x. The set of all images is the range of T.
When A is an m×n matrix, T(x)=Ax is a matrix transformation. Its domain is Rn because x needs one entry per column of A, and its codomain is Rm because each column has m entries.
Let A be a 2×3 matrix. The map T(x)=Ax goes
The standard matrix
Often you know a move in words, such as a quarter turn, and want its matrix. This section finds a recipe for that matrix that needs no algebra.
Turn the plane a quarter turn counterclockwise about the origin. Where do e1=(1,0) and e2=(0,1) land? Use that to find where (2,1) lands.
Walk through the solutionHide the walkthrough
The arrow e1 points right, and a quarter turn counterclockwise makes it point up, so it lands on (0,1). The arrow e2 points up and turns to point left, so it lands on (−1,0).
Now write (2,1) as a walk made of those arrows: (2,1)=2e1+1e2. The turn carries the whole walk along rigidly, so the turned point is two turned e1 steps plus one turned e2 step:
2[01]+1[−10]=[−12].
By Day 4, that combination is a matrix times (2,1), and the matrix has the two landing spots as its columns:
[01−10][21]=[−12].
Every x in R2 is x1e1+x2e2. So once you know where e1 and e2 land, you know where everything lands, and those two landing spots are the columns of the matrix.
Theorem 10
Let T:Rn→Rm be a linear transformation. Then there is exactly one matrix A with T(x)=Ax for every x in Rn, namely
A=[T(e1)⋯T(en)],
where ej is column j of the n×n identity matrix. This A is the standard matrix of T.
The word "linear" is defined precisely in the section after next. For now it means the map carries walks along the way the quarter turn did.
Drag the green and red tips to build a quarter turn clockwise. Picture where e1 and e2 should end up first.
That's it. Turning clockwise sends e1 down to (0,−1) and e2 right to (1,0), so those are the two columns.
[1001]
Rotation
The quarter turn was one angle. The same recipe gives a turn through any angle φ.
Rotate the plane counterclockwise through an angle φ. Where do e1 and e2 land? Write the matrix, and check it against Problem 2 with φ=90∘.
Walk through the solutionHide the walkthrough
The arrow e1 has length 1 and ends up at angle φ from the positive x1-axis. A point on the unit circle at angle φ is (cosφ,sinφ), so that is where e1 lands.
The arrow e2 starts a quarter turn ahead of e1, so it ends at angle φ+90∘. Turning (cosφ,sinφ) by a quarter turn gives (−sinφ,cosφ), by the same move as Problem 2. The matrix is
[cosφsinφ−sinφcosφ].
At φ=90∘, cosφ=0 and sinφ=1, so the matrix is [01−10], the quarter turn from Problem 2.
Find the angle that makes the F land on its dashed outline. Read the first column of the target matrix as a point on the dashed unit circle.
Slide the angle φ, in degrees, until the F covers the dashed outline. The outline is the F moved by [−0.710.71−0.71−0.71].
That is φ=135∘. The first column is (cos135∘,sin135∘), which is where e1 lands on the dashed circle.
[cosφsinφ−sinφcosφ]
=[1001]
Linearity
Problem 2 relied on the turn carrying a walk of e1 and e2 steps along with it. Naming that property tells you exactly which moves a matrix can make.
A map T carries walks along, and it sends e1 to (1,2) and e2 to (−3,1). Find T(4,−1) and the standard matrix of T.
Walk through the solutionHide the walkthrough
Write the input as a walk: (4,−1)=4e1−1e2. The map moves each step, and the walk follows:
T[4−1]=4T(e1)−1T(e2)=[48]−[−31]=[77].
The standard matrix has the two images as columns, [12−31]. Check with the row rule: 1⋅4+(−3)(−1)=7 and 2⋅4+1⋅(−1)=7.
The same walk picture works for any linear map. Here x=(2,1) is two e1 steps and one e2 step, and its image is two T(e1) steps and one T(e2) step:
T(x)=2T(e1)+1T(e2)
Linear transformation
A transformation T is linear when, for all vectors u,v in its domain and every scalar c,
(i) T(u+v)=T(u)+T(v), and
(ii) T(cu)=cT(u).
Every matrix transformation is linear, because A(u+v)=Au+Av and A(cu)=cAu from Day 4.
What linearity guarantees
Using (i) and then (ii) gives T(cu+dv)=cT(u)+dT(v). So the images of any two vectors determine the images of all their combinations, as in Problem 4.
Taking c=0 in (ii) gives T(0)=0T(u)=0. A linear map never moves the origin. A slide such as T(x)=x+(1,1) keeps grid lines straight, but it sends 0 to (1,1), so it is not linear and no matrix can do it. On Day 20 these same two rules define a linear map between any vector spaces, so differentiation counts too.
The vectors u and v below are not e1 and e2, but the same reasoning works for them.
You only know where T sends u and v. Drag the teal point to where T(2u+1v) must land.
Linearity says T(2u+1v)=2T(u)+1T(v)=[34]. You never needed the matrix.
T(u)=[21]
T(v)=[−12]
guess=[00]
Which of these maps is linear?
The range
Going backwards asks which x has a given image b. That is Day 4's equation Ax=b, seen as a picture.
Let T(x)=Ax with A=[21−11]. Is b=(1,5) in the range of T? If so, find an x with T(x)=b.
Walk through the solutionHide the walkthrough
b is in the range exactly when Ax=b has a solution, so row reduce [Ab].
1
Swap the rows so the pivot is a 1, which avoids fractions:
[21−1115]∼[121−151]
2
Clear below the pivot with R2←R2−2R1. Row 2 becomes (2−2,−1−2,1−10)=(0,−3,−9):
∼[101−35−9]
3
Scale row 2 by −31 to get (0,1,3), then R1←R1−R2:
∼[100123]
So x=(2,3), and b is in the range. Check: 2(2,1)+3(−1,1)=(1,5).
The moved grid is made of copies of T(e1) and T(e2), so you can also count how many of each step reach b.
Drag x until its image T(x)=Ax lands on the ringed point b=(1,5). Count steps along the blue grid.
Found it. With x=(2,3) you take two green steps and three red steps, and 2(2,1)+3(−1,1)=(1,5).
[21−11][10]=[21]
=1[21]+0[−11]
A gallery of moves
A horizontal shear keeps e1 fixed and sends e2 to (2,1). Write its matrix, and find where the corner (1,1) of the unit square lands.
Walk through the solutionHide the walkthrough
The columns are the landing spots, so the matrix is [1021]. The corner is e1+e2, so it lands on (1,0)+(2,1)=(3,1). The top edge of the square slid 2 to the right while the bottom edge stayed put.
Each matrix above is [T(e1)T(e2)], so you can rebuild it from the picture. From left to right they are [2001], [−1001], [1101] and [1000]. A pink square means the map flipped the plane over, and on Day 25 the sign of the determinant detects exactly that flip.
The standard catalog
Reflection across the x1-axisReflection across the line x2=x1Horizontal shear by kVertical stretch by kProjection onto the x1-axis[100−1][0110][10k1][100k][1000]
You never need to memorize this table. Picture where e1 and e2 go and write them down as columns.
Drag the green and red tips so the F lands exactly on the dashed outline.
Matched. This map swaps e1 and e2, which reflects the plane across the line x2=x1. The F turned pink because it was flipped over.
A=[1001]
Tomorrow you run two of these moves in a row, and the matrix of the combined move turns out to be a product of matrices.
Practice
Warm-up
A 3×5 matrix A defines T(x)=Ax as a map T:Rn→Rm. Find n and m. (Modeled on Lay §1.8 #21.)
Show the solutionHide the solution
The product Ax needs one entry of x for each of the 5 columns, so n=5. Each column has 3 entries, so Ax lives in R3 and m=3.
Let A=201−131 and T(x)=Ax. Find the image of u=(3,2). (Modeled on Lay §1.8 #1.)
Show the solutionHide the solution
By the row rule, T(u)=(2⋅3−1⋅2,0⋅3+3⋅2,1⋅3+1⋅2)=(4,6,5). The input lives in R2 and the image lives in R3.
Which matrix reflects the plane across the x1-axis?
Core
T first performs a vertical shear that sends e1 to e1+2e2 and keeps e2 fixed, then reflects through the line x2=x1. Find T(1,1). (Modeled on Lay §1.9 #9.)
Show a hintHide the hint
Follow e1 and e2 through both steps, in order. The reflection swaps the two coordinates.
Show the solutionHide the solution
Track each basis vector through both steps.
e1e2→(1,2)→(2,1),→(0,1)→(1,0),
so A=[2110] and T(1,1)=(2,1)+(1,0)=(3,1).
A linear map T sends u=(1,1) to (4,2) and v=(1,−1) to (2,−4). Find T(e1). (Modeled on Lay §1.8 #17.)
Show a hintHide the hint
Write e1 as a combination of u and v. Adding them gives (2,0).
Show the solutionHide the solution
Since e1=21(u+v), linearity gives
T(e1)=21(T(u)+T(v))=21[6−2]=[3−1].
In the same way e2=21(u−v) gives T(e2)=(1,3), so the standard matrix is [3−113].
Let T(x)=Ax with A=102213. Find x with T(x)=(4,1,7). (Modeled on Lay §1.8 #9.)
Show a hintHide the hint
Row 2 of the system says x2=1 directly. Use it in row 1, and then check row 3.
Show the solutionHide the solution
The rows are x1+2x2=4, x2=1 and 2x1+3x2=7. Row 2 gives x2=1, and then row 1 gives x1=2. Row 3 checks: 4+3=7. So x=(2,1). Had the third entry of b been anything other than 7, b would not be in the range.
Find the standard matrix of a quarter turn clockwise. Enter it row by row. (Modeled on Lay §1.9 #3.)
Show a hintHide the hint
Clockwise sends e1 pointing down. Alternatively, use the rotation matrix with φ=−90∘.
Show the solutionHide the solution
A clockwise quarter turn sends e1=(1,0) to (0,−1) and e2=(0,1) to (1,0). With those as columns,
A=[0−110].
The rotation formula agrees: cos(−90∘)=0 and sin(−90∘)=−1.
Let T(x1,x2)=(x1+4x2,3x1−x2). Find T(e1) and T(e2), write the standard matrix, and use it to find T(2,1). (Modeled on Lay §1.9 #19.)
Show a hintHide the hint
Put (1,0) into the formula to get the first column, and (0,1) to get the second.
Show the solutionHide the solution
T(1,0)=(1,3) and T(0,1)=(4,−1), so
A=[134−1],A[21]=[2+46−1]=[65].
The formula gives the same thing directly: (2+4,6−1)=(6,5).
Challenge
T first rotates the plane a quarter turn counterclockwise and then reflects it across the x1-axis. Find the standard matrix of T and enter it row by row. Which single reflection is it?
Show a hintHide the hint
Track e1 and e2 through the turn first, then flip the sign of each second entry.
Show the solutionHide the solution
The turn sends e1→(0,1) and e2→(−1,0). The reflection flips the sign of the second entry, so e1→(0,−1) and e2→(−1,0):
A=[0−1−10].
This matrix swaps the two coordinates and negates both, so it reflects the plane across the line x2=−x1. Two moves in a row made a single move, which is tomorrow's topic.
A linear map T has T(u)=(1,2). What is T(−3u)?
Show that T(x)=x+(1,1) is not linear. Then explain why every linear map must send 0 to 0.
Show a hintHide the hint
Compute T(0). For the second part, write 0=0u for any u and use rule (ii).
Show the solutionHide the solution
T(0)=(1,1), but a linear map sends 0 to 0, so T is not linear. Rule (i) fails directly too: T(0+0)=(1,1), while T(0)+T(0)=(2,2).
For any linear T and any vector u, 0=0u, so rule (ii) gives T(0)=T(0u)=0T(u)=0.