📊

Gaussian Elimination to Solve Systems of Linear Equations

May 24, 2024

Gaussian Elimination to Solve Systems of Linear Equations

Introduction

  • Focus on solving systems of equations using Gaussian elimination.
  • Example system:
    • Equation 1: (x + y - z = -2)
    • Equation 2: (2x - y + z = 5)
    • Equation 3: (-x + 2y + 2z = 1)
  • Goal: Convert the system into an augmented matrix and then to row echelon form.

Converting to Augmented Matrix

  • Write coefficients in matrix form:

    11-1-2
    2-115
    -1221

Steps to Row Echelon Form

  1. Make bottom-left elements zero: Add Row 1 to Row 3

    • New Row 3: (r3 \leftarrow r1 + r3)

      11-1-2
      2-115
      031-1
  2. Make the second column, second row zero: Modify Row 2

    • New Row 2: (r2 \leftarrow -2r1 + r2)

      11-1-2
      0-339
      031-1
  3. Make third row, second column zero: Add Row 2 to Row 3

    • New Row 3: (r3 \leftarrow r2 + r3)

      11-1-2
      0-339
      0048
  4. Normalize the diagonal elements to 1

    • Divide Row 2 by -3 and Row 3 by 4

      11-1-2
      01-1-3
      0012

Converting Back to System of Equations

  1. Equation from Row 3: (z = 2)
  2. Equation from Row 2: (y - z = -3)
    • Substitute (z = 2 \rightarrow y - 2 = -3 \rightarrow y = -1)
  3. Equation from Row 1: (x + y - z = -2)
    • Substitute (y = -1, z = 2 \rightarrow x - 1 - 2 = -2 \rightarrow x = 1)

Final Solution

  • ((x, y, z) = (1, -1, 2))
  • Achieved Row Echelon Form: Diagonal ones and zeros below

Another Example

  • Equations:
    • (2x + y - z = 1)
    • (3x + 2y + z = 10)
    • (2x - y + 2z = 6)

Steps to Simplify

  1. Perform row operations to make zeros below the pivot positions:

    • Modify Row 3: (r3 \leftarrow r3 - r1)

      21-11
      32110
      02-3-5
  2. Adjust Row 2:

    • Modify Row 2: (r2 \leftarrow -3r1 + 2r2)

      21-11
      01517
      02-3-5
  3. Modify Row 3 again:

    • (r3 \leftarrow -2r2 + r3)

      21-11
      01517
      00-13-39

Back Substitution

  1. From Row 3: (-13z = -39) (\rightarrow z = 3)
  2. Substitute in Row 2: (y + 5z = 17 \rightarrow y + 5(3) = 17 \rightarrow y = 2)
  3. Substitute in Row 1: (2x + y - z = 1 \rightarrow 2x + 2 - 3 = 1\rightarrow x = 1)

Final Solution

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