AP Precalculus · Study guide

Matrices as Functions

AP® Precalculus · Unit 4 · Functions Involving Parameters, Vectors, and Matrices

Matrices as Functions

A 2 × 2 matrix is a function that moves every point of the plane. This guide reads a matrix from where it sends the unit vectors, builds rotations and reflections, measures how areas change, and composes and undoes transformations.

The idea in one paragraph

The linear transformation \(\langle x, y\rangle \mapsto \langle a_{11}x + a_{12}y,\ a_{21}x + a_{22}y\rangle\) is multiplication by \(\begin{bmatrix} a_{11} & a_{12} \\ a_{21} & a_{22} \end{bmatrix}\), whose columns are the images of \(\vec i = \langle 1, 0\rangle\) and \(\vec j = \langle 0, 1\rangle\). The rotation counterclockwise by \(\theta\) about the origin has matrix \(\begin{bmatrix} \cos\theta & -\sin\theta \\ \sin\theta & \cos\theta \end{bmatrix}\). The absolute value of the determinant is the factor by which areas are multiplied. Doing one transformation after another is a linear transformation whose matrix is the product (the first one on the right), and the inverse transformation uses the inverse matrix.

1The columns tell the story

Figure 1. A’s first column is the image of i and its second column is the image of j. Knowing those two images fixes the whole transformation.
Worked Example 1 The matrix from two images

A linear transformation sends \(\vec i = \langle 1, 0\rangle\) to \(\langle 2, 1\rangle\) and \(\vec j = \langle 0, 1\rangle\) to \(\langle -1, 3\rangle\). Find its matrix.

  1. 1
    \(A\vec i\) is the first column of \(A\) and \(A\vec j\) is the second.
  2. 2
    \(A = \begin{bmatrix} 2 & -1 \\ 1 & 3 \end{bmatrix}\). It maps \(\langle x, y\rangle\) to \(\langle 2x - y,\ x + 3y\rangle\).
Answer: \(A = \begin{bmatrix} 2 & -1 \\ 1 & 3 \end{bmatrix}\) (Figure 1).
Worked Example 2 Reflections from unit vectors

Find the matrices of reflection over the line \(y = x\) and over the x-axis.

  1. 1
    Over \(y = x\): \(\vec i\) goes to \(\langle 0, 1\rangle\) and \(\vec j\) to \(\langle 1, 0\rangle\). Matrix \(\begin{bmatrix} 0 & 1 \\ 1 & 0 \end{bmatrix}\), which swaps coordinates: \(\langle 4, 1\rangle \rightarrow \langle 1, 4\rangle\).
  2. 2
    Over the x-axis: \(\vec i\) stays, \(\vec j\) goes to \(\langle 0, -1\rangle\). Matrix \(\begin{bmatrix} 1 & 0 \\ 0 & -1 \end{bmatrix}\).
Answer: Swap matrix; sign-flip matrix.
Write it like this

“Since \(L(\vec i) = \langle 2, 1\rangle\) and \(L(\vec j) = \langle -1, 3\rangle\), the matrix of \(L\) has these as its columns.”

Common Mistake 1 · Writing the images as rows

The image of \(\vec i\) is the first column. Putting \(\langle 2, 1\rangle\) and \(\langle -1, 3\rangle\) as rows gives \(\begin{bmatrix} 2 & 1 \\ -1 & 3 \end{bmatrix}\), which sends \(\vec i\) to \(\langle 2, -1\rangle\) instead.

2Rotations and reflections

\[ R_\theta = \begin{bmatrix} \cos\theta & -\sin\theta \\ \sin\theta & \cos\theta \end{bmatrix} \]
Figure 2. The rotation keeps every length and angle; only the position turns. Equal scales keep the shapes true.
Worked Example 3 Rotations

Write the matrix for a counterclockwise rotation by \(\frac{\pi}{3}\) and apply it to \(\langle 2, 0\rangle\).

  1. 1
    \(R_{\pi/3} = \begin{bmatrix} \frac12 & -\frac{\sqrt3}{2} \\ \frac{\sqrt3}{2} & \frac12 \end{bmatrix}\).
  2. 2
    \(R_{\pi/3}\begin{bmatrix} 2 \\ 0 \end{bmatrix} = \begin{bmatrix} 1 \\ \sqrt3 \end{bmatrix}\): still length 2, now at angle \(\frac{\pi}{3}\).
Answer: \(\langle 1, \sqrt3\rangle\)

3How areas change

Worked Example 4 How areas change

A region of area 4 is transformed by \(\begin{bmatrix} 3 & 1 \\ 1 & 2 \end{bmatrix}\). What is the area of its image? What does a reflection do to area?

  1. 1
    \(\det = 3(2) - 1(1) = 5\). Every area is multiplied by \(|\det| = 5\): the image has area 20.
  2. 2
    The reflection \(\begin{bmatrix} 1 & 0 \\ 0 & -1 \end{bmatrix}\) has determinant \(-1\): areas are unchanged (factor 1); the negative sign only signals the flip.
Answer: Area 20; reflections keep area the same.

4Composing transformations

Worked Example 5 Composing transformations

Rotate by 90° counterclockwise, then reflect over the x-axis. Find the single matrix and apply it to \(\langle 2, 1\rangle\).

  1. 1
    The first transformation goes on the right: \(M = R_x R_{90°} = \begin{bmatrix} 1 & 0 \\ 0 & -1 \end{bmatrix}\begin{bmatrix} 0 & -1 \\ 1 & 0 \end{bmatrix} = \begin{bmatrix} 0 & -1 \\ -1 & 0 \end{bmatrix}\).
  2. 2
    \(M\begin{bmatrix} 2 \\ 1 \end{bmatrix} = \begin{bmatrix} -1 \\ -2 \end{bmatrix}\). The combined effect is reflection over \(y = -x\).
  3. 3
    In the other order, \(R_{90°}R_x = \begin{bmatrix} 0 & 1 \\ 1 & 0 \end{bmatrix}\), reflection over \(y = x\): order matters.
Answer: \(\begin{bmatrix} 0 & -1 \\ -1 & 0 \end{bmatrix}\); \(\langle 2, 1\rangle \rightarrow \langle -1, -2\rangle\).
Common Mistake 2 · Multiplying in reading order

“Rotate, then reflect” is \(R_x R_{90°}\), not \(R_{90°}R_x\). The vector is multiplied by the rightmost matrix first, so the first step goes on the right.

5Undoing a transformation

Worked Example 6 Undoing a transformation

\(L(\vec v) = A\vec v\) with \(A = \begin{bmatrix} 2 & 1 \\ 5 & 3 \end{bmatrix}\) sends some vector to \(\langle 3, 8\rangle\). Which vector? How do you undo a rotation by \(\frac{\pi}{3}\)?

  1. 1
    The inverse transformation is \(L^{-1}(\vec v) = A^{-1}\vec v\) with \(A^{-1} = \begin{bmatrix} 3 & -1 \\ -5 & 2 \end{bmatrix}\). \(A^{-1}\langle 3, 8\rangle = \langle 9 - 8, -15 + 16\rangle = \langle 1, 1\rangle\).
  2. 2
    Check: \(A\langle 1, 1\rangle = \langle 3, 8\rangle\). Composing \(L\) and \(L^{-1}\) gives the identity.
  3. 3
    A rotation by \(\frac{\pi}{3}\) is undone by a rotation by \(-\frac{\pi}{3}\), and \(R_{-\pi/3} = R_{\pi/3}^{-1}\).
Answer: \(\langle 1, 1\rangle\); rotate by \(-\frac{\pi}{3}\).

Quick reference

FactMatrix
ColumnsImages of \(\vec i\) and \(\vec j\)
Rotation by \(\theta\)\(\begin{bmatrix} \cos\theta & -\sin\theta \\ \sin\theta & \cos\theta \end{bmatrix}\)
Reflect over x-axis / y = x\(\begin{bmatrix} 1 & 0 \\ 0 & -1 \end{bmatrix}\) / \(\begin{bmatrix} 0 & 1 \\ 1 & 0 \end{bmatrix}\)
Area factor\(|\det A|\)
First L₁, then L₂\(A_2A_1\)
Inverse transformation\(A^{-1}\)