01 / 21

Linear Systems
as Matrices

Transform systems of linear equations into compact matrix equations using the form \( A\mathbf{x} = \mathbf{b} \).

Precalculus

What is a Matrix?

A matrix is a rectangular array of numbers arranged in rows and columns. 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 \) \( 3 \) \( -4 \) \( 7 \) 3 columns 2 rows \( 2 \times 3 \) matrix

Why Use Matrices for Systems?

A system of linear equations can have many variables and many equations. Writing them out fully becomes cluttered. Matrices give us a compact, organized representation that makes patterns visible and enables powerful solution methods.

Compact
An entire system collapses into a single equation: \( A\mathbf{x} = \mathbf{b} \)
Organized
Coefficients, variables, and constants each live in their own matrix or vector
Powerful
Enables methods like Gaussian elimination, inverse matrices, and determinants

The Three Pieces of a System

Every system of linear equations contains three distinct components. Identifying them is the first step to writing the matrix equation.

1
Coefficient matrix \( A \): Contains all the coefficients of the variables, arranged by equation (row) and variable (column).
2
Variable vector \( \mathbf{x} \): A column vector listing all the unknowns: \( x, y, z, \ldots \)
3
Constant vector \( \mathbf{b} \): A column vector of the numbers on the right side of each equation.

The Core Rule: \( A\mathbf{x} = \mathbf{b} \)

Any system of \( m \) linear equations in \( n \) unknowns can be written as a single matrix equation:

\( a_{11} \) \( a_{12} \) \( \dots \) \( a_{21} \) \( a_{22} \) \( \dots \) \( \vdots \) \( \vdots \) \( \ddots \) \( A \) (\( m \times n \)) \( x_1 \) \( x_2 \) \( \vdots \) \( \mathbf{x} \) (\( n \times 1 \)) = \( b_1 \) \( b_2 \) \( \vdots \) \( \mathbf{b} \) (\( m \times 1 \)) Matrix Equation Form

From Equations to Matrix Form

SYSTEM OF EQUATIONS \( 2x + 3y = 7 \) \( 5x - y = 4 \) MATRIX EQUATION \( 2 \) \( 3 \) \( 5 \) \( -1 \) \( x \) \( y \) = \( 7 \) \( 4 \) Coefficients go into matrix A Variables go into vector x Constants go into vector b

Matrix Equation vs. Augmented Matrix

Students often confuse two related representations. Both encode the same system, but they are structurally different.

Matrix Equation Augmented Matrix
Form \( A\mathbf{x} = \mathbf{b} \) \( [A \mid \mathbf{b}] \)
Variables Explicitly shown in \( \mathbf{x} \) Implied by column position
Pieces Three separate objects One combined matrix
Best for Inverse methods, theory Row reduction, elimination

How to Convert a System

1
Align variables: Rewrite each equation in standard form with all variables on the left and the constant on the right. Use the same variable order in every equation.
2
Insert zero coefficients: If a variable is missing from an equation, write its coefficient as \( 0 \).
3
Build matrix \( A \): Read coefficients row by row, each equation becoming one row.
4
Build vectors \( \mathbf{x} \) and \( \mathbf{b} \): List the variables and constants as column vectors.
5
Verify dimensions: If you have \( m \) equations and \( n \) variables, then \( A \) is \( m \times n \), \( \mathbf{x} \) is \( n \times 1 \), and \( \mathbf{b} \) is \( m \times 1 \).

Example 1: A \( 2 \times 2 \) System

\( 4 \) \( 3 \) \( 2 \) \( -5 \) \( x \) \( y \) = \( 10 \) \( -1 \) \( A \) is \( 2 \times 2 \) \( \mathbf{x} \) is \( 2 \times 1 \) \( \mathbf{b} \) is \( 2 \times 1 \) ✓ Dimensions match

Example 2: A \( 3 \times 3 \) System

\( 1 \) \( -2 \) \( 3 \) \( 2 \) \( 1 \) \( -1 \) \( -1 \) \( 4 \) \( 2 \) \( x \) \( y \) \( z \) = \( 9 \) \( 3 \) \( 7 \) \( A \) is \( 3 \times 3 \) \( \mathbf{x} \) is \( 3 \times 1 \) \( \mathbf{b} \) is \( 3 \times 1 \) ✓ Dimensions match

Example 3: Missing Variables

Notice that equation 1 has no \( y \) term and equation 2 has no \( x \) term. We insert zero coefficients for the missing variables:

\( 3 \) \( 0 \) \( 1 \) \( 0 \) \( 1 \) \( -2 \) \( 1 \) \( 1 \) \( 1 \) \( x \) \( y \) \( z \) = \( 5 \) \( 1 \) \( 6 \) Zero for missing y Zero for missing x All present

Verifying with Multiplication

You can check your work by multiplying \( A\mathbf{x} \) to recover the original equations. Each row of \( A \) dotted with \( \mathbf{x} \) should give the corresponding entry of \( \mathbf{b} \).

Non-Square Systems

The matrix \( A \) does not have to be square. A system can have more equations than variables, or more variables than equations.

Overdetermined
More equations than variables. \( A \) has more rows than columns (e.g., \( 3 \times 2 \)). May have no solution.
Underdetermined
More variables than equations. \( A \) has more columns than rows (e.g., \( 2 \times 3 \)). May have infinitely many solutions.

Why This Matters

The matrix equation \( A\mathbf{x} = \mathbf{b} \) unlocks solution methods that are impossible with raw equations:

1
Inverse method: If \( A \) is invertible, the solution is \( \mathbf{x} = A^{-1}\mathbf{b} \).
2
Cramer's rule: Uses determinants to find each variable individually.
3
Computer algorithms: Software (NumPy, MATLAB) solves systems by operating on matrices, not equation strings.

Common Mistakes

✕ Wrong Variable Order
Mixing up which column represents which variable. Always use a consistent order (e.g., \( x, y, z \)) in every row.
✕ Forgetting Zeros
Leaving out a column when a variable is missing from an equation. The coefficient is \( 0 \), not absent.
✕ Sign Errors
Moving terms across the equals sign without flipping the sign. E.g., \( -3y \) on the left stays \( -3 \) in \( A \).

Summary of Key Concepts

Concept Details
Matrix equation form \( A\mathbf{x} = \mathbf{b} \)
Coefficient matrix \( A \) Size \( m \times n \): rows = equations, columns = variables
Variable vector \( \mathbf{x} \) Size \( n \times 1 \): one entry per variable
Constant vector \( \mathbf{b} \) Size \( m \times 1 \): right-hand side values
Missing variable rule Insert \( 0 \) as the coefficient
Verification Multiply \( A\mathbf{x} \) to recover original equations

Question 1 of 5

Which matrix is the coefficient matrix \( A \) for the system
\( 2x + y = 5 \)
\( 3x - 4y = 1 \)?

Question 2 of 5

For the system \( x - z = 2 \), \( 3y + z = 7 \), what are the dimensions of the coefficient matrix \( A \)?

Question 3 of 5

If \( A = \begin{bmatrix} 1 & 0 & -2 \\ 0 & 3 & 1 \end{bmatrix} \), \( \mathbf{x} = \begin{bmatrix} x \\ y \\ z \end{bmatrix} \), and \( \mathbf{b} = \begin{bmatrix} 2 \\ 7 \end{bmatrix} \), what is the first equation of the system?

Question 4 of 5

A student writes the matrix equation for \( 5x + 2y = 8 \), \( x - y = 3 \) as
\( \begin{bmatrix} 5 & 1 \\ 2 & -1 \end{bmatrix} \begin{bmatrix} x \\ y \end{bmatrix} = \begin{bmatrix} 8 \\ 3 \end{bmatrix} \).
What mistake was made?

Question 5 of 5

Which system of equations corresponds to the matrix equation
\( \begin{bmatrix} 4 & -1 \\ 0 & 6 \\ 2 & 3 \end{bmatrix} \begin{bmatrix} x \\ y \end{bmatrix} = \begin{bmatrix} 10 \\ -3 \\ 8 \end{bmatrix} \)?