Skip to main content

Gauss-Seidel: four unknowns

Short answer

After rearranging for diagonal dominance and applying Gauss-Seidel iterations, the solution converges to x1 = 1.3665, x2 = 1.8681, x3 = 1.2138, x4 = 1.8918.

Solve the following systems of linear equations using the Gauss-Seidel iteration method. x1 + 3x2 - x3 + 7x4 = 19 2x1 + 8x2 + x3 - x4 = 17 3x1 + x2 + 9x3 - x4 = 15 9x1 - x2 - x3 + 2x4 = 13

Gauss-Seidel method: solve each equation for its diagonal unknown and use the newest values immediately in the same iteration. It converges when the system is diagonally dominant.

Step 1: Check dominance and rearrange

The given equations are not in diagonally dominant order, so rearrange them (swap equations) so that the largest coefficient of each unknown lies on the diagonal:

9x1 −  x2 −  x3 + 2x4 = 13   (was 4th)
2x1 + 8x2 +  x3 −  x4 = 17   (was 2nd)
3x1 +  x2 + 9x3 −  x4 = 15   (was 3rd)
 x1 + 3x2 −  x3 + 7x4 = 19   (was 1st)

Now 9 > 1 + 1 + 2, 8 > 2 + 1 + 1, 9 > 3 + 1 + 1, 7 > 1 + 3 + 1, so the system is diagonally dominant.

Step 2: Iteration formulas

x1 = (13 + x2 + x3 − 2x4) / 9
x2 = (17 − 2x1 − x3 + x4) / 8
x3 = (15 − 3x1 − x2 + x4) / 9
x4 = (19 − x1 − 3x2 + x3) / 7

Start with x1(0) = 0, x2(0) = 0, x3(0) = 0, x4(0) = 0.

Step 3: Iterations

Iterx1x2x3x4
00.00000.00000.00000.0000
11.44441.76390.98921.8933
21.32961.90561.22211.8822
31.37371.86411.21081.8921
41.36561.86881.21411.8917
51.36661.86811.21381.8919
61.36651.86811.21381.8918
71.36651.86811.21381.8918
81.36651.86811.21381.8918

Values of two successive iterations agree to 4 decimal places, so we stop.

Answer: x1 ≈ 1.3665, x2 ≈ 1.8681, x3 ≈ 1.2138, x4 ≈ 1.8918

✓ Answer checked by Claude Opus 5.5 (high effort)

All Numerical Method chapter 3 questions →