Math Project
Math Project
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 m 1 x 1+ am 2 x2 + …+amn x n=b m
[ ] [ ] [ ][ ]
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
[ ] [] []
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
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.
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
⇒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;
}
..~***~..
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.
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.
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)
⇒ ( 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
⇒ 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
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
⇒ 6 x−20 x−8−20=0
⇒−14 x−28=0
⇒ 14 x =−28
−28
⇒ x= =−2
14
⇒ 2 y−8=0
⇒ y =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)
a2a2x+a2b1y+a2c1=0 ..........(3)
a1a2x+a1b2y+a1c2=0 ...........(4)
⇒ ( a2 b1−a 1 b 2) x + ( a 1 c 2−a2 c1 ) =0
−a1 c2 −a2 c 1
⇒ y=
a1 b2−a2 b1
c 1 a2−c 2 a1
⇒ y= ..........(5)
a1 b 2−a 2 b1
b1 c 2−b2 c 1
⇒ x= ..........(6)
a 1 b 2−a2 b1
17
Multiplying equation (i) by 3 and (ii) by 5, we get
⇒ 15 x +6 y +6=0 ..........(iii)
⇒ 14 y=56
56
⇒ y= =4
14
⇒ y =4
⇒ 5 x +8+2=0
⇒ 5 x +10=0
⇒ 5 x=−10
⇒ x=−2
..~***~..
(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
y 1 ..........(4)
=
c 1 a 2−c 2 a1 a 1 b 2−a2 b1
a1 b1
If a1b2-a2b1≠0⇒ a ≠
b2
2
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
..~***~..
(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.
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
..~***~..
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
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
⇒x= Dx =
D −28
14 =-2
⇒y= Dy = 14 =4
D 56
..~***~..
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
[ ], 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
..~***~..
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
29
Where [ A|b ] is the augmented matrix. The elementsa(2) (2)
11 and a 22 which
a 11 x 1 +a 12 x 2+ …+a1 n x n=b1
(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 ,
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
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
⇒ 5 x 1=−10
−10
⇒ x 1= −2
5
A= a[ a11 a12
21 a22 ]=[ ],
5 2
3 4
32
[ ] 10 [ x ]
b
b= b1 =
2
[ −2
],X=
x 1
[ | ]
[ A|b ] = 5 2 −2
3 4 10
3
R2 → R2 − R1
5
[ |]
5 2 −2
≈ 14 56
0
5 5
14 56 .......(vii)
x=
5 2 5
⇒ 14 x 2=56
56
⇒ x 2= =4
14
⇒ x 2=4
⇒ 5 x 1=−10
⇒ x 1=−2
..~***~..
33
a 11 x 1 +a 12 x 2+ …+a1 n x n=b1
[ ][ ] [ ]
1 0 0 x1 d1
0 …
0 0 0 x2 d2
⋮
1
⋱
…
⋮ ⋮ = ⋮
……..(2)
¿0 ¿…
0 0 1 xn dn
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
Where, [
A= a
a11 a12
21 a22 ]=[ ],
5 2
3 4
35
[ ] 10 [ x ]
b
B= b1 =
2
[ −2
], X=
x1
[ | ]
[ 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
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
..~***~..
(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
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
LUx=b ………..(8)
39
We write Eq. (8) as the following two system of equations
Ux=z ………(9)
Lz=b …………..(10)
(i)Crout's Method:
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
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
⇒[ ][ ] = [ ]
Ux=y
1 u 12 x 1 y1
0 1 x2 y2
⇒[ ]=[ ]
x1 +u12 x2 y1
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
[ ][
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;
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
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
[ 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
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
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
..~***~..
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
AA-1= [ BE CD ] [ XZ YV ]=[ I0 I0 ]
1
2
……..(3)
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 =
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
[ ][ ]
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
..~***~..
(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)
( )
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)
a¿
u¿ = , i=1 ,2 , 3 , ….. ,(n−1)
unn
51
( )
n
uij = aij − ∑ u ik u jk /u jj
k= j+1
( )
n 1/ 2
uii = aii − ∑ uik 2
,i=n−1 , n−2 , … … , 1
k=i +1
5 x+ 2 y +2=0………….(i)
3 x+ 4 y −10=0 …………..(ii)
5 x+ 2 y =−2
3 x+ 4 y =10 ……..(iii)
x +2 y=4
……..(iv)
2 x+5 y =5
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
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
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
..~***~..
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
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
(k ) −1 (k ) −1
¿ x −D [ D+ L+U ] x + D B
¿ x (k )+ D−1 [ B− A x ( k ) ] ……(6)
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)
[ ] ([ 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
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
⋮ ……(1)
a n 1 x 1+ an 2 x 2 +…+ ann x n =bn
⋮ ……(3)
(k+1 ) −1
x1 = (a x (k )+ a13 x 3( k ) +…+a 1 n x n(k )−b1 )
a11 12 2
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)
⋮
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
60
( ) −1 ( )
¿ x k + ( D+ L ) (B− A x k )
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
[ ] [ ][
−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
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
..~***~..
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.
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.
10. www.wikipedia.org
11. www.scribd.com
67
68