Chameli Devi Group of Institutions, Indore: Dr. Ravindra Parsai
Chameli Devi Group of Institutions, Indore: Dr. Ravindra Parsai
Chameli Devi Group of Institutions, Indore: Dr. Ravindra Parsai
of Institutions,
Indore
B.Tech, 2nd Year , Mathematics-III [M3]
Module-1 [Numerical Methods-1 ] :Solution of polynomial and transcendental equations Bisection
method, Newton Raphson method and Regula-Falsi method. Finite differences, Relation between
operators, Interpolation using Newton’s forward and backward Difference formulae. Interpolation with
unequal intervals: Newton’s divided difference and Lagrange’s formulae.
By
Dr. Ravindra Parsai , Associate Professor ,
Mathematics
Department of Engg. Science and Humanities
1
Introduction
In this unit we will discuss one of the most basic problems in numerical analysis. The problem is
called a root-finding problem and consists of finding values of the variable x (real) that satisfy
the equation f(x) = 0, for a given function f. Let f be a real-value function of a real variable. Any
real number for which f() = 0 is called a root of that equation or a zero of f. We shall
confine our discussion to locating only the real roots of f(x), that is, locating non-real complex
roots of f(x) = 0 will not be discussed. This is one of the oldest numerical approximation
problems. The procedures we will discuss range from the classical Newton-Raphson method
developed primarily by Isaac Newton over 300 years ago to methods that were established in
the recent past.
Myriads of methods are available for locating zeros of functions and in first section we discuss
bisection methods and fixed point method. In the second section, Chord Method for finding
roots will be discussed. More specifically, we will take up regula-falsi method (or method of
false position), Newton-Raphson method, and secant method. In section 3, we will discuss
error analysis for iterative methods or convergence analysis of iterative method.
We shall consider the problem of numerical computation of the real roots of a given equation
f(x) = 0
2
which may be algebraic or transcendental. It will be assumed that the function f(x) is
continuously differentiable a sufficient number of times. Mostly, we shall confine to simple
roots and indicate the iteration function for multiple roots in case of Newton Raphson method.
All the methods for numerical solution of equations discussed here will consist of two steps.
First step is about the location of the roots, that is, rough approximate value of the roots are
obtained as initial approximation to a root. Second step consists of methods, which improve
the rough value of each root.
A method for improvement of the value of a root at a second step usually involves a
process of successive approximation of iteration. In such a process of successive approximation a
sequence {Xn} n = 0, 1, 2, … is generated by the method used starting with the initial approximation xo of
the root obtained in the first step such that the sequence {Xn} converges to as n . This xn is
called the nth approximation of nth iterate and it gives a sufficiently accurate value of the root .
3
For the first step we need the following theorem:
Theorem 1: If f(x) is continuous in the closed internal [a, b] and f(a) are of opposite signs, then
there is at least one real root of the equation f(x) = 0 such that a < < b.
If further f(x) is differentiable in the open interval (a, b) and either f’(x) < 0 or f’(x) > 0 in (a, b)
then f(x) is strictly monotonic in [a, b] and the root is unique.
We shall not discuss the case of complex roots, roots of simultaneous equations nor shall we take up
cases when all roots are targeted at the same time, in this unit.
4
Bisection Method (Bolzano Method)
In this method we find an interval in which the root lies and that there is no other root in that
interval. Then we keep on narrowing down the interval to half at each successive iteration. We
proceed as follows:
(1) Find interval I (x1 , x 2 ) in which the root of f(x) = 0 lies and that there is no other
root in I.
x1 x 2
(2) Bisect the interval at x and compute f(x). If | f(x) | is less than the desired
2
accuracy then it is the root of f(x) = 0.
(3) Otherwise check sign of f(x). If sign {f(x)} = sign {f(x2)} then root lies in the interval
[x1, x] and if they are of opposite signs then the root lies in the interval [x, x2].
Change x to x2 or x1 accordingly. We may test sign of f(x) f(x2) for same sign or
opposite signs.
Check the length of interval | x1 – x2 |. If an accuracy of say, two decimal places is required then
stop the process when the length of
5
x1 x 2
(1) the interval is 0.005 or less. We may take the mid value x as the root of
2
f(x) = 0. The convergence of this method is very slow in the beginning.
Example
Find the positive root of the equation x 3 4x 2 10 0 by bisection method correct upto
two places of decimal.
Solution
f (x) x 3 4x 2 10 0
x 0 1 2 >2
f(x) 10 5 14
Sign f(x) + +
There is only one + ive root and it lies between 1 and 2. Let x1 = 1 and x2 = 2; at x = 1, f(x)
x1 x 2
is – ive and at x = 2, f(x) is + ive. We examine the sign of f(x) at x 1.5 and check
2
whether the root lies in the interval
(1, 1.5) or (1.5, 2). Let us show the computations in the table below :
6
Iteration x1 +x2 Sign f(x)
x= Sign f(x) x1 x2
No. 2 f(x2)
1 1.5 + 2.375 + 1 1.5
2 1.25 1.797 1.25 1.5
3 1.375 + 0.162 + 1.25 1.375
4 1.3125 0.8484 1.3125 1.375
5 1.3438 0.3502 1.3438 1.375
6 1.3594 0.0960 1.3594 1.375
7 1.367 0.0471 1.367 1.375
8 1.371 + 0.0956 + 1.367 1.371
7
We see that | x1 x 2 | 0.004 .
1.367 1.371
We can choose the root as x 1.369 .
2
Regula-Falsi Method (or Method of False Position)
In this method also we find two values of x say x1 and x2 where function f(x) has opposite signs
and there is only one root in the interval (x1, x2). Let us express the function of y = f(x) and we
are interested in finding the value of x where curve y = f(x) intersects x-axis i.e. y = 0. We
identify two points (x1, y1) and (x2, y2) on the curve. Then we approximate the curve by a
straight line joining these two points. We find the point on the x-axis where this line cuts the x-
axis. The equation of the straight line passing through (x1, y1) and (x2, y2) is given by
8
y 2 y1
y y1 (x x1 )
x 2 x1
Now we check the sign of f(x) and proceed like in the bisection method. That is, if f(x) has same
sign as f(x2) then root lies in the interval (x1, x) and if they have opposite signs, then it lies in the
interval (x, x2). See Figure 1.
(1) y = f (x)
(2)
x1 x1
x1 x
O x2
9
Figure 1 : Regula- Falsi Method, Superscript Shows Iteration Number
Example
Find positive root of x 3 4x 2 10 0 by Regula- Falsi method. Compute upto the two
decimal places only.
Solution
It is the same problem as given in the previous example. We start by taking x 1 = 1 and x2 =
2. We have y x 3 4x 2 10 ; y1 = 5 and y2 = 14. The point on the curve are (1, – 5) and
(2, 14). The points on the x-axis where the line joining these two pints cuts it, is given by
I-Iteration
1 14 2 ( 5) 24
x 1.26
14 5 19
y f (x) 1.65
10
II-Iteration
Take points (1.26, – 1.65) and (2, 14)
1.26 14 2 ( 1.65)
x 1.34
14 1.65
y f (x) 0.41
III-Iteration
Take two points (1.34, – 0.41) and (2, 14)
1.34 14 2 ( 0.41)
x 1.36
14 0.41
y f (x) 0.086
IV-Iteration
Take two points (1.36, – 0.086) and (2, 14)
1.36 14 2 ( 0.086)
x 1.36
14 0.086
y y 0 f (x 0 ) (x x 0 )
The point where the tangent cuts the x-axis (y = 0) is taken as the next estimate x = x1 for
the root, i.e.
f (x 0 )
x1 x 0
f (x 0 )
13
f (x n )
In general x n 1 x n , see Figure 2
f (x n )
y = f (x)
x1 x3 x4
x
O x2 x0
14
Let be the exact root of f(x) = 0 and let = x0 + h where h is a small number to be
determined. From Taylor’s series as have,
h2
f () f (x 0 h) f (x 0 ) h f (x 0 ) f (x 0 ) . . . 0
2
f (x 0 )
Neglecting h2 and higher powers we get an approximate value of h, as h .
f (x 0 )
Hence, an approximation for the exact root may be written as,
f (x 0 )
x1 x 0 h x 0
f (x 0 )
f (x)
where (x) x
f (x)
1
f (x) x 1 N ; f (x)
x2
N-R scheme is
f (x n ) 1
xn 1 xn x n x 2n N
f (x n ) xn
x n (2 N x n ) x n (2 17x n ) N 17.
We take x0 = 0.05.
Substituting in the formula, we get
x1 = 0.0575 ; x2 = 0.0588 ; x3 = 0.0588
1
Hence, 0.0588 .
17 17
Example: Write down N-R iterative scheme for finding qth root of a positive number N. Hence,
find cube root of 10 correct up to 3 places of decimal taking initial estimate as 2.0.
1
f (x) x q N ; f (x) q x q 1
18
Example: Using N-R method find the root of the equation x – cos x = 0 correct upto two places
of decimal only. Take the starting value as ( = 3.1416, radian = 180o).
4
Solution : f (x) x cos x ; f (x) 1 sin x
Taking x 0
4
1 1
sin cos
x1 4 4 4 4 2 2
1
1 sin 1
4 2
19
1
4 1.7854
0.7395
2 1 2.4142
20
Note : If starting value is not given, we can plot graphs of y = x and y = cos x and locate
their point of intersection which will be root of x – cos x = 0. See Figure 3
y= x
y = cos x
x
O /2
𝑓(𝑥𝑛 )
𝑥𝑛+1 = 𝑥𝑛 − ′
𝑓 (𝑥𝑛 )
𝑥2 = 0.6071
𝑥3 = 0.6071
Suppose we are given the following values of y = f(x) for a set of values of x
X : x0 x1 x2 …… xn
y : y0 y1 y2 …… yn
The process of finding the values of y corresponding to any value of x=x i between x0 and xn is
called interpolation.
23
(1) The technique of estimating the value of a function for any intermediate value of the
independent variable is called interpolation.
(2) The technique of estimating the value of a function outside the given range is called
extrapolation.
(4) Suppose that the function y=f(x) is tabulated for the equally spaced values x = x 0,
x1=x0+h, x2=x0+2h, …, xn=x0+nh giving y = y0, y1, y2, …, yn. To determine the values of f(x)
and f '(x) for some intermediate values of x, we use the following two types of
differences
24
1. Forward difference
2. Backward difference
Forward difference: The first order forward differences are defined and denoted by ∆f(x) = f(x+h)-
f(x),
∆y0 = y1 – y0
∆y1 = y2 – y1
∆y2 = y3 – y2
…………….
∆yr = yr+1 – yr
…………….
∆yn-1 = yn – yn-1
These are called the first forward differences and ∆ is the forward difference operator. 25
Similarly the second forward differences are defined by
2∆ y = ∆ y – ∆y .
r r+1 r
In general
p p-1 p-1
∆ yr = ∆ yr+1 – ∆ yr ,
th
p forward differences.
The forward differences systematically set out in a table called forward difference table.
26
3rd diff. 4th diff. 5thdiff.
Value of x Value of y 1st diff. 2nd diff. ∆3 ∆4 ∆5
∆ ∆2
x0 y0
∆y0
x1 y1 ∆2y0
∆y1 ∆3 y 0
x2 y2 ∆2y1 ∆4y0
∆y2 ∆3 y 1 ∆5y0
x3 y3 ∆2y2 ∆4y1
∆y3 ∆3 y 2
x4 y4 ∆2y3
∆y4
x5 y5
27
Backward Differences: The first order backward differences are defined and denoted by ∇ f(x)=
f(x)-f(x-h),
∇y1 = y1 – y0
∇y2 = y2 – y1
∇y3 = y3 – y2
…………….
∇yr = yr – yr-1
…………….
∇yn = yn – yn-1.
These are called the first backward differences and ∇ is the backward difference operator.
Similarly the second backward differences are defined by
∇2 yr = ∇ yr – ∇yr-1.
In general
∇p yr= ∇p-1yr – ∇p-1yr-1 , 28
Example1: Evaluate
-1
(i) ∆ tan x
x
(ii) ∆ (e log 2x)
2
(iii) ∆ cos 2x
Sol. From the definition of forward differences ∆f(x) = f(x+h) – f(x).
-1
(i) Let f(x) = tan x, then
-1 -1 -1
∆ tan x = tan (x+h) - tan x
1 x h x 1 h
= tan tan .
1 ( x h) x 1 hx x
2
29
(ii)
(e x log 2 x) e x h log 2( x h) e x log 2 x
e x h log 2( x h) e x h log 2 x e x h log 2 x e x log 2 x
xh xh xh
e log (e e ) log 2 x
x
x
x h h
e e log(1 ) (e 1) log 2 x .
h
x
(iii) ∆2 cos 2x = ∆ [∆ cos 2x]
= ∆ [ cos 2(x+h) – cos 2x]
= ∆ cos 2(x+h) – ∆ cos 2x
= cos 2(x+2h) – cos 2(x+h) – [cos 2(x+h) ) – cos 2x]
= – 2 cos (2x+3h) sin h + 2 sin(2x+h) sin h
= – 2 sin h [sin(2x+3h) – sin(2x+h) ]
= – 2 sin h [2 cos(2x+2h)sin h]
= – 2 sin2 h cos 2(x+h). 30
Example2: Evaluate the following, with interval of difference being unity
(i) ∆2 (abx) (ii) ∆n ex
Sol. From the definition of forward differences ∆f(x) = f(x+h) – f(x).
(i) ∆(abx) = a ∆bx = a(bx+1 – bx) = abx(b – 1)
∆2 (abx) = ∆ [∆ (abx)]
= ∆ abx(b – 1) = a(b – 1) ∆(bx)
= a(b – 1) (bx+1 – bx)
= a(b – 1)2 bx.
(ii) ∆ex = ex+1 – ex = ex(e – 1)
∆2ex = ∆ [∆ex] = ∆ [ex+1 – ex ]= (e – 1)∆ex
= (e – 1) ex(e – 1) = (e – 1)2 ex.
Similarly ∆2ex = (e – 1)2 ex, ∆3ex = (e – 1)3 ex, … and ∆nex = (e – 1)n ex.
31
Factorial Notation: r
A product of the form x(x – 1) (x – 2) …(x – r +1) is denoted by [x] and is
called a factorial. In particular,
[x] = x, [x]2 = x(x – 1) , [x]3 = x(x – 1) (x – 2), …[x]n = x(x – 1) (x – 2) …(x – n +1).
The factorial notation is of special utility in the theory of finite differences. It helps in finding the
r
successive differences of a polynomial directly by simple rule of differentiation ([x] as x ). r
32
To express a polynomial of nth degree in the factorial notation, we use the following two steps
x3 x2 x
1 2 -3 3 -10 = D
_ 2 -1
2 2 -1 2=C
_ 4
3 2 3=B
_
2=A
x 45 50 55 60 65
y 3 ? 2 ? -2.4
37
Sol. Let p and q be the missing values in the given table, then the difference
table is as follows:
x y ∆y ∆2y ∆3y
45 3
p–3
50 p 5 – 2p
2–p 3p + q – 9
55 2 p+q–4
q–2 3.6 – p – 3q
60 q –0.4 – 2q
–2.4 – q
65 -2.4
38
Since three entries are given, the function y can be represented by a
second degree polynomial.
Therefore, ∆3y0 = 0 and ∆3y1 = 0. Thus 3p + q – 9 = 0 and 3.6 – p – 3q =
0. Solving these equations,
we get p = 2.925 and q = 0.225.
Example2. Determine the missing values in the following table without
using difference table.
x 45 50 55 60 65
y 3 ? 2 ? -2.4
Sol. Given that y0 = 3, y2 = 2 and y4 = -2.4 and missing values be taken as
y1= p and y3 = q. Since three entries are given, the function y can be
represented by a second degree polynomial
39
Therefore, ∆3y0 = 0 and ∆3y1 = 0.
(E – 1)3y0 = 0 (E – 1)3y1 = 0
(E3 – 3E2 + 3E – 1)y0 = 0 (E3 – 3E2 + 3E – 1)y1 = 0
y3 – 3y2 + 3y1 – y0 = 0 y4 – 3y3 + 3y2 – y1 = 0
q – 3(2)+ 3p – 3 = 0 -2.4 – 3q + 3(2) – p = 0
3p + q – 9 = 0 3.6 – p – 3q = 0.
Solving these equations, we get p = 2.925 and q = 0.225.
40
Newton’s Forward Interpolation Formulae:
Let the function y=f(x) take the values y0, y1, y2, … corresponding to the
values x0, x1, x2, … of x. Suppose it is required to evaluate f(x) for x=x0+ph, p
is any real number.
For any real number p, we have defined E such that
Ep f(x) = f(x0+ph)
yp = f(x0+ph) = Epf(x0)= (1+∆)py0
= [1+p∆+p(p-1)/2! ∆2 + p(p-1)(p-2)/3! ∆3 +…] y0
= y0 + p ∆y0 + p(p-1)/2! ∆2 y0+ p(p-1)(p-2)/3! ∆3 y0+…
It is called Newton’s forward interpolation formulae.
41
Newton’s Backward Interpolation Formulae:
Suppose it is required to evaluate f(x) for x=xn+ph, where p is any real number.
Ep f(x) = f(xn+ph)
yp = f(xn+ph) = Epf(xn)= (1- )-p yn
= [1+p +p(p+1)/2! 2 + p(p+1)(p+2)/3! 3 +…] yn
= yn + p yn + p(p+1)/2! 2 yn+ p(p+1)(p+2)/3! 3 yn+…
It is called Newton’s backward interpolation formulae.
43
x y ∆ ∆2 ∆3 ∆4
100 10.63
2.4
150 13.03 -0.39
2.01 0.15
x0=20015.04 -0.24 -0.07
1.77 0.08
250 16.81 -0.16 -0.05
1.61 0.03
300 18.42 -0.13 -0.01
1.48 0.02
350 19.90 -0.11
1.37
Xn
=400 21.27
44
(i) If we take x0=200, then y0=15.04, ∆y0=1.77, ∆2y0=-0.16, ∆3y0=0.03, ∆4y0=-
0.01.
Since x=218, step length h=50 and p=(x-x0)/h =18/50 = 0.36.
By Newton’s forward interpolation formula, we have
y(218) = y0 + p ∆y0 + p(p-1)/2! ∆2 y0+ p(p-1)(p-2)/3! ∆3 y0+ p(p-1)(p-2)(p-
3)/4! ∆4 y0
= 15.04 + 0.36 (1.77) + 0.36(0.36-1)/2 (-0.16)+ 0.36(0.36-1)(0.36-2)/6
(0.03)
+ 0.36(0.36-1)(0.36-2)(0.36-3)/24 (-0.01)
=15.04+0.6372+0.0184+0.0018+ 0.00041 = 15.69741
≈ 15.7 nautical miles.
(ii) If we take xn=400, then yn=21.27, yn=1.37, 2yn=-0.11, 3yn=0.02,
4yn=-0.01.
Since x=410, step length h=50 and p=(x-xn)/h =10/50 = 0.2.
45
By Newton’s backward interpolation formula, we have
y(410) = yn + p yn + p(p+1)/2! 2 yn+ p(p+1)(p+2)/3! 3 yn+ p(p+1)(p+2)(p+3)/4! 4 yn
= 21.27 + 0.2 (1.37) + 0.2(0.2+1)/2 (-0.11) + 0.2(0.2+1)(0.2+2)/6 (0.02)
+ 0.2(0.2+1)(0.2+2)(0.2+3)/24 (-0.01)
=21.27+0.274-0.0132+0.0017- 0.0007 = 21.5318
≈ 21.53 nautical miles.
46
Lagrange’s interpolation formula: If y = f(x) takes the values y0, y1, y2, …, yn corresponding to x0,
x1, x2, …, xn, then
(x x 1 )(x x 2 ) (x x n ) (x x 0 )(x x 2 ) (x x n )
f(x) y0 y1
(x 0 x 1 )(x 0 x 2 ) (x 0 x n ) (x 1 x 0 )(x 1 x 2 ) (x 1 x n )
(x x 0 )(x x 1 ) (x x n 1 )
yn ,
(x n x 0 )(x n x 1 ) (x n x n 1 )
Which is known as Lagrange’s formula.
Divided Differences: If (x0, y0), (x1, y1), …, (xn, yn) are given points, then the first divided
differences for the argument x0, x1 is defined by
y1 y 0
[x 0 , x 1 ] .
x1 x 0 47
Similarly
y 2 y1 y3 y2 y n y n 1
[x 1 , x 2 ] , [x 2 , x 3 ] , , [x n 1 , x n ] .
x 2 x1 x3 x2 x n x n 1
The second divided differences for x0, x1, x2 is
[x 1 , x 2 ] [x 0 , x 1 ]
[x 0 , x 1 , x 2 ] .
x2 x0
The third divided differences for x0, x1, x2 , x3 is
[x 1 , x 2 , x 3 ] [x 0 , x 1 , x 2 ]
[x 0 , x 1 , x 2 , x 3 ] .
x3 x0
And so on, the nth divided differences for x0, x1, x2, …, xn is
[x 1 , x 2 , , x n ] [x 0 , x 1 , , x n -1 ]
[x 0 , x 1 , x 2 , , x n ] .
xn x0
All the divided differences systematically set out in a table called divided difference table. 48
Value Value 1st divided 2nd divided 3rd divided 4th divided difference 5th divided difference
difference
of x of y difference difference
x0 y0
[x0,x1]
x1 y1 [x0,x1,x2]
[x1,x2] [x0,x1,x2,x3]
x2 y2 [x1,x2,x3] [x0,x1,x2,x3,x4]
[x2,x3] [x1,x2,x3,x4] [x0,x1,x2,x3,x4,x5]
x3 y3 [x2,x3,x4] [x1,x2,x3,x4,x5]
[x3,x4] [x2,x3,x4,x5]
x4 y4 [x3,x4,x5]
[x4,x5]
x5 y5
49
Newton’s divided difference formula: If y = f(x) takes the values y0, y1, y2, …, yn corresponding
to x0, x1, x2, …, xn, then
f(x) = y0+(x-x0)[x0, x1] + (x-x0)(x-x1)[x0, x1, x2] + ……
+ (x-x0)(x-x1)…(x-xn-1)[x0, x1, x2, …, xn],
Which is known as Newton’s general interpolation formula with divided differences.
51
(9 7)(9 11)(9 13)(9 17) (9 5)(9 11)(9 13)(9 17)
f(9) 150 392
(5 7)(5 11)(5 13)(5 17) (7 5)(7 11)(7 13)(7 17)
(9 5)(9 7)(9 13)(9 17) (9 5)(9 7)(9 11)(9 17)
1452 2366
(11 8)(11 7)(11 13)(11 17) (13 5)(13 7)(13 11)(13 17)
(9 5)(9 7)(9 11)(9 13) 50 3136 3872 2366 578
5202 810.
(17 5)(17 7)(17 11)(17 13) 3 15 3 3 5
52
(iii) The divided difference table is
Value of x Value of y 1st divided difference 2nd divided difference 3rd divided difference 4th divided difference
5 150
121
7 392 24
265 1
11 1452 32 0
457 1
13 2366 42
709
17 5202
53
By Newton divided difference formula
f(x) = y0+(x-x0)[x0, x1] + (x-x0)(x-x1)[x0, x1, x2] +(x-x0)(x-x1)(x-x2)[x0, x1, x2,x3]
+ (x-x0)(x-x1)(x-x2)(x-x3)[x0, x1, x2,x3,x4].
f(9) = 150 + (9 – 5)×121 + (9 – 5) (9 – 7)×24 + (9 – 5)(9 – 7)(9 – 11)×1
+ (9 – 5)(9 – 7)(9 – 11)(9 – 13)×0
= 150 + 484 + 192 – 16 + 0
= 810.
54
THANKS
55