Gaussian Elimination

Category: Linear Algebra   Level: 301

row operations: Ri → Ri - k Rj

Subtract multiples of one row from another to clear out the entries below each pivot. The staircase that remains solves from the bottom up.

Step through it

Watch it

Animated walkthrough

Step by step

Step 1: Write the system as an augmented matrix

Each equation becomes a row: the coefficients of x, y, z, then a bar, then the right side. Same information, less ink.

x + y + z = 6, 2x + y - z = 1, x - y + 2z = 5

Step 1: Write the system as an augmented matrix

Step 2: Clear an entry with the first row operation

Subtract two times row 1 from row 2. The x term in row 2 disappears.

R2 → R2 - 2R1

Step 2: Clear an entry with the first row operation

Step 3: Clear an entry with a second row operation

Subtract row 1 from row 3. Now column 1 has zeros under its pivot.

R3 → R3 - R1

Step 3: Clear an entry with a second row operation

Step 4: Clear an entry with a third row operation

Subtract two times the new row 2 from row 3. The y term in row 3 disappears too.

R3 → R3 - 2R2

Step 4: Clear an entry with a third row operation

Step 5: Solve the bottom row

The last row now says 7z = 21, with no x or y left. Divide to get z.

7z = 21 ⇒ z = 3

Step 5: Solve the bottom row

Step 6: Substitute upward

Put z = 3 into row 2 to get y, then put y and z into row 1 to get x. Each row up has only one unknown left.

(x, y, z) = (1, 2, 3)

Step 6: Substitute upward

All steps at once

Storyboard

Generate it yourself

cd svg-generator
python3 -m svgmath render gaussian-elimination --out /tmp/gaussian-elimination

Source: svgmath/diagrams/matrix_ops.py