Skip to main content

Iterative method: 4 equations

Short answer

The Gauss-Seidel method is used after reordering equations for better diagonal dominance. Starting from zero, after about 19 iterations the solution converges to x≈5.000, y≈6.000, z≈-10.000, w≈8.000.

Solve the following set of linear equations using a suitable iterative method. 2x + y + z - 2w = -10 4x + 2z + w = 8 3x + 2y + 2z = 7 x + 3y + 2z - w = -5

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

As given, the system is not diagonally dominant (for example, the coefficient of y in the second equation is 0 and the x coefficient in the first equation is only 2). Reorder the equations so that the largest available coefficient is on the diagonal:

4x      + 2z +  w =   8     (given eq. 2)
3x + 2y + 2z      =   7     (given eq. 3)
 x + 3y + 2z −  w =  −5     (given eq. 4)
2x +  y +  z − 2w = −10     (given eq. 1)

The diagonal entries are 4, 2, 2, −2. Only the first row is strictly dominant, but for this order the Gauss-Seidel iteration matrix has spectral radius 0.59 < 1 (checked), so the iteration converges.

Step 2: Iteration formulas

x = (8 − 2z − w) / 4
y = (7 − 3x − 2z) / 2
z = (−5 − x − 3y + w) / 2
w = (10 + 2x + y + z) / 2

Start with x(0) = 0, y(0) = 0, z(0) = 0, w(0) = 0.

Step 3: Iterations

Iterxyzw
00.0000.0000.0000.000
12.0000.500-4.2505.125
22.8443.484-6.5866.293
33.7204.506-7.9736.986
44.2405.113-8.7967.398
54.5495.473-9.2857.643
64.7325.687-9.5767.788
74.8415.814-9.7487.874
84.9065.890-9.8507.925
94.9445.935-9.9117.956
104.9675.961-9.9477.974
114.9805.977-9.9697.984
124.9885.986-9.9817.991
134.9935.992-9.9897.994
144.9965.995-9.9937.997
154.9985.997-9.9967.998
164.9995.998-9.9987.999
174.9995.999-9.9997.999
184.9995.999-9.9998.000
195.0006.000-10.0008.000

Between the last two iterations every unknown changes by less than 0.0005, so we stop. (Check: x = 5, y = 6, z = −10, w = 8 satisfy all four equations exactly.)

Answer: x ≈ 5.000, y ≈ 6.000, z ≈ -10.000, w ≈ 8.000

✓ Answer checked by Claude Opus 5.5 (high effort)

All Numerical Method chapter 3 questions →