Mathwords logoMathwords

Gauss-Seidel Method — Definition, Formula & Examples

The Gauss-Seidel method is an iterative algorithm for solving a system of linear equations. Instead of finding an exact solution in one step, it starts with an initial guess and repeatedly refines each variable using the most recently computed values until the answers converge.

Given a system Ax=bA\mathbf{x} = \mathbf{b} where AA is an n×nn \times n matrix decomposed as A=L+UA = L_* + U (with LL_* being the lower triangular part including the diagonal and UU the strictly upper triangular part), the Gauss-Seidel iteration computes x(k+1)=L1(bUx(k))\mathbf{x}^{(k+1)} = L_*^{-1}(\mathbf{b} - U\mathbf{x}^{(k)}). Convergence is guaranteed when AA is strictly diagonally dominant or symmetric positive definite.

Key Formula

xi(k+1)=1aii(bij=1i1aijxj(k+1)j=i+1naijxj(k))x_i^{(k+1)} = \frac{1}{a_{ii}}\left(b_i - \sum_{j=1}^{i-1} a_{ij}\, x_j^{(k+1)} - \sum_{j=i+1}^{n} a_{ij}\, x_j^{(k)}\right)
Where:
  • xi(k+1)x_i^{(k+1)} = Updated value of the i-th variable at iteration k+1
  • aija_{ij} = Entry in row i, column j of the coefficient matrix A
  • bib_i = The i-th entry of the constant vector b
  • kk = Current iteration number

How It Works

You isolate each variable xix_i from the ii-th equation. When computing xix_i in a new iteration, you use the updated values of x1,,xi1x_1, \dots, x_{i-1} that were already calculated in the current iteration, along with the old values of xi+1,,xnx_{i+1}, \dots, x_n. This immediate use of new values is what distinguishes Gauss-Seidel from the Jacobi method and typically makes it converge faster. You repeat until the change between successive iterations is smaller than a chosen tolerance.

Worked Example

Problem: Solve the system using one Gauss-Seidel iteration starting from x₁ = 0, x₂ = 0: 4x₁ + x₂ = 1 x₁ + 3x₂ = 2
Step 1: Isolate x₁ from equation 1 and compute using the initial guess for x₂.
x1(1)=14(11x2(0))=14(10)=0.25x_1^{(1)} = \frac{1}{4}(1 - 1 \cdot x_2^{(0)}) = \frac{1}{4}(1 - 0) = 0.25
Step 2: Isolate x₂ from equation 2, using the newly computed x₁ = 0.25 (not the old value 0).
x2(1)=13(21x1(1))=13(20.25)=0.5833x_2^{(1)} = \frac{1}{3}(2 - 1 \cdot x_1^{(1)}) = \frac{1}{3}(2 - 0.25) = 0.5833
Answer: After one iteration: x₁ ≈ 0.25, x₂ ≈ 0.5833. Repeating this process, the values converge to the exact solution x₁ = 1/11 ≈ 0.0909, x₂ = 7/11 ≈ 0.6364.

Why It Matters

Direct methods like Cramer's Rule or Gaussian elimination become computationally expensive for very large systems. The Gauss-Seidel method is widely used in engineering simulations, finite element analysis, and computational fluid dynamics where systems can have thousands or millions of equations.

Common Mistakes

Mistake: Using old iteration values for all variables instead of updated ones within the same iteration.
Correction: That describes the Jacobi method, not Gauss-Seidel. In Gauss-Seidel, always substitute the most recently computed value of each variable as soon as it is available.