50. Gaussian Elimination

Convert a matrix into its row echelon form (REF) or reduced row echelon form (RREF)

𝑎11𝑥1+𝑎12𝑥2++𝑎1𝑛𝑥𝑛=𝑏1𝑎21𝑥1+𝑎22𝑥2++𝑎2𝑛𝑥𝑛=𝑏2𝑎𝑚1𝑥1+𝑎𝑚2𝑥2++𝑎𝑚𝑛𝑥𝑛=𝑏𝑚
  1. Create an augmented matrix
𝐴=[𝑎11𝑎12𝑎1𝑛𝑏1𝑎21𝑎22𝑎2𝑛𝑏2𝑏3𝑎2𝑚1𝑎𝑚2𝑎𝑚𝑛𝑏𝑚]
  1. Forward Elimination

Eliminate the element in the 𝑖-th of the 𝑘-th column (𝑘>𝑖)

𝑅𝑘𝑅𝑘𝑎𝑘𝑖𝑎𝑖𝑖𝑅𝑖

Where

  1. Back Substitution

  2. Reduced Row Echelon Form (RREF)

Example
2𝑥1+3𝑥2=54𝑥1+5𝑥2=5
  1. Create an augmented matrix
[235456]
  1. Forward Elimination

𝑅𝑘𝑅𝑘𝑎𝑘𝑖𝑎𝑖𝑖𝑅𝑖

𝑅𝑘𝑅𝑘𝑎21𝑎11𝑅𝑖

𝑅2𝑅242𝑅1

𝑅2𝑅22×𝑅1

[23542×252×362×5]

Simplifies to:

[235014]

System is now:

2𝑥1+3𝑥2=51𝑥2=4
  1. Back Substitution
1𝑥2=4𝑥2=4

Substitute:

2𝑥1+3(4)=52𝑥1+12=5𝑥1=3.5

Solution:

𝑥1=3.5𝑥2=4