2: Solving Linear Systems Solving a linear system means finding a recipe that produces a target dish.
The Kitchen Metaphor Applied
Ingredients : Matrix columns
Target dish : The vector b \mathbf{b} b
Your task : Find the quantities (the solution x \mathbf{x} x )
Three possible outcomes:
Exactly one recipe works
Infinitely many ways to hit the target
Impossible โ the ingredients you have canโt produce that flavor
Row reduction is the universal algorithm for answering โdoes a solution exist, and if so, what is it?โ Itโs mechanical, systematic, and reveals everything about the systemโs structure. This is the computational heart of linear algebra.
Systems of Linear Equations
(What is a Linear System?)
A system of linear equations looks like:
{ a 11 x 1 + a 12 x 2 + โฏ + a 1 n x n = b 1 a 21 x 1 + a 22 x 2 + โฏ + a 2 n x n = b 2 โฎ a m 1 x 1 + a m 2 x 2 + โฏ + a m n x n = b m \begin{cases}
a_{11}x_1 + a_{12}x_2 + \cdots + a_{1n}x_n = b_1 \\
a_{21}x_1 + a_{22}x_2 + \cdots + a_{2n}x_n = b_2 \\
\vdots \\
a_{m1}x_1 + a_{m2}x_2 + \cdots + a_{mn}x_n = b_m
\end{cases} โฉ โจ โง โ a 11 โ x 1 โ + a 12 โ x 2 โ + โฏ + a 1 n โ x n โ = b 1 โ a 21 โ x 1 โ + a 22 โ x 2 โ + โฏ + a 2 n โ x n โ = b 2 โ โฎ a m 1 โ x 1 โ + a m 2 โ x 2 โ + โฏ + a mn โ x n โ = b m โ โ
This is the same as the matrix equation:
A x = b A\mathbf{x} = \mathbf{b} A x = b
where A A A is the m ร n m \times n m ร n coefficient matrix , x \mathbf{x} x is the vector of unknowns, and b \mathbf{b} b is the target vector.
(Geometric Interpretation)
Each equation represents a hyperplane in R n \mathbb{R}^n R n . Solving the system means finding where all these hyperplanes intersect.
In R 2 \mathbb{R}^2 R 2 : Each equation is a line. The solution is where the lines meet.
Two lines typically intersect at one point (unique solution)
Parallel lines never meet (no solution)
The same line counted twice (infinitely many solutions)
In R 3 \mathbb{R}^3 R 3 : Each equation is a plane. The solution is where all planes meet,a point, a line, a plane, or nothing.
In higher dimensions: Same idea, harder to visualize.
(Consistency)
A system is consistent if it has at least one solution. Otherwise itโs inconsistent (no solution exists).
Example of inconsistent system:
{ x + y = 1 x + y = 2 \begin{cases}
x + y = 1 \\
x + y = 2
\end{cases} { x + y = 1 x + y = 2 โ
These are parallel lines,they never intersect. No ( x , y ) (x, y) ( x , y ) satisfies both equations.
The Augmented Matrix
To solve A x = b A\mathbf{x} = \mathbf{b} A x = b , we work with the augmented matrix :
[ A โฃ b ] [A \mid \mathbf{b}] [ A โฃ b ]
This glues the coefficient matrix and the target vector together. Row operations apply to both simultaneously.
Example:
{ x + 2 y = 5 3 x + 4 y = 11 โถ [ 1 2 5 3 4 11 ] \begin{cases}
x + 2y = 5 \\
3x + 4y = 11
\end{cases}
\quad \longrightarrow \quad
\left[\begin{array}{cc|c}
1 & 2 & 5 \\
3 & 4 & 11
\end{array}\right] { x + 2 y = 5 3 x + 4 y = 11 โ โถ [ 1 3 โ 2 4 โ 5 11 โ ]
(Pivots)
The pivot of a row is its leftmost nonzero entry.
Example:
[ 2 1 3 0 โ 1 4 0 0 5 ] \begin{bmatrix}
\boxed{2} & 1 & 3 \\
0 & \boxed{-1} & 4 \\
0 & 0 & \boxed{5}
\end{bmatrix} โ 2 โ 0 0 โ 1 โ 1 โ 0 โ 3 4 5 โ โ โ
The pivots are 2 2 2 , โ 1 -1 โ 1 , and 5 5 5 .
A matrix is in row echelon form if:
All zero rows are at the bottom
Each pivot is to the right of the pivot in the row above
Examples:
[ 1 2 3 0 5 7 0 0 2 ] [ 3 1 4 1 0 2 7 8 0 0 0 0 ] \begin{bmatrix}
\boxed{1} & 2 & 3 \\
0 & \boxed{5} & 7 \\
0 & 0 & \boxed{2}
\end{bmatrix}
\quad
\begin{bmatrix}
\boxed{3} & 1 & 4 & 1 \\
0 & \boxed{2} & 7 & 8 \\
0 & 0 & 0 & 0
\end{bmatrix} โ 1 โ 0 0 โ 2 5 โ 0 โ 3 7 2 โ โ โ โ 3 โ 0 0 โ 1 2 โ 0 โ 4 7 0 โ 1 8 0 โ โ
Both are in REF,pivots descend in a โstaircaseโ pattern.
A matrix is in reduced row echelon form if:
Itโs in REF
Every pivot equals 1 1 1
Every pivot is the only nonzero entry in its column
Examples:
[ 1 0 0 0 1 0 0 0 1 ] [ 1 0 2 0 0 1 3 0 0 0 0 1 ] \begin{bmatrix}
\boxed{1} & 0 & 0 \\
0 & \boxed{1} & 0 \\
0 & 0 & \boxed{1}
\end{bmatrix}
\quad
\begin{bmatrix}
\boxed{1} & 0 & 2 & 0 \\
0 & \boxed{1} & 3 & 0 \\
0 & 0 & 0 & \boxed{1}
\end{bmatrix} โ 1 โ 0 0 โ 0 1 โ 0 โ 0 0 1 โ โ โ โ 1 โ 0 0 โ 0 1 โ 0 โ 2 3 0 โ 0 0 1 โ โ โ
RREF is unique,every matrix has exactly one RREF.
Row Operations
Three operations preserve solutions:
Row swap: Exchange two rows
Row scaling: Multiply a row by a nonzero scalar
Row replacement: Add a multiple of one row to another
Key fact: If you row-reduce [ A โฃ b ] [A \mid \mathbf{b}] [ A โฃ b ] to [ rref ( A ) โฃ b โฒ ] [\text{rref}(A) \mid \mathbf{b}'] [ rref ( A ) โฃ b โฒ ] , the solutions donโt change. The systems A x = b A\mathbf{x} = \mathbf{b} A x = b and rref ( A ) x = b โฒ \text{rref}(A)\mathbf{x} = \mathbf{b}' rref ( A ) x = b โฒ are equivalent.
(Example: Row Reduction)
Solve:
{ x + 2 y + z = 3 2 x + 4 y + 3 z = 8 x + 2 y + 2 z = 5 \begin{cases}
x + 2y + z = 3 \\
2x + 4y + 3z = 8 \\
x + 2y + 2z = 5
\end{cases} โฉ โจ โง โ x + 2 y + z = 3 2 x + 4 y + 3 z = 8 x + 2 y + 2 z = 5 โ
Augmented matrix:
[ 1 2 1 3 2 4 3 8 1 2 2 5 ] \left[\begin{array}{ccc|c}
1 & 2 & 1 & 3 \\
2 & 4 & 3 & 8 \\
1 & 2 & 2 & 5
\end{array}\right] โ 1 2 1 โ 2 4 2 โ 1 3 2 โ 3 8 5 โ โ
Step 1: R 2 โ 2 R 1 R_2 - 2R_1 R 2 โ โ 2 R 1 โ , R 3 โ R 1 R_3 - R_1 R 3 โ โ R 1 โ :
[ 1 2 1 3 0 0 1 2 0 0 1 2 ] \left[\begin{array}{ccc|c}
1 & 2 & 1 & 3 \\
0 & 0 & 1 & 2 \\
0 & 0 & 1 & 2
\end{array}\right] โ 1 0 0 โ 2 0 0 โ 1 1 1 โ 3 2 2 โ โ
Step 2: R 3 โ R 2 R_3 - R_2 R 3 โ โ R 2 โ :
[ 1 2 1 3 0 0 1 2 0 0 0 0 ] \left[\begin{array}{ccc|c}
1 & 2 & 1 & 3 \\
0 & 0 & 1 & 2 \\
0 & 0 & 0 & 0
\end{array}\right] โ 1 0 0 โ 2 0 0 โ 1 1 0 โ 3 2 0 โ โ
Step 3: R 1 โ R 2 R_1 - R_2 R 1 โ โ R 2 โ :
[ 1 2 0 1 0 0 1 2 0 0 0 0 ] \left[\begin{array}{ccc|c}
1 & 2 & 0 & 1 \\
0 & 0 & 1 & 2 \\
0 & 0 & 0 & 0
\end{array}\right] โ 1 0 0 โ 2 0 0 โ 0 1 0 โ 1 2 0 โ โ
This is RREF. Now read off the solution.
Variables: Basic and Free
(Basic Variables)
A variable x i x_i x i โ is basic if column i i i of rref ( A ) \text{rref}(A) rref ( A ) contains a pivot.
(Free Variables)
A variable x i x_i x i โ is free if column i i i of rref ( A ) \text{rref}(A) rref ( A ) has no pivot.
In the example above:
x x x and z z z are basic (columns 1 and 3 have pivots)
y y y is free (column 2 has no pivot)
Free variables can take any value ,they parameterize the solution set.
(General Solution)
From the RREF:
{ x + 2 y = 1 z = 2 \begin{cases}
x + 2y = 1 \\
z = 2
\end{cases} { x + 2 y = 1 z = 2 โ
Solve for basic variables in terms of free variables:
{ x = 1 โ 2 y z = 2 y = t (free) \begin{cases}
x = 1 - 2y \\
z = 2 \\
y = t \quad \text{(free)}
\end{cases} โฉ โจ โง โ x = 1 โ 2 y z = 2 y = t (free) โ
Solution set:
x = [ 1 โ 2 t t 2 ] = [ 1 0 2 ] + t [ โ 2 1 0 ] , t โ R \mathbf{x} = \begin{bmatrix} 1 - 2t \\ t \\ 2 \end{bmatrix} = \begin{bmatrix} 1 \\ 0 \\ 2 \end{bmatrix} + t\begin{bmatrix} -2 \\ 1 \\ 0 \end{bmatrix}, \quad t \in \mathbb{R} x = โ 1 โ 2 t t 2 โ โ = โ 1 0 2 โ โ + t โ โ 2 1 0 โ โ , t โ R
This is a line in R 3 \mathbb{R}^3 R 3 ,infinitely many solutions parameterized by t t t .
The RouchรฉโCapelli Theorem
This theorem tells you how many solutions exist by looking at the RREF.
Let:
[ A โฃ b ] [A \mid \mathbf{b}] [ A โฃ b ] be the augmented matrix
A A A be the coefficient matrix (without b \mathbf{b} b )
(Inconsistent System: No Solutions)
The system is inconsistent if and only if:
The last column of rref ( [ A โฃ b ] ) \text{rref}([A \mid \mathbf{b}]) rref ([ A โฃ b ]) has a pivot.
This means you get a row like:
[ 0 โ
โ 0 โ
โ 0 โ
โ โฏ โ
โ 0 โฃ 1 ] [0 \; 0 \; 0 \; \cdots \; 0 \mid 1] [ 0 0 0 โฏ 0 โฃ 1 ]
This says 0 = 1 0 = 1 0 = 1 ,impossible.
Example:
[ 1 2 3 2 4 7 ] โ R 2 โ 2 R 1 [ 1 2 3 0 0 1 ] \left[\begin{array}{cc|c}
1 & 2 & 3 \\
2 & 4 & 7
\end{array}\right]
\xrightarrow{R_2 - 2R_1}
\left[\begin{array}{cc|c}
1 & 2 & 3 \\
0 & 0 & 1
\end{array}\right] [ 1 2 โ 2 4 โ 3 7 โ ] R 2 โ โ 2 R 1 โ โ [ 1 0 โ 2 0 โ 3 1 โ ]
Last column has a pivot,no solution.
(Unique Solution)
The system has exactly one solution if and only if:
Last column of rref ( [ A โฃ b ] ) \text{rref}([A \mid \mathbf{b}]) rref ([ A โฃ b ]) has no pivot, AND
Every column of rref ( A ) \text{rref}(A) rref ( A ) has a pivot
Equivalently:
rank ( A ) = numberย ofย variables \text{rank}(A) = \text{number of variables} rank ( A ) = numberย ofย variables
Every variable is basic,no free variables.
Example:
[ 1 0 2 0 1 3 ] \left[\begin{array}{cc|c}
1 & 0 & 2 \\
0 & 1 & 3
\end{array}\right] [ 1 0 โ 0 1 โ 2 3 โ ]
Unique solution: x = 2 x = 2 x = 2 , y = 3 y = 3 y = 3 .
(Infinitely Many Solutions)
The system has infinitely many solutions if and only if:
Last column of rref ( [ A โฃ b ] ) \text{rref}([A \mid \mathbf{b}]) rref ([ A โฃ b ]) has no pivot, AND
rref ( A ) \text{rref}(A) rref ( A ) has at least one column without a pivot
Equivalently:
rank ( A ) < numberย ofย variables \text{rank}(A) < \text{number of variables} rank ( A ) < numberย ofย variables
Thereโs at least one free variable.
Dimension of solution set:
dim โก ( solutionย set ) = ( numberย ofย variables ) โ rank ( A ) \dim(\text{solution set}) = (\text{number of variables}) - \text{rank}(A) dim ( solutionย set ) = ( numberย ofย variables ) โ rank ( A )
This is the number of free variables.
(Summary Table)
Pivot in last column? All columns of A A A have pivots? Number of solutions Yes , None (inconsistent)No Yes One (unique)No No Infinitely many
Examples
(Example 1: Unique Solution)
{ x + y = 3 x โ y = 1 \begin{cases}
x + y = 3 \\
x - y = 1
\end{cases} { x + y = 3 x โ y = 1 โ
[ 1 1 3 1 โ 1 1 ] โ R 2 โ R 1 [ 1 1 3 0 โ 2 โ 2 ] โ R 2 / ( โ 2 ) [ 1 1 3 0 1 1 ] \left[\begin{array}{cc|c}
1 & 1 & 3 \\
1 & -1 & 1
\end{array}\right]
\xrightarrow{R_2 - R_1}
\left[\begin{array}{cc|c}
1 & 1 & 3 \\
0 & -2 & -2
\end{array}\right]
\xrightarrow{R_2 / (-2)}
\left[\begin{array}{cc|c}
1 & 1 & 3 \\
0 & 1 & 1
\end{array}\right] [ 1 1 โ 1 โ 1 โ 3 1 โ ] R 2 โ โ R 1 โ โ [ 1 0 โ 1 โ 2 โ 3 โ 2 โ ] R 2 โ / ( โ 2 ) โ [ 1 0 โ 1 1 โ 3 1 โ ]
โ R 1 โ R 2 [ 1 0 2 0 1 1 ] \xrightarrow{R_1 - R_2}
\left[\begin{array}{cc|c}
1 & 0 & 2 \\
0 & 1 & 1
\end{array}\right] R 1 โ โ R 2 โ โ [ 1 0 โ 0 1 โ 2 1 โ ]
Solution: x = 2 x = 2 x = 2 , y = 1 y = 1 y = 1 (unique).
(Example 2: No Solution)
{ x + y = 1 x + y = 2 \begin{cases}
x + y = 1 \\
x + y = 2
\end{cases} { x + y = 1 x + y = 2 โ
[ 1 1 1 1 1 2 ] โ R 2 โ R 1 [ 1 1 1 0 0 1 ] \left[\begin{array}{cc|c}
1 & 1 & 1 \\
1 & 1 & 2
\end{array}\right]
\xrightarrow{R_2 - R_1}
\left[\begin{array}{cc|c}
1 & 1 & 1 \\
0 & 0 & 1
\end{array}\right] [ 1 1 โ 1 1 โ 1 2 โ ] R 2 โ โ R 1 โ โ [ 1 0 โ 1 0 โ 1 1 โ ]
Inconsistent (pivot in last column).
(Example 3: Infinitely Many Solutions)
{ x + 2 y = 4 2 x + 4 y = 8 \begin{cases}
x + 2y = 4 \\
2x + 4y = 8
\end{cases} { x + 2 y = 4 2 x + 4 y = 8 โ
[ 1 2 4 2 4 8 ] โ R 2 โ 2 R 1 [ 1 2 4 0 0 0 ] \left[\begin{array}{cc|c}
1 & 2 & 4 \\
2 & 4 & 8
\end{array}\right]
\xrightarrow{R_2 - 2R_1}
\left[\begin{array}{cc|c}
1 & 2 & 4 \\
0 & 0 & 0
\end{array}\right] [ 1 2 โ 2 4 โ 4 8 โ ] R 2 โ โ 2 R 1 โ โ [ 1 0 โ 2 0 โ 4 0 โ ]
General solution: x = 4 โ 2 t x = 4 - 2t x = 4 โ 2 t , y = t y = t y = t for any t โ R t \in \mathbb{R} t โ R .
This is a line (1-dimensional solution space).
Why This Matters
Row reduction is the universal algorithm for linear systems.
Three Questions, One Method
Does a solution exist? โ Check for pivot in last column
Is it unique? โ Count free variables
What is the solution? โ Solve for basic variables in terms of free ones
Every computational tool in linear algebraโfinding inverses, computing kernels, checking independenceโultimately reduces to row reduction.
The Big Picture
Geometry : Each equation carves out a hyperplane
Algebra : Row operations preserve solutions
Together : A complete answer to โdoes this system have solutions, and if so, what are they?โ
Next, weโll build the geometric languageโvectors, spans, linear combinationsโthat makes sense of what these solutions mean.