Chapter 35
Chapter 35
60
5.1 Introduction.
The limitations of analytical methods have led the engineers and scientists to evolve
graphical and numerical methods. The graphical methods, though simple, give results to a low
E3
degree of accuracy. Numerical methods can, however, be derived which are more accurate.
5.2 Significant digits and Rounding off of Numbers.
(1) Significant digits : The significant digits in a number are determined by the following
rules :
ID
(i) All non-zero digits in a number are significant.
(ii) All zeros between two non-zero digits are significant.
(iii) If a number having embedded decimal point ends with a non-zero or a sequences of
zeros, then all these zeros are significant digits.
U
(iv) All zeros preceding a non-zero digit are non-significant.
3.0450 5
0.0025 2
102.030070 9
35.9200 6
0.0002050 4
D
20.00 4
2000 1
(2) Rounding off of numbers : If a number is to be rounded off to n significant digits, then we
U
(ii) If the (n+1)th digit is greater then 5 or it is 5 followed by a nonzero digit, then nth digit
is increased by 1. If the (n+1)th digit is less then 5, then digit remains unchanged.
(iii) If the (n+1)th digit is 5 and is followed by zero or zeros, then nth digit is increased by
1 if it is odd and it remains unchanged if it is even.
5.3 Error due to Rounding off of Numbers.
If a number is rounded off according to the rules, the maximum error due to rounding does
not exceed the one half of the place value of the last retained digit in the number.
The difference between a numerical value X and its rounded value X1 is called round off
error is given by E X X 1 .
5.4 Truncation and Error due to Truncation of Numbers.
Numerical Methods 155
Leaving out the extra digits that are not required in a number without rounding off, is
called truncation or chopping off.
The difference between a numerical value X and its truncated value X1 is called truncation
error and is given by E X X 1 .
The maximum error due to truncation of a number cannot exceed the place value of the last
retained digit in the number.
60
Remark 1 : In truncation the numerical value of a positive number is decreased and that of a
negative number is increased.
Remark 2 : If we round off a large number of positive numbers to the same number of
E3
decimal places, then the average error due to rounding off is zero.
Remark 3 : In case of truncation of a large number of positive numbers to the same number
of decimal places the average truncation error is one half of the place value of the last retained
digit.
Remark ID
4 : If the number is rounded off and truncated to the same number of decimal
places, then truncation error is greater than the round off error.
Remark
U
5 : Round of error may be positive or negative but truncation error is always
positive in case of positive numbers and negative in case of negative numbers.
YG
60
Example: 2 When a number is rounded off to n decimal places, then the magnitude of relative error does not
exceed [DCE 1998]
(a) 10 n (b) 10 n 1 (c) 0 .5 10 n 1 (d) None of these
Solution: (c) When a number is rounded off to n decimal places, then the magnitude of relative error i.e. | E R | does
not exceed 0 .5 10 n 1 .
E3
Example: 3 When the number 2.089 is rounded off to three significant digits, then the absolute error is
(a) 0.01 (b) –0.01 (c) 0.001 (d) –0.001
Solution: (d) When the number 2.089 is rounded off to three significant digits, it becomes 2.09. Hence, the
absolute error that occurs is 2.089 2.09 0.001
By location of a real root of an equation, we mean finding an approximate value of the root
graphically or otherwise.
(1) Graphical Method : It is often possible to write f (x ) 0 in the form f1 (x ) f2 (x ) and then
plot the graphs of the functions y f1 (x ) and y f2 (x ) .
D
Y
y=f2(x) y=f1(x)
P
U
X X
ST
O A real root of
Y f1(x) = f2(x)
The abscissae of the points of intersection of these two graphs are the real roots of f (x ) 0 .
(2) Location Theorem : Let y f (x ) be a real-valued, continuous function defined on [a, b]. If
f (a) and f(b)
Y
y=
fx A real root of
f(x) = 0
f(a
)
X a X
O b
f(b
Y )
Numerical Methods 157
have opposite signs i.e. f(a).f(b) < 0, then the equation f(x)=0 has at least one real root
between a and b.
5.8 Position of Real Roots
If f (x ) 0 be a polynomial equation and x 1 , x 2 .......... .. x k are the consecutive real roots of
60
f ( x ) 0 , then positive or negative sign of the values of f (), f (x )......... ..... f (x k ), f() will determine
the intervals in which the root of f (x ) 0 will lie whenever there is a change of sign from f ( x r )
to f (x r 1 ) the root lies in the interval [ x r , x r 1 ] .
Example: 4 If all roots of equation x 3 3 x k 0 are real, then range of value of k
E3
(a) (–2, 2) (b) [–2, 2] (c) Both (d) None of these
Solution: (a) Let f (x ) x 3 3 x k , then f (x ) 3 x 2 3 and so f (x ) 0 x 1 . The values of f(x) at x , 1, 1, are :
x : 1 1
f (x ) : k 2 k 2
If all roots of given equation are real, then k 2 0 and k 2 0 2 k 2 . Hence the range of k is
(–2, 2)
Example: 5
Solution: (a)
(a) (0, 1) (b) (–1, 0)
ID
For the smallest positive root of transcendental equation x e x 0 , interval is
(c) (1, 2) (d) (2, 3)
Let f (x ) x e x 0 xe x 1 0 but f (0 ) ive and f (1) ive . Therefore root lie in (0,1).
[MP PET 1996]
U
Example: 6 The maximum number of real roots of the equation x 2 n 1 0 is [MP PET 2001]
(a) 2 (b) 3 (c) n (d) 2n
Solution: (a) Let f (x ) x 2n 1 , then f ' (x ) x 2n 1 0 x 0
YG
x: 0
Sign of f (x ) at x , 0, are
f (x ) : ive ive ive
This show that there are two real roots of f (x ) 0 which lie in the interval (,0 ) and (0,) . Hence
maximum number of real roots are 2.
There are many numerical methods for solving algebraic and transcendental equations. Some
of these methods are given below. After locating root of an equation, we successively approximate
U
signs i.e. f(a).f(b)<0, then there is (at least one) root between a and b. For definiteness, let f(a)
1
be negative and f(b) be positive. Then the first approximation to the root x 1 (a b) .
2
Working Rule : (i) Find f (a) by the above formula.
ab
(ii) Let f (a) be negative and f (b ) be positive, then take x 1 .
2
60
(iii) If f ( x 1 ) 0 , then c is the required root or otherwise if f ( x 1 ) is negative
then root will be in ( x 1 , b ) and if f ( x 1 ) is positive then root will be in (a, x 1 ) .
(iv) Repeat it until you get the root nearest to the actual root.
Note
E3
: This method of approximation is very slow but it is reliable and can be
applied to any type of algebraic or transcendental equations.
This method may give a false root if f (x ) is discontinuous on [a, b].
Example: 7 By bisection method, the real root of the equation x 3 9 x 1 0 lying between x 2 and x 4 is
nearer to
Solution: (b)
(a) 2.2 (b) 2.75
ID (c) 3.5
Since f (2) 2 3 9(2) 1 0 and f (4 ) 4 3 9(4 ) 1 0
(d) 4.0
[MP PET 1997]
U
Root will lie between 2 and 4.
24
At x 3 , f (3) 3 3 9(3) 1 0
2
YG
(3) Method of false position or Regula-Falsi method : This is the oldest method of finding the
D
B[x1,
f(x1)]
x1 x 0
abscissa of the point where the chord cuts the x-axis (y 0 ) is given by x 2 x 0 f (x 0 )
f (x 1 ) f (x 2 )
.........(ii)
which is an approximation to the root.
If now f ( x 0 ) and f ( x 2 ) are of opposite signs, then the root lies between x 0 and x 2 . So
60
replacing x 1 by x 2 in (ii), we obtain the next approximation x 3 . (The root could as well lie
between x 1 and x 2 and we would obtain x 3 accordingly). This procedure is repeated till the
root is found to desired accuracy. The iteration process based on (i) is known as the method of
false position.
E3
Working rule
(i) Calculate f ( x 0 ) and f ( x 1 ) , if these are of opposite sign then the root lies between x 0 and
x1 .
(ii) Calculate x 2 by the above formula.
(iii) Now if f ( x 2 ) 0 , then x 2 is the required root.
ID
(iv) If f ( x 2 ) is negative, then the root lies in (x 2 , x 1 ) .
U
(v) If f ( x 2 ) is positive, then the root lies in (x 0 , x 2 ) .
(vi) Repeat it until you get the root nearest to the real root.
YG
Geometrically speaking, in this method, part of the curve between the points P(a,
f(a)) and Q (b, f(b)) is replaced by the secant PQ and the point of intersection of
this secant with x-axis gives an approximate value of the root.
U
Example: 8 The root of the equation x 3 x 3 0 lies in interval (1, 2) after second iteration by false position
ST
method, it will be in
[MP PET 2003]
(a) (1.178, 2.00) (b) (1.25, 1.75) (c) (1.125, 1.375) (d) (1.875, 2.00)
Solution: (a) f (x ) x x 3
3
60
h2
f (x 0 ) hf ' (x 0 ) f ' ' (x 0 ) ....... 0
2!
Since h is small, neglecting h 2 and higher powers of h, we get
f (x 0 ) hf ' (x 0 ) 0
E3
f (x 0 )
or h ........(i)
f ' (x 0 )
A closer approximation to the root is given by
x1 x 0
f (x 0 )
f ' (x 0 )
Similarly, starting with x 1 , a still better approximation x 2 is given by
ID
U
f (x 1 )
x 2 x1
f ' (x 1 )
f (x n )
YG
In general, x n 1 x n ........(ii)
f ' (x n )
Which is known as the Newton-Raphson formula or Newton's iteration formula.
Working rule : (i) Find | f (a)| and | f (b )| . If | f (a)| | f (b)| , then let a x 0 , otherwise b x 0 .
f (x 0 )
(ii) Calculate x 1 x 0
D
f ' (x 0 )
(iii) x 1 is the required root if f ( x 1 ) 0 .
U
tangent to the curve at the point at each step in the approximation process.
This method is very useful for approximating isolated roots.
The Newton-Raphson method fails if f ' ( x ) is difficult to compute or vanishes in a
neighbourhood of the desired root. In such cases, the Regula-Falsi method should
be used.
The Newton-Raphson method is widely used since in a neighbourhood of the
desired root, it converges more rapidly than the bisection method or the Regula-
Falsi method.
If the starting value a is not close enough to the desired root, the method may give
a false root or may not converge.
Numerical Methods 161
If f (x 0 ) / f ' (x 0 ) is not sufficiently small, this method does not work. Also if it work,
it works faster.
Geometrical Interpretation
Let x 0 be a point near the root of the equation f (x ) 0 . Then the equation of the tangent
at A 0 [ x 0 , f (x 0 )] is y f (x 0 ) f ' (x 0 )(x x 0 ) .
Y
60
f (x 0 ) A[x0,
It cuts the x-axis at x 1 x 0 y= f(x) f(x0)]
f ' (x 0 )
A1
A2
X
O x2 x1
E3
Example: 9 The value of the root nearest to the 2, after first iteration of the equation x 4 x 10 0 by Newton-
U
Raphson method is
[MP PET 2003]
(a) 2.321 (b) 2.125 (c) 1.983 (d) 1.871
YG
Also f ' (x ) 4 x 3 1
f ' (2) 4 (8 ) 1 31
By Newton's rule, the first iteration,
D
f (x 0 ) 4
x1 x 0 2 1 .871
f ' (x 0 ) 31
U
Example: 10 For finding real roots of the equation x 2 x 2 by Newton-Raphson method, choose x 0 1 , then the
value of x 2 is
[MP PET 2000, 02]
ST
11
(a) –1 (b) 3 (c) (d) None of these
5
Solution: (c) Let f (x ) x 2 x 2 . Given x 0 1 .
f (x 0 )
By Newton-Raphson method, x 1 x 0
f ' (x 0 )
2
f ' (x ) 2 x 1 2(1) 1 1 and f (1) 2 . Now x 1 1 3
1
f (x 1 ) f (3) 9 3 2 4
4 11
f ' (x 1 ) f ' (3) 2(3) 1 5 ; x 2 3
5 5
Example: 11 The value of 12 correct to 3 decimal places by Newton-Raphson method is given by [DCE 1999, 2000]
162 Numerical Methods
(a) 3.463 (b) 3.462 (c) 3.467 (d) None of these
Solution: (a) Let x 12 x 2 12 0 f (x ) x 12, f ' (x ) 2 x
2
60
0 .25
Now second iteration, f (3.5) 0.25, f ' (3.5) 7 , x 2 3 .5 3 .463
7
5.10 Numerical Integration
It is the process of computing the value of a definite integral when we are given a set of
E3
numerical values of the integrand f(x) corresponding to some values of the independent
variable x.
b
If I y .dx . Then I represents the area of the region R under the curve y f (x ) between the
a
x 0 nh 1 h
y dx h (y 0 y n ) (y 1 y 2 ...... y n 1 ) (y 0 y n ) 2(y 1 y 2 ...... y n 1 )
b
Then f (x )dx
a x0
2 2
This rule is known as Trapezoidal rule .
The geometrical significance of this rule is that the curve y f (x ) is replaced by n straight
D
e
4
Example: 12 If e 0 1, e 1 2 .72, e 2 7 . 39 , e 3 20 .09 , e 4 54 .60 , then by Trapezoidal rule x
dx [MP PET 1995, 2001]
ST
(y 0 y 4 ) 2(y 1 y 2 y 3 )
4 4
h
By Trapezoidal rule, f (x ) dx e x dx
0 0 2
x
5
2
Example: 13 By trapezoidal rule the value of the integral dx on dividing the interval into four equal parts is [MP PET
1
5 1
Solution: (a) h 1
4
x: 1 2 3 4 5
y: 1 4 9 16 25
x
9
60
Example: 14 If for n4, the approximate value of integral 2
dx by Trapezoidal rule is
1
1
2 (1 9 2 ) 2 2 7 2 , then
2
[MP PET 2002]
E3
(a) 1, 3 (b) 2, 4 (c) 3, 5 (d) 4, 6
b a 9 1
Solution: (c) h 2
n 4
x 0 1 , x 1 x 0 nh 1 1.2 3 , x 2 x 0 2.2 5, x 3 x 0 3.2 7, x 4 x 0 4.2 9
y 0 1, y 1 9, y 2 25, y 3 49, y 4 81
By trapezoidal rule,
f(x) dx 2 (y
b
a
h
0 y 4 ) 2(y 1 y 2 y 3 )
This formula is known as Simpson's one-third rule. Its geometric significance is that we
n
replace the graph of the given function by arcs of second degree polynomials, or parabolas
2
ST
with vertical axes. It is to note here that the interval [a, b] is divided into an even number of
subinterval of equal width.
Simpson's rule yield more accurate results than the trapezoidal rule. Small size of interval
gives more accuracy.
x dx
6
Example: 15 By Simpson's rule the value of the interval on dividing, the interval into four equal parts is [MP PET 2
1
1 .25
(1 6) 4 (2 .25 4.75 ) 2(3.5) 1.25 7 28 7 17 .5
3 3
60
6
dx
Example: 16 Considering six sub-interval, the value of by Simpson's rule is
0 1 x2
(a) 1.3562 (b) 1.3662 (c) 1.3456 (d) 1.2662
60
Solution: (b) h 1
6
E3
x 0 0, x 1 0 1.1 1
x 2 0 2.1 2, x 3 3, x 4 4, x 5 5, x 6 6
1 1 1 1 1 1 1
and y 0 1, y 1 , y 2 , y 3 , y4 , y5 , y6
10 2 5 10 17 26 37
By Simpson's rule ,
a
b
f (x )dx
h
3
ID
3 37 2 10 26 5 17
(y 0 y 6 ) 4(y 1 y 3 y 5 ) 2(y 2 y 4 ) 1 1 1 4 1 1 1 2 1 1 1.3662
1 x
1
1
U
Example: 17 By Simpson's rule taking n 4 , the value of the integral 2
dx is equal to [Kurukshetra CEE 1998; DCE 20
0
0 .25
(1 0.5) 4 (0 .941 0.64 ) 2(0 .8) 0.785 .
3
ST