AP Precalculus • Functions Involving Parameters, Vectors, and Matrices

Matrices as Functions

Discover how matrix multiplication defines linear transformations that map input vectors to output vectors.

A function curve with a triangle and circular angle measure.
Inside this lesson 9 sections 5 questions 9 figures

SECTION 1

Historical Context & Motivation

The idea that a matrix can serve as a function—accepting an input and producing a deterministic output—did not emerge overnight. It grew from centuries of work on systems of equations, geometric transformations, and the eventual recognition that these seemingly different problems share a common algebraic backbone. Understanding this history reveals why the matrix-as-function viewpoint is so central to modern mathematics, physics, and data science.

1693 • Leibniz and Determinants

Gottfried Wilhelm Leibniz introduced a systematic notation for solving systems of linear equations, foreshadowing the concept of a determinant and implicitly treating coefficient arrays as operational objects.

1858 • Cayley Formalizes Matrices

Arthur Cayley published 'A Memoir on the Theory of Matrices,' defining matrix multiplication and explicitly treating matrices as algebraic entities that could be composed, inverted, and studied in their own right.

1888 • Peano and Vector Spaces

Giuseppe Peano axiomatized the concept of a vector space, providing the domain and codomain structure needed to view matrix multiplication as a bona fide function between spaces.

1927 • Quantum Mechanics and Matrix Theory

Werner Heisenberg's matrix mechanics showed that physical observables are represented by matrices acting as operators on state vectors, cementing the function interpretation of matrices in science.

The unifying insight across these milestones is deceptively simple: when you multiply a matrix A by a vector x, you obtain a new vector b. This operation satisfies the definition of a function: each input vector maps to exactly one output vector. The central question this lesson addresses is: How does treating a matrix as a function deepen our understanding of both matrices and functions?

SECTION 2

Core Principles & Definitions

To interpret a matrix as a function, we need to establish precisely what the input is, what the output is, and what properties that mapping possesses. The foundational ideas below build from the definition of a function through to the distinguishing features of linear transformations.

1

Matrix–Vector Product as Mapping

An m × n matrix A defines a function T(x) = Ax that takes a vector in ℝⁿ (the domain) and returns a vector in ℝᵐ (the codomain). Each input has exactly one output.
2

Linearity

A matrix function satisfies two properties: T(u + v) = T(u) + T(v) (additivity) and T(cv) = cT(v) (homogeneity). Together these define a linear transformation.
3

Domain and Codomain

For an m × n matrix, the domain is ℝⁿ (column vectors with n entries) and the codomain is ℝᵐ (column vectors with m entries). The range may be a proper subset of the codomain.
4

Composition Equals Multiplication

If T₁(x) = Ax and T₂(x) = Bx, then the composition T₂ ∘ T₁ is represented by the product BA. Function composition corresponds to matrix multiplication.

SECTION 3

Visual Explanation: How a Matrix Transforms the Plane

The most illuminating way to see a matrix acting as a function is to watch it transform every point in the plane simultaneously. The diagram below shows how the 2 × 2 matrix A = [[2, 1], [0, 1]] maps the standard unit square to a parallelogram. Notice that the columns of A become the images of the basis vectors e₁ and e₂.

INPUT: Unit Squarex₁x₂e₁ = (1, 0)e₂ = (0, 1)T(x) = AxA = [2 1; 0 1]OUTPUT: Parallelogramy₁y₂Ae₁ = (2, 0)Ae₂ = (1, 1)
The left panel shows the unit square spanned by e₁ (cyan) and e₂ (pink). Applying T(x) = Ax with A = [[2, 1], [0, 1]] sends the square to the parallelogram on the right. The columns of A are exactly the images of the basis vectors.

This geometric view highlights a crucial principle: a matrix function is entirely determined by what it does to the basis vectors. Because every vector in the domain is a linear combination of the basis vectors, and the transformation is linear, the images of the basis vectors (i.e., the columns of the matrix) tell you everything about the function. This is why you can reconstruct any m × n matrix from the n images of the standard basis.

SECTION 4

Mathematical Framework

We now formalize the connection between matrices and functions. The key equation is the matrix–vector product, which defines the transformation, together with the linearity conditions that characterize it.

MATRIX FUNCTION DEFINITION

T:Rn→RmdefinedbyT(x)=AxT : ℝⁿ → ℝᵐ defined by T(x) = Ax

A is an m × n matrix, x is a column vector in ℝⁿ, and Ax is the resulting column vector in ℝᵐ. The domain is ℝⁿ and the codomain is ℝᵐ.

LINEARITY CONDITIONS

T(u+v)=T(u)+T(v)andT(cv)=cT(v)T(u + v) = T(u) + T(v) and T(cv) = cT(v)

For all vectors u, v in ℝⁿ and all scalars c in ℝ. These two properties together are equivalent to T(cu + dv) = cT(u) + dT(v), called superposition.

COLUMN INTERPRETATION

Ax=x1a1+x2a2+⋯+xnanAx = x₁a₁ + x₂a₂ + ⋯ + xₙaₙ

Each aᵢ is the i-th column of A. The product Ax is a linear combination of the columns of A, weighted by the components of x. This directly connects matrix multiplication to the span of columns.

COMPOSITION

(T2∘T1)(x)=T2(T1(x))=B(Ax)=(BA)x(T₂ ∘ T₁)(x) = T₂(T₁(x)) = B(Ax) = (BA)x

If T₁ corresponds to matrix A (n × p) and T₂ corresponds to matrix B (m × n), then their composition corresponds to the product BA (m × p). Order matters: BA ≠ AB in general.

A profound consequence of the column interpretation is that the range of the matrix function T equals the column space of A. If the columns of A are linearly independent, then T maps ℝⁿ onto an n-dimensional subspace of ℝᵐ. If m = n and the matrix is invertible, T is a bijection and the inverse function is T⁻¹(y) = A⁻¹y, confirming that invertible matrices correspond to invertible functions.

SECTION 5

Classification of Common Matrix Transformations

Different matrices encode different geometric operations. By examining the entries of a 2 × 2 matrix, you can predict whether the corresponding function stretches, rotates, reflects, or shears the plane. The table and diagram below catalog the most important families of matrix functions encountered in precalculus and linear algebra.

TransformationMatrix Form (2 × 2)Effect on Geometry
Scaling[[k, 0], [0, k]]Enlarges (k > 1) or shrinks (0 < k < 1) all vectors uniformly
Rotation by θ[[cos θ, −sin θ], [sin θ, cos θ]]Rotates every point counterclockwise by angle θ about the origin
Reflection over x-axis[[1, 0], [0, −1]]Flips points across the horizontal axis
Horizontal shear[[1, k], [0, 1]]Tilts vertical lines into slanted lines; horizontal lines stay fixed
Projection onto x-axis[[1, 0], [0, 0]]Collapses every point onto the x-axis (not invertible)

Common 2 × 2 matrix transformations and their geometric effects

Gallery of 2×2 Matrix Transformations on a Unit FOriginal FScale ×1.5[[1.5,0],[0,1.5]]Rotate 90°[[0,−1],[1,0]]Shear k=1[[1,1],[0,1]]Key Observations• Scaling preserves shape; rotation preserves distances; shearing distorts angles.• det(A) gives the signed area scale factor. If det(A) = 0, the transformation collapses dimension.• Rotation matrices always have det = 1 and preserve the unit circle.
Four transformations applied to an F-shaped region: uniform scaling (cyan), 90° rotation (pink), and horizontal shear (amber). The original (violet) is shown at left for comparison.

A critical detail for the AP exam: the determinant of the matrix equals the signed area scale factor of the transformation. A rotation matrix has determinant 1, so it preserves areas. A projection matrix has determinant 0, reflecting the fact that it collapses two-dimensional inputs onto a line (or point), which has zero area. These connections let you extract geometric meaning directly from algebraic properties.

SECTION 6

Worked Example: Matrix Function in Action

Let us apply a matrix function to a concrete geometric problem. We will compute the image of a triangle under a matrix transformation, verify linearity, and interpret the result geometrically.

Worked example

  1. 1

    Step 1 — Define the matrix and the inputs

    Let A = [[1, −1], [2, 0]]. The triangle has vertices P = (1, 0), Q = (0, 1), and R = (1, 1). We treat each vertex as a column vector and compute T(P), T(Q), and T(R) where T(x) = Ax.
  2. 2

    Step 2 — Compute T(P) = A · P

    A · [1, 0]ᵀ = [1·1 + (−1)·0, 2·1 + 0·0]ᵀ = [1, 2]ᵀ.
    T(P) = (1, 2)
  3. 3

    Step 3 — Compute T(Q) = A · Q

    A · [0, 1]ᵀ = [1·0 + (−1)·1, 2·0 + 0·1]ᵀ = [−1, 0]ᵀ.
    T(Q) = (−1, 0)
  4. 4

    Step 4 — Compute T(R) = A · R

    A · [1, 1]ᵀ = [1·1 + (−1)·1, 2·1 + 0·1]ᵀ = [0, 2]ᵀ.
    T(R) = (0, 2)
  5. 5

    Step 5 — Verify linearity

    Note that R = P + Q. By linearity, T(R) should equal T(P) + T(Q) = (1, 2) + (−1, 0) = (0, 2). This matches our direct computation, confirming the additivity property of the matrix function.
    T(P + Q) = T(P) + T(Q) ✓
  6. 6

    Step 6 — Geometric interpretation

    The original right triangle with area ½ is mapped to a new triangle with vertices (1, 2), (−1, 0), and (0, 2). The area of the image is |det(A)| × (original area) = |1·0 − (−1)·2| × ½ = 2 × ½ = 1. The transformation doubled the area, consistent with det(A) = 2.
    Image area = |det(A)| × original area = 2 × ½ = 1

SECTION 7

Matrices vs. Other Function Types

Matrix functions are one species in a large ecosystem of functions you have encountered in precalculus. Comparing matrix functions with scalar functions and parametric functions clarifies what makes them distinctive and where their limitations lie.

FeatureScalar Function f(x)Matrix Function T(x) = Ax
DomainSubset of ℝ (single real numbers)ℝⁿ (vectors with n components)
CodomainSubset of ℝℝᵐ (vectors with m components)
LinearityOnly f(x) = kx is linearAlways linear by definition
Compositionf(g(x)); commutative only in special casesBA ≠ AB in general; matrix multiplication is associative but not commutative
InvertibilityRequires one-to-one and onto (passes horizontal line test)Requires det(A) ≠ 0; the inverse function is T⁻¹(y) = A⁻¹y
Can model curvature?Yes (quadratics, exponentials, etc.)No—maps lines to lines; cannot bend straight paths

Comparing scalar functions with matrix functions

SECTION 8

Connection to Linear Algebra & Beyond

The matrix-as-function viewpoint is not merely a precalculus convenience—it is the conceptual gateway to linear algebra, one of the most widely used branches of mathematics. Below we outline how the ideas from this lesson scale up to more advanced contexts.

Precalculus ConceptAdvanced Generalization
T(x) = Ax for a specific matrix AAbstract linear maps T : V → W between any vector spaces, not just ℝⁿ
Columns of A are images of basis vectorsAny linear map is determined by its action on a basis; the matrix is the coordinate representation
det(A) ≠ 0 ⟹ invertibleRank–Nullity Theorem; kernel and image capture all information about injectivity and surjectivity
Rotation and scaling matricesEigenvalue decomposition: every matrix can be analyzed through its eigenvalues and eigenvectors
Composition = matrix multiplicationRepresentation theory: group actions can be studied via matrix representations

From precalculus matrix functions to advanced linear algebra

If you continue to study mathematics or any quantitative field, the ability to think of a matrix as a function—and vice versa—will serve as a conceptual Swiss Army knife. Computer graphics, machine learning, quantum mechanics, and signal processing all rely on this interpretation daily. Mastering it now builds a foundation for virtually any STEM direction.

SECTION 9

Practice Problems

Question 1: CONCEPTUAL

A matrix A is 3 × 2. When we define T(x) = Ax, which of the following correctly describes the domain and codomain of T? A. Domain = ℝ³, Codomain = ℝ² B. Domain = ℝ², Codomain = ℝ² C. Domain = ℝ², Codomain = ℝ³ D. Domain = ℝ³, Codomain = ℝ³ E. Domain = ℝ⁶, Codomain = ℝ⁶
  • A. Domain = ℝ³, Codomain = ℝ²
  • B. Domain = ℝ², Codomain = ℝ²
  • C. Domain = ℝ², Codomain = ℝ³
  • D. Domain = ℝ³, Codomain = ℝ³
  • E. Domain = ℝ⁶, Codomain = ℝ⁶
Show answer (C)
Correct answer: C. For an m × n matrix, the input vector must have n components (so the domain is ℝⁿ = ℝ²) and the output vector has m components (so the codomain is ℝᵐ = ℝ³). Choice A reverses domain and codomain. Choice B uses only n = 2 for both, ignoring that the matrix has 3 rows. Choice D uses only m = 3 for both, ignoring the 2 columns. Choice E confuses the total number of entries (6) with the dimension of the spaces.

Question 2: BASIC CALCULATION

Let A = [[3, −1], [0, 2]]. What is T(x) = Ax when x = [4, 1]ᵀ? A. (11, 2) B. (13, 2) C. (12, −1) D. (11, 8) E. (5, 2)
  • A. (11, 2)
  • B. (13, 2)
  • C. (12, −1)
  • D. (11, 8)
  • E. (5, 2)
Show answer (A)
Correct answer: A. Row 1: 3(4) + (−1)(1) = 12 − 1 = 11. Row 2: 0(4) + 2(1) = 2. So T(x) = (11, 2). Choice B uses 3(4) + 1(1) = 13, forgetting the negative sign. Choice C computes row 1 as 3(4) + 0 = 12 and swaps the −1 into row 2. Choice D uses 2(4) = 8 for the second component, incorrectly multiplying 2 by 4 instead of 2 by 1. Choice E adds entries: 3 + (−1) + 0 + 2 = 4, which is not how matrix multiplication works.

Question 3: INTERMEDIATE

Matrix B represents a 90° counterclockwise rotation and matrix C = [[2, 0], [0, 2]] represents a scaling by factor 2. If we apply the rotation first and then the scaling, which matrix product represents the composed transformation? A. BC B. CB C. B + C D. B²C E. C²B
  • A. BC
  • B. CB
  • C. B + C
  • D. B²C
  • E. C²B
Show answer (B)
Correct answer: B. When composing transformations, the first transformation applied goes on the right. We apply B first (rotation), then C (scaling), so the composition is (C ∘ B)(x) = C(Bx) = (CB)x. Choice A reverses the order, applying scaling first. Choice C adds the matrices, which does not correspond to composition of functions. Choices D and E introduce extraneous squaring operations with no basis in the problem.

Question 4: APPLIED

A computer graphics engine uses a 2 × 2 matrix to transform sprites. The matrix M = [[cos 45°, −sin 45°], [sin 45°, cos 45°]] is applied to a square with vertices at (0, 0), (100, 0), (100, 100), and (0, 100). (a) Compute the image of the vertex (100, 0) under T(x) = Mx. Express your answer in exact form using √2. (b) What is the area of the transformed square? Justify your answer using det(M). (c) A designer wants to first rotate the square by 45° and then scale it by a factor of 3. Write the single matrix that accomplishes both transformations and state its determinant. (d) Is the combined transformation invertible? Explain.
Show answer
(a) cos 45° = sin 45° = √2/2. M · [100, 0]ᵀ = [100 · √2/2, 100 · √2/2]ᵀ = (50√2, 50√2). [1 point] (b) det(M) = cos²45° + sin²45° = 1. The area scale factor is |det(M)| = 1, so the transformed square has the same area as the original: 100 × 100 = 10,000 square units. Rotation preserves area. [1 point] (c) The scaling matrix is S = [[3, 0], [0, 3]]. Apply rotation first, then scaling: combined = SM = [[3cos 45°, −3sin 45°], [3sin 45°, 3cos 45°]] = [[3√2/2, −3√2/2], [3√2/2, 3√2/2]]. det(SM) = 9 · det(M) = 9. [1 point] (d) Yes, because det(SM) = 9 ≠ 0. A matrix with nonzero determinant is invertible, so the combined transformation has an inverse function given by (SM)⁻¹. [1 point]

Question 5: CRITICAL THINKING

Let T : ℝ² → ℝ² be a matrix function defined by T(x) = Ax where A = [[a, b], [c, d]]. (a) Prove that T must map the zero vector to itself, i.e., T(0) = 0. (b) Suppose T maps every vector to the zero vector. What can you conclude about the entries of A? What is det(A)? (c) Give an example of a nonzero 2 × 2 matrix A such that T is not one-to-one (i.e., two different input vectors produce the same output). Justify your answer by exhibiting two distinct inputs with the same image.
Show answer
(a) By the homogeneity property, T(0) = T(0 · v) = 0 · T(v) = 0 for any vector v. Alternatively, direct computation gives A · [0, 0]ᵀ = [a·0 + b·0, c·0 + d·0]ᵀ = [0, 0]ᵀ. Either argument earns full credit. [1 point] (b) If T(x) = 0 for all x, then in particular T(e₁) = [a, c]ᵀ = [0, 0]ᵀ and T(e₂) = [b, d]ᵀ = [0, 0]ᵀ. Hence a = b = c = d = 0, so A is the zero matrix. det(A) = 0·0 − 0·0 = 0. [1 point] (c) Let A = [[1, 2], [2, 4]]. Then det(A) = 4 − 4 = 0, so T is not one-to-one. Concretely, T([2, −1]ᵀ) = [1·2 + 2·(−1), 2·2 + 4·(−1)]ᵀ = [0, 0]ᵀ and T([0, 0]ᵀ) = [0, 0]ᵀ. Two distinct inputs, (2, −1) and (0, 0), both map to (0, 0). [1 point]

Varsity Tutors • AP Precalculus • Matrices as Functions