01 / 21

Matrices
Foundations & Operations

Master the language of rectangular arrays: how to organize data, perform arithmetic, and unlock systems of equations with matrix algebra.

AP Precalculus

What Is a Matrix?

A matrix is a rectangular array of numbers arranged in rows (horizontal) and columns (vertical). We describe its size as \( m \times n \), where \( m \) is the number of rows and \( n \) is the number of columns.

\( 2 \)
\( 5 \)
\( -1 \)
\( 0 \)
\( 3 \)
\( 7 \)
\( 4 \)
\( -2 \)
\( 6 \)
\( 3 \times 3 \)
rows × cols
Row 1 Col 2

Types of Matrices

Row Matrix
A matrix with one row: \( 1 \times n \). Example: \( \begin{bmatrix} 3 & 7 & -1 \end{bmatrix} \)
Column Matrix
A matrix with one column: \( m \times 1 \). Example: \( \begin{bmatrix} 2 \\ 5 \end{bmatrix} \)
Square Matrix
Same number of rows and columns: \( n \times n \). Required for determinants.
Zero Matrix
Every element is 0. Acts like the number 0 in addition.
Identity Matrix
\( I_n \): 1's on the main diagonal, 0's elsewhere. Acts like the number 1 in multiplication.

Why Do Matrices Matter?

Matrices are everywhere: they encode systems of linear equations, represent transformations in geometry, organize data in statistics, and power algorithms in computer science.

1
Systems of equations: Rewrite \( ax + by = c \) as a compact matrix equation \( A\mathbf{x} = \mathbf{b} \).
2
Geometric transformations: Rotations, reflections, and scaling are all matrix multiplications.
3
Data organization: Spreadsheets, image pixels, and network connections are all stored as matrices.

Addition & Subtraction

To add or subtract two matrices, they must have the same dimensions. Then simply add (or subtract) corresponding elements:

\( 1 \)
\( 3 \)
\( 5 \)
\( 2 \)
\( + \)
\( 4 \)
\( 0 \)
\( -1 \)
\( 7 \)
\( = \)
\( 5 \)
\( 3 \)
\( 4 \)
\( 9 \)

Scalar Multiplication

Multiply every element of a matrix by the same scalar constant \( k \):

\( 3 \)
\( \cdot \)
\( 2 \)
\( -1 \)
\( 4 \)
\( 0 \)
\( = \)
\( 6 \)
\( -3 \)
\( 12 \)
\( 0 \)

Matrix Multiplication Rule

To multiply \( A_{m \times \color{#818cf8}{n}} \) by \( B_{\color{#818cf8}{n} \times p} \), the inner dimensions must match. The result is an \( m \times p \) matrix.

A
\( m \times n \)
\( \times \)
B
\( n \times p \)
AB
\( m \times p \)
must match

Commutative or Not?

Matrix addition is commutative (\( A + B = B + A \)), but matrix multiplication is not.

Addition Multiplication
Commutative ✓ \( A + B = B + A \) ✕ \( AB \neq BA \) in general
Associative ✓ \( (A+B)+C = A+(B+C) \) ✓ \( (AB)C = A(BC) \)
Distributive ✓ \( A(B+C) = AB + AC \)
Identity element Zero matrix \( O \) Identity matrix \( I \)

The Determinant of a \( 2 \times 2 \) Matrix

For a \( 2 \times 2 \) matrix \( A = \begin{bmatrix} a & b \\ c & d \end{bmatrix} \), the determinant is:

\( a \)
\( b \)
\( c \)
\( d \)
\( ad \) (main)
\( bc \) (subtract)

If \( \det(A) = 0 \), the matrix is singular and has no inverse.

The Inverse of a \( 2 \times 2 \) Matrix

If \( \det(A) \neq 0 \), the inverse \( A^{-1} \) exists and satisfies \( A \cdot A^{-1} = I \).

1
Swap the main-diagonal elements: \( a \leftrightarrow d \).
2
Negate the off-diagonal elements: \( b \to -b \) and \( c \to -c \).
3
Divide every entry by the determinant \( ad - bc \).

Solving Systems with Matrices

A system of equations can be written as \( A\mathbf{x} = \mathbf{b} \). If \( A^{-1} \) exists, the solution is \( \mathbf{x} = A^{-1}\mathbf{b} \).

1
Write the system as a matrix equation: identify \( A \) (coefficients), \( \mathbf{x} \) (variables), and \( \mathbf{b} \) (constants).
2
Compute \( \det(A) \). If it is 0, the system has no unique solution.
3
Find \( A^{-1} \) using the formula (swap, negate, divide).
4
Multiply \( A^{-1}\mathbf{b} \) to get the solution vector \( \mathbf{x} \).
5
Check by substituting back into the original equations.

Example 1: Matrix Addition

Find \( A + B \) where \( A = \begin{bmatrix} 4 & -2 \\ 1 & 7 \end{bmatrix} \) and \( B = \begin{bmatrix} -3 & 5 \\ 6 & -1 \end{bmatrix} \).

Example 2: Matrix Multiplication

Find \( AB \) where \( A = \begin{bmatrix} 1 & 3 \\ 2 & 0 \end{bmatrix} \) and \( B = \begin{bmatrix} 4 & -1 \\ 2 & 5 \end{bmatrix} \).

Example 3: Solving a System

Solve using matrices: \( 3x + 2y = 16 \) and \( x - y = 2 \).

Common Mistakes

✕ Wrong Dimensions
Trying to add a \( 2 \times 3 \) and a \( 3 \times 2 \) matrix. Dimensions must be identical for addition.
✕ Assuming Commutativity
Writing \( AB = BA \). Matrix multiplication is not commutative: order matters.
✕ Forgetting to Negate
When finding the inverse, students forget to negate \( b \) and \( c \) (the off-diagonal entries).

Operations Summary

Operation Rule Result Size
Addition / Subtraction Add/subtract corresponding entries Same as inputs
Scalar Multiplication Multiply every entry by \( k \) Same as input
Matrix Multiplication Dot product of rows and columns \( m \times p \)
Determinant (\( 2 \times 2 \)) \( ad - bc \) Scalar
Inverse (\( 2 \times 2 \)) Swap, negate, divide by det Same as input

Question 1 of 5

If \( A \) is a \( 3 \times 4 \) matrix and \( B \) is a \( 4 \times 2 \) matrix, what are the dimensions of \( AB \)?

Question 2 of 5

What is the determinant of \( \begin{bmatrix} 5 & 3 \\ 2 & 4 \end{bmatrix} \)?

Question 3 of 5

Which property does not hold for matrix multiplication?

Question 4 of 5

Find the inverse of \( A = \begin{bmatrix} 2 & 1 \\ 5 & 3 \end{bmatrix} \).

Question 5 of 5

If \( A = \begin{bmatrix} 1 & 2 \\ 3 & 4 \end{bmatrix} \) and \( B = \begin{bmatrix} 0 & 1 \\ 1 & 0 \end{bmatrix} \), what is the element in row 1, column 1 of \( AB \)?