01 / 21

Matrices as
Functions

Discover how a matrix \( A \) acts as a function that maps input vectors to output vectors: transforming, rotating, and scaling the plane.

AP Precalculus

What Is a Function, Really?

A function is a rule that takes each element from an input set (the domain) and assigns it to exactly one element in an output set (the codomain). You already know functions like \( f(x) = x^2 \).

Domain
The set of all valid inputs
Codomain
The set of all possible outputs
Rule
Each input maps to exactly one output

Vectors as Inputs and Outputs

Instead of plugging a single number into \( f(x) \), imagine plugging in a vector \( \mathbf{v} = \begin{bmatrix} x \\ y \end{bmatrix} \). The function returns a new vector. This is exactly what matrix multiplication does.

Input
\( \begin{bmatrix} x \\ y \end{bmatrix} \)
Matrix A
\( \begin{bmatrix} a & b \\ c & d \end{bmatrix} \)
Output
\( \begin{bmatrix} ax+by \\ cx+dy \end{bmatrix} \)

The Matrix-Function Connection

A matrix \( A \) defines a function \( T(\mathbf{v}) = A\mathbf{v} \). This function is called a linear transformation because it preserves two fundamental operations:

1
Addition: \( T(\mathbf{u} + \mathbf{v}) = T(\mathbf{u}) + T(\mathbf{v}) \)
2
Scalar multiplication: \( T(c\mathbf{v}) = cT(\mathbf{v}) \)

Domain and Codomain of Matrix Functions

For an \( m \times n \) matrix \( A \), the function \( T(\mathbf{v}) = A\mathbf{v} \) maps vectors from \( \mathbb{R}^n \) to \( \mathbb{R}^m \).

Domain
\( \mathbb{R}^n \): vectors with \( n \) entries (number of columns)
Codomain
\( \mathbb{R}^m \): vectors with \( m \) entries (number of rows)

The Fundamental Theorem

This means that matrices and linear functions are the same thing. To find the matrix, evaluate the function on the standard basis vectors:

Finding the Standard Matrix

To find the matrix \( A \) for a linear transformation \( T \), evaluate \( T \) on each standard basis vector. Each result becomes a column of \( A \).

\( \mathbf{e}_1 \)
\( \begin{bmatrix} 1 \\ 0 \end{bmatrix} \)
T Column 1
\( T(\mathbf{e}_1) \)
\( \mathbf{e}_2 \)
\( \begin{bmatrix} 0 \\ 1 \end{bmatrix} \)
T Column 2
\( T(\mathbf{e}_2) \)
Matrix A
\( \begin{bmatrix} T(\mathbf{e}_1) & T(\mathbf{e}_2) \end{bmatrix} \)

Functions vs. Transformations

Both terms describe the same concept, but emphasis differs:

Function Transformation
Emphasis Input-output mapping Geometric action
Notation \( T(\mathbf{v}) \) or \( f(\mathbf{v}) \) \( T : \mathbb{R}^n \to \mathbb{R}^m \)
Interpretation Compute new coordinates Move, rotate, scale points
Requirement Each input has one output Same: plus linearity

Common Geometric Transformations

Rotation
\( \begin{bmatrix} \cos\theta & -\sin\theta \\ \sin\theta & \cos\theta \end{bmatrix} \)
Scaling
\( \begin{bmatrix} k_x & 0 \\ 0 & k_y \end{bmatrix} \)
Reflection
\( \begin{bmatrix} 1 & 0 \\ 0 & -1 \end{bmatrix} \) reflects over the \( x \)-axis

How to Apply a Matrix Function

1
Identify the matrix \( A \) and the input vector \( \mathbf{v} \).
2
Check dimensions: if \( A \) is \( m \times n \), then \( \mathbf{v} \) must have \( n \) entries.
3
Multiply: compute \( A\mathbf{v} \) using the dot product of each row of \( A \) with \( \mathbf{v} \).
4
Interpret the result: the output vector is the image of \( \mathbf{v} \) under the transformation.

Example 1: Scaling

Let \( A = \begin{bmatrix} 3 & 0 \\ 0 & 2 \end{bmatrix} \) and \( \mathbf{v} = \begin{bmatrix} 1 \\ 4 \end{bmatrix} \). Compute \( T(\mathbf{v}) = A\mathbf{v} \).

x y 1 2 3 1 2 4 6 8 (1, 4) (3, 8)

Example 2: Rotation by \( 90^\circ \)

Let \( A = \begin{bmatrix} 0 & -1 \\ 1 & 0 \end{bmatrix} \) and \( \mathbf{v} = \begin{bmatrix} 3 \\ 1 \end{bmatrix} \). This matrix rotates vectors \( 90^\circ \) counterclockwise.

x y 1 2 3 -1 1 2 -1 (3, 1) (-1, 3) 90°

Example 3: Reflection over the \( x \)-axis

Let \( A = \begin{bmatrix} 1 & 0 \\ 0 & -1 \end{bmatrix} \) and \( \mathbf{v} = \begin{bmatrix} 2 \\ 5 \end{bmatrix} \).

x y x-axis (mirror line) 2 4 1 2 3 4 5 -1 -2 -3 -4 -5 (2, 5) (2, -5)

Composition: Chaining Matrix Functions

Applying one matrix function and then another is the same as multiplying the matrices. If \( T_1(\mathbf{v}) = A\mathbf{v} \) and \( T_2(\mathbf{v}) = B\mathbf{v} \), then:

1
Order matters: \( AB \neq BA \) in general. The rightmost matrix is applied first.
2
Think inside out: in \( BA\mathbf{v} \), first apply \( A \) to \( \mathbf{v} \), then apply \( B \) to the result.

Common Mistakes

✕ Wrong Dimensions
Trying to multiply a \( 2 \times 3 \) matrix by a \( 2 \times 1 \) vector. The columns of \( A \) must match the rows of \( \mathbf{v} \).
✕ Order Reversed
Computing \( \mathbf{v} \cdot A \) instead of \( A\mathbf{v} \). Matrix functions act by left-multiplication.
✕ Not Linear
Assuming all transformations are matrix functions. Translation \( T(\mathbf{v}) = \mathbf{v} + \mathbf{b} \) is not linear: it cannot be written as \( A\mathbf{v} \).

Summary: Matrix Functions at a Glance

Concept Details
Definition \( T(\mathbf{v}) = A\mathbf{v} \)
Domain \( \mathbb{R}^n \) (number of columns of \( A \))
Codomain \( \mathbb{R}^m \) (number of rows of \( A \))
Linearity \( T(\mathbf{u}+\mathbf{v}) = T(\mathbf{u})+T(\mathbf{v}) \), \( T(c\mathbf{v}) = cT(\mathbf{v}) \)
Standard matrix Columns are \( T(\mathbf{e}_1), T(\mathbf{e}_2), \ldots \)
Composition \( T_2 \circ T_1 \leftrightarrow BA \)

Question 1 of 5

If \( A = \begin{bmatrix} 2 & 1 \\ 0 & 3 \end{bmatrix} \) and \( \mathbf{v} = \begin{bmatrix} 4 \\ -1 \end{bmatrix} \), what is \( A\mathbf{v} \)?

Question 2 of 5

A \( 3 \times 2 \) matrix defines a function from which domain to which codomain?

Question 3 of 5

Which matrix represents reflection over the \( y \)-axis?

Question 4 of 5

If \( T(\mathbf{v}) = A\mathbf{v} \) is a linear transformation, which property must hold?

Question 5 of 5

If \( T_1(\mathbf{v}) = A\mathbf{v} \) and \( T_2(\mathbf{v}) = B\mathbf{v} \), the composition \( T_2(T_1(\mathbf{v})) \) equals: