PHY477 Lecture Material02
PHY477 Lecture Material02
a 21 a22 a2n b2
[A|b] =
an1 an 2 ann bn
If the system of equations has some special forms, then the solution is obtained directly.
We consider two such special forms.
(a) Let A be a diagonal matrix, A = D. That is, we consider the system of equations
Dx = b as
a11x 1 = b1
a22x 2 = b2
... ... ... ... (1.34)
an1, n 1 xn 1 = bn1
annxn = bn
This system is called a diagonal system of equations. Solving directly, we obtain
bi
xi = , aii 0, i = 1, 2, ..., n. (1.35)
aii
(b) Let A be an upper triangular matrix, A = U. That is, we consider the system of
equations Ux = b as
a11x1 + a12x2 + ... ... + a1n xn = b1
a22x2 + ... ... + a2n xn = b2
... ... ... ... (1.36)
an1, n1 xn1 + an1, n xn = bn1
annxn = bn
This system is called an upper triangular system of equations. Solving for the unknowns
in the order xn, xn1, ..., x1, we get
xn = bn/ann,
xn1 = (bn1 an1, n xn)/an1, n1,
... ... ... ...
n
b1 a1, j x j n
j 2
x1 = = b1 a1, j x j a11 (1.37)
a11 j 2
The unknowns are obtained by back substitution and this procedure is called the back
substitution method.
Therefore, when the given system of equations is one of the above two forms, the solution
is obtained directly.
Before we derive some direct methods, we define elementary row operations that can be
performed on the rows of a matrix.
Elementary row transformations (operations) The following operations on the rows of a
matrix A are called the elementary row transformations (operations).
(i) Interchange of any two rows. If we interchange the ith row with the jth row, then we
usually denote the operation as Ri Rj.
(ii) Division/multiplication of any row by a non-zero number p. If the ith row is multiplied by
p, then we usually denote this operation as pRi.
(iii) Adding/subtracting a scalar multiple of any row to any other row. If all the elements of
the jth row are multiplied by a scalar p and added to the corresponding elements of the ith
row, then, we usually denote this operation as Ri Ri + pR j. Note the order in which the
operation Ri + pRj is written. The elements of the jth row remain unchanged and the elements
of the ith row get changed.
These row operations change the form of A, but do not change the row-rank of A. The
matrix B obtained after the elementary row operations is said to be row equivalent with A. In
the context of the solution of the system of algebraic equations, the solution of the new system
is identical with the solution of the original system.
The above elementary operations performed on the columns of A (column C in place of
row R) are called elementary column transformations (operations). However, we shall be using
only the elementary row operations.
In this section, we derive two direct methods for the solution of the given system of
equations, namely, Gauss elimination method and Gauss-Jordan method.
We assume a11 0. This element in the 1 × 1 position is called the first pivot. We use
this pivot to reduce all the elements below this pivot in the first column as zeros. Multiply the
first row in (1.39) by a21/a11 and a31/a11 respectively and subtract from the second and third
rows. That is, we are performing the elementary row operations R2 (a 21/a11)R1 and
R3 (a31/a11)R1 respectively. We obtain the new augmented matrix as
(1)
a31 a31 a31
a32 = a32 a , a (1) = a33 a , b(1) = b 3 b.
a11 12 33 a11 13 3 a11 1
(1) (1)
( 2) (1) a32 (1) a32
where a33 a33 (1)
a23 , b3( 2) b3(1) (1)
b2(1) .
a22 a22
( 2)
The element a33 0 is called the third pivot. This system is in the required upper
triangular form [U|z]. The solution vector x is now obtained by back substitution.
Then, rank (A) = 2, rank [A|b] = 3 and rank (A) rank [A|b]. Therefore, the system is
inconsistent and has no solution.
Suppose that we obtain the reduced system as
a11 a12 a13 b1
(1) ( 1)
0 a22 a23 b2( 1) .
0 0 0 0
Then, rank (A) = rank [A|b] = 2 < 3. Therefore, the system has 3 2 = 1 parameter
family of infinite number of solutions.
Example 1.13 Solve the system of equations
x1 + 10x2 x3 = 3
2x1 + 3x2 + 20x3 = 7
10x1 x2 + 2x3 = 4
using the Gauss elimination with partial pivoting.
Solution We have the augmented matrix as
1 10 1 3
2 3 20 7
10 1 2 4
We perform the following elementary row transformations and do the eliminations.
10 1 2 4
R1 R3 : 2 3 20 7 . R2 (R1/5), R3 (R1/10) :
1 10 1 3
10 1 2 4 10 1 2 4
0 3.2 19.6 6.2 . R2 R3 : 0 101
. 1.2 2.6 .
0 101. 1.2 2.6 0 3.2 19.6 6.2
10 1 2 4
R3 (3.2/10.1)R2 : 0 101
. 1.2 2.6 .
0 0 19.98020 537624
.
1 1
First equation gives x1 = (4 + x2 2x3) = (4 + 0.2894 2(0.26908)) = 0.37512.
10 10
Example 1.14 Solve the system of equations
2x1 + x2 + x3 2x4 = 10
4x1 + 2x3 + x4 = 8
3x1 + 2x2 + 2x3 = 7
x1 + 3x2 + 2x3 x4 = 5
using the Gauss elimination with partial pivoting.
Solution The augmented matrix is given by
2 1 1 2 10
4 0 2 1 8
.
3 2 2 0 7
1 3 2 1 5
We perform the following elementary row transformations and do the eliminations.
4 0 2 1 8
2 1 1 2 10
R1 R2 : . R2 (1/2) R1, R3 (3/4) R1, R4 (1/4) R1:
3 2 2 0 7
1 3 2 1 5
4 0 2 1 8 4 0 2 1 8
0 1 0 5/2 14 . R
2 R4: 0 3 3/ 2 5/ 4 7 .
0 2 1/ 2 3/4 1 0 2 1/ 2 3/ 4 1
0 3 3/ 2 5/4 7 0 1 0 5/ 2 14
4 0 2 1 8
R3 (2/3) R2, R4 (1/3)R2: 0 3 3/2 5/ 4 7 .R R :
4 3
0 0 1/ 2 1/ 12 17 / 3
0 0 1/ 2 25 / 12 35 / 3
4 0 2 1 8
0 3 3/2 5/4 7
.
0 0 1/ 2 1/ 12 17 / 3
0 0 0 13 / 6 52 / 3
52 6 17 1 17 1
x4 = = 8, x3 = 2 x3 =2 ( 8) = 10,
3 13 3 12 3 12
1 3 5 1 3 5
x2 = 7 x3 x4 7 ( 10) ( 8) = 6,
3 2 4 3 2 4
1 1
x1 = [8 2x3 x4] = [8 2( 10) 8] = 5.
4 4
Example 1.15 Solve the system of equations
3x1 + 3x2 + 4x3 = 20
2x1 + x2 + 3x3 = 13
x1 + x2 + 3x3 = 6
using the Gauss elimination method.
Solution Let us solve this problem by making the pivots as 1. The augmented matrix is given
by
3 3 4 20
2 1 3 13 .
1 1 3 6
1 1 4 /3 20 /3 1 1 4 /3 20/3
R1/3: 2 1 3 13 . R2 2R1, R3 R1: 0 1 1/ 3 1/3 .
1 1 3 6 0 0 5/ 3 2/ 3
Back substitution gives the solution as
2 3 2 1 x3 1 1 2 1
x3 = = ,x = ,
3 5 5 2 3 3 3 3 5 5
20 4 20 1 4 2 35
x1 = x2 x3 = = 7.
3 3 3 5 3 5 5
1 10 1 3 1 10 1 3
R2 2R1, R3 9R1 : 0 17 22 1 . R3 4R2 : 0 17 22 1 .
0 68 88 18 0 0 0 14
Now, rank [A] = 2, and rank [A|b] = 3. Therefore, the system is inconsistent and has no
solution.
The method is based on the idea of reducing the given system of equations Ax = b, to a
diagonal system of equations Ix = d, where I is the identity matrix, using elementary row
operations. We know that the solutions of both the systems are identical. This reduced system
gives the solution vector x. This reduction is equivalent to finding the solution as x = A1b.
Gauss - Jordan method
[A|b] [I | X]
In this case, after the eliminations are completed, we obtain the augmented matrix for
a 3 × 3 system as
1 0 0 d1
0 1 0 d2 (1.42)
0 0 1 d3
and the solution is xi = di, i = 1, 2, 3.
Elimination procedure The first step is same as in Gauss elimination method, that is, we
make the elements below the first pivot as zeros, using the elementary row transformations.
From the second step onwards, we make the elements below and above the pivots as zeros
using the elementary row transformations. Lastly, we divide each row by its pivot so that the
final augmented matrix is of the form (1.42). Partial pivoting can also be used in the solution.
We may also make the pivots as 1 before performing the elimination.
Let us illustrate the method.
Example 1.17 Solve the following system of equations
x1 + x2 + x3 = 1
4x1 + 3x2 x3 = 6
3x1 + 5x2 + 3x3 = 4
using the Gauss-Jordan method (i) without partial pivoting, (ii) with partial pivoting.
Solution We have the augmented matrix as
1 1 1 1
4 3 1 6
3 5 3 4
(i) We perform the following elementary row transformations and do the eliminations.
1 1 1 1
R2 4R1, R3 3R1 : 0 1 5 2 .
0 2 0 1
1 0 4 3
R1 + R2, R3 + 2R2 : 0 1 5 2 .
0 0 10 5
1 0 0 1
R1 (4/10)R3, R2 (5/10) R3 : 0 1 0 1/2 .
0 0 10 5
1 0 0 1
0 1 0 1/2 .
0 0 1 1/2
1 0 14/11 18/11
R1 (3/4) R2, R3 (1/4)R2 : 0 1 15/11 2/11 .
0 0 10/11 5/11
1 0 14/11 18/11
R3 /(10/11) : 0 1 15/11 2/11 .
0 0 1 1/2
1 0 0 1
R1 + (14/11) R3, R2 (15/11)R3 : 0 1 0 1/2 .
0 0 1 1/2
(i) We perform the following elementary row transformations and do the eliminations.
1 1 1 1 0 0
R2 4R1, R3 3R1: 0 1 5 4 1 0 .
0 2 0 3 0 1
1 1 1 1 0 0
R2 : 0 1 5 4 1 0
0 2 0 3 0 1
1 0 4 3 1 0
R1 R2, R3 2R2 : 0 1 5 4 1 0 .
0 0 10 11 2 1
1 0 4 3 1 0
R3 /( 10) : 0 1 5 4 1 0 .
0 0 1 11/10 2/10 1/10
(ii) We perform the following elementary row transformations and do the eliminations.
1 0 1411
/ 0 511
/ 311
/
R1 (3/4) R2, R3 (1/4)R2 : 0 1 1511
/ 0 311
/ 4/11 .
0 0 1011
/ 1 211
/ 111
/
1 0 14/11 0 511
/ 311
/
R3 /(10/11) : 0 1 1511
/ 0 311
/ 411
/ .
0 0 1 1110
/ 15/ 110
/
1 0 0 7/5 15
/ 2/5
R 1 + (14/11) R3, R 2 (15/11)R3 : 0 1 0 3/2 0 1/2 .
0 0 1 1110
/ 1/5 110
/
7/5 15
/ 2/5
3/2 0 1/2
1110
/ 15
/ 110
/
2 2 3
2 1 1 . (A.U. Apr./May 2004)
1 3 5
2 2 3 1 0 0
2 1 1 0 1 0 .
1 3 5 0 0 1
1 1 3/2 1/2 0 0
R2 R3. Then, R2/2 : 0 1 7/4 1/4 0 1/2 .
0 1 2 1 1 0
1 0 0 2 1 1
R1 + (1/4)R3, R2 (7/4)R3 : 0 1 0 9 7 4 .
0 0 1 5 4 2
Therefore, the inverse of the given matrix is given by
2 1 1
9 7 4 .
5 4 2
2 1 1 2 x1 2
2 2 1 x 1 4 0 2 1 x2 3
3. 4 3 3 y 2 . 4. 3 2 2 0 x3 1 .
1 1 1 z 3 1 3 2 6 x4 2
2 1 1 1 1 3
9. 3 2 3 . (A.U. Nov/Dec 2006) 10. 1 3 3 . (A.U. Nov/Dec 2006)
1 4 9 2 4 4
2 2 6 2 0 1
11. 2 6 6 . 12. 3 2 5 . (A.U. Nov/Dec 2005)
4 8 8 1 1 0
Show that the following systems of equations are inconsistent using the Gauss elimination
method.
13. 2x1 + x2 3x3 = 0 14. x1 3x2 + 4x3 = 2
5x1 + 8x2 + x3 = 14, x1 + x 2 x 3 = 0
4x1 + 13x2 + 11x3 = 25. 3x1 x2 + 2x3 = 4.
Show that the following systems of equations have infinite number of solutions using the Gauss
elimination.
15. 2x1 + x2 3x3 = 0, 16. x1 + 5x2 x3 = 0,
5x1 + 8x2 + x3 = 14, 2x1 + 3x2 + x3 = 11,
4x1 + 13x2 + 11x3 = 28. 5x1 + 11x2 + x3 = 22.
As discussed earlier, iterative methods are based on the idea of successive approximations.
We start with an initial approximation to the solution vector x = x0, to solve the system of
equations Ax = b, and obtain a sequence of approximate vectors x0, x1, ..., xk, ..., which in the
limit as k , converges to the exact solution vector x = A1b. A general linear iterative
method for the solution of the system of equations Ax = b, can be written in matrix form as
x(k+1) = Hx(k) + c, k = 0, 1, 2, (1.43)
where x(k+1) and x(k) are the approximations for x at the (k + 1)th and kth iterations respec-
tively. H is called the iteration matrix, which depends on A and c is a column vector, which
depends on A and b.
When to stop the iteration We stop the iteration procedure when the magnitudes of the
differences between the two successive iterates of all the variables are smaller than a given
accuracy or error tolerance or an error bound , that is,
xi( k 1)
xi( k) , for all i. (1.44)
For example, if we require two decimal places of accuracy, then we iterate until
xi( k 1)
xi( k) 0.005, for all i. If we require three decimal places of accuracy, then we iterate
( 1)
until xi k xi( k) 0.0005, for all i.
Now, we derive two iterative methods for the solution of the system of algebraic equations
a11x1 + a12x2 + a13x3 = b1
a21x1 + a22x2 + a23x3 = b2 (1.45)
a31x1 + a32x2 + a33x3 = b3