MODULE III
NUMERICAL SOLUTION OF ALGEBRAIC AND TRANSCENDENTAL EQUATIONS
A .To find the roots of the equation f(x) = 0.
Bisection Method
It consist of locating the roots of the equation f(x) = 0betwen a and b. Suppose f(x) is continuous between a and b and f(a) is -ve and f(b) is positive. Then the first approximation to the root is x1 = .If f( x1) =0 then x1 is a root of f(x) =0. If f( x1) is positive then the root lies between a and x1.
If f(x1) is -ve, root lies between x1and b. Then bisect the interval as before and continue the process until the root is found to desired accuracy.
Problem 1
Find the root of the equation x3- 4x - 9=0 using the bisection method in 4 stages.
Solution
Let f(x) = x3- 4x – 9
Then f(1) = -12
f(2) = -9
f(3) = 6
Here f(2) is -ve and f(3) is positive. Therefore root lies in (2,3)
Hence the first approximation to the root is x1 = =2.5
f( x1) = 2.53- 4x2.5 – 9 = -3
Root lies between 2.5 and 3.
x2 = =2.75
f( x2) = 2.753- 4x2.75 – 9 = 0.79
Root lies between 2.5 and 2.75.
x3 = =2.625
f( x3) = 2.6253- 4x2.625 – 9 = -1.4121
Root lies between 2.625 and 2.75.
x4 = =2.6875
required root is x4 = 2.6875
Note
Negative root of the equation f(x) = 0 is equal to the -ve of +ve root of the equation f(-x) =0
Problem 2
Find a -ve root of the equation x3+1 = sinx
Solution
Given equation is sinx - x3-1 = 0
Negative root of sinx - x3-1 = 0 ≡ -ve of positive root of sin(-x) - (-x)3-1 = 0
Now to find the +ve root of x3 sinx – 1 = 0
Let f(x) = x3 sinx – 1
Then f(1)= 1- sin1-1 = -0.84
f(2)= 8- sin2-1 = 6.09
Therefore f(1) is -ve and f(2) is +ve.
Rootlies in (1,2)
Hence the first approximation to the root is x1 = =1.5
f( x1) = 1.53- sin 1.5 – 1 = 1.37
Root lies between 1 and 1.5.
x2 = =1.25
f( x2) = 1. 253- sin 1. 25 – 1 = 0.004
Root lies between 1 and 1.25.
x3 = =1.125
f( x3) = 1.1253- sin 1.125 – 1 = -0.47
Root lies between 1.125 and 1.25.
x4 = =1.1875
f( x4) = 1.18753- sin 1.1875 – 1 = -0.25
Root lies between 1.1875 and 1.25.
x4 = =1.21875
required root is x4 = -1.21875
Regula – Falsi method or method of False Position
Find two values a and b of x such that f(a) and f(b) are of opposite signs. Then the first approximation to the root is
x1 = Then find f(x1) and continue the same procedure.
Problem
Using Regula -Falsi method, compute a real root of the equation 2x- logx = 6 correct to 3 decimal places
Solution
Given equation is 2x- logx – 6 =0
Let f(x) = 2x- logx – 6
Then f(1)= - 5
f(2)= -2.3010
f(3)= -0.47712 , f(4)= 1.39794
Therefore f(3) is -ve and f(4) is +ve.
Root lies in (3,4)
x1 = == 3.25445
f( x1) = -0.00356
x2 = 3.25634
f( x2) = -0.00004
Root lies between 1 and 1.25.
x3 = =3.2563
required root is x3 =3.2563
Homework
1.Find the root of the equation x ex = 2 using the Regula-Falsi method correct to 4 decimal places
III NEWTON'S METHOD OR NEWTON -RAPHSON METHOD OR N-R METHOD
Given an approximate value of a root of a n equation a better approximation can be found by using this method. Let α 0 be an approximate value of a root of the equation f(x) = 0. and let α0 be the exact root near to α0.Then α 0 =α0 +h where h is very small +ve or -ve.
Then f(α0) = f(α0 +h)
= f(α0 )+hf '(α0 )+h2/2! f ''(α0 )+...... = 0, by Taylors series expansion.
I.e; f(α0 )+hf '(α0 ) =0 ,neglecting h2,h3, ......
Therefore = h = - [f(α0 )/f '(α0 )]
Therefore α0 = α0 -[f(α0 ) / f '(α0 )]
Let this value be α1.
Therefore α1 = α0 -[f(α0 ) / f '(α0 )]
α1 is a better approximate root than α0 Starting with thisα1 , we get,α2 = α1 -[f(α1 ) / f '(α1)],which is still better.
Continuing like this we get, αr+1 = αr -[f(αr ) / f '(αr)] , r = 0,1,2,3......
This is the iterative formula of N-R method.
Problem
Find the iterative formula to find (Where N is a +ve number) and hence find
Solution
Let x =
Therefore x2 = N
that is x2-N = 0
Let f(x) = x2-N
Then the iterative formula in N-R method is,
αr+1 = αr -[f(αr ) / f '(αr)] ,
= αr - αr2 – N
2 αr
=αr + N
2 αr
That is αr+1 = 1/2(αr+N/αr) is the iterative formula to find
Now to find
Put N= 5
Then f(x) becomes, x2-5
Then f(1) = - 4
f(2)= -1
f(3) = 4
Therefore let α0 = 2
And, the iterative formula becomes,
αr+1 = 1/2(αr+5/αr)
Therefore α1 = 1/2(α0+5/α0) =2.25
α2 = 1/2(2.25+5/2.25) =2.236111
α3 = 1/2(2.236111+5/2.236111) =2.23606798
α4 = 1/2(2.23606798+5/2.23606798) =2.23606798
Hence the approximate value of -=2.23606798
Home work
Find a root of the equation 2e-x = sin X correct to 4 decimal places by Newton-Raphsion method
B.ITERATIVE METHODS OF SOLVING SIMULTANEOUS LINEAR EQUATIONS
(I)GAUSS JACOB'S METHOD
consider the system of equations
a1x+b1y+c1z = d1
a2x+b2y+c2z = d2
a3x+b3y+c3z = d3 ...... (1)
Solving for x,y,z respectively, we get,
x = 1/a1[d1- b1y-c1z ]
y = 1/b2[d2- a2x-c2z ]
z = 1/c3[d3- a3x - b3y ]...... (2)
Let (x0,y0,z0) be the initial approximations to the unknowns x,y,z. Substituting these on RHS of (2), the first approximations are given by
x1 = 1/a1[d1- b1y0-c1z0 ]
y1 = 1/b2[d2- a2x0-c2z0 ]
z1 = 1/c3[d3- a3x0 - b3y0 ]
Substituting these values of (x1,y1,z1) in the R.H.S of (2) the second approximations are given by ,
x2 = 1/a1[d1- b1y1-c1z1 ]
y2 = 1/b2[d2- a2x1-c2z1 ]
z2 = 1/c3[d3- a3x1- b3y1]
Proceeding in the same way if (xr,yr,zr) are the r th literates then,
x r+1= 1/a1[d1- b1yr-c1zr ]
y r+1= 1/b2[d2- a2xr-c2zr ]
zr+1 = 1/c3[d3- a3xr- b3yr]
Note:-
In the given system of equations |a1| must be larger as compared to |b1| and |c1|; |b2|>|a2| and |c2|;|c3|>|a3| and |b3|. That is, the diagonal elements should be large when compared to others.
Problems
- Solve 20x+y-2z = 17, 3x + 20y -z = -18, 2x-3y+20z = 25
Solution
The given system can be written as,
x = 1/20[17- y + 2z ]
y = 1/20[-18- 3x+ z ]
z = 1/20[25- 2x + 3y]...... (1)
Take the initial approximation as,x0=y0=z0 =0
Then from (1) Ist iteration,
x1 = 1/20[17] = 0.85
y1 = 1/20[-18] = - 0.9
z1 = 1/20[25]= 1.25
Again putting these values on the RHS of (1)
2nd iteration
x2 = 1/20[17+0.9 + 2 *1.25 ] = 1.02
y2 = 1/20[-18- 3*0.85+ 1.25] = -0.965
z2 = 1/20[25- 2*0.85 + 3*-0.9].= 1.1515
Thus ( x2, y2, z2 ) = ( 1.02,-0.965, 1.1515
Third iteration
x3 = 1/20[17-0.965 + 2 *1.1515] = 1.0134
y3= 1/20[-18- 3*1.02+ 1.1515 ] = -0.9954
z3 = 1/20[25- 2*1.02+ 3*-0.965].=1.0032
Thus ( x3, y3, z3 ) = (1.0134,-0.9954, 1.0032)
Forth iteration
x4 = 1/20[17- 0.9954 + 2 *1.0032] = 1.0009
y4= 1/20[-18- 3*1.0134+ 1.0032] = -1.0018
z4 = 1/20[25- 2*1.0134+ 3*-0.9954].=0.9993
Thus ( x4 y4, z4 ) = (1.0009,-1.0018, 0.9993)
Fifth iteration
x5 = 1/20[17-1.0018 + 2 *0.9993] = 1.000
y5= 1/20[-18- 3*1.0009+ 0.9993] = -1.0002
z5 = 1/20[25- 2*1.0009+ 3*-1.0018].=0.9996
Thus ( x5 y5, z5 ) = (1.000,-1.0002, 0.9996)
Since the second and third iterations are practically equal.
Therefore we can take the solution as ( x5 y5, z5 ) = (1,-1,1)
That is required solution (x,y,z) = (1,-1,1)
Homework
Solve the system using Jacob's method
5x – y + z = 10
2x+4y = 12
x+y+5z = -1.Start with the solution (2,3,0)
(ii)Gauss -Seidel Iteration method (Modification of Gauss-Jacob's method)
This method is similar to Jacob's method. The only difference is, as soon as a new approximation for an unknown is found , it is immediately used in the next step.
Problem 1
1. Solve 20x+y-2z = 17, 3x + 20y -z = -18, 2x-3y+20z = 25 using Gauss -Seidel method
Solution
The given system can be written as,
x = 1/20[17- y + 2z ]
y = 1/20[-18- 3x+ z ]
z = 1/20[25- 2x + 3y]...... (1)
Take the initial approximation as,x0=y0=z0 =0
Then from (1) Ist iteration,
x1 = 1/20[17] = 0.85
y1 = 1/20[-18- 3*0.85] = - 1.0275
z1 = 1/20[25- 3*0.85 -1.0275]= 1.0109...... (1)
Thus ( x1, y1, z1 ) = (0.85,,- 1.0275,,1.0109)
Second iteration
x2 = 1/20[17+1.0275 + 2 *1.0109 ] = 1.0025
y2 = 1/20[-18- 3*1.0025+1.0109] = -0.9998
z2 = 1/20[25- 2*1.0025 + 3*-0.9998].= 0.9998
Thus ( x2, y2, z2 ) = (1.0025,-0.9998, 0.9998)
Third iteration
x3 = 1/20[17+0.9998 + 2 *0.9998 ] = 1.0000
y3= 1/20[-18- 3*1+0.9998 ] = -1.000
z3 = 1/20[25- 2*1.0000+ 3*-1.000].=1.000
Thus ( x3, y3, z3 ) = (1.0000,-1.000, 1.000)
Since the second and third iterations are practically equal.
Homework
Solve the system using Gauss Seidel method
10x1 – 2x2 – x3 – x4 = 3
-2x1 +10x2 – x3 – x4 = 15
-x1 - x2 – 2x3 + 10 x4 = -9
-x1 - x2 +10x3 - 2 x4 = 27
********************************