← MATH 231 MathScape 0 MATH231

The Matrix Equation Ax = b

10 min read

Before The product Ax is a combination of the columns of A, so this lesson rests on span and on row reduction. Builds on: Vector Equations and the Span · Systems of Linear Equations and Row Reduction

Next The matrix equation is the language of the rest of the course: solution sets, independence, transformations, inverses, and subspaces. Leads to: Solution Sets of Linear Systems and Free Variables · Linear Independence · Linear Transformations and Their Matrices · Matrix Operations and Invertibility · Vector Spaces and Subspaces

Jump to a section
Reference: Lay, Linear Algebra and Its Applications, Section 1.4: The Matrix Equation Ax = b

Video: Dr Lynch’s MATH 231 lectures (YouTube playlists)

The Matrix Equation $Ax = \mathbf{b}$

Before You Start: Prerequisite Check

Can you do these? (Click to reveal self-test)

Test yourself on these prerequisite skills:

  1. Span test: How do you determine whether a vector $\mathbf{b}$ is in $\text{Span}\{\mathbf{v}_1, \mathbf{v}_2\}$?

    Check

    Row-reduce the augmented matrix $[\mathbf{v}_1 \; \mathbf{v}_2 \mid \mathbf{b}]$. If the system is consistent, $\mathbf{b}$ is in the span. If not, it is not.

  2. Linear combination: Compute $3\begin{pmatrix}1\\0\\-1\end{pmatrix} + (-2)\begin{pmatrix}2\\1\\3\end{pmatrix}$.

    Check

    \[ \begin{pmatrix}3\\0\\-3\end{pmatrix} + \begin{pmatrix}-4\\-2\\-6\end{pmatrix} = \begin{pmatrix}-1\\-2\\-9\end{pmatrix} \]

  3. Row reduction: What does a pivot in every row of a coefficient matrix tell you?

    Check

    If every row of the coefficient matrix contains a pivot, the system $A\mathbf{x} = \mathbf{b}$ is consistent for every right-hand side $\mathbf{b}$.

If you struggled: Review Vector Equations and Span and Systems and Row Reduction.


Try This First

Compute the matrix-vector product $A\mathbf{x}$ using the method you already know (row by row):

\[ A = \begin{pmatrix}2&1\\-1&3\end{pmatrix}, \quad \mathbf{x} = \begin{pmatrix}2\\1\end{pmatrix} \]

Once you have the answer, recompute it a different way: $2$ times column 1 of $A$ plus $1$ times column 2 of $A$.

Do both methods give the same result?

Show Solution

Row-by-row: \[ A\mathbf{x} = \begin{pmatrix}2(2)+1(1) \\ -1(2)+3(1)\end{pmatrix} = \begin{pmatrix}5\\1\end{pmatrix} \]

Column combination: \[ 2\begin{pmatrix}2\\-1\end{pmatrix} + 1\begin{pmatrix}1\\3\end{pmatrix} = \begin{pmatrix}4\\-2\end{pmatrix} + \begin{pmatrix}1\\3\end{pmatrix} = \begin{pmatrix}5\\1\end{pmatrix} \]

Both give $\begin{pmatrix}5\\1\end{pmatrix}$.

The column view is the main idea of this section: $A\mathbf{x}$ is always a linear combination of the columns of $A$, with the entries of $\mathbf{x}$ as scalars. The row-by-row calculation gives the same numbers. The column view also shows the geometry.


Two Views of $Ax$

The matrix-vector product $A\mathbf{x}$ can be understood two ways, both of which are correct.

Row view: The $i$th entry of $A\mathbf{x}$ is the dot product of the $i$th row of $A$ with $\mathbf{x}$.

Column view: $A\mathbf{x}$ is a linear combination of the columns of $A$, with the entries of $\mathbf{x}$ as the scalars:

\[ A\mathbf{x} = x_1 \mathbf{a}_1 + x_2 \mathbf{a}_2 + \cdots + x_n \mathbf{a}_n \]

where $\mathbf{a}_1, \ldots, \mathbf{a}_n$ are the columns of $A$ and $x_1, \ldots, x_n$ are the entries of $\mathbf{x}$.

The column view unifies three problems that look different on the surface:

Problem Form Underlying Question
System: $a_{11}x_1 + \cdots = b_1$, etc. Is there a solution?
Vector equation: $x_1\mathbf{a}_1 + \cdots = \mathbf{b}$ Is $\mathbf{b}$ in the span?
Matrix equation: $A\mathbf{x} = \mathbf{b}$ Is $\mathbf{b}$ in the column space of $A$?

All three ask the same question. The matrix equation is the most compact notation.


Prerequisite Map


Quick Reference

Property Value
Course MATH 231
Difficulty Intermediate
Time ~30 minutes
Source Lay, Linear Algebra and Its Applications, Section 1.4

Definition

If $A$ is an $m \times n$ matrix with columns $\mathbf{a}_1, \ldots, \mathbf{a}_n$ and $\mathbf{x} \in \mathbb{R}^n$, then:

\[ A\mathbf{x} = x_1\mathbf{a}_1 + x_2\mathbf{a}_2 + \cdots + x_n\mathbf{a}_n \]

Requirement: The number of columns of $A$ must equal the number of entries of $\mathbf{x}$.


Key Concepts

The Column Combination Definition

When $A$ is $m \times n$ and $\mathbf{x} \in \mathbb{R}^n$, the product $A\mathbf{x}$ is defined by:

\[ A\mathbf{x} = \begin{pmatrix} | & | & & | \\ \mathbf{a}_1 & \mathbf{a}_2 & \cdots & \mathbf{a}_n \\ | & | & & | \end{pmatrix} \begin{pmatrix}x_1\\x_2\\\vdots\\x_n\end{pmatrix} = x_1\mathbf{a}_1 + x_2\mathbf{a}_2 + \cdots + x_n\mathbf{a}_n \]

The result is a vector in $\mathbb{R}^m$.

Worked example:

Let $A = \begin{pmatrix}1&2\\-1&3\\0&1\end{pmatrix}$ and $\mathbf{x} = \begin{pmatrix}3\\-1\end{pmatrix}$.

\[ A\mathbf{x} = 3\begin{pmatrix}1\\-1\\0\end{pmatrix} + (-1)\begin{pmatrix}2\\3\\1\end{pmatrix} = \begin{pmatrix}3\\-3\\0\end{pmatrix} + \begin{pmatrix}-2\\-3\\-1\end{pmatrix} = \begin{pmatrix}1\\-6\\-1\end{pmatrix} \]

Verify via row view: Row 1: $1(3)+2(-1)=1$; Row 2: $-1(3)+3(-1)=-6$; Row 3: $0(3)+1(-1)=-1$. Agrees.

Source: Lay, Linear Algebra and Its Applications, Section 1.4: The Matrix Equation Ax = b.

The Column Space

The column space of $A$, written $\text{Col}(A)$, is the span of the columns of $A$:

\[ \text{Col}(A) = \text{Span}\{\mathbf{a}_1, \mathbf{a}_2, \ldots, \mathbf{a}_n\} \]

It is the set of all vectors of the form $A\mathbf{x}$: every target reachable by some choice of $\mathbf{x}$.

Key question: Is $\mathbf{b}$ in $\text{Col}(A)$? Equivalently, does $A\mathbf{x} = \mathbf{b}$ have a solution? These are the same question, and row reduction on $[A \mid \mathbf{b}]$ answers it.

The Existence Theorem

Theorem (Lay, Section 1.4): The following statements are equivalent for an $m \times n$ matrix $A$:

  1. For every $\mathbf{b}$ in $\mathbb{R}^m$, the equation $A\mathbf{x} = \mathbf{b}$ has a solution.
  2. Every $\mathbf{b}$ in $\mathbb{R}^m$ is a linear combination of the columns of $A$.
  3. The columns of $A$ span $\mathbb{R}^m$.
  4. $A$ has a pivot position in every row.

Consequence: If $A$ has any row without a pivot, then there exist right-hand sides $\mathbf{b}$ for which the equation $A\mathbf{x} = \mathbf{b}$ has no solution. That “impossible $\mathbf{b}$” is not in $\text{Col}(A)$.

Algebraic Properties of the Product

For an $m \times n$ matrix $A$ and vectors $\mathbf{u}, \mathbf{v} \in \mathbb{R}^n$ and scalar $c$:

\[ A(\mathbf{u} + \mathbf{v}) = A\mathbf{u} + A\mathbf{v}, \quad A(c\mathbf{u}) = c(A\mathbf{u}) \]

These properties follow from the column combination definition and will become central when linear transformations are studied.


Common Pitfalls

Mistake Why It Is Wrong Correct Approach
Computing $A\mathbf{x}$ using only the row view without the column insight The row view gives the numbers but misses the geometric meaning Practice writing $A\mathbf{x}$ as a column combination to build geometric intuition
Concluding $A\mathbf{x} = \mathbf{b}$ is solvable for any $\mathbf{b}$ Only guaranteed when $A$ has a pivot in every row Row-reduce $A$ alone to count pivot rows
Attempting to “divide both sides by $A$” Matrix division is not defined; only matrix inverses exist, and only for square invertible matrices Row-reduce $[A \mid \mathbf{b}]$ to find solutions
Writing $\mathbf{x} A$ instead of $A\mathbf{x}$ Matrix-vector products are not commutative; $\mathbf{x} A$ is often not even defined Always write $A$ on the left and $\mathbf{x}$ on the right
Why $A\mathbf{x} = \mathbf{b}$ May Have No Solution

Consider $A = \begin{pmatrix}1&2\\2&4\end{pmatrix}$ and $\mathbf{b} = \begin{pmatrix}1\\3\end{pmatrix}$.

Row-reduce $[A \mid \mathbf{b}]$:

$R_2 \to R_2 - 2R_1$: \[ \left[\begin{array}{rr|r}1&2&1\\0&0&1\end{array}\right] \]

Row 2 reads $0 = 1$: inconsistent. So $\mathbf{b} = \begin{pmatrix}1\\3\end{pmatrix}$ is not in $\text{Col}(A)$.

Why? Both columns of $A$ are multiples of $\begin{pmatrix}1\\2\end{pmatrix}$, so the column space is the line $\{t\begin{pmatrix}1\\2\end{pmatrix} \mid t \in \mathbb{R}\}$. The vector $\begin{pmatrix}1\\3\end{pmatrix}$ does not lie on this line.


Practice Problems

Level 1 Compute the Product

Compute $A\mathbf{x}$ using the column combination view.

\[ A = \begin{pmatrix}3&-1\\0&2\\-2&4\end{pmatrix}, \quad \mathbf{x} = \begin{pmatrix}-1\\3\end{pmatrix} \]

Also verify your result using the row-by-row method.

Thought Process

Column view: $A\mathbf{x} = (-1)\mathbf{a}_1 + 3\mathbf{a}_2$ where $\mathbf{a}_1$ is the first column and $\mathbf{a}_2$ is the second column.

Scale each column and add.

Show Answer

Column combination: \[ (-1)\begin{pmatrix}3\\0\\-2\end{pmatrix} + 3\begin{pmatrix}-1\\2\\4\end{pmatrix} = \begin{pmatrix}-3\\0\\2\end{pmatrix} + \begin{pmatrix}-3\\6\\12\end{pmatrix} = \begin{pmatrix}-6\\6\\14\end{pmatrix} \]

Row-by-row verification:

  • Row 1: $3(-1)+(-1)(3) = -3-3 = -6$
  • Row 2: $0(-1)+2(3) = 0+6 = 6$
  • Row 3: $-2(-1)+4(3) = 2+12 = 14$

Both methods give $\begin{pmatrix}-6\\6\\14\end{pmatrix}$.

Level 2 Write the Matrix Equation

Write the following system as a matrix equation $A\mathbf{x} = \mathbf{b}$. Identify $A$, $\mathbf{x}$, and $\mathbf{b}$ explicitly.

\[ \begin{cases} 2x_1 - x_2 + 4x_3 = 6 \\ x_1 + 3x_2 - x_3 = -2 \\ 5x_1 + 2x_3 = 0 \end{cases} \]

Thought Process

Each row of $A$ comes from the coefficients in one equation. The vector $\mathbf{x}$ holds the unknowns $x_1, x_2, x_3$. The vector $\mathbf{b}$ holds the right-hand sides. Note: the coefficient of $x_2$ in equation 3 is $0$.

Show Answer

\[ A = \begin{pmatrix}2&-1&4\\1&3&-1\\5&0&2\end{pmatrix}, \quad \mathbf{x} = \begin{pmatrix}x_1\\x_2\\x_3\end{pmatrix}, \quad \mathbf{b} = \begin{pmatrix}6\\-2\\0\end{pmatrix} \]

Matrix equation: \[ \begin{pmatrix}2&-1&4\\1&3&-1\\5&0&2\end{pmatrix}\begin{pmatrix}x_1\\x_2\\x_3\end{pmatrix} = \begin{pmatrix}6\\-2\\0\end{pmatrix} \]

Level 3 Is $\mathbf{b}$ in the Column Space?

Is $\mathbf{b} = \begin{pmatrix}1\\1\\2\end{pmatrix}$ in $\text{Col}(A)$ where $A = \begin{pmatrix}1&1\\1&2\\0&1\end{pmatrix}$?

If yes, express $\mathbf{b}$ as a linear combination of the columns of $A$. If no, explain what the row reduction reveals.

Thought Process

Row-reduce $[A \mid \mathbf{b}]$. Look at the bottom row after reduction: if it reads $[0 \; 0 \mid c]$ with $c \neq 0$, the system is inconsistent and $\mathbf{b}$ is not in $\text{Col}(A)$.

Show Answer

Augmented matrix $[A \mid \mathbf{b}]$: \[ \left[\begin{array}{rr|r}1&1&1\\1&2&1\\0&1&2\end{array}\right] \]

$R_2 \to R_2 - R_1$: \[ \left[\begin{array}{rr|r}1&1&1\\0&1&0\\0&1&2\end{array}\right] \]

$R_3 \to R_3 - R_2$: \[ \left[\begin{array}{rr|r}1&1&1\\0&1&0\\0&0&2\end{array}\right] \]

Row 3 reads $0 = 2$: inconsistent. $\mathbf{b}$ is NOT in $\text{Col}(A)$.

The third row tells us that no combination of the two columns of $A$ can produce a third component of $2$ while simultaneously satisfying the first two equations. The column space of $A$ is a plane (two columns, neither a multiple of the other, both in $\mathbb{R}^3$), and $\mathbf{b}$ does not lie in that plane.

Level 4 Does $A\mathbf{x} = \mathbf{b}$ Have a Solution for Every $\mathbf{b}$?

Let $A = \begin{pmatrix}1&0&3\\2&1&-1\end{pmatrix}$.

(a) Row-reduce $A$ alone (not an augmented matrix). How many pivots does $A$ have?

(b) Does $A$ have a pivot in every row? What does this tell you about $A\mathbf{x} = \mathbf{b}$?

(c) Give a specific $\mathbf{b} \in \mathbb{R}^2$ and find one solution $\mathbf{x}$ to $A\mathbf{x} = \mathbf{b}$.

Thought Process

Row-reduce $A$ to echelon form without an augmented column. Count the pivot positions.

Then apply the existence theorem: if every row has a pivot, the column space is all of $\mathbb{R}^m$.

For part (c), choose any specific $\mathbf{b}$ and row-reduce $[A \mid \mathbf{b}]$ to find $\mathbf{x}$.

Show Answer

(a) Row-reduce $A$:

$R_2 \to R_2 - 2R_1$: \[ \begin{pmatrix}1&0&3\\0&1&-7\end{pmatrix} \]

Pivots in columns 1 and 2: 2 pivots.

(b) $A$ is $2 \times 3$ with 2 rows, both containing pivots. So $A$ has a pivot in every row. By the existence theorem, $A\mathbf{x} = \mathbf{b}$ has at least one solution for every $\mathbf{b} \in \mathbb{R}^2$.

(c) Choose $\mathbf{b} = \begin{pmatrix}4\\1\end{pmatrix}$. Augmented matrix:

\[ \left[\begin{array}{rrr|r}1&0&3&4\\2&1&-1&1\end{array}\right] \]

$R_2 \to R_2 - 2R_1$: \[ \left[\begin{array}{rrr|r}1&0&3&4\\0&1&-7&-7\end{array}\right] \]

This is already RREF. Column 3 is free; set $x_3 = 0$. Then $x_2 = -7$ and $x_1 = 4$.

One solution: $\mathbf{x} = \begin{pmatrix}4\\-7\\0\end{pmatrix}$.

Verify: $A\mathbf{x} = 4\begin{pmatrix}1\\2\end{pmatrix} + (-7)\begin{pmatrix}0\\1\end{pmatrix} + 0\begin{pmatrix}3\\-1\end{pmatrix} = \begin{pmatrix}4\\8\end{pmatrix} + \begin{pmatrix}0\\-7\end{pmatrix} = \begin{pmatrix}4\\1\end{pmatrix}$ (correct).

Level 5 Characterize the Column Space

Let $A = \begin{pmatrix}1&-1\\2&-2\\-1&1\end{pmatrix}$.

(a) Row-reduce $[A \mid \mathbf{b}]$ with $\mathbf{b} = \begin{pmatrix}b_1\\b_2\\b_3\end{pmatrix}$ left as symbols. Determine the condition(s) on $b_1, b_2, b_3$ for $A\mathbf{x} = \mathbf{b}$ to be consistent.

(b) Describe $\text{Col}(A)$ geometrically.

Thought Process

Form the augmented matrix with symbolic entries. Row-reduce, and collect the conditions that make the bottom rows read $0 = 0$ rather than $0 = c$ with $c \neq 0$.

For part (b): what is the rank of $A$? How many linearly independent columns does $A$ have? The answer determines the geometric dimension.

Show Answer

(a) Augmented matrix: \[ \left[\begin{array}{rr|r}1&-1&b_1\\2&-2&b_2\\-1&1&b_3\end{array}\right] \]

$R_2 \to R_2 - 2R_1$: \[ \left[\begin{array}{rr|r}1&-1&b_1\\0&0&b_2-2b_1\\-1&1&b_3\end{array}\right] \]

$R_3 \to R_3 + R_1$: \[ \left[\begin{array}{rr|r}1&-1&b_1\\0&0&b_2-2b_1\\0&0&b_3+b_1\end{array}\right] \]

For consistency, both $b_2 - 2b_1 = 0$ and $b_3 + b_1 = 0$ must hold:

\[ b_2 = 2b_1 \quad \text{and} \quad b_3 = -b_1 \]

(b) The two columns of $A$ are $\begin{pmatrix}1\\2\\-1\end{pmatrix}$ and $\begin{pmatrix}-1\\-2\\1\end{pmatrix} = -\begin{pmatrix}1\\2\\-1\end{pmatrix}$. The second column is $-1$ times the first: they are linearly dependent. The column space is therefore:

\[ \text{Col}(A) = \text{Span}\left\{\begin{pmatrix}1\\2\\-1\end{pmatrix}\right\} \]

Geometrically, $\text{Col}(A)$ is a line through the origin in $\mathbb{R}^3$, in the direction $\begin{pmatrix}1\\2\\-1\end{pmatrix}$. Only vectors of the form $t\begin{pmatrix}1\\2\\-1\end{pmatrix}$ can be produced by $A\mathbf{x}$.


Common Misconceptions

Common misconception

the row view of $A\mathbf{x}$ is the only or primary way to understand the product. The row-by-row dot product computes the right numbers, but it conceals the geometry. The column combination view reveals that $A\mathbf{x}$ is a vector in the column space of $A$, which is the central fact behind existence of solutions, the column space, and linear transformations. Both views are valid computations; the column view is the one that generalizes.

Common misconception

$A\mathbf{x} = \mathbf{b}$ is solved by computing $A^{-1}\mathbf{b}$. The formula $\mathbf{x} = A^{-1}\mathbf{b}$ applies only when $A$ is square and invertible. For rectangular matrices, or square matrices that are not invertible, there is no inverse to use. The general method is always row reduction of the augmented matrix $[A \mid \mathbf{b}]$.

Common misconception

$A\mathbf{x} = \mathbf{b}$ always has a solution. The system has a solution for a given $\mathbf{b}$ only when $\mathbf{b}$ lies in the column space of $A$. If $A$ has a row without a pivot, then some right-hand sides $\mathbf{b}$ will not be in the column space. A specific $\mathbf{b}$ is in the column space exactly when row-reducing $[A \mid \mathbf{b}]$ produces no contradiction row.


Mastery Checklist

Novice (Level 1-2):

Competent (Level 3-4):

Proficient (Level 5):


Mental Model

The Projector Screen

Imagine each column of $A$ as a “dial” that controls a direction in $\mathbb{R}^m$. The vector $\mathbf{x}$ holds the settings for all the dials. The product $A\mathbf{x}$ is the result: a point in $\mathbb{R}^m$ obtained by combining the directions in the proportions given by $\mathbf{x}$.

The column space is the screen: the set of all points the projector can reach. If your target $\mathbf{b}$ falls on the screen, there exist settings $\mathbf{x}$ that project to it. If $\mathbf{b}$ is off the screen, no settings work.

Row reduction checks whether $\mathbf{b}$ is on the screen. The Existence Theorem tells you whether the screen covers all of $\mathbb{R}^m$ or only a subspace.


Connections

Looking ahead in MATH 231:

Real-world connections:

Source: Lay, Linear Algebra and Its Applications, Section 1.4: The Matrix Equation Ax = b.



Last updated: 2026-06-16

Watch and Read