Now you are in the subtree of Container for Linear Algebra project. 

Example of solving a 3-by-3 matrix equation

Created over 8 years ago, updated 10 days ago

Example: Solving a 3-by-3 Matrix Equation

Solve Ax = b where:

A = [1  2  1]    b = [ 4]
    [2  5 -1]        [ 7]
    [1  1  2]        [ 5]

Step 1: Form the augmented matrix [A | b]

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

Step 2: R2 = R2 - 2*R1, R3 = R3 - R1

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

Step 3: R3 = R3 + R2

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

Step 4: From R3: -2z = 0, so z = 0.
From R2: y - 3(0) = -1, so y = -1.
From R1: x + 2(-1) + 0 = 4, so x = 6.

Solution: x = [6, -1, 0]^

Verification:

  • Row 1: 1(6) + 2(-1) + 1(0) = 6 - 2 = 4 ✓
  • Row 2: 2(6) + 5(-1) + (-1)(0) = 12 - 5 = 7 ✓
  • Row 3: 1(6) + 1(-1) + 2(0) = 6 - 1 = 5 ✓