Gaussian Elimination

Summary

Gaussian elimination transforms Ax=b into an upper-triangular system Ux=c by elementary row operations, then recovers x by back substitution. Partial pivoting improves numerical stability.

Prerequisites

Problem Type

Solve a square linear system Ax=b .

Method Definition

Form the augmented matrix [A|b] . For each column k=1,…,n−1 , eliminate entries below the pivot akk using multipliers mik=aik/akk . After triangularization, apply back substitution.[1]

With partial pivoting, swap row k with the row of largest |aik| for i≥k before eliminating.

Assumptions / Requirements

Algorithm

  1. For k=1 to n−1 :
    • Pivot: choose p≥k maximizing |apk| ; swap rows k and p (and entries of b ).
    • For i=k+1 to n : m←aik/akk ; row i← row i−m⋅ row k .
  2. Back-substitute on the resulting upper-triangular system.

Convergence

Direct method: finishes in finitely many arithmetic operations ( O(n3) ). No iteration.

Error / Accuracy

Primary check: residual r=b−Ax . In exact arithmetic r=0 . In floating point, small ∥r∥ relative to ∥A∥∥x∥+∥b∥ indicates a consistent solve.

Worked Example

Solve

{2x+3y−z=14x−y+2z=7−2x+2y+5z=0

Augmented matrix:

[23−114−127−2250]

Eliminate column 1:

R2←R2−2R1,R3←R3+R1 [23−110−7450541]

Eliminate y in row 3. Multiplier m=5/(−7)=−5/7 , so

R3←R3−mR2=R3+57R2: [23−110−74500487327]

Back substitution:

z=32/748/7=23, −7y+4⋅23=5⇒−7y=73⇒y=−13, 2x+3(−13)−23=1⇒2x=83⇒x=43.

Solution: (43,−13,23) . Residual:

A(4/3−1/32/3)−(170)=0.

Common Failure Modes

Connections

References


  1. Burden & Faires, Numerical Analysis, Gaussian elimination; NIST DLMF Ch. 3, https://dlmf.nist.gov/3 ↩︎