Educerie

Educerie · AP · Precalculus

Unit 4 Functions Involving Parameters, Vectors, and Matrices · 4.12 Linear Transformations and Matrices

This unit is not on the AP exam. The exam covers Units 1 to 3 only; Unit 4 is taught here for the course and for what comes after it.

Big ideas: A function whose inputs and outputs are vectors; a matrix as the rule of such a function; many vectors moved at once by one product.

Where it is examined: Not on the AP Precalculus exam. The College Board lists Unit 4 as an additional topic available to schools. If your school teaches it, the work is applying a matrix to one vector or to a set of vectors, and recognising which rules are linear.

The question this unit answers: How can one matrix move every vector in the plane, and many vectors at once?


AP Precalculus 4.12

Linear Transformations and Matrices

How can one matrix move every vector in the plane, and many vectors at once?

What you will learn

  • Understand what makes a transformation linear and that it fixes the zero vector
  • Know that every linear transformation has a unique 2 by 2 matrix
  • Know that one product moves a whole set of vectors

You must be able to

  1. Decide whether a rule is linear and say why a non-linear one fails
  2. Write the matrix of a linear transformation from its rule
  3. Find the output vector A v
  4. Transform several vectors or the corners of a shape with one product
  5. Write vectors as columns of a 2 by n matrix
  6. Check one output column by hand

1What is a linear transformation?

A linear transformation is a function that maps an input vector to an output vector so that each component of the output is a sum of constant multiples of the input components.

For input ⟨x,y⟩\langle x, y\rangle, the output is

L(⟨x,y⟩)=⟨ax+by, cx+dy⟩L(\langle x, y\rangle) = \langle ax + by,\ cx + dy\rangle

where a,b,c,da, b, c, d are constants.

Worked example 1. Is L(x,y)=(3x−y, x+4y)L(x, y) = (3x - y,\ x + 4y) linear?

Yes. The first output, 3x−y3x - y, is 33 times xx plus −1-1 times yy. The second, x+4yx + 4y, is 11 times xx plus 44 times yy. Both are sums of constant multiples.

Worked example 2. Which of these are linear?

  • L(x,y)=(x+1, y)L(x, y) = (x + 1,\ y). Not linear. The +1+1 is not a multiple of an input.
  • L(x,y)=(xy, y)L(x, y) = (xy,\ y). Not linear. xyxy is a product of the inputs, not a constant multiple of one.
  • L(x,y)=(x2, y)L(x, y) = (x^2,\ y). Not linear. Squaring is not a constant multiple.
  • L(x,y)=(2x, 5y)L(x, y) = (2x,\ 5y). Linear.

A quick test: a linear transformation sends the zero vector to the zero vector.

L(⟨0,0⟩)=⟨a(0)+b(0), c(0)+d(0)⟩=⟨0,0⟩L(\langle 0, 0\rangle) = \langle a(0) + b(0),\ c(0) + d(0)\rangle = \langle 0, 0\rangle

If a rule sends ⟨0,0⟩\langle 0, 0\rangle anywhere else, it is not linear. The rule (x+1,y)(x + 1, y) sends it to ⟨1,0⟩\langle 1, 0\rangle, so it fails.

Passing the test does not make a rule linear. (xy,y)(xy, y) sends zero to zero and is still not linear. Use the test to rule a rule out, and check the form to rule one in.

2Vectors as matrices

A single vector in the plane is a 2×12 \times 1 matrix, a column:

⟨x,y⟩ is written [xy]\langle x, y\rangle \ \text{is written}\ \begin{bmatrix} x \\ y \end{bmatrix}

A set of nn vectors in the plane is a 2×n2 \times n matrix. Each vector is one column.

Example: the three vectors ⟨1,0⟩\langle 1, 0\rangle, ⟨0,1⟩\langle 0, 1\rangle and ⟨2,−1⟩\langle 2, -1\rangle form

V=[10201−1]V = \begin{bmatrix} 1 & 0 & 2 \\ 0 & 1 & -1 \end{bmatrix}

The first row holds the x-components. The second row holds the y-components.

A shape can be stored the same way. The corners of a triangle at (0,0)(0,0), (4,0)(4,0) and (0,3)(0,3) are the columns of [040003]\begin{bmatrix} 0 & 4 & 0 \\ 0 & 0 & 3 \end{bmatrix}.

3The matrix of a linear transformation

Every linear transformation LL from the plane to the plane has exactly one 2×22 \times 2 matrix AA with

L(v⃗)=Av⃗L(\vec{v}) = A\vec{v}

for every vector v⃗\vec{v}. The other way round, any 2×22 \times 2 matrix AA gives a linear transformation L(v⃗)=Av⃗L(\vec{v}) = A\vec{v}.

The entries come from the rule. For L(x,y)=(ax+by, cx+dy)L(x, y) = (ax + by,\ cx + dy):

A=[abcd]A = \begin{bmatrix} a & b \\ c & d \end{bmatrix}

Check by multiplying:

[abcd][xy]=[ax+bycx+dy]\begin{bmatrix} a & b \\ c & d \end{bmatrix}\begin{bmatrix} x \\ y \end{bmatrix} = \begin{bmatrix} ax + by \\ cx + dy \end{bmatrix}

Worked example 3. Write the matrix of L(x,y)=(3x−y, x+4y)L(x, y) = (3x - y,\ x + 4y).

Read the coefficients row by row.

A=[3−114]A = \begin{bmatrix} 3 & -1 \\ 1 & 4 \end{bmatrix}

If a variable is missing, its coefficient is 00. For L(x,y)=(2x, 5y)L(x, y) = (2x,\ 5y) the matrix is [2005]\begin{bmatrix} 2 & 0 \\ 0 & 5 \end{bmatrix}.

Worked example 4. Let A=[21−13]A = \begin{bmatrix} 2 & 1 \\ -1 & 3 \end{bmatrix}. Find the output when the input is ⟨1,2⟩\langle 1, 2\rangle.

A[12]=[2(1)+1(2)−1(1)+3(2)]=[45]A\begin{bmatrix} 1 \\ 2 \end{bmatrix} = \begin{bmatrix} 2(1) + 1(2) \\ -1(1) + 3(2) \end{bmatrix} = \begin{bmatrix} 4 \\ 5 \end{bmatrix}

The input ⟨1,2⟩\langle 1, 2\rangle is sent to ⟨4,5⟩\langle 4, 5\rangle.

The zero vector always maps to the zero vector: A[00]=[00]A\begin{bmatrix} 0 \\ 0 \end{bmatrix} = \begin{bmatrix} 0 \\ 0 \end{bmatrix} for any AA.

4Many vectors at once

To transform nn vectors, put them in a 2×n2 \times n matrix VV, and multiply on the left by AA:

AVAV

The product is a 2×n2 \times n matrix. Its columns are the output vectors, in the same order.

The reason is how matrix multiplication works. Each column of AVAV is AA times the matching column of VV.

Worked example 5. Use A=[21−13]A = \begin{bmatrix} 2 & 1 \\ -1 & 3 \end{bmatrix} on the vectors ⟨1,0⟩\langle 1, 0\rangle, ⟨0,1⟩\langle 0, 1\rangle and ⟨2,−1⟩\langle 2, -1\rangle.

AV=[21−13][10201−1]=[213−13−5]AV = \begin{bmatrix} 2 & 1 \\ -1 & 3 \end{bmatrix}\begin{bmatrix} 1 & 0 & 2 \\ 0 & 1 & -1 \end{bmatrix} = \begin{bmatrix} 2 & 1 & 3 \\ -1 & 3 & -5 \end{bmatrix}

The outputs are ⟨2,−1⟩\langle 2, -1\rangle, ⟨1,3⟩\langle 1, 3\rangle and ⟨3,−5⟩\langle 3, -5\rangle.

Check the third column by hand: 2(2)+1(−1)=32(2) + 1(-1) = 3 and −1(2)+3(−1)=−5-1(2) + 3(-1) = -5.

Notice what happened to the first two vectors. The inputs ⟨1,0⟩\langle 1, 0\rangle and ⟨0,1⟩\langle 0, 1\rangle came out as the two columns of AA. Topic 4.13 uses that.

Worked example 6. Apply A=[3−114]A = \begin{bmatrix} 3 & -1 \\ 1 & 4 \end{bmatrix} to the vectors ⟨1,0⟩\langle 1, 0\rangle, ⟨2,1⟩\langle 2, 1\rangle and ⟨−1,3⟩\langle -1, 3\rangle.

[3−114][12−1013]=[35−61611]\begin{bmatrix} 3 & -1 \\ 1 & 4 \end{bmatrix}\begin{bmatrix} 1 & 2 & -1 \\ 0 & 1 & 3 \end{bmatrix} = \begin{bmatrix} 3 & 5 & -6 \\ 1 & 6 & 11 \end{bmatrix}

The outputs are ⟨3,1⟩\langle 3, 1\rangle, ⟨5,6⟩\langle 5, 6\rangle and ⟨−6,11⟩\langle -6, 11\rangle.

5Moving a shape

The corners of a shape are vectors, so one product moves all of them. If you join the output points in the same order, you get the transformed shape.

Example: the triangle with corners (0,0)(0,0), (4,0)(4,0) and (0,3)(0,3), under A=[2005]A = \begin{bmatrix} 2 & 0 \\ 0 & 5 \end{bmatrix}:

[2005][040003]=[0800015]\begin{bmatrix} 2 & 0 \\ 0 & 5 \end{bmatrix}\begin{bmatrix} 0 & 4 & 0 \\ 0 & 0 & 3 \end{bmatrix} = \begin{bmatrix} 0 & 8 & 0 \\ 0 & 0 & 15 \end{bmatrix}

The new corners are (0,0)(0,0), (8,0)(8,0) and (0,15)(0,15). The triangle is stretched 22 times horizontally and 55 times vertically.

Linear transformations of this kind are what computer graphics use to turn, stretch and shrink a picture: every point is a column, and one matrix product moves them all.