Tutorials › Linear Algebra › Convergence Tests for Jacobi and Gauss-Seidel

LU Factorization and Numerical Considerations · Tutorial 929 of 1000

Convergence Tests for Jacobi and Gauss-Seidel

Write each iteration as a matrix recurrence, apply the spectral-radius criterion, and use strict diagonal dominance to certify convergence.

Intermediate 12 min read

What You'll Learn

  • Express Jacobi and Gauss-Seidel updates using their iteration matrices.
  • Relate convergence for every initial guess to powers of the iteration matrix.
  • State and justify the spectral-radius convergence criterion.
  • Apply strict row diagonal dominance as a sufficient convergence condition.
  • Distinguish a sufficient norm bound from the more general spectral-radius test.

From an Iteration to an Error Recurrence

Jacobi and Gauss-Seidel are stationary iterative methods: each step applies the same matrix to the current estimate, then adds a fixed vector. Whether the estimates approach the solution is therefore controlled by repeated powers of that matrix. The spectral radius gives an exact convergence test, while strict diagonal dominance gives a convenient sufficient condition that can be checked directly from the coefficients.

Let \(\mathbf{A}\in\mathbb{R}^{n\times n}\) be nonsingular, and consider \(\mathbf{A}\mathbf{x}=\mathbf{b}\). Write \(\mathbf{A}=\mathbf{D}+\mathbf{L}+\mathbf{U}\), where \(\mathbf{D}\) is diagonal, \(\mathbf{L}\) contains the entries below the diagonal, and \(\mathbf{U}\) contains those above it. Assume every diagonal entry of \(\mathbf{A}\) is nonzero, so \(\mathbf{D}\) and the lower triangular matrix \(\mathbf{D}+\mathbf{L}\) are invertible.

Definition: The Jacobi iteration and Gauss-Seidel iteration are, respectively, $$ \mathbf{x}^{(k+1)} =-\mathbf{D}^{-1}(\mathbf{L}+\mathbf{U})\mathbf{x}^{(k)} +\mathbf{D}^{-1}\mathbf{b}, \qquad \mathbf{x}^{(k+1)} =-(\mathbf{D}+\mathbf{L})^{-1}\mathbf{U}\mathbf{x}^{(k)} +(\mathbf{D}+\mathbf{L})^{-1}\mathbf{b}. $$ In each case, the matrix multiplying \(\mathbf{x}^{(k)}\) is the iteration matrix, denoted \(\mathbf{T}\), and the remaining term is a fixed vector.

For either method, write the update as \(\mathbf{x}^{(k+1)}=\mathbf{T}\mathbf{x}^{(k)}+\mathbf{c}\). A fixed point \(\mathbf{x}\) satisfies \(\mathbf{x}=\mathbf{T}\mathbf{x}+\mathbf{c}\). For Jacobi, multiplying this equation by \(\mathbf{D}\) gives \(\mathbf{D}\mathbf{x}=-(\mathbf{L}+\mathbf{U})\mathbf{x}+\mathbf{b}\), hence \(\mathbf{A}\mathbf{x}=\mathbf{b}\). For Gauss-Seidel, multiplication by \(\mathbf{D}+\mathbf{L}\) gives \((\mathbf{D}+\mathbf{L})\mathbf{x}=-\mathbf{U}\mathbf{x}+\mathbf{b}\), again equivalent to \(\mathbf{A}\mathbf{x}=\mathbf{b}\). Thus the exact solution is the fixed point for both methods.

Let \(\mathbf{x}\) be that solution and define the error by \(\mathbf{e}^{(k)}=\mathbf{x}^{(k)}-\mathbf{x}\). Subtracting the fixed-point equation from the iteration gives the central recurrence:

$$ \mathbf{e}^{(k+1)}=\mathbf{T}\mathbf{e}^{(k)}, \qquad \mathbf{e}^{(k)}=\mathbf{T}^{k}\mathbf{e}^{(0)}. $$

The error tends to zero for every starting vector exactly when every initial error is driven to zero by powers of \(\mathbf{T}\). The spectral radius captures this property.

Definition: The spectral radius of a square matrix \(\mathbf{T}\), written \(\rho(\mathbf{T})\), is the largest absolute value of its complex eigenvalues. The iteration converges for every initial vector to the solution if and only if \(\rho(\mathbf{T})<1\).

Proof. First, \(\mathbf{T}^k\to\mathbf{O}\) implies that every eigenvalue has absolute value less than \(1\). If \(\lambda\) is an eigenvalue with nonzero complex eigenvector \(\mathbf{v}\), then \(\mathbf{T}^k\mathbf{v}=\lambda^k\mathbf{v}\). If \(|\lambda|\ge1\), this sequence does not tend to zero, contradicting \(\mathbf{T}^k\to\mathbf{O}\).

Conversely, suppose every eigenvalue has absolute value less than \(1\). Use the standard Jordan canonical form over \(\mathbb{C}\), whose construction is proved in the later treatment of Jordan form: \(\mathbf{T}=\mathbf{P}\mathbf{J}\mathbf{P}^{-1}\), with \(\mathbf{J}\) a block diagonal matrix of Jordan blocks. A block of size \(m\) has the form \(\mathbf{J}_{\lambda}=\lambda\mathbf{I}+\mathbf{N}\), where \(\mathbf{N}^m=\mathbf{O}\). For \(\lambda\ne0\), the binomial formula gives $$ \mathbf{J}_{\lambda}^{\,k} =\sum_{r=0}^{m-1}\binom{k}{r}\lambda^{k-r}\mathbf{N}^{r}, $$ where terms with \(r>k\) are zero. Each scalar coefficient tends to zero: a fixed-degree polynomial in \(k\) multiplied by \(|\lambda|^k\) tends to zero when \(|\lambda|<1\). If \(\lambda=0\), the block is \(\mathbf{N}\), whose powers are zero for \(k\ge m\). Hence every block power tends to zero, so \(\mathbf{J}^k\to\mathbf{O}\) and \(\mathbf{T}^k=\mathbf{P}\mathbf{J}^k\mathbf{P}^{-1}\to\mathbf{O}\). Finally, \(\mathbf{e}^{(k)}=\mathbf{T}^k\mathbf{e}^{(0)}\) shows convergence for every initial error. Conversely, convergence for every real initial error forces \(\mathbf{T}^k\to\mathbf{O}\), since applying the powers to each standard basis vector makes every column tend to zero. The two implications prove the criterion. \(\square\)

Worked Convergence Tests

Worked Example: Strict Diagonal Dominance for Both Methods

Consider $$ \mathbf{A}=\begin{bmatrix}4&-1&0\\-1&4&-1\\0&-1&3\end{bmatrix}, \qquad \mathbf{b}=\begin{bmatrix}3\\2\\2\end{bmatrix}. $$ The vector \(\mathbf{x}=(1,1,1)^{\top}\) solves the system, since \(\mathbf{A}\mathbf{x}=(4-1,\,-1+4-1,\,-1+3)^{\top}=(3,2,2)^{\top}\). We test the convergence of each method.

For Jacobi, the iteration matrix is $$ \mathbf{T}_{J} =\begin{bmatrix}0&1/4&0\\1/4&0&1/4\\0&1/3&0\end{bmatrix}. $$ The absolute row sums are \(1/4\), \(1/2\), and \(1/3\). Therefore \(\|\mathbf{T}_{J}\|_{\infty}=1/2<1\), so its powers tend to zero and Jacobi converges for every starting vector.

For Gauss-Seidel, $$ \mathbf{D}+\mathbf{L} =\begin{bmatrix}4&0&0\\-1&4&0\\0&-1&3\end{bmatrix}, \qquad \mathbf{U} =\begin{bmatrix}0&-1&0\\0&0&-1\\0&0&0\end{bmatrix}. $$ Solving \((\mathbf{D}+\mathbf{L})\mathbf{y}=\mathbf{U}\) column by column gives $$ \mathbf{T}_{GS}=-(\mathbf{D}+\mathbf{L})^{-1}\mathbf{U} =\begin{bmatrix}0&1/4&0\\0&1/16&1/4\\0&1/48&1/12\end{bmatrix}. $$ Its absolute row sums are \(1/4\), \(5/16\), and \(5/48\), so \(\|\mathbf{T}_{GS}\|_{\infty}=5/16<1\). Gauss-Seidel also converges for every starting vector. These norm estimates are stronger than necessary: the exact test is the spectral-radius criterion.

Check: In both iterations, convergence means \(\mathbf{e}^{(k)}\to\mathbf{0}\), so the computed estimates approach the verified solution \((1,1,1)^{\top}\).

Worked Example: Convergence Without Strict Diagonal Dominance

Consider $$ \mathbf{A}=\begin{bmatrix}1&2\\1/4&1\end{bmatrix}, \qquad \mathbf{b}=\begin{bmatrix}0\\-1/2\end{bmatrix}. $$ The solution is \(\mathbf{x}=(2,-1)^{\top}\), because \(\mathbf{A}\mathbf{x}=(2-2,\,1/2-1)^{\top}=(0,-1/2)^{\top}\). The first row is not strictly diagonally dominant: \(1<2\).

Here \(\mathbf{D}=\mathbf{I}_2\), and the Jacobi iteration matrix and fixed vector are $$ \mathbf{T}_{J}=\begin{bmatrix}0&-2\\-1/4&0\end{bmatrix}, \qquad \mathbf{c}_{J}=\begin{bmatrix}0\\-1/2\end{bmatrix}. $$ The characteristic polynomial is \(\lambda^2-1/2\), so the eigenvalues are \(\lambda=\pm1/\sqrt{2}\) and \(\rho(\mathbf{T}_{J})=1/\sqrt{2}<1\). Jacobi converges, even though strict diagonal dominance does not apply.

For Gauss-Seidel, \(\mathbf{D}+\mathbf{L}=\begin{bmatrix}1&0\\1/4&1\end{bmatrix}\). Its inverse is \(\begin{bmatrix}1&0\\-1/4&1\end{bmatrix}\), and $$ \mathbf{T}_{GS}=\begin{bmatrix}0&-2\\0&1/2\end{bmatrix}, \qquad \mathbf{c}_{GS}=\begin{bmatrix}0\\-1/2\end{bmatrix}. $$ The eigenvalues are \(0\) and \(1/2\), so \(\rho(\mathbf{T}_{GS})=1/2<1\) and Gauss-Seidel converges too. As a fixed-point check, $$ \mathbf{T}_{J}\begin{bmatrix}2\\-1\end{bmatrix}+\mathbf{c}_{J} =\begin{bmatrix}2\\-1\end{bmatrix}, \qquad \mathbf{T}_{GS}\begin{bmatrix}2\\-1\end{bmatrix}+\mathbf{c}_{GS} =\begin{bmatrix}2\\-1\end{bmatrix}. $$

Worked Example: Spectral Radius Greater Than One

Take \(\mathbf{A}=\begin{bmatrix}1&2\\2&1\end{bmatrix}\) and \(\mathbf{b}=(3,3)^{\top}\). The exact solution is \((1,1)^{\top}\). For Jacobi, $$ \mathbf{T}_{J}=\begin{bmatrix}0&-2\\-2&0\end{bmatrix}, \qquad \mathbf{c}_{J}=\begin{bmatrix}3\\3\end{bmatrix}. $$ Its eigenvalues are \(2\) and \(-2\), giving \(\rho(\mathbf{T}_{J})=2\). Starting from \(\mathbf{x}^{(0)}=\mathbf{0}\) gives \(\mathbf{x}^{(1)}=(3,3)^{\top}\) and \(\mathbf{x}^{(2)}=(-3,-3)^{\top}\), which already shows the iterates moving away from the solution.

For Gauss-Seidel, \(\mathbf{D}+\mathbf{L}=\begin{bmatrix}1&0\\2&1\end{bmatrix}\), so $$ \mathbf{T}_{GS}=\begin{bmatrix}0&-2\\0&4\end{bmatrix}, \qquad \mathbf{c}_{GS}=\begin{bmatrix}3\\-3\end{bmatrix}. $$ The eigenvalues are \(0\) and \(4\), hence \(\rho(\mathbf{T}_{GS})=4\). From \(\mathbf{x}^{(0)}=\mathbf{0}\), the first two iterates are \((3,-3)^{\top}\) and \((9,-15)^{\top}\). Both methods fail the convergence test; for this starting vector, neither converges to \((1,1)^{\top}\).

Strict Diagonal Dominance as a Sufficient Test

Definition: A matrix \(\mathbf{A}\in\mathbb{R}^{n\times n}\) is strictly diagonally dominant by rows if $$ |a_{ii}|>\sum_{j\ne i}|a_{ij}| \quad\text{for every }i=1,\dots,n. $$ This condition is sufficient for convergence of both Jacobi and Gauss-Seidel, but it is not necessary.

Proof. First, strict row diagonal dominance implies that \(\mathbf{A}\) is nonsingular. If \(\mathbf{A}\mathbf{z}=\mathbf{0}\) for a nonzero vector \(\mathbf{z}\), choose \(i\) with \(|z_i|=\|\mathbf{z}\|_{\infty}>0\). The \(i\)-th equation would imply $$ |a_{ii}|\|\mathbf{z}\|_{\infty} \le \sum_{j\ne i}|a_{ij}||z_j| \le \left(\sum_{j\ne i}|a_{ij}|\right)\|\mathbf{z}\|_{\infty} <|a_{ii}|\|\mathbf{z}\|_{\infty}, $$ a contradiction. Thus the homogeneous system has only the zero solution, and the square matrix is nonsingular.

For Jacobi, the absolute row sum of its iteration matrix in row \(i\) is \(\sum_{j\ne i}|a_{ij}|/|a_{ii}|<1\). There are finitely many rows, so their maximum is some \(q<1\). Hence \(\|\mathbf{T}_{J}\|_{\infty}\le q<1\), and \(\|\mathbf{T}_{J}^{\,k}\|_{\infty}\le q^k\to0\).

For Gauss-Seidel, let \(\mathbf{y}=\mathbf{T}_{GS}\mathbf{x}\). Its component equations are $$ a_{ii}y_i=-\sum_{j<i}a_{ij}y_j-\sum_{j>i}a_{ij}x_j. $$ Suppose \(\mathbf{x}\ne\mathbf{0}\) and \(\|\mathbf{y}\|_{\infty}\ge\|\mathbf{x}\|_{\infty}\). Choose an index \(i\) with \(|y_i|=\|\mathbf{y}\|_{\infty}\). Then $$ |a_{ii}|\|\mathbf{y}\|_{\infty} \le \left(\sum_{j<i}|a_{ij}|\right)\|\mathbf{y}\|_{\infty} +\left(\sum_{j>i}|a_{ij}|\right)\|\mathbf{x}\|_{\infty} \le \left(\sum_{j\ne i}|a_{ij}|\right)\|\mathbf{y}\|_{\infty} <|a_{ii}|\|\mathbf{y}\|_{\infty}, $$ which is impossible. Thus \(\|\mathbf{T}_{GS}\mathbf{x}\|_{\infty}<\|\mathbf{x}\|_{\infty}\) for every nonzero real \(\mathbf{x}\). The unit sphere in \(\mathbb{R}^n\) is compact, and \(\mathbf{x}\mapsto\|\mathbf{T}_{GS}\mathbf{x}\|_{\infty}\) is continuous. Its maximum on that sphere is therefore some \(q<1\); scaling gives \(\|\mathbf{T}_{GS}\mathbf{x}\|_{\infty}\le q\|\mathbf{x}\|_{\infty}\) for every \(\mathbf{x}\). Consequently its powers tend to zero. The spectral-radius criterion now proves convergence of both methods for every starting vector. \(\square\)

Common Mistake: Treating a Sufficient Condition as Necessary

A common error is to see that strict diagonal dominance fails and conclude that an iteration must diverge. The second worked example is a concrete counterexample to that reasoning: its first row satisfies \(1<2\), so the matrix is not strictly diagonally dominant, but the Jacobi eigenvalues have absolute value \(1/\sqrt{2}<1\), and Gauss-Seidel has spectral radius \(1/2<1\). The correction is to treat diagonal dominance as a convenient sufficient test. When it fails, compute or otherwise bound the spectral radius instead.

Another pitfall is to check only that one update looks close to the solution. Convergence concerns every later power of the iteration matrix, not a single step or a small residual at one iterate. The recurrence \(\mathbf{e}^{(k)}=\mathbf{T}^k\mathbf{e}^{(0)}\) explains why the spectral-radius test addresses the long-term behavior.

Check Your Understanding

Use the error recurrence and the stated hypotheses to justify each conclusion.

  1. For \(\mathbf{A}=\begin{bmatrix}5&-1\\-2&4\end{bmatrix}\), verify strict row diagonal dominance and find the Jacobi iteration matrix.
  2. Explain why \(\rho(\mathbf{T})<1\) implies convergence from every initial vector, not just from one selected starting guess.
  3. For \(\mathbf{T}=\begin{bmatrix}0&-1/4\\-1/2&0\end{bmatrix}\), find its eigenvalues and decide whether the associated stationary iteration converges for every initial error.
  4. State why failure of strict diagonal dominance does not by itself prove divergence.
  5. For Gauss-Seidel, identify which error components in the update have already been replaced by new values and which still use old values.

Test yourself: Linear Algebra final exam practice

Ready to check what you know? Work a full-length practice final, then open the complete worked solutions.

Want all 1,114 practice problems?

This tutorial covers one topic. Calc Pass covers the full Calculus AB & BC curriculum (the core of Calculus I and II): full review, every practice question, and step-by-step solutions to each one.

QR code to download the Calc Pass app

Get the Calc Pass App

Scan to download and practice on the go, with instant scoring.

Calc Pass Volume 1: 1,114 Practice Questions book cover

Vol. 1: 1,114 Questions

The complete practice question bank, organized by AB & BC topic.

View on Amazon
Calc Pass Volume 2: Solutions Manual book cover

Vol. 2: Solutions Manual

Fully worked solutions to every question in Volume 1.

View on Amazon