01 / 21

Linear Systems
as Matrices

Learn to represent a system of linear equations as a single matrix equation, a foundational concept in linear algebra.

Linear Algebra

What Is a Matrix?

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

2 5 -1 3 -4 7 0 1 6 A \( 3 \times 3 \) matrix 3 rows 3 columns

Three Key Pieces of the Puzzle

To write a system of equations as a matrix equation, we need three special matrices:

Coefficient Matrix \( A \)
Contains only the coefficients of the variables, arranged in rows matching each equation.
Variable Vector \( \vec{x} \)
A column vector holding all the unknowns, arranged vertically like \( \begin{bsmallmatrix} x \\ y \\ \vdots \end{bsmallmatrix} \).
Constant Vector \( \vec{b} \)
A column vector of the constants on the right-hand side of each equation.

From Equations to One Equation

Consider this system of two linear equations:

We can rewrite the entire system as the single matrix equation \( A\vec{x} = \vec{b} \):

2 3 5 -1 \( A \) x y \( \vec{x} \) = 8 1 \( \vec{b} \) \( A\vec{x} = \vec{b} \)

Why Does This Work?

When we multiply the coefficient matrix \( A \) by the variable vector \( \vec{x} \), each row of \( A \) gets multiplied by the vector. This produces one equation per row:

Each row of the matrix product \( A\vec{x} \) is the dot product of that row with the variable vector. Setting the result equal to \( \vec{b} \) recovers our original system.

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

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

1
\( A \) is an \( m \times n \) coefficient matrix.
2
\( \vec{x} \) is an \( n \times 1 \) column vector of unknowns.
3
\( \vec{b} \) is an \( m \times 1 \) column vector of constants.

Dimensions Must Match

For the matrix multiplication \( A\vec{x} \) to be valid, the number of columns in \( A \) must equal the number of rows in \( \vec{x} \):

\( A \) \( m \times n \) \( \vec{x} \) \( n \times 1 \) = \( \vec{b} \) \( m \times 1 \) n must match n

Equations vs Matrix Form

System of Equations Matrix Equation
Format Multiple separate equations Single equation: \( A\vec{x} = \vec{b} \)
Variables Written out in each equation Collected in one vector \( \vec{x} \)
Coefficients Mixed in with variables Isolated in matrix \( A \)
Scalability Cumbersome for large systems Same compact form for any size
Best For Small systems, by-hand solving Computation, theory, proofs

How to Convert: Step by Step

1
Align variables. Rewrite every equation in the form \( ax + by + cz + \cdots = d \). Put zero coefficients where a variable is missing.
2
Extract coefficients into \( A \). Each row of the coefficient matrix comes from one equation, in order.
3
Build the variable vector \( \vec{x} \). List the unknowns in the same column order used in \( A \).
4
Build the constant vector \( \vec{b} \). Collect the right-hand side values, one per equation.
5
Write \( A\vec{x} = \vec{b} \). Verify: multiply \( A\vec{x} \) to confirm you recover the original system.

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

1
Coefficient matrix: Row 1 gives \( [4, -2] \); Row 2 gives \( [-1, 6] \).
2
Variable vector: \( \vec{x} = \begin{bmatrix} x \\ y \end{bmatrix} \)
3
Constant vector: \( \vec{b} = \begin{bmatrix} 10 \\ 3 \end{bmatrix} \)

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

Step 1: All equations already have \( x, y, z \) in order with explicit coefficients.

Example 3: Missing Variables

Key step: Insert zero coefficients for missing variables. Rewrite as:

Visualizing the Mapping

System of Equations \( 2x + 3y = 7 \) \( x - 4y = 5 \) \( 3x + y = -2 \) extract 2 3 1 -4 3 1 x y = 7 5 -2 \( A \) \( \vec{x} \) \( \vec{b} \) Each row of A comes from one equation's coefficients Each entry in \( \vec{b} \) comes from the right-hand side

Reverse: Matrix to System

You can also go backwards: given a matrix equation, recover the system of equations by multiplying out each row.

1
Row 1 \( \cdot \) \( \vec{x} \): \( 1 \cdot x + (-3) \cdot y = 5 \), so \( x - 3y = 5 \)
2
Row 2 \( \cdot \) \( \vec{x} \): \( 4 \cdot x + 2 \cdot y = -8 \), so \( 4x + 2y = -8 \)

Common Mistakes to Avoid

✕ Forgetting Zero Coefficients
If a variable is missing from an equation, its coefficient is 0, not omitted. Skipping it shifts all entries and corrupts the matrix.
✕ Swapping Variable Order
The variable vector must use the same order as the columns of \( A \). If column 1 is \( x \), column 2 must be \( y \), not \( z \).
✕ Mixing Up Signs
Subtraction means a negative coefficient: in \( 3x - 5y = 2 \), the coefficient of \( y \) is \( -5 \), not \( 5 \).

Summary: Putting It All Together

Component Symbol Size Contains
Coefficient Matrix \( A \) \( m \times n \) Coefficients of each variable
Variable Vector \( \vec{x} \) \( n \times 1 \) Unknowns: \( x, y, z, \ldots \)
Constant Vector \( \vec{b} \) \( m \times 1 \) Right-hand side constants
Matrix Equation \( A\vec{x} = \vec{b} \) --- Entire system in one line

Question 1 of 5

Which matrix equation represents the system
\( \begin{cases} 3x + y = 7 \\ 2x - 4y = -1 \end{cases} \)?

Question 2 of 5

For the system \( \begin{cases} x - 2y + z = 3 \\ 4y - z = 0 \\ 2x + y = 5 \end{cases} \), what is the coefficient matrix \( A \)?

Question 3 of 5

The matrix equation \( \begin{bmatrix} 2 & -1 \\ 0 & 5 \end{bmatrix} \begin{bmatrix} x \\ y \end{bmatrix} = \begin{bmatrix} 9 \\ 15 \end{bmatrix} \) represents which system?

Question 4 of 5

A system of \(4\) equations in \(3\) unknowns would produce a coefficient matrix \( A \) of what size?

Question 5 of 5

In the equation \( A\vec{x} = \vec{b} \), the number of columns of \( A \) must equal which of the following?