Skip to content
VidiMaster it, module by module
Module 2/Systems & Gaussian Elimination

Solving Systems by Gaussian Elimination

How to find every solution of a linear system Ax=bAx=b. We justify why row-reducing the augmented matrix [A∣b][A\mid b] never changes the solution set (Lemma 5.1 and Theorem 5.5), read off consistency by comparing rank⁡(A)\operatorname{rank}(A) with rank⁡([A∣b])\operatorname{rank}([A\mid b]), and run the course's 4-step procedure to write the full solution as a particular solution plus a basis of ker⁡A\ker A. Along the way we meet the three possible outcomes: a unique solution, infinitely many, or none.

Before you start — give these a try

Attempting first primes your brain for the lesson — even if you miss. Nothing is graded or saved; it's just a warm-up.

Solve the system and give the solution vector (x,y,z)(x,y,z): {x+y+z=52x+y+z=7x+2y+3z=10\begin{cases} x+y+z=5 \\ 2x+y+z=7 \\ x+2y+3z=10 \end{cases}

How many solutions does {x−2y=1−2x+4y=5\begin{cases} x-2y=1 \\ -2x+4y=5 \end{cases} have?

What you’ll be able to do

  • State Lemma 5.1 and Theorem 5.5 and explain why performing elementary row operations on the augmented matrix [A∣b][A\mid b] leaves the solution set sol⁡(A,b)\operatorname{sol}(A,b) unchanged.
  • Use the comparison rank⁡(A)\operatorname{rank}(A) versus rank⁡([A∣b])\operatorname{rank}([A\mid b]) to decide whether Ax=bAx=b is inconsistent, has a unique solution, or has infinitely many solutions.
  • Carry out the course's 4-step procedure: reduce [A∣b][A\mid b] to reduced echelon form, set non-pivot columns as free variables λ1,…,λk\lambda_1,\dots,\lambda_k, solve each pivot variable, and write sol⁡(A,b)=w+λ1u1+⋯+λkuk\operatorname{sol}(A,b)=w+\lambda_1 u_1+\dots+\lambda_k u_k.
  • Interpret the solution set as a particular solution plus ker⁡A\ker A (an affine subspace), and connect nullity⁡(A)=n−rank⁡(A)\operatorname{nullity}(A)=n-\operatorname{rank}(A) to the number of free variables.
  • Classify concrete small systems among the three cases of Examples 5.7-5.11: unique (nullity 00), infinitely many (free variables), or inconsistent (rank mismatch).

In your course

· MATH2015 · Linear Algebra & Probability
§5.4 Systems of linear equations
  • Lemma 5.1Invertible transformations preserve solutions
    For an m×nm\times n matrix AA, b∈Rmb\in\mathbb{R}^m, and any invertible m×mm\times m matrix BB, sol⁡(A,b)=sol⁡(BA,Bb)\operatorname{sol}(A,b)=\operatorname{sol}(BA,Bb).
  • Theorem 5.5Row operations on the augmented matrix preserve the solution set
    If A′A' and b′b' are obtained from AA and bb by the same elementary row operations, then sol⁡(A′,b′)=sol⁡(A,b)\operatorname{sol}(A',b')=\operatorname{sol}(A,b).
  • Theorem 5.4Structure of the solution set
    sol⁡(A,0)=ker⁡A\operatorname{sol}(A,0)=\ker A; the system Ax=bAx=b is consistent iff rank⁡(A)=rank⁡([A∣b])\operatorname{rank}(A)=\operatorname{rank}([A\mid b]); and if ww is one solution then sol⁡(A,b)=w+ker⁡A\operatorname{sol}(A,b)=w+\ker A.
  • Examples 5.7-5.11The three cases worked out
    Unique solution with nullity 00 (Ex. 5.11); infinitely many with free variables (Ex. 5.7, 5.9, 5.10); inconsistent with a rank mismatch (Ex. 5.8).
Solutions follow the course's 4-step procedure: reduce [A∣b][A\mid b] to reduced echelon form and compare rank⁡(A)\operatorname{rank}(A) with rank⁡([A∣b])\operatorname{rank}([A\mid b]); set non-pivot columns as free variables λ1,…,λk\lambda_1,\dots,\lambda_k; solve each pivot variable; then write sol⁡(A,b)=w+λ1u1+⋯+λkuk\operatorname{sol}(A,b)=w+\lambda_1 u_1+\dots+\lambda_k u_k, a particular solution plus a basis of ker⁡A\ker A. The course writes the free scalars with λ\lambda (rendered as a generic scalar in the source due to OCR).
1

The augmented matrix and why row-reduction is legal

A system of mm equations in nn unknowns is written Ax=bAx=b with coefficient matrix A∈Rm×nA\in\mathbb{R}^{m\times n} and right-hand side b∈Rmb\in\mathbb{R}^{m}. We record it compactly in the augmented matrix [A∣b]∈Rm×(n+1)[A\mid b]\in\mathbb{R}^{m\times(n+1)}. The whole method rests on one fact: elementary row operations (swap two rows, scale a row by a nonzero scalar, add a multiple of one row to another) do not change the solution set. Each such operation is multiplication on the left by an invertible matrix, and Lemma 5.1 says that multiplying both sides by an invertible BB turns sol⁡(A,b)\operatorname{sol}(A,b) into sol⁡(BA,Bb)=sol⁡(A,b)\operatorname{sol}(BA,Bb)=\operatorname{sol}(A,b). Applied to the augmented matrix (same operation on AA and on bb simultaneously), this is Theorem 5.5: sol⁡(A′,b′)=sol⁡(A,b)\operatorname{sol}(A',b')=\operatorname{sol}(A,b).

2

Consistency via rank

The solution set is sol⁡(A,b)={x∈Rn∣Ax=b}\operatorname{sol}(A,b)=\{x\in\mathbb{R}^n\mid Ax=b\}. The system is consistent if this set is nonempty and inconsistent if it is empty. Theorem 5.4 gives the test: Ax=bAx=b is consistent if and only if b∈im⁡(A)b\in\operatorname{im}(A), equivalently rank⁡(A)=rank⁡([A∣b])\operatorname{rank}(A)=\operatorname{rank}([A\mid b]). Appending bb can only keep the rank the same or raise it by one, so there are exactly two possibilities. If rank⁡([A∣b])>rank⁡(A)\operatorname{rank}([A\mid b])>\operatorname{rank}(A) the reduced matrix has a row [ 0  ⋯  0∣c ][\,0\;\cdots\;0\mid c\,] with c≠0c\neq 0, i.e. the impossible equation 0=c0=c, and the system has no solution (Example 5.8).

3

Structure of the solution set: particular + homogeneous

When the system is consistent, Theorem 5.4 describes the shape of the answer. First, the homogeneous system Ax=0Ax=0 always has the solution x=0x=0 and its full solution set is sol⁡(A,0)=ker⁡A\operatorname{sol}(A,0)=\ker A, a subspace of Rn\mathbb{R}^n of dimension n−rank⁡(A)n-\operatorname{rank}(A) (rank-nullity). Second, if ww is any one (particular) solution of Ax=bAx=b, then sol⁡(A,b)=w+ker⁡A={w+x∣x∈ker⁡A}\operatorname{sol}(A,b)=w+\ker A=\{w+x\mid x\in\ker A\}. So the general solution is one particular solution plus all homogeneous solutions. For b≠0b\neq 0 this is an affine subspace (a point, line, or plane shifted off the origin), not a subspace, because x=0x=0 is not a solution.

4

The 4-step solving procedure

(1) Bring [A∣b][A\mid b] to reduced echelon form and compare rank⁡(A)\operatorname{rank}(A) with rank⁡([A∣b])\operatorname{rank}([A\mid b]); if they differ, stop -- there is no solution. (2) The columns of AA without a pivot correspond to free variables; name them λ1,…,λk\lambda_1,\dots,\lambda_k where k=n−rank⁡(A)k=n-\operatorname{rank}(A). (3) Each nonzero row of the reduced matrix solves one pivot variable in terms of the λi\lambda_i and the last column. (4) Collect the constant part and the λi\lambda_i-parts to write sol⁡(A,b)=w+λ1u1+⋯+λkuk\operatorname{sol}(A,b)=w+\lambda_1 u_1+\dots+\lambda_k u_k, where ww is a particular solution and u1,…,uku_1,\dots,u_k form a basis of ker⁡A\ker A. Three outcomes: k=0k=0 gives a unique solution (Example 5.11); k≥1k\ge 1 with consistency gives infinitely many (Examples 5.7, 5.9, 5.10); rank mismatch gives none (Example 5.8).

Lemma 5.1 (Invertible transformations preserve solutions)

Let AA be an m×nm\times n matrix and b∈Rmb\in\mathbb{R}^m. For any invertible m×mm\times m matrix BB, sol⁡(A,b)=sol⁡(BA,Bb)\operatorname{sol}(A,b)=\operatorname{sol}(BA,Bb).

Intuition. Multiplying every equation of the system on the left by an invertible BB is a reversible bookkeeping change: if Av=bAv=b then BAv=BbBAv=Bb, and because B−1B^{-1} exists you can undo it, so no solutions are gained or lost. This is the engine that makes row-reduction safe.
Theorem 5.5 (Row operations on $[A\mid b]$ preserve the solution set)

If A′A' is obtained from AA by elementary row operations and b′b' is obtained from bb by the same operations, then sol⁡(A′,b′)=sol⁡(A,b)\operatorname{sol}(A',b')=\operatorname{sol}(A,b).

Intuition. A sequence of elementary row operations equals left-multiplication by a product of elementary matrices E=Ek⋯E1E=E_k\cdots E_1, which is invertible; so A′=EAA'=EA, b′=Ebb'=Eb, and Lemma 5.1 applies. This is exactly why you may reduce the augmented matrix to (reduced) echelon form and just read the answer off -- the simplified system has the same solutions as the original.
Theorem 5.4 (Structure of the solution set)

Let Ax=bAx=b with A∈Rm×nA\in\mathbb{R}^{m\times n}, b∈Rmb\in\mathbb{R}^m. (1) sol⁡(A,0)=ker⁡A\operatorname{sol}(A,0)=\ker A, a subspace of Rn\mathbb{R}^n with dim⁡=n−rank⁡(A)\dim=n-\operatorname{rank}(A). (2) The following are equivalent: Ax=bAx=b is consistent; b∈im⁡(A)b\in\operatorname{im}(A); rank⁡(A)=rank⁡([A∣b])\operatorname{rank}(A)=\operatorname{rank}([A\mid b]). (3) If ww is one solution, then sol⁡(A,b)=w+ker⁡A\operatorname{sol}(A,b)=w+\ker A.

Intuition. The answer always has the form 'one particular solution ww plus every solution of the homogeneous system'. The homogeneous part is a subspace through the origin (its size is the nullity = number of free variables); adding ww slides it into position. Consistency is decided purely by whether tacking bb onto AA raises the rank.

Worked examples

Example 1

Unique solution (nullity 00), in the spirit of Example 5.11. Solve {x+y+z=52x+y+z=7x+2y+3z=10\begin{cases} x+y+z=5 \\ 2x+y+z=7 \\ x+2y+3z=10 \end{cases} and classify the solution set.

  1. 1

    Write the augmented matrix [A∣b]=[1115211712310][A\mid b]=\left[\begin{array}{ccc|c} 1&1&1&5 \\ 2&1&1&7 \\ 1&2&3&10 \end{array}\right]. By Theorem 5.5 we may row-reduce it without changing the solution set.

  2. 2

    Clear the first column with R2→R2−2R1R_2\to R_2-2R_1 and R3→R3−R1R_3\to R_3-R_1: [11150−1−1−30125]\left[\begin{array}{ccc|c} 1&1&1&5 \\ 0&-1&-1&-3 \\ 0&1&2&5 \end{array}\right].

  3. 3

    Clear the second column with R3→R3+R2R_3\to R_3+R_2 and scale R2→−R2R_2\to -R_2: [111501130012]\left[\begin{array}{ccc|c} 1&1&1&5 \\ 0&1&1&3 \\ 0&0&1&2 \end{array}\right]. Every column of AA has a pivot, so rank⁡(A)=3=n\operatorname{rank}(A)=3=n and nullity⁡(A)=0\operatorname{nullity}(A)=0.

  4. 4

    Back-substitute: z=2z=2, then y=3−z=1y=3-z=1, then x=5−y−z=2x=5-y-z=2. Since rank⁡(A)=rank⁡([A∣b])=3\operatorname{rank}(A)=\operatorname{rank}([A\mid b])=3 with no free variables, the solution is unique. Check: 2+1+2=52+1+2=5, 4+1+2=74+1+2=7, 2+2+6=102+2+6=10.

Answer. x=[212]\mathbf{x}=\begin{bmatrix}2\\1\\2\end{bmatrix} is the unique solution; sol⁡(A,b)\operatorname{sol}(A,b) is a single point (nullity 00).
Example 2

Infinitely many solutions (Example 5.9). Find the solution set of {2x1+6x2+x3+2x4=53x2+x3+4x4=13x2+x3+2x4=5\begin{cases} 2x_1+6x_2+x_3+2x_4=5 \\ 3x_2+x_3+4x_4=1 \\ 3x_2+x_3+2x_4=5 \end{cases}.

Example 3

No solution (Example 5.8). Decide whether {x+4y+2z=22x+8y+4z=5\begin{cases} x+4y+2z=2 \\ 2x+8y+4z=5 \end{cases} is consistent.