0% found this document useful (0 votes)
117 views69 pages

Math Project

Uploaded by

Hitzz Abd
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
117 views69 pages

Math Project

Uploaded by

Hitzz Abd
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 69

CONTENTS

1. Introduction…………………………………………... 1
2. Objective……………………………………………... 4
3. Part-I:Solution To A Linear Equation……………... 5
(a) Simple Method……………………………….. 7
(b) Flow Chart……………………………………... 8
(c) Algorithm………………………………………. 8
(d) C++ Program………………………………….. 9
(e) Graphical Method…………………………….. 11
4. Paer-II:Solution To System Of Equations……….... 13
(a) Method Of Substitution……………………….. 15
(b) Method Of Elimination………………………... 17
(c) Cross-Multiplication Method…………………. 19
(d) Graphical Method……………………………... 21
(e) Cramer’s Rule…………………………………. 23
(f) Matrix Method…………………………………. 26
(g) Gauss Elimination Method…………………… 29
(h) Gauss-Jordan Elimination Method………….. 34
(i) Triangularization Method…………………….. 38
(j) Partition Method………………………………. 48
(k) Cholesky Method…………………………….. 51
(l) Jacobi Iteration Method………………………. 56
(m) Gauss-Seidel Iteration Method……………… 60
5. Result And Discussion……………………………… 65
6. Conclusion…………………………………………… 67
7. Reference……………………………………………. 68
INTRODUCTION
A linear equation is an algebraic equation in which
each term is either a constant or the product of a constant and (the
first power of) a single variable (however, different variables may
occur in different terms).
In mathematics, a system of linear equations (or linear
system) is a collection of two or more linear equations involving the
same set of variables
A simple example of a linear equation with only one
variable, x, may be written in the form: ax + b = 0, where a and b are
constants and a ≠ 0. The constants may be numbers, parameters, or
even non-linear functions of parameters, and the distinction between
variables and parameters may depend on the problem (for an
example, see linear regression).
Linear equations can have one or more variables. An
example of a linear equation with three variables, x, y, and z, is given
by: ax + by + cz + d = 0, where a, b, c, and d are constants and a, b,
and c are non-zero. Linear equations occur frequently in most
subareas of mathematics and especially in applied mathematics.
While they arise quite naturally when modeling many phenomena,
they are particularly useful since many non-linear equations may be
reduced to linear equations by assuming that quantities of interest
vary to only a small extent from some "background" state.
An equation is linear if the sum of the exponents of the
variables of each term is one. Equations with exponents greater than
one are non-linear. An example of a non-linear equation of two
variables is axy + b = 0, where a and b are constants and a ≠ 0. It has
two variables, x and y, and is non-linear because the sum of the
exponents of the variables in the first term, axy, is two.
Example:
One variable: 2x+8=0 Here, x is variable.
Two variables: x+4y+3=0 Here, x and y are variables.
General form:

1
A general system of m linear equations with n unknowns can be
written as
a 11 x 1 +a 12 x 2+ …+a1 n x n=b1

a 21 x 1+ a22 x 2 +…+a 2 n x n=b 2


……(1)

a m 1 x 1+ am 2 x2 + …+amn x n=b m

where x 1 , x 2 ,… , x n are the unknowns, a 11 , a12 , … . , amn are the coefficients of


the system, and b 1 , b2 , … , bm are the constant terms.
Consider the system of n linear algebraic equations in n unknowns
a 11 x 1 +a 12 x 2+ …+a1 n x n=b1

a 21 x 1+ a22 x 2 +…+a 2 n x n=b 2


……(2)

a n 1 x 1+ an 2 x 2 +…+ ann x n =bn

where x 1 , x 2 ,… , x n are the unknowns, a 11 , a12 , … . , ann are the coefficients of


the system, and b 1 , b2 , … , bn are the constant terms.
Vector equation:
One extremely helpful view is that each unknown is a weight for
a column vector in a linear combination.

[ ] [ ] [ ][ ]
a11 a 12 a1 n b1
x 1 a 21 + x 2 a 22 +…+ x
n
a2 n b
= 2 ………(3)
⋮ ⋮ ⋮ ⋮
am 1 am 2 a mn bm

This allows all the language and theory of vector spaces (or more
generally, modules) to be brought to bear. For example, the collection
of all possible linear combinations of the vectors on the left-hand side
is called their span, and the equations have a solution just when the
right-hand vector is within that span. If every vector within that span
has exactly one expression as a linear combination of the given left-
hand vectors, then any solution is unique. In any event, the span
has a basis of linearly independent vectors that do guarantee
exactly one expression; and the number of vectors in that basis
(its dimension) cannot be larger than m or n, but it can be smaller.

2
This is important because if we have m independent vectors a
solution is guaranteed regardless of the right-hand side, and
otherwise not guaranteed.
Matrix equation:
The vector equation is equivalent to a matrix equation of the form
Ax=b,

[ ][ ] [ ]
a11 a 12 … a1 n x 1 b1
⇒ a 21 a 22 … a2 n x 2 =
b2
⋮ ⋮ ⋱ ⋮ ⋮ ⋮

am 1 am 2 a mn x n bm

where A is an m×n matrix, x is a column vector with n entries,


and b is a column vector with m entries.

[ ] [] []
a11 a12 … a 1 n x1 b1
A= a21 a22 … a 2 n ,
x
x¿ ⋮ 2 ,
b
b¿ ⋮ 2
⋮ ⋮ ⋱ ⋮
a m 1 a m 2 … amn xn bm

The number of vectors in a basis for the span is now expressed


as the rank of the matrix.
Solution Set:
A solution of a linear system is an assignment of values to the
variables x1, x2,..., xnsuch that each of the equations is satisfied.
The setof all possible solutions is called the solution set.
A linear system may behave in any one of three possible ways:

1. The system has infinitely many solutions.


2. The system has a single unique solution.
3. The system has no solution.

3
OBJECTIVE
Students can know about the solution of a linear equation
by different methods i.e. Simple Method, Flowchart, Algorithm,
C++ Program and Graphical Methods.

Students can have idea about solution of linear equation by


so many methods i.e. Method of Substitution, Method of
Elimination, Cross Multiplication, Graphical Method, Cramer's
Rule,Matrix Method, Gauss Elimination Method, Gauss-Jordan
Elimination Method, Triangularization Method, Partition Method,
Cholesky Method, Jacobi Iteration Method, Gauss-Seidel Iteration
Method etc. and they can know which will be easier to them.

4
Part-I

5
S
ol
u
ti
o
n
T
o
A
Li

6
(c) n (e)
(a) (b) Algorit
e (d)
Simple Flow C++ Graphical
hm a Method
Method Chart Program
(a) Linear equation with one
variable(Simple Method)
Let the equation be ax+b=0 ........................(1)
Here x is variable and a and b are constants.
Here we have to find the value of x. So, solution of equation (1) is
given below

⇒x=-(b/a) provided by a≠0


There is only one solution i.e. x=-(b/a)

Example:1.1 Solve the equation 2x-6=0


Solution:

⇒2x-6=0

⇒2x=6

⇒x=6/2

⇒ x=3

..~***~..

7
(b) Flow chart of a linear equation
with one variable
The given equation is ax+b+0; a≠0.

START

READ a,b

x=(-b)/a

PRINT x

STOP

..~***~..
(c) Algorithm of a linear equation
with one variable
Step 1.BEGIN
Step 2.READ a,b
Step 3.x=(-b)/a
Step 4.PRINT x
Step 5.END

..~***~..

8
(d)C++ program of a linear
equation for solving x i.e
(ax+b=0)
Program:
#include<iostream>
using namespaced std;
int main()
{
double a,b,x;
cout<<"Enter the value of a:";
cin>>a;
cout<<endl;
cout<<"Enter the value of b:";
cin>>b;
cout<<endl;
If (a>0 || a<0)
{
x=(-b)/a;
If (b>0)
{
cout<<"Solution of"<<" "<<a<<"x+"<<b<<"=0 is x="<<x<<endl;
}
else if (b<0)
{
cout<<"Solution of"<<" "<<a<<"x"<<b<<"=0 is x="<<x<<endl;

9
}
else
{
cout<<"Solution of"<<" "<<a<<"x=0 is x="<<x<<endl;
}
}
else
cout<<"Invalid equation"<<endl;
return 0;
}

Output:( Solve 2x-6=0 )


Enter the value of a:2
Enter the value of b:6
Solution of 2x-6=0 is x=3

..~***~..

10
(e) Graphical solution to a linear
equation in one variable
Steps are given below:
Finding a Graphical Solution for an Equation
Step 1. Let each side of the equation represent a function of x.
Step 2. Graph the two functions on the same set of axes.
Step 3. Find the point of intersection of the two graphs. The x
value at this point represent the solution to the original
equation.

Example:1.1 Solve by graphical method 2x-6=0


Solution: Given equation is 2x-6=0
Step 1. Let each side of the equation represent a
function of x.
f(x)=2x-6
g(x)=0
Step 2. Graph of the two functions on the same axes.
y

f Linear (f) g Linear (g)


15

10

0
-4 -2 0 2 4 6 8 10

-5

-10

-15

11
Step 3. Find the point of intersection of the two graphs.
The x coordinate of this point represents the
solution to the original equation.

f Linear (f) g Linear (g)

10

9 f
8

3
y

1
(3,0) g
0
-4 -3 -2 -1 0 1 2 3 4 5 6 7 8 9
-1

-2

-3

-4

-5 x

The two lines intersect on the x axis at the point (3,0). We are
looking for the x value at the point of intersection, which is 3.

..~***~..

12
PART-II

13
(a) (m)
Method Gauss
Of Seidel
(b) Substitutio Method
Method n S (l)
Of ol Jacobi
Eliminatio Iteration
n u Method
(c) ti
Cross o (k)
Multipli Chole
cation
n
sky
T Metho
o d

14
(d) S (j)
Graphic Partiti
y on
al
Method st Metho
e d
(i)
(e) m Triangul
Crame arizatio
O
r’s (f) n
Rule Matrix (g)
f (h)
Method
Method GaussLi Gauss
Elimination Jordan
Method Method
(a) Method Of Substitution
Consider the system of equations

a1x+b1+c1=0 .......(1)

a2x+b2y+c2=0 .........(2)

If b1≠0,then b1y= - c1-a1x


−1
⇒ y= (c +a x) ..........(3)
b1 1 1

Substituting Equation (3) in Equation (2), then we get


b2
⇒ a2 x +
b1
(−c1 −a1 x ) + c 2=0

⇒ ( a2 b1−a 1 b 2) x + ( c 2 b1−c1 b2 ) =0

−c 2 b1−c1 b2
⇒ x=
a2 b1−a1 b 2

b1 c 2−b2 c 1 ..........(4)
⇒ x=
a 1 b 2−a2 b1

Substituting the equation (4) in equation (1)

⇒ a1
( )
b1 c 2−b 2 c 1
a1 b2−a 2 b 1
+ b1 y+ c 1=0

c 1 a2−c 2 a1
⇒ y= ..........(5)
a1 b 2−a 2 b1

So,the equations (4) and (5) are required solutions.

Example:2.1 Solve 5x+2y+2=0


3x+4y-10=0

15
Solution:
Given equations are 5x+2y+2=0 ..............(i)
3x+4y-10=0 .............(ii)
From equation (i),we have

⇒2y= - 5x - 2
1
⇒ y = (−5 x−2)..........(iii)
2

Substituting equation (iii) in (ii),we get


4
⇒ 3 x + (−5 x−2)−10=0
2

⇒ 6 x−20 x−8−20=0

⇒−14 x−28=0

⇒ 14 x =−28

−28
⇒ x= =−2
14

Substituting the value of x=-2 in equation (i), then we get


⇒ 5(−2)+2 y +2=0

⇒ 2 y−8=0

⇒ y =4

Therefore, the required solution is (-2,4).

..~***~..
(b) Method Of Elimination
In this method we eliminate x and y from the given
equations. Here the equations are

16
a1x+b1y+c1=0 ............(1)

a2x+b2y+c2=0 ............(2)

To eliminate x, we multiply in equation (1) by a2 and (2) by a1 , we


get

a2a2x+a2b1y+a2c1=0 ..........(3)

a1a2x+a1b2y+a1c2=0 ...........(4)

Now subtracting equation (3) from (4), we get

⇒ ( a2 b1−a 1 b 2) x + ( a 1 c 2−a2 c1 ) =0

⇒ ( a2 b1−a 1 b 2) x=−( a1 c 2−a2 c 1 )

−a1 c2 −a2 c 1
⇒ y=
a1 b2−a2 b1

c 1 a2−c 2 a1
⇒ y= ..........(5)
a1 b 2−a 2 b1

Similarly eliminating 'y' from equation (1) and (2), we get

b1 c 2−b2 c 1
⇒ x= ..........(6)
a 1 b 2−a2 b1

The above solutions exist provided by a1b2-a2b1≠0.

Example:2.2 Solve 5x+2y+2=0


3x+4y-10=0
Solution:
Given equations are 5 x+ 2 y +2=0 .............(i)
3 x+ 4 y −10=0 ............(ii)

17
Multiplying equation (i) by 3 and (ii) by 5, we get
⇒ 15 x +6 y +6=0 ..........(iii)

⇒15 x +20 y−50=0 ......(iv)

Now subtracting equation (iv) from (iii), we get


⇒−14 y +56=0

⇒ 14 y=56

56
⇒ y= =4
14

⇒ y =4

Substituting y=4 in equation (i), we get


⇒ 5 x +2(4)+ 2=0

⇒ 5 x +8+2=0

⇒ 5 x +10=0

⇒ 5 x=−10

⇒ x=−2

Therefore, required solution is (-2,4).

..~***~..
(c) Cross Multiplication:
Consider the equations a1x+b1y+c1=0 .............(1)
a 2x+b2y+c2=0 .............(2)
From elimination method, we have
b1 c 2−b2 c 1
⇒ x=
a 1 b 2−a2 b1

..........(3)

18
c 1 a2−c 2 a1
⇒ y=
a1 b 2−a 2 b1

From equation (3), we have


x 1
=
b1 c 2−b2 c 1 a 1 b 2−a2 b1

y 1 ..........(4)
=
c 1 a 2−c 2 a1 a 1 b 2−a2 b1

From equation (4), we get


x y 1
=
b1 c 2−b2 c 1 c 1 a 2−c 2 a1 a 1 b 2−a2 b1 ……(5)
=

a1 b1
If a1b2-a2b1≠0⇒ a ≠
b2
2

We can write equation (5) is of the form which is given below


x y 1
= =
b1 c1 c1 a1 a 1 b1 ……….(6)
b2 c2 c2 a2 a 2 b2

Equation (6) is the Cross Multiplication method.


Note: b1c2-b2c1; c1a2-c2a1; c1a2-c2a1 .
Example: Solve 5x+2y+2=0
3x+4y-10=0
Solution: Given equations are 5x+2y+2=0 .......(i)
3x+4y-10=0 .......(ii)
Here, a1=5, b1=2, c1=2
a2=3, b2=4, c2=-10
By using cross-multiplication method,we have
x y 1
= =
2 2 2 5 5 2
4 −10 −10 3 3 4

19
x y 1
⇒ = =
−20−8 6−(−50 ) 14

x y 1
⇒ = =
−28 56 14
x 1
Now taking −28 and 14
x 1
⇒ =
−28 14
−28
⇒ x= =−2
14
y 1
Again taking 56 and 14
y 1
⇒ =
56 14
56
⇒ y= =4
14

Therefore,the required solution is (-2,4).

..~***~..
(d) Graphical Method
A system of linear equations in two variables i.e.
a1x+b1y+c1=0
a2x+b2y+c2=0
Here x and y are variables we have to determine it and
a1,a2,b1,b2,c1 and c2 are constants. The solution of such a
system is the order pair that is a solution to both equations.
To solve a system of linear equations graphically we graph
both equations in the same coordinate system. The solution
to the system will be the point where the two lines intersect.
Steps are given below:

20
Finding a Graphical Solution for an Equation
Step 1. Let two the equation represent a function of x &y.
Step 2. Graph the two functions on the same set of axes.
Step 3.Find the point of intersection of the two graphs.
The (x,y)value at this point represent the solution
to the original equations.

Example:2.1 Solve 5x+2y+2=0


3x+4y-10=0
Solution:
Given equation are 5x+2y+2=0 .................(1)
3x+4y-10=0 ................. (2)
Now from equation (1), we have
−1
⇒ y=
2
(5 x+ 2)=f (say) ................(3)
1
⇒ y = (10−3 x )=g
4
(say) .................(4)

Now we plot the graph of two equations (3) and (4).

21
f Linear (f) g Linear (g)

8
f 7

5
g
(-2, 4) 4
3

2
y

0
-5 -4 -3 -2 -1 0 1 2 3 4 5 6 7 8
-1

-2

-3

-4

-5

The two lines are intersected at the point (-2,4).


So, the required solution is(-2,4).

..~***~..

(e) Cramer’s Rule

22
Cramer’s Rule is one of many techniques that can be used to
solve systems of linear equations. Cramer’s Rule involves the use
of determinants to find the solution and like any other technique it
has its advantages and disadvantages. Cramer’s Rule itself is
very simple, but the notation used requires a little bit of
explanation, so let’s take a look at Cramer’s Rule.
For two variables: Here x and y are two unknown variables.

Cramer’s Rule
Dx D
x=
D
, y= y
D

Steps:
Step 1: Find the determinant, D, by using the x and y
values from the problem.
Step 2: Find the determinant, Dx, by replacing the x-values
in the first column with the values after the equal
sign leaving the y and z columns unchanged.
Step 3: Find the determinant, Dy, by replacing the y-values
in the second column with the values after the
equal sign leaving the x and z columns
unchanged.
Step 4: Use Cramer’s Rule to find the values of x, y, and z.

Mathematically:
Consider the equations a1x+b1y+c1=0 ……………….(1)
a 2x+b2y+c2=0 ……………….(2)
where, a1,a2,b1 , b2,c1 and c2 are represent the real numbers.
We can write equations (1) and (2) is of the form
a1x+b1y=d1…………(3)

23
a2x+b2y=d2 .….……..(4)
where, d1=-c1 and d2=-c2 and Eq.(3) and (4) are the standard
form.
To eliminate y, we multiply Eq. (3) by b2 and Eq. (4) by –b1, then
we get
a1b2x+b1b2y=b2d1
-a2b1x-b1b2y=-b1d2
(Adding) a1b2x- a2b1x= b2d1-b1d2
⇒(a1b2- a2b1)x=(d1b2-d2b1)

⇒x=
d1b2-d2b1
…………..(5)
a1b2x-a2b1
Using similar steps to eliminate x from the equations (3) & (4), we
get

⇒y=
a1d2-a2d1
…………..(6)
a1b2x-a2b1
Equation (5) and (6) are the solution of the given system which is
provided by a1b2x- a2b1≠0.These formulas can be written by
using determinants. In the determinant form they are called
Cramer’s Rule.
The solution to the system
a1x+b1y=d1
a2x+b2y=d2
D D
is given by x= Dx , y= Dy , where

| |
D= a
a1 b 1
2 b2
| |
d1 b1
, D x= d
2 b2 | | , provided that D≠0
, Dy= a
a1 d 1
2 d2

Example:2.5 Solve 5x+2y+2=0

24
3x+4y-10=0
Solution:
Given equations are 5x+2y+2=0 …………(i)
3x+4y-10=0 …………(ii)
Equation (i) and (ii) can be written as in standard equation form
i.e.
5x+2y=-2 ………(iii)
3x+4y=10 ………(iv)
Here, a1=5, b1=2, d1=-2
a2=3, b2=4, d2=10

|
D= a b = 3
2 2
| 4|=(5×4)-(3×2)=20-6=14
a1 b 1
|5 2

D =| |=| |={(-2)×4}-(10×2)=-8-20=-28
d1 b1 −2 2
x 10 4
d2 b2

D =| |=| |=(5×10)-{3×(-2)}=50+6=56
a1 d 1 5 −2
y 3 10
a2 d 2

Here D≠0, so we can use Cramer’s Rule

⇒x= Dx =
D −28
14 =-2

⇒y= Dy = 14 =4
D 56

Therefore, the required solution is (-2, 4).

..~***~..

25
(f) Matrix Method
Suppose we have the following system of equation
a1x+b1y+c1=0 ……………….(1)
a2x+b2y+c2=0 ……………….(2)
where, a1,a2,b1 , b2,c1 and c2 are represent the real numbers.
We can write above equations is of the form
a1x+b1y=d1 …………(3)
a2x+b2y=d2 .….……..(4)
where, d1=-c1 and d2=-c2 and Eq. (3) and (4) are the standard
form.
In the matrix notation, the above equations (3) and (4) can be
written as
AX=B ……….(5)
The matrix [Ax=b] is called the augmented matrix. It is formed by
appending the column b to the 2×2 matrix A.
If d1 and d2 are zero then the system of equation is said to be
homogeneous, and if at least one of d1 or d2 is not zero then it is
said to be non-homogeneous. The non-homogeneous system
( Eq. (3),(4) ) has a unique solution if and only if the determinant
of A is nonzero, i.e.

| |
a1 b 1
det(A)= a b ≠0
2 2

The solution of system ( Eq. (3) and (4) ) may be written as


X=A-1B if A-1exists.

[ ], B=[ ],X=[ ]
Here A= a
a1 b1
2 b2
d1
d2
x
y

Adj (A )
X= ¿ A∨¿ ¿ .B ..………(6)

26
Example:2.6 Solve 5x+2y+2=0
3x+4y-10=0
Solution:
Given equations are 5x+2y+2=0 …………(i)
3x+4y-10=0 …………(ii)
Equation (i) and (ii) can be written as in standard equation form
i.e.
5x+2y=-2 ………(iii)
3x+4y=10 ………(iv)
Here, a1=5, b1=2, d1=-2
a2=3, b2=4, d2=10
The above equations are is of the form AX=B,

Where, A= a [ a1 b1
2 b2] [ ],
=
5 2
3 4 [ ] [ ],
d
B= d 1 =
2
−2
10 X=[ xy ]

| |=| |=(5×4)-(3×2)=20-6=14
| A|=
a1 b 1
a2 b 2
5 2
3 4

As |A|≠0 ⇒A-1exists.
Now AX=B ⇒X=A-1B
A11=(-1)1+1 ×4=4
A12=(-1)1+2 ×3=-3
A21=(-1)2+1 ×2=-2
A22=(-1)2+2 ×5=5

[
C A=
A11
A 21 ][
A12
=
4 −3
A22 −2 5 ]

27
AdjA= [ A 11
A 12
A21
][
=
4 −2
A22 −3 5 ]
Adj ( A )
A-1= ¿ A∨¿ ¿

= [ 5 ]
4 −2
−3
14

[ ]
4 −2
14 14
= −3 5
14 14

[ ][ ]
4 −2
14 14 −2
X=A-1B= −3 5 10
14 14

[ ]
−8 20

14 14
= 6 50
+
14 14

[ ]
−28
14
= 56
14

=[ 4 ]
−2

⇒[ y ]=[ 4 ]
x −2

⇒x=-2 and y=4


Therefore, the required solution is (-2, 4).

..~***~..

28
(g) Gauss Elimination Method
Here, the unknowns are eliminated by combining equations such
that n equations is n unknowns are reduced to an equivalent
upper triangular system which is then solved by back substitution
method.
Consider the 2ˣ2 system
a 11 x 1 +a 12 x 2=b1
.......(1)
a 21 x 1+ a22 x 2=b 2

In the first stage of elimination, multiply the first row in Eq. (1) by
a 21/a 11 and subtract from the second row. We get
(2) (2)
a 22 x 2=b 2
.......(2)

( 2) a 21
Where a 22 =a 22− a
a11 12

(2) a21
b 2 =b 2− b
a11 1

Collecting the first equation from the first stage, i. e., from Eq.(1),
we obtain the system
(1) (1) (1)
a 11 x 1+ a22 x 2=b1
.......(3)
(2) (2)
a 22 x 2=b 2

Where a ij(1 )=aij , bij(1)=; i , j=1 , 2


The system (3) is an upper triangular system and can be solved
using the back substitution method. Therefore, the gauss
elimination method gives
Gauss .......(4)
[ A|b⃗
] [U∨c ]
Elimination

29
Where [ A|b ] is the augmented matrix. The elementsa(2) (2)
11 and a 22 which

has been assumed to be non-zero are called pivot elements.


The elimination procedure described above to determine the
unknowns is called the Gauss elimination method. We may also
make the pivot as 1 before elimination, at each step. At the end of
the elimination procedure, we produce 1 at each of the positions
of the diagonal elements.
We now solve the system

a 11 x 1 +a 12 x 2+ …+a1 n x n=b1

a 21 x 1+ a22 x 2 +…+a 2 n x n=b 2


.......(5)

a n 1 x 1+ an 2 x 2 +…+ ann x n =bn

in n unknowns by performing the Gauss elimination on the


augmented matrix [ A|b ]. Denote
bi =a(k)
(k )
i ,n+1 i, k =1(1)n . .......(6)

The elements a(k)


ij with i , j≥ k are given by

(k )
(k+1 ) (k) aik (k)
a ij =a ij (k )
a kj
.......(7)
a kk

i=k + 1, k + 2, n ; j=k +1 , … , n ;
(1 )
Where a ij =aij ,

The elimination is performed in (n-1) steps, k=1, 2, 3… n-1. In the


elimination process, if any one of the pivot elements a(1) (2) (n)
11 , a22 , … … , a nn

vanishes or becomes very small compared to other elements in


that column, then we attempts to rearrange the remaining rows so
as to obtain a non-vanishing pivot or to avoid the multiplication by
a large number. This strategy is called pivoting. The pivoting is
of the following two types.
(i) Partial pivoting:

30
In the first stage of elimination, the first column is searched for the
largest element in magnitude and brought as the first pivot by
interchanging the first equation with the equation having the
largest element in magnitude. In the second elimination stage, the
second column is searched for the largest element in magnitude
among the n−1 element leaving the first element, and this element
is brought as the second pivot by an interchanging of the second
equation with the equation having the largest element in
magnitude. This procedure is continued until we arrived at the
equations (4). We are thus led to the following algorithm to find
the pivot.
Choose j , the smallest integer for which
(k ) (k)
│ a jk │=max │a ik │, k ≤ i ≤ n

and interchange rowsk and j.

(ii) Complete Pivoting:


We search the matrix A for the largest element in the magnitude
and bring it as the first pivot. This requires not only an
interchanging of equations but also an interchanging of the
variables. This leads us to the following algorithm to find the pivot.
Choose land mas the smallest integers for which
│ a(k) (k)
lm │= max │a ij │, k ≤ i, j ≤ n

and interchange rows k and l and columns k and m.


If the matrix A is diagonally dominant or real, symmetric and
positive definite, then no pivoting is necessary.
Example:2.7 Solve 5x+2y+2=0
3x+4y-10=0
Solution:
Given equations are 5x+2y+2=0 …………(i)
3x+4y-10=0 …………(ii)

31
Equation (i) and (ii) can be written as in standard equation form
i.e.
5x+2y=-2 ………(iii)
3x+4y=10 ………(iv)
Taking x=x1 ,y=x2 then above equations becomes
5x1+2x2=-2 ………(v)
3x1+4x2=10 ………(vi)
(i)Normal Elimination:
In the first step we eliminate x1 from the last equation, so we
3
multiply 5 in (v) and subtract from (vi), then we get

( 4− 65 ) x =10+ 65
2

⇒ 14 x 2=56

56
⇒ x 2= =4
14

Now using the backward substitution method, we get


5 x 1+2 × 4=−2

⇒ 5 x 1=−10

−10
⇒ x 1= −2
5

Therefore, the required solution is (-2, 4).


(b)Partial Pivoiting:
The above equations are is of the form AX=B,
Where,

A= a[ a11 a12
21 a22 ]=[ ],
5 2
3 4

32
[ ] 10 [ x ]
b
b= b1 =
2
[ −2
],X=
x 1

The augmented matrix of above equations is given by

[ | ]
[ A|b ] = 5 2 −2
3 4 10

3
R2 → R2 − R1
5

[ |]
5 2 −2
≈ 14 56
0
5 5

Using backward substitution method we get


5 x 1+2 x 2=−2

14 56 .......(vii)
x=
5 2 5
⇒ 14 x 2=56

56
⇒ x 2= =4
14
⇒ x 2=4

Now substitute x2=4 in Eq. (v), we get


5 x 1+2 × 4=−2

⇒ 5 x 1=−10

⇒ x 1=−2

Therefore, the required solution is (-2, 4).

(h) Gauss-Jordan Elimination


Method
Consider the system of n linear algebraic equations in n
unknowns

..~***~..
33
a 11 x 1 +a 12 x 2+ …+a1 n x n=b1

a 21 x 1+ a22 x 2 +…+a 2 n x n=b 2


……(1)

a n 1 x 1+ an 2 x 2 +…+ ann x n =bn

where a ij ,(i , j=1 ( 1 ) n) are the known coefficients, b i ,(i=1 ( 1 ) n)


are the known values and x i ,(i=1 (1 ) n) are the unknowns to be
determined.
Here, the coefficient matrix is reduced to a diagonals matrix
rather than a triangular matrix. At all steps of the Gauss
elimination method, the elimination is done not only in the
equations below but also in the equations above the pivots,
producing the solution without using the back substitution
method. On the completion of the Gauss-Jordan method the
equation (1) becomes

[ ][ ] [ ]
1 0 0 x1 d1
0 …
0 0 0 x2 d2

1


⋮ ⋮ = ⋮
……..(2)
¿0 ¿…
0 0 1 xn dn

The solution is given by


x i=d i , i=1 ,2 , 3 , 4 , … , n

Hence , the Gauss-Jordan method gives


Gauss
[ A|b ]⃗ [I ∨d ]…….. (3)
Jordan

Generally, this method is not used for the solution of a


system of equations as it is more expensive the competition view-
point than the Gauss-elimination method. However, it gives a
simple method for finding the inverse of a given matrix A. we start
with the augmented matrix of A with the identity matrix I of the

34
same order. When the Gauss-Jordan procedure is completed we
obtain
Gauss
[ A|I ]⃗ [I ∨ A−1 ]...........(5)
Jordan

After getting A-1 then we use this formula which is given below
X=A-1 B
Where,

[] []
x1 d1
x2 d2
X= ⋮
and B = ⋮
xn dn

Example:2.8 Solve 5x+2y+2=0


3x+4y-10=0
Solution:
Given equations are 5x+2y+2=0 …………(i)
3x+4y-10=0 …………(ii)
Equation (i) and (ii) can be written as in standard equation form
i.e.
5x+2y=-2 ………(iii)
3x+4y=10 ………(iv)
Taking x=x1 ,y=x2 then above equations becomes
5x1+2x2=-2 ………(v)
3x1+4x2=10 ………(vi)
The above equations are is of the form AX=B,

Where, [
A= a
a11 a12
21 a22 ]=[ ],
5 2
3 4

35
[ ] 10 [ x ]
b
B= b1 =
2
[ −2
], X=
x1

The augmented matrix of above equations is given by

[ | ]
[ A|I ] = 5 2 1 0
3 40 1

R2→R2 –
3
4 R1

[ | ]
5 2 1 0
~ 0
14 −3
1
5 5

5
R2 → 14 R2

[ | ]
1 0
5 2
~ 0 1
−3 5
14 14

R 1→ 5 R1
1

[| ]
1
2 0
1 5
~ 5
−3 5
0 1
14 14

R 1→ R 1 - 5 R2
2

[| ]
2 −1
1 0 7 7
~ 0 1 −3 5
14 14

[ ]
2 −1
−1 7 7
A =
−3 5
14 14

We know that, X=A-1 B

36
⇒ [ ]= [ ][ ]
2 −1
x1 7 7 −2
x2 −3 5 10
14 14

[ ]
2 −1
{ × (−2 ) }+{( )× 10 }
¿ 7 7
−3 5
{( )× (−2 ) }+( ×10)
14 14

[ ]
−4 10

¿ 7 7
6 50
+
14 14

[ ]
−14
¿ 7
56
14

[ ]
¿ −2
4

⇒[ x ]=[ 4 ]
x 1 −2

⇒ x=x 1=−2and
2

y=x 2=4

Therefore, the required solution is (-2, 4).

..~***~..
(i) Triangularization Method
This method is also known as the Decomposition method or the
Factorization method. In this method the coefficient matrix A of
the system of equation (Ax=b) is decomposed or factorized into
the product of a lower triangular matrix L and an upper triangular
matrix U. We write the matrix A as

37
A=LU ……………(1)

Where

[ ]
l 11
0 0 … 0
l 21 l
0 … 0
L=
22
l 31 l l … 0
32 33
⋮ ¿ l ¿ l ¿ … ¿l
nn
l n1 n 2 n 3

and

[ ]
u11 u u u1 n
12 13 …
0
u u23 … u2 n
U= 0 22
u … u3 n
⋮ 0 33
¿ 0 ¿ 0 ¿ … ¿ unn
0

Using the matrix multiplication rule to multiply the matrices L and


U and comparing the elements of the resulting matrix with those
of A we obtain

l i1u1j + l i2u2j +….+ l inunj = a ij , j= 1(1)n


…………(2)

where lij=0,j > i and uij = 0, i > j.

The system of equations involves n 2 + n unknowns. Thus, there


are n parameter family of solutions. To produce a unique solution
it is convenient to choose either uii = 1or lii = 1, I = 1(1)n.

When we choose
(i) uii = 1, the method is called the Crout’s method,
(ii)lii = 1,the method is called the Doolittle’s
method.

38
When we take uii =1, I =1(1)n, the solution of the equations (2) may
be written as j-1

lij = aij – ∑ lik ukj , i ≥ j …….(3)


∑ lik u kj)/lii, i < j
uij = (aij –j-1K=1 …………..(4)
uii = 1.
K=1

We note that the first column of the matrix L is identical


with the first column of the matrix A. That is
li1 = ai1 , i = 1(1)n ………(5)
we also note that
u1j = a1j / l11 , j = 2(1)n ……..(6)
The first column of L and the first row of U have been
determined. We can now proceed to determine the second
column of L and the second row of U.
li2 = ai2 – li1 u12 , I = 2(1)n

u2j = (a2j – l21 u1j )/ l22 , j = 3(1)n. ………(7)

Next, we find the third column of L followed by the third row of U.


Thus, for the relevant indices I and j, the elements are computed
in the order
l i 1 , u1 j ; l i 2 , u2 j ; l i 3 , u3 j ; … … ; l i , n−1 , un−1 , j ; l nn.

Having determined the matrices L and U, the system of equation


i.e (Ax=b) becomes

LUx=b ………..(8)

39
We write Eq. (8) as the following two system of equations
Ux=z ………(9)

Lz=b …………..(10)

The unknowns z1,z2,z3,….,zn in (10) are determined by


forward substitution and the unknowns x 1,x2,x3,….,xn in (9) are
obtained by back substitution. Alternatively, we find L-1and U-1to
get
z = L-1 b and x = U-1 z. …….(11)

The inverse of A can also be determined from

A-1 = U-1 L-1 ………(12)


This method fails if any of the diagonal elements lii or uii is zero.
The L U decomposition is guaranteed when the matrix A is
positive definite. However, it is only a sufficient condition.

(i)Crout's Method:

Consider the following 2x2 square matrix

Here solving the system of equation of the form Ax=b where

A=a a ,
21 22
[ a11 a12
]
[] x1
x = x and b= b
2 2
[]
b1

40
The matrix A is factorized as a product of two matrices L (lower
triangular matrix) and U (upper triangular matrix) as follows:

[ l 11 0 1 u12
l 21 l22 0 1 ][ ] = [ a11 a12
a21 a22 ]
⇒l [ ]=[ ]
l 11 l 11 u12 a11 a12
21 l21 u12+l 22 a21 a22

This implies
l 11=a 11;

l 21=a 21;

l 11 u12=a 12

⇒u = l = a ;
a12 a12
12
11 11

l 21 u12 +l 22=a 22

⇒l =a -
22 22 l 11 u12

Once all the value of lij’s and uij’s are obtained, we can write
A x= b as L U x = b

][ ] =[ ]
Let U x = y, then L y = b

[⇒l
l 11 0 y1 b1
l22 y 2 b2

⇒[ ]=[ ]
21

l 11 y 1 b1
l 21 y 1+ l 22 y 2 b2

By forward substitution, we get


l 11 y 1=b1

41
⇒ y1 = l11 ;
b1

⇒l = -
l 21 y 1 +l 22 y 2=b2

22 y2 b2 l 21 y 1

⇒y = l 22 ( 2 - l 21 y 1)
1
2 b

By forward substitution we obtain,

⇒[ ][ ] = [ ]
Ux=y
1 u 12 x 1 y1
0 1 x2 y2

⇒[ ]=[ ]
x1 +u12 x2 y1
x2 y2

By backward substitution, we get


x2 = y2

⇒x =
x 1+ u12 x 2= y 1

1 y1 -u 12 x2

(ii)Doolittle’s Method:
Consider the following 2x2 square matrix
Here solving the system of equation of the form Ax=b where

A= a [ a11 a12
21 a22 ], x = [ ]and b = [ ]
x1
x2
b1
b2

The matrix A is factorized as a product of two matrices L (lower


triangular matrix) and U (upper triangular matrix) as follows:

[ ][
1 0 u11 u12
l 21 1 0 u22 ] [ ]
=
a11 a12
a21 a22

⇒l [ ]=[ ]
u11 u12 a11 a12
21 u11 l 21 u12+u 22 a21 a22

42
This implies
u11=a 11;

u12=a 12;

l 21 u11=a 21⇒l 21= = a11 ;


a21 a21
u11

l 21 u12 +u22=a 22⇒u22=a 22 - l 21 u12.

Once all the value of lij’s and uij’s are obtained, we can write
A x= b as L U x = b

[ ][ ] =[ ]
Let U x = y, then L y = b
⇒ l21
1 0 y1 b1

⇒l =
1 y2 b2

[ y1
21 y 1+ y 2
] [] b1
b2
By forward substitution, we get
⇒ y 1 =b 1 ;
⇒ y 2 =b 2−l21 y 1
By forward substitution we obtain, U x = y

⇒ [ ][ ] [ ] =
u11 u 12 x 1 y1

⇒ ]=[ ]
0 u 22 x 2 y2

[ u11 x1 +u12 x2
u 22 x 2
y1
y2

By backward substitution, we get


y2
x2 =
u11 x 1+ u12 x 2= y 1⇒ x 1
u22
1
= u11 ( y 1 - u12 x 2)

Example:2.9 Solve 5x+2y+2=0


3x+4y-10=0

43
Solution:
Given equations are 5x+2y+2=0 …………(i)
3x+4y-10=0 …………(ii)
Equation (i) and (ii) can be written as in standard equation form
i.e.
5x+2y=-2 ………(iii)
3x+4y=10 ………(iv)
Taking x=x1 ,y=x2 then above equations becomes
5x1+2x2=-2 ………(v)
3x1+4x2=10 ………(vi)
The above equations are is of the form AX=B,
Where,

[
A= a
a11 a12
21 a22 ][ ]
=3
5 2
4 , [ ] 10 [ x ]
b
B= b1 =[
2
−2
], X=
x
,let Z =[z ]
z1

2
1

A X= B as LU X = B
Let U X = Z, then L Z = B

(i)By Crout's Method:

The matrix A is factorized as a product of two matrices L (lower


triangular matrix) and U (upper triangular matrix) as follows:

[ 53 24]=[ll 11

21
][ ]
0 1 u 12
l 22 0 1

⇒3[ ][ ]
5 2 l 11 l 11 u12
4 =l l21 u12+l 22
21

This implies
l 11=5;

44
l 21=3;

l 11 u12=2

⇒u12= l11 = 5 ;
2 2

l 21 u12 +l 22=4

⇒l22=4 -
2 6 14
l 11 u12=4−3 × =4− =
5 5 5

Thus we have

[ ] [ ]
5 0 2
1
L= 3
14 and U= 5
5 0 1

Now L Z =B ⇒Z=L-1 B

⇒Z =
[ ][ ] [ ]
−1
5 0 −2
−2
3
14
10
= 5
5 4

Now U X = Z⇒X=U-1 Z

⇒ X= [ ] [ ] [ ][ ] [
−1
2 −2 −2 −2
1
0
5
1
5 =
4
1
0 1
5 5 =
4
−2
4 ]
⇒[ ][ ]
x1 −2
=
x2 4

⇒ x=x 1=−2and y=x 2=4

Therefore, the required solution is (-2, 4).

(ii)By Doolittle’s Method:


The matrix A is factorized as a product of two matrices L (lower
triangular matrix) and U (upper triangular matrix) as follows:

45
[ 53 24]=[l1 01] [ u0 uu ]
21
11 12

22

⇒[ 3 4 ]=[l u l u +u ]
5 2 u 11 u 12

21 11 21 12 22

This implies
u11=5;
u12=2;
l 21 u11=3

⇒l21= u11 = 5 ;
3 3

l 21 u12 +u22=4 ⇒u22=4− × 2=4− =


3 6 14
5 5 5

Thus we have

[ ] [ ]
1 0 5 2
L= 3
1 and U= 0 14
5 5

Now L Z =B ⇒Z=L-1 B

⇒Z =
[ ][ ] [ ]
−1
1 0 −2
−2
3
1 10
= 56
5 5

Now U X = Z⇒X=U-1 Z

⇒X=
[ ][ ]
−1
5 2 −2
14 56
0
5 5

[ ][ ]
1 −1
5 7 −2
¿ 56
5
0 5
14

¿ −2
4[ ]

46
⇒[ x ]=[ 4 ]
x1 −2
2

⇒ x=x 1=−2and y=x 2=4

Therefore, the required solution is (-2, 4).

..~***~..

(j) Partition Method


Partition method is used to find the inverse of a matrix. Let the
coefficient matrix A be partitioned as

A= [ BE CD ] ………..(1)
where, B is an r × r matrix,
C is an r × s matrix,
E is an s × r matrix
D is an s × s matrix.
Here r and s are positive integers with r + s = n. Further ,we also
assume that A-1 is partitioned similarly as

47
[ X YV ] ……..(2)
A-1= Z

Where, X, Y, Z and V are matrices of the same orders as B, C,


E, D respectively. Then we have

AA-1= [ BE CD ] [ XZ YV ]=[ I0 I0 ]
1

2
……..(3)

Where, I1 and I2 are identity matrices of orders r and s


respectively. From equation (3)
B X + C Z = I1
B Y + D Z =0
……..(4)
E X + D Z =0
E Y + D V = I2

From these equations we get


V = (D - E B-1 C)-1
Y = - B-1 C V
Z = - (D – E B-1 C)-1 E B-1 = - V E B-1 ……..(5)

X = B-1 (I1 – C Z)=B-1 – B-1 C Z


It is obvious that we need to find two inverse matrices B-1and
(D - E B-1 C)-1 of order r and s respectively.
When we get A-1 then we apply Matrix Method after calculating
we get the solution to the system of linear equations.
Example:2.10 Solve 5x+2y+2=0
3x+4y-10=0
Solution:

48
Given equations are 5x+2y+2=0 …………(i)
3x+4y-10=0 …………(ii)
Equation (i) and (ii) can be written as in standard equation form
i.e.
5x+2y=-2 ………(iii)
3x+4y=10 ………(iv)

Here, A= a [ a1 b1
2 b2
] [ ],
=
5 2
3 4 [ ] [ ],
d
b= d 1 =
2
−2
10 a=[ xy ]
a = A-1 b ........(v)
where equation (v) is the Matrix Method formula .Now using
Partition Method.
Let the matrix A be partitioned as

A= [ BE CD ]=[53 24 ]
B =5, C=2, D = 4, E = 3
1
B-1= 5
1 6 14
D - E B-1 C = 4 - 3× 5 ×2 = 4 - 5 = 5
5
V = (D - E B-1 C)-1= 14
1 5 1
Y = - B-1 C V = - 5 ×2× 14 = -7
Z = - V E B-1

⇒Z= - 14 ×3× 5
5 1 3
=- 14

X = B-1 (I1 – C Z)=B-1 – B-1 C Z

⇒X =
1 1 −3 1 3 10 2
5 - 5 ×2× 14 = 5 + 35 = 35 = 7

49
[ ]
2 1
Now A-1= Z[ X YV ]= 7
3
7
5
14 14

Now for solution a = A-1 b

[ ][ ]
2 1
7 7 −2
a= 3 5 10
14 14

⇒y= [][ ][ ][ ]
−4 10 −14

x 7 7 7 −2
6 50 = 56 = 4
+
14 14 14

Therefore, the required solution is (-2, 4).

..~***~..
(k) Cholesky Method
This method is also known as the square-root method. If
the coefficient matrix A is the symmetric and positive definite, the
matrix A can be decomposed as
A=L LT ……..(1)
Where L ¿(lij),l ij=0 ,i< j. Alternatively, A may be decomposed as
A=UUT . ………(2)
For Eq. (1),the systems Ax=b becomes
LLTx=b ……..(3)
Which may be written as
LT x=z …………..(4)

50
L z=b. ………….(5)
The intermediate solution value z i ,i=1(1)n are obtained from
Eq.(5) by forward substitution and the solution values x i ,i=1(1)n
are determined from Eq.(4) by back substitution . Alternatively,
we can find only one inverse L-1 and obtained
z=L-1b …………(6)
and
x= (LT)-1z= (L-1)Tz …….(7)

This results in substantial saving of computational work. The


inverse of A may be obtained from
A-1 = (L-1)T L-1 ………(8)
The elements of the lower triangular matrix L may be obtained as

( )
i−1 1
l ii = aii −∑ l ij 2 2
,i=1 , 2 ,3 , … .. , n
j=1

( )
i−1
1
l ij = aij −∑ l jk l ik ,i= j+1 , j+ 2 ,… .. , n ; j=1(1) n
l ii j=1

l ij =0 , i< j ……….(9)

where the summation is taken as zero if the upper limit is less


than the lower limit. For Eq.(2) the elements uij are given by
1/ 2
unn=(a nn)

a¿
u¿ = , i=1 ,2 , 3 , ….. ,(n−1)
unn

51
( )
n
uij = aij − ∑ u ik u jk /u jj
k= j+1

i=n−1 , n−2 , … … … , 1; j=i+1 ,i+2 , … . ,n−1

( )
n 1/ 2
uii = aii − ∑ uik 2
,i=n−1 , n−2 , … … , 1
k=i +1

uij =0 , i> j . …………..(10)

Example:2.11 Solve the system of equations

5 x+ 2 y +2=0………….(i)

3 x+ 4 y −10=0 …………..(ii)

Solution: We can write the equation is of the form

5 x+ 2 y =−2

3 x+ 4 y =10 ……..(iii)

We cannot solve the above system (iii) by using Cholesky


method, because this system (iii) is not a symmetric and positive
definite.

Consider the another 2×2 symmetric and positive definite system

x +2 y=4
……..(iv)
2 x+5 y =5

Here, A¿ [12 25], b¿ [ 45], X¿ [ xy ]

52
Here, A=AT, so A is a symmetric matrix. Now we can apply
Cholesky method

[ ][ ][ ] [ ]
2
1 2 l 0 l l l l l
A¿ 2 5 = l11 l 011 l12 = l 11l l 112 +l21 2
21 22 22 21 11 21 22

Comparing the corresponding elements on the both sides, we get

First row:
2
l 11 =1

⇒ l 11 =1

l 11 l 21=2

⇒ l 21=2

Second row:
2 2
l 21 +l 22 =5
2 2
⇒ 2 +l 22 =5
2
⇒ l 22 =5−4
2
⇒ l 22 =1

⇒ l 22=1

Hence, we get A=LLT

where, L¿ [12 01]


We write the given system of equation as
LLT X = b
⇒LY=b and LT X=Y

53
where, Y= []y1
y2

From LY=b

⇒ [ ][ ] [ ]
1 0 y1
2 1 y2
=
4
5

[] [ ] [ 5 −3 ]
] [
−1
y1 1 0 4 4
⇒ = =
y2 2 1

From LT X=Y

[ 12 01] [ xy ] =[−34 ]
[][ ][ ][ ]
−1
x 1 0 4 10
⇒ = =
y 2 1 −3 −3

Therefore, the required solution is (10, -3).

..~***~..

54
(l) Jacobi Iteration Method
Consider the system of n linear algebraic equations in n
unknowns
a 11 x 1 +a 12 x 2+ …+a1 n x n=b1

a 21 x 1+ a22 x 2 +…+a 2 n x n=b 2


……(1)

a n 1 x 1+ an 2 x 2 +…+ ann x n =bn

In the matrix notation, the system (1) can be written as


A X = B ………..(2)
We assume that the quantities a ii in Eq. (2) are pivot elements.
The equations (2) may be written as
a 11 x 1=−( a12 x 2 +a 13 x 3+ …+a1 n x n ) +b1

a 22 x 2=−(a ¿ ¿ 21 x1 +a 23 x 3 +…+a 2 n x n)+ b2 ¿


……(3)

a nn x n=−(a ¿ ¿ n 1 x 1+ an 2 x 2 +…+ an ,n −1 x n−1)+b n ¿

The Jocobi iteration method or Gauss-Jacobi iteration method


may now be defined as
(k+1 ) −1
x1 = (a12 x 2(k )+ a13 x 3( k ) +…+a 1 n x n(k )−b1 )
a11

(k+ 1) −1 (k) (k) (k)


x2 = (a¿¿ 21 x1 +a23 x3 +…+ a2 n x n −b 2)¿
a22 …(4)

(k +1) −1 (k) (k) (k)


xn = (a¿¿ n 1 x1 +a n2 x 2 +…+ an , n−1 x n−1 −bn )¿
ann

k =0 , 1 ,2 , … .

55
Since, we replace the complete vector x(k) in the right side of Eq.
(4) at the end of each iteration, this method is also called as the
method of simultaneous displacement.
In matrix form, the method can be written as
( k +1) −1 (k ) −1
x =−D ( L+U ) x + D B

(k)
¿ H x +C ,k =0 , 1 ,2 , … . ……(5)

Where, −1 −1
H=− D ( L+U ) , C=D B

And L and U respectively lower and upper triangular matrices


with zero diagonal entries, D is the diagonal matrix such that
A = L + D + U.
Equation (5) can alternatively be written as
( k +1) (k) −1 ( k) −1
x =x −[I + D ( L+ U ) ] x + D B

(k ) −1 (k ) −1
¿ x −D [ D+ L+U ] x + D B

¿ x (k )+ D−1 [ B− A x ( k ) ] ……(6)

or v(k)= D-1 r(k) ………(7)

Where, v(k) = x(k+1) + x(k), is the error in the approximation and


r(k)=B– Ax(k) is the residual vector.

We may rewrite the above equation as

D v(k) = r(k) …….(8)

We solve for v(k) and find x


( k +1) (k)
=x + v . These equations describe
(k)

the Jacobi iteration method in an error format.

Example:2.12 Solve 5x+2y+2=0

56
3x+4y-10=0
Solution:
Given equations are 5x+2y+2=0 …………(i)
3x+4y-10=0 …………(ii)
Equation (i) and (ii) can be written as in standard equation form
i.e.
5x+2y=-2 ………(iii)
3x+4y=10 ………(iv)

L= [ 03 00], D= [ 50 04], U= [ 00 20], B=[−210],


−1
H=− D ( L+U )

[ ] ([ 03 00]+[00 20])
−1
5 0
¿−
0 4

[ 50 04 ] [ 03 20]
−1
¿−

[ ][
1
0
¿−
5
0
0 2
1 3 0 ]
5

¿
[−0.75
0 −0.4
0 ]
−1
C=D B

[ ][ ]
1
0
5 −2
¿
1 10
0
5

[ ]
¿ −0.4
2.5

So, by Jocobi iteration method


(
x k +1 =
)
[−0.75
0
0 ] [ ]
−0.4 (k ) −0.4
x +
2.5
, k=0 , 1 , 2, … .

57
Starting k =0,
(0)
[ ]
x = −1.5
2.5

=[ −1.4 ]
(1)
k =1, x
3.625

=[−1.80 ]
(2)
k =2, x
3.550

Table for the value of x and y:


Value of k x y
0 -1.4 3.675
1 -1.85 3.550
2 -1.82 3.8875
3 -1.9550 3.8650
4 -1.9460 3.9663
5 -1.9865 3.9545
6 -1.9832 3.9298
7 -1.9960 3.9879
8 -1.9951 3.9970
9 -1.9982 3.9964
10 -1.9985 3.9991
11 -1.9996 3.9989
12 -1.9996 3.9997
13 -1.9999 3.9997
14 -1.9999 3.9999
15 -2.0000 3.9999
16 -2.0000 4.0000

Therefore, the required solution is (-2, 4).

(m) Gauss-Seidel Iteration


Method
..~***~..
58
Consider the system of n linear algebraic equations in n
unknowns
a 11 x 1 +a 12 x 2+ …+a1 n x n=b1

a 21 x 1+ a22 x 2 +…+a 2 n x n=b 2

⋮ ……(1)
a n 1 x 1+ an 2 x 2 +…+ ann x n =bn

In the matrix notation, the system (1) can be written as


A X = B……..(2)
We assume that the quantities a ii in Eq. (2) are pivot elements.
The equations (2) may be written as
a 11 x 1=−( a12 x 2 +a 13 x 3+ …+a1 n x n ) +b1

a 22 x 2=−(a ¿ ¿ 21 x1 +a 23 x 3 +…+a 2 n x n)+ b2 ¿

⋮ ……(3)

a nn x n=−(a ¿ ¿ n 1 x 1+ an 2 x 2 +…+ an ,n −1 x n−1)+b n ¿

(k+1 ) −1
x1 = (a x (k )+ a13 x 3( k ) +…+a 1 n x n(k )−b1 )
a11 12 2

(k+ 1) −1 (k) (k) (k)


x2 = (a¿¿ 21 x1 +a23 x3 +…+ a2 n x n −b 2)¿
a22 ……(4)

(k +1) −1 (k) (k) (k)


xn = (a¿¿ n 1 x1 +a n2 x 2 +…+ an , n−1 x n−1 −bn )¿
ann

k =0 , 1 ,2 , … .

We now use on the right hand side of Eq. (4), all the available
values from the present iteration. We write the Gauss-Seidel
method as
−1 b1
x1
(k+1 )
=
a11
( a12 x 2 + a13 x 3 + …+a 1n x n ) +
(k ) (k ) (k )
a11

59
(k+ 1) −1 (k+1) (k) (k) b2
x2 = (a¿¿ 21 x1 +a 23 x 3 + …+a2 n x n )+ ¿
a22 a22 ……(5)

(k +1) −1 (k+1) (k +1) (k+1) bn


xn = (a¿¿ n 1 x1 + an 2 x 2 +…+a n ,n−1 x n−1 )+ ¿
ann ann

which may be re arranged in the form


n
a 11 x 1 ( k+1)
=−∑ a1 i x i( k ) +b1
i=2

n
a 21 x 1(k+1) + a22 x 2(k +1)=−∑ a2 i x i(k) + b2 ……(6)
i=3


(k+1 ) (k+1) (k+1)
an1 x1 + an 2 x 2 +…+ ann x n =bn

Since we replace the vector x(k) ion the right side of Eq. (4)
element by element, this method is also called the method of
successive displacement.
In matrix notation Eq. (6) becomes
(D + L)x(k+1)=-Ux(k)+b
or
( ) −1
x k +1 =−( D+ L ) Ux k +(D+ L) B
( ) −1 ……(7)
(k)
¿ H x +C ,k =0 , 1 ,2 , … .

Where, −1
H= ( D+ L ) U , C=(D+ L) B
−1

And L and U respectively lower and upper triangular matrices


with zero diagonal entries, D is the diagonal matrix such that
A = L + D + U.
Equation (7) can alternatively be written as
( k +1) (k) −1 (k ) −1
x =x −[I +(D+ L) U ] x +(D+ L) B
( ) −1 ( ) −1
¿ x k −( D+ L ) ( D+ L+ U ) x k + ( D+ L ) B
( ) −1 ( ) −1
¿ x k −( D+ L ) A x k + ( D+ L ) B
……(8)

60
( ) −1 ( )
¿ x k + ( D+ L ) (B− A x k )

We write v(k)= ( D+ L )−1 r(k)………(9)


Where, v(k) = x(k+1) - x(k) and r(k)=B– Ax(k) is the residual vector.
We may rewrite the above equation as
(D+L) v(k) = r(k) …….(10)
and solve for v(k)by forward substitution. The solution is then
found from
x
( k +1)
=x + v
(k)
.
(k)

These equations describe the Gauss-Seidel method in an error


format.

Example:2.13 Solve 5x+2y+2=0


3x+4y-10=0
Solution:Given equations are 5x+2y+2=0 …………(i)
3x+4y-10=0 …………(ii)
Using the Gauss-Seidel method given in the equation x(0)=[0 0
0]T and perform ten iteration.
Equation (i) and (ii) can be written as in standard equation form
i.e.
5x+2y=-2 ………(iii)
3x+4y=10 ………(iv)

We have L = [ 03 00],D = [ 50 04], U= [ 00 20], B¿ [−210],


D+L=[ 3 4 ]
5 0

The Gauss-Seidel method gives


( ) −1 ( ) −1
x k +1 =−( D+ L ) Ux k +(D+ L) B

61
[ ]
1
0
[ ]
−1
-1¿ 5 0 5
(D+L) =
3 4 −3 1
20 4

[ ][ ]
1
0
5 −2
C=(D+L)-1B¿ −3 1 10
20 4

[]
−2
¿ 5
14
5
−1
H= ( D+ L ) U

[ ][
1
0
¿−
5
−3
0 2
1 0 0 ]
20 4

[ ]
2
0
5
¿−
−3
0
10

[ ]
−2
0
5
¿
3
0
10

[ ] []
−2 −2
0
5
x ( 0 ) =[ 0 0 0 ]
T
and x (k +1)= x ( k ) +¿ 5
3 14
0
10 5

Starting with zero initial vector, we get

[ ] [ ][
−2 −2
0
x (1 )=
0
5 (0 )
3
x + 5
14
= −0.4000
2.8000 ]
10 5

62
[ ] [ ][
−2 −2
0
x (2 )=
0
5 x ( 1) +
3
5
14
= −1.5200
3.6400 ]
10 5

Table for the ten iteration:

k x y
0 0 0
1 -0.4000 2.8000
2 -1.5200 3.6400
3 -1.8560 3.8920
4 -1.9568 3.9676
5 -1.9870 3.9902
6 -1.9961 3.9971
7 -1.9988 3.9991
8 -1.9997 3.9997
9 -1.9999 3.9999
10 -2 4

Therefore, the required solution is (-2, 4).

..~***~..

RESULTS &
DISCUSSION
Part-I
Simple Method is very useful to solve a linear equation
because it has only simple calculations like addition, subtraction,
multiplication and division etc. But in case of other methods like

63
(i) Flow Chart:
 We need to know the all property of different shapes.
 We need to draw every shape in sequentially.
(ii) Algorithm:
 First we draw a flowchart, then we can write an algorithm on
the basis of the flow chart.
 The algorithm is a sequential process so we need here
more attentions.
(iii) C++ Program:
 First we need a computer system and also need a software
to run the program.
 It is very costly.
 Before write a C++ program, we must draw a flow chart and
write an algorithm of the program. So, it needs more time,
more attention, more knowledge about computer system,
C++ Software and C++ language.
(iv) Graphical Method:
 It must require a graph paper and a compass box to plot the
graph.
 Then solve the equations and draw the line. It needs more
time, more knowledge, more attention.
 We need to find the point of intersection the equations.
So, the Simple Method is better for solving a linear equation.

Part-II
 Gauss Jordan elimination Method is usually more
convenient to use and easy to solve a system of linear
equation. Because the other methods need more time, more
attention, more knowledge, more calculation, and have

64
more errors. But Gauss Jordan Elimination Method has no
error.
 Gauss elimination Method help to put a matrix in row
echelon form, while Gauss Jordan Elimination Method puts
a matrix in reduced row echelon form. For small system (or
by hand) it is usually more convenient to use Gauss Jordan
Elimination and explicitly solve for each variable
represented in matrix system. However, Gaussian
Elimination in itself is occasionally all you need to determine
the rank of a matrix ( an important property of each matrix )
while going through the trouble to put a matrix in reduced
row echelon form is not worth it to only solve for the matrix's
rank.
 Gauss Jordan Elimination Method is a direct method.
 Iteration methods like Jacobi Iteration Method and Gauss
Seidel Iteration Method need more time, more attention,
more calculation and a scientific calculator to calculate and
have more errors.

65
CONCLUSION
In Part-I, there many different methods to solve “A Linear
Equation” and in my opinion, there is a method named “Simple
Method” is very easy and useful to solve a linear equation.
In Part-II, here also there many different methods to solve
the “System Of Linear Equations” and in my opinion, there is a
method named “Gauss Jordan Elimination Method” is very
easy and useful to solve the system of linear equations because
by reducing the row we can easily get the solution of linear
equations.

66
REFERENCE
1. Linear Algebra and its Applications, 3rd Ed., Pearson Education
Asia, Indian Reprint,2007, David C. Lay.

2. B.P. Acharya and R.N. Das, A Course on Numerical Analysis,


Kalyani Publishers, New Delhi,Ludhiana.

3. Brian Bradie, A Friendly Introduction to Numerical Analysis,


Pearson Education, India, 2007.

4. M.K. Jain, S.R.K. Iyengar and R.K. Jain, Numerical Methods for
Scientific and Engineering Computation, 6th Ed., New age
International Publisher, India, 2007.Page:104 -165

5. Elements of Mathematics,Vol-I,Vol-II.

6. Mathematics (10th Class)

7. C.F. Gerald and P.O. Wheatley, Applied Numerical Analysis,


Pearson Education, India, 2008.

8. Uri M. Ascher and Chen Greif, A First Course in Numerical


Methods, 7th Ed., PHI Learning Private Limited, 2013.

9. John H. Mathews and Kurtis D. Fink, Numerical Methods using


Matlab, 4th Ed., PHI Learning, Private Limited, 2012.

10. www.wikipedia.org

11. www.scribd.com

67
68

You might also like