We have been writing systems as combinations of columns. A matrix-vector product packs that into two symbols. It is the single most important definition in the course.
If $A$ is $m \times n$ with columns $\mathbf{a}_1, \dots, \mathbf{a}_n$, and $\mathbf{x}$ is in $\mathbb{R}^n$, then $$A\mathbf{x} = x_1\mathbf{a}_1 + x_2\mathbf{a}_2 + \cdots + x_n\mathbf{a}_n.$$ The entries of $\mathbf{x}$ are the weights on the columns. So $\mathbf{x}$ must have exactly one entry per column of $A$, and the result lives in $\mathbb{R}^m$, like the columns.
Worked example: Two ways to compute Ax
- By columns: $3\begin{bmatrix} 1 \\ 0 \end{bmatrix} + 1\begin{bmatrix} 2 \\ -3 \end{bmatrix} + 2\begin{bmatrix} -1 \\ 4 \end{bmatrix}$ $= \begin{bmatrix} 3 \\ 0 \end{bmatrix} + \begin{bmatrix} 2 \\ -3 \end{bmatrix} + \begin{bmatrix} -2 \\ 8 \end{bmatrix}$ $= \begin{bmatrix} 3 \\ 5 \end{bmatrix}$.
- By rows (faster by hand): entry $i$ is row $i$ of $A$ times $\mathbf{x}$, entry by entry, added up. Entry 1: $(1)(3) + (2)(1) + (-1)(2)$ $= 3$. Entry 2: $(0)(3) + (-3)(1) + (4)(2)$ $= 5$.
- Both give $\begin{bmatrix} 3 \\ 5 \end{bmatrix}$: $A$ is $2 \times 3$, $\mathbf{x}$ has 3 entries, and $A\mathbf{x}$ has 2.
Answer: $\begin{bmatrix} 3 \\ 5 \end{bmatrix}$
So one system has three equivalent forms: a list of equations, a vector equation $x_1\mathbf{a}_1 + \cdots + x_n\mathbf{a}_n = \mathbf{b}$, and the matrix equation $A\mathbf{x} = \mathbf{b}$. All three have the same solutions, and $A\mathbf{x} = \mathbf{b}$ has a solution exactly when $\mathbf{b}$ is in the span of the columns of $A$.
Why it works
One matrix deserves a name now. The identity matrix $I_n$ has $1$s on the diagonal and $0$s elsewhere, so its columns are $\mathbf{e}_1, \dots, \mathbf{e}_n$, and $I_n\mathbf{x} = x_1\mathbf{e}_1 + \cdots + x_n\mathbf{e}_n = \mathbf{x}$ for every $\mathbf{x}$. Likewise $A\mathbf{e}_j$ is simply column $j$ of $A$: a handy way to pull out a column.
Worked example: From a system to Ax = b
- Unknowns $x_1, x_2, x_3$ give three columns; a missing unknown gets a $0$.
- $\begin{bmatrix} 3 & -1 & 0 \\ 1 & 0 & 5 \end{bmatrix}\begin{bmatrix} x_1 \\ x_2 \\ x_3 \end{bmatrix}$ $= \begin{bmatrix} 4 \\ 0 \end{bmatrix}$.
Answer: $A = \begin{bmatrix} 3 & -1 & 0 \\ 1 & 0 & 5 \end{bmatrix}$, $\mathbf{b} = \begin{bmatrix} 4 \\ 0 \end{bmatrix}$
Common mistake
Key idea