Solving Simultaneous Linear Equations Using Gauss - Seidel Method

The Gauss - Seidel method is a modification of the Jacobi method for solving systems of simultaneous linear equations  
\[A \mathbf{x}= \mathbf{b}\]
  numerically. Both methods use iteration formulae derived from the equations. The difference lies in the initial solution. The Jacobi method sets all  
\[x_i =0\]
  and the Gauss - Seidel method sets  
\[x_i = b_i/a_{ii}\]
 
Suppose we have the system of equations
\[14x_1+2x_2+4x_3=-10\]

\[16x_1+40x_2-4x_3=55\]

\[-2x_1+4x_2-16x_3=-38\]

Rearrange each equation for  
\[x_1, \: x_2, \: x_3\]
  respectively.
\[x_1=-10/14-2/14x_2-4/14x_3\]

\[x_2=55/40-16/40x_1+4/40x_3\]

\[x_3=-38/-16-2/16x_1+4/16x_2\]

Now use the iteration formulae
\[x^{(n+1)}_1=-10/14-2/14x^{(n)}_2-4/14x^{(n)}_3=-0.714-0.143x^{(n)}_2-0.286x^{(n)}_3\]

\[x_2=55/40-16/40x^{(n)}_1+4/40x^{(n)}_3=1.375-0.400x^{(n)}_1+0.100x^{(n)}_3\]

\[x_3=-38/-16-2/16x^{(n)}_1+4/16x^{(n)}_2=2.275-0.125x^{(n)}+0.250x^{(n)}_2\]

Take initial solution  
\[x^{(0)}_1=-10/14=-0.714, \: x^{(0)}_2=55/40=1.375, \: x^{(0)}_3=38/16=2.375\]

Then
\[x^{(1)}_1=-0.714-0.143 \times 1.375-0.286 \times 2.375=-1.590\]

\[x^{(1)}_2=1.375-0.400 \times -0.714+0.100 \times 2.375=1.899\]

\[x^{(1)}_3=2.375-0.125 \times -0.714 +0.250 \times 1.375=2.808\]

Continuing in this way gives the table.
nbsp;
\[n\]
 
nbsp;
\[x^{(n)}_1\]
 
nbsp;
\[x^{(n)}_2\]
 
nbsp;
\[x^{(n)}_3\]
 
0 -0.714 1.375 2.375
1 -1.599 1.899 2,808
2 -1.789 2.293 3.049
3 -1.914 2.396 3.172
4 -1.964 2.458 3.213
5 -1.984 2.482 3.236
6 -1.994 2.493 3.244
7 -1.998 2.498 3.247
The iterations are converging. In fact the true solution is  
\[x_1=-2, \: x_2=2.5, \: x_3=3.25\]