JOVANA
Library Glossary Getting Started Three Levels Fields How it works Mission
Join the mission
All guides

Three Variables and an Early Look at Matrices

Add a third variable and the bookkeeping grows. Eliminate down to one variable, back-substitute up, then meet the augmented matrix and Gaussian elimination — the organized form of everything you just did.

Eliminate down, substitute up

A three-variable system has three equations in x, y, z. The strategy is the same elimination you know, applied twice: combine pairs of equations to kill one variable, reducing three equations in three unknowns to two equations in two unknowns. Solve that smaller system, then use back-substitution to climb back up and recover the eliminated variables.

Solve:   x + y + z = 6      (1)
         2x - y + z = 3      (2)
          x + 2y - z = 2     (3)

Add (1)+(3) to kill z:   2x + 3y = 8     (A)
Add (2)+(3) to kill z:   3x + y  = 5     (B)

From (B): y = 5 - 3x.  Substitute into (A):
   2x + 3(5 - 3x) = 8
   2x + 15 - 9x = 8
   -7x = -7  ->  x = 1
Then y = 5 - 3(1) = 2,  and z = 6 - x - y = 6 - 1 - 2 = 3.

Solution: (1, 2, 3).  Check (2): 2 - 2 + 3 = 3 ✓
Cancel one variable twice, solve the 2x2 core, then back-substitute.

The augmented matrix: bookkeeping made tidy

Writing x, y, z over and over is wasteful — only the numbers change. An augmented matrix is a matrix holding just the coefficients and the right-hand sides, with a bar standing in for the equals signs. Each row is one equation.

Gaussian elimination is exactly the elimination you just did, performed on the rows. The allowed moves are the elementary row operations: swap two rows, multiply a row by a nonzero number, or add a multiple of one row to another. You drive the matrix toward a staircase of zeros, then back-substitute.

Same system as a matrix [ coeffs | rhs ]:
   [ 1   1   1 | 6 ]
   [ 2  -1   1 | 3 ]
   [ 1   2  -1 | 2 ]

R2 -> R2 - 2*R1,  R3 -> R3 - R1:
   [ 1   1   1 |  6 ]
   [ 0  -3  -1 | -9 ]
   [ 0   1  -2 | -4 ]

R3 -> 3*R3 + R2  (clear the y-column below):
   [ 1   1   1 |  6 ]
   [ 0  -3  -1 | -9 ]
   [ 0   0  -7 | -21 ]

Last row: -7z = -21 -> z = 3.  Back up: y = 2, x = 1.
Row operations zero out below the diagonal; the bottom row hands you z.