Solving Systems with Matrices

Solve systems of linear equations using matrix equations, row operations, and Gaussian elimination.

advancedalgebramatricessystems-of-equationsgaussian-eliminationhigh-schoolUpdated 2026-02-01

Matrix Representation of Systems

System of equations can be written as matrix equation

Example system:

2x + 3y = 7
4x + y = 9

Matrix form: AX = B

[2  3] [x]   [7]
[4  1] [y] = [9]

Where:

  • A = coefficient matrix
  • X = variable vector
  • B = constant vector

Augmented Matrix

Augmented matrix: Combine A and B

Notation: [A | B]

Example:

[2  3 | 7]
[4  1 | 9]

Vertical bar separates coefficients from constants

Example: Write Augmented Matrix

System:

x + 2y - z = 4
3x - y + 2z = 1
2x + 3y + z = 7

Augmented matrix:

[1   2  -1 | 4]
[3  -1   2 | 1]
[2   3   1 | 7]

Elementary Row Operations

Three operations that don't change solution:

  1. Swap two rows (Rᵢ ↔ Rⱼ)
  2. Multiply row by nonzero constant (kRᵢ → Rᵢ)
  3. Add multiple of one row to another (Rᵢ + kRⱼ → Rᵢ)

Goal: Transform to simpler form

Example: Row Operations

Start with:

[2  3 | 7]
[4  1 | 9]

Operation: R₂ - 2R₁ → R₂

[2   3 |  7]
[0  -5 | -5]

Row 2 now: 0x - 5y = -5

Row Echelon Form

Row echelon form (REF):

  • All zero rows at bottom
  • Leading entry (pivot) in each row is to the right of pivot above
  • All entries below pivot are zero

Example REF:

[1  2  3 | 4]
[0  1  5 | 2]
[0  0  1 | 3]

Reduced Row Echelon Form

Reduced row echelon form (RREF):

  • All pivots are 1
  • Each pivot is only nonzero entry in its column
  • Satisfies REF conditions

Example RREF:

[1  0  0 | 2]
[0  1  0 | 3]
[0  0  1 | -1]

Solution read directly: x = 2, y = 3, z = -1

Gaussian Elimination

Process:

  1. Write augmented matrix
  2. Use row operations to get REF
  3. Use back-substitution to solve

Example 1: Solve 2×2 System

System:

2x + 3y = 7
4x + y = 9

Augmented matrix:

[2  3 | 7]
[4  1 | 9]

Step 1: R₂ - 2R₁ → R₂

[2   3 |  7]
[0  -5 | -5]

Step 2: Solve from bottom

-5y = -5  →  y = 1
2x + 3(1) = 7  →  x = 2

Solution: x = 2, y = 1

Example 2: Solve 3×3 System

System:

x + y + z = 6
2x - y + 3z = 14
-x + 2y - z = -4

Augmented matrix:

[1   1   1 |  6]
[2  -1   3 | 14]
[-1  2  -1 | -4]

R₂ - 2R₁ → R₂:

[1   1   1 |  6]
[0  -3   1 |  2]
[-1  2  -1 | -4]

R₃ + R₁ → R₃:

[1   1   1 |  6]
[0  -3   1 |  2]
[0   3   0 |  2]

R₃ + R₂ → R₃:

[1   1   1 | 6]
[0  -3   1 | 2]
[0   0   1 | 4]

Back-substitution:

z = 4
-3y + 4 = 2  →  y = 2/3... hmm let me recalculate

Actually from -3y + z = 2:

-3y + 4 = 2
-3y = -2
y = 2/3

From x + y + z = 6:

x + 2/3 + 4 = 6
x = 6 - 4 - 2/3 = 4/3

Solution: x = 4/3, y = 2/3, z = 4

Gauss-Jordan Elimination

Extension of Gaussian elimination to RREF

Process:

  1. Get REF (Gaussian elimination)
  2. Make all pivots = 1
  3. Eliminate above pivots too
  4. Solution reads directly from rightmost column

Example: Gauss-Jordan

Start from REF:

[2   3 |  7]
[0  -5 | -5]

Make pivots 1:

1/2 R₁ → R₁:

[1   3/2 | 7/2]
[0   -5  |  -5]

-1/5 R₂ → R₂:

[1  3/2 | 7/2]
[0   1  |  1]

Eliminate above pivot:

R₁ - (3/2)R₂ → R₁:

[1  0 | 2]
[0  1 | 1]

Solution: x = 2, y = 1 (read directly!)

Types of Solutions

Three possibilities:

  1. Unique solution: One pivot per variable
  2. Infinite solutions: Free variables exist
  3. No solution: Inconsistent row like [0 0 | 5]

Example: No Solution

System:

x + y = 3
2x + 2y = 8

Augmented:

[1  1 | 3]
[2  2 | 8]

R₂ - 2R₁ → R₂:

[1  1 | 3]
[0  0 | 2]

Row 2: 0 = 2 (impossible!)

No solution (inconsistent system)

Example: Infinite Solutions

System:

x + y + z = 4
2x + 2y + 2z = 8

Augmented:

[1  1  1 | 4]
[2  2  2 | 8]

R₂ - 2R₁ → R₂:

[1  1  1 | 4]
[0  0  0 | 0]

Only one equation: x + y + z = 4

Two free variables → Infinite solutions

Parametric form: Let y = s, z = t

x = 4 - s - t
y = s
z = t

Using Inverse Matrices

If A is invertible: X = A⁻¹B

Only works for square systems with det(A) 0

Example: Inverse Method

System:

3x + 2y = 7
x + 4y = 11

From earlier lessons, A⁻¹:

A⁻¹ = 1/10 [4  -2]
            [-1  3]

Solution:

[x]   1/10 [4  -2] [7]    1/10 [6]    [0.6]
[y] =     [-1  3] [11] =     [26] = [2.6]

Solution: x = 0.6, y = 2.6

Applications: Real-World Problems

Business: Production planning

Economics: Supply and demand

Engineering: Circuit analysis, structural loads

Chemistry: Balancing equations

Physics: Forces, motion

Example: Mixture Problem

Problem: Mix two solutions

  • Solution A: 20% acid
  • Solution B: 50% acid
  • Want 30 liters of 35% acid

How much of each?

Variables: x = liters of A, y = liters of B

Equations:

x + y = 30           (total volume)
0.20x + 0.50y = 0.35(30)  (acid amount)

Simplify second:

0.20x + 0.50y = 10.5

Augmented matrix:

[1    1   | 30]
[0.2  0.5 | 10.5]

Solve: (multiply R₂ by 10)

[1   1  | 30]
[2   5  | 105]

R₂ - 2R₁ → R₂:

[1  1 | 30]
[0  3 | 45]

From R₂: y = 15 From R₁: x = 15

Answer: 15 liters of each

Computational Methods

For large systems:

  • Computers use row operations
  • LU decomposition for efficiency
  • Iterative methods for very large systems

Practice

In augmented matrix [2 3 | 7; 4 1 | 9], what does the 7 represent?

Row operation: R₂ + 3R₁ → R₂ means:

If augmented matrix reduces to [1 0 | 3; 0 0 | 2], the system has:

In RREF, each pivot must be: