Unit-1-Errors and Approximation
Unit-1-Errors and Approximation
Unit-1-Errors and Approximation
UNIT 1
ERRORS
ERRORS AND APPROXIMATIONS
APPROXIMATIONS
1.1 Introduction 9
Objectives
1.2 Essential Preliminaries 10
1.3 Round-off Error 21
1.4 Truncation Error 25
1.5 Summary 33
1.6 Solutions / Answers 34
1.1 INTRODUCTION
Any mathematical problem can either be solved by an analytical method or a
numerical method. Mostly, the analytical solutions are expressed in the closed
forms and are exact. However, most of the numerical methods give answers
that are approximations to the desired solutions. In such situations, it is
important to measure the accuracy of the approximate solution compared to
the actual solution. To find the accuracy we must have an idea of the possible
errors that can arise in computational procedures. In this unit, we shall
introduce you to different forms of errors which are common in numerical
computations.
You are already familiar with some fundamental theorems about continuous
functions from your calculus course (BMTC-131). Here we shall review some
of the theorems given in that course, namely, Intermediate value theorem,
Rolle’s theorem and Lagrange’s mean value theorem etc. We shall discuss
some more theorems about the roots of the polynomial equation from the
course calculus. As you go along the course, you will be using these concepts,
therefore we will discuss these theorems in Sec.1.2 under the heading
essential preliminaries. We shall also discuss a few basic ideas and concepts
regarding errors considerations, absolute and relative errors, round-off errors
and truncation errors. We shall discuss round-off error and truncation error in
Sec.1.3 and Sec.1.4, respectively.
The basic ideas and results that we have illustrated in this unit will be used
often throughout this course. So, we suggest you go through this unit very
carefully.
9
Block 1 Solution of Nonlinear Equations in One Variable
Now we will list the objectives of this unit. After going through the unit, please
read this list again and make sure that you have achieved the objectives.
Objectives
After studying this unit you should be able to
• apply intermediate value theorem, Rolle’s theorem, Lagrange’s mean
value theorem, Taylor’s theorem and other theorems wherever applicable
for continuous functions defined on closed intervals;
• define the term ‘error’ in approximation;
• distinguish between round-off error and truncation error and calculate
these errors as the situation demands.
Let us discuss these theorems one by one. We begin with intermediate value
theorem.
10 Fig. 1
Unit 1 Errors and Approximations
From Fig. 1, it is clear that f (a ) > f (b) and f (a ) > c > f (b). You can also
observe that the points (a , f (a )) and (b, f (b)) lie on the opposite sides of the
line y = c . Further f is continuous, which implies that the graph crosses the
line y = c at some point, which is ( x 0 , c).
1
ii) f (0) = 1 and f (π) = −1 , we have f (π) < < f (0).
2
Thus, f satisfies all the conditions of Theorem 1. Therefore, there exists at
1
least one value of x , say x 0 , such that f ( x 0 ) = , that is, the theorem
2
1
guarantees that there exists a point x 0 such that cos(x 0 ) = . Let us try to
2
locate this point on the graph of cos x in the interval [0, π] (see Fig. 2).
Fig. 2 11
Block 1 Solution of Nonlinear Equations in One Variable
1
From Fig. 2, you can see that the line y = cuts the graph at the point
2
π 1 π
, . Hence, there exists a point x 0 = in [0, π] such that
4 2 4
1
cos ( x 0 ) = .
2
***
Now let us discuss Rolle’s theorem. The theorem is named after the
seventeenth century French mathematician Michel Rolle (1652-1719).
Fig. 3
Now we shall see whether we can find a function f which satisfies the
conditions of Rolle’s theorem and for which f ′(x ) = ( x − 1) cos x + sin x.
From our experience of differentiating the product of two functions, we may try
the function f where f ( x ) = (x − 1) sin x.
Here,
i) f is continuous in [0,1].
ii) f is differentiable in ] 0,1[
iii) f (0) = 0 = f (1)
Thus, f satisfies all the conditions of Rolle’s theorem. Hence, there exists a
point x 0 in ] 0,1[, such that f ′(x 0 ) = (x 0 − 1) cos x 0 + sin x 0 = 0.
Let us look again at Fig.3 carefully. You can see that the line joining (a , f (a ))
and (b, f (b)) is parallel to the tangent at ( x 0 , f ( x 0 )) . Does this property hold
when f (a ) ≠ f (b) also? In other words, does there exist a point x 0 in ] a , b [
such that the tangent at ( x 0 , f ( x 0 )) is parallel to the line joining (a , f (a )) and
(b, f (b)) ? The answer to this question is the content of the well-known
theorem, “Lagrange’s mean value theorem”, which we discuss next. This
theorem was first proved by the French mathematician Joseph Louis Lagrange Joseph-Louis
(1736-1813). Lagrange
(1736-1813)
Theorem 3 (Lagrange’s Mean Value Theorem): Let f be a function defined
on [a , b] and satisfies the following properties:
i) f is continuous on the interval [a , b]
ii) f is differentiable on the interval ]a , b[
(b − a )f ′( x 0 ) = f (b) − f (a ).
Fig. 4
In Fig. 4, you can see that the straight line joining the end points (a , f (a )) and
(b, f (b)) of the graph is parallel to some tangent to the curve at an
intermediate point P( x 0 , f (x 0 )).
Remark 1: You may note that Rolle’s theorem is a special case of mean value
theorem. Suppose f is a function defined on [a , b] which satisfies all the
conditions of Lagrange’s mean value theorem. Then there exists a point x 0 in
f ( b ) − f (a )
] a , b [ such that f ′(x 0 ) = .
b−a
We shall illustrate how to use this theorem with the help of the following
examples.
f ( x ) = (x − 1) ( x − 2) ( x − 3) = x 3 − 6 x 2 + 11x − 6
We know that
i) f is continuous on [0, 4] , since f is a polynomial in x .
Example 5: Does the mean value theorem holds for the function f defined by
f ( x ) = x in [0, 2]? Justify.
f (2) − f (0) = f ′( x 0 ) (2 − 0)
1 1
2 −0= (2) [Q f (2) = 2 , f (0) = 0 and f ′(x 0 ) = ].
2 x0 2 x0
1 1
i.e., x 0 = and x 0 = .
2 2
1
Since 0 < < 2, therefore, the mean value theorem is verified.
2
***
3
Example 6: Find an approximate value of 26 using the mean value
theorem.
1
3
27 − 3 26 = (27 − 26) [using f (b) − f (a ) = f ′( x 0 )(b − a )]
3x 02 / 3
3 1
i.e., 26 = 3 − 2 / 3
3x 0
1 1 1
3
26 ≈ 3 − Q 2 / 3 ≈ , as x 0 is close to 27
27 3x 0 27
= 2.963
You may note that in writing the value of 3 26 we have rounded-off the
number after three decimal places. Using calculator we can find the exact
value of 3 26 , which is 2.9624961 .
***
The mean value theorem has got many other applications which you will come
across in later units.
You may now try some exercises on your own to check your understanding of
these theorems discussed above.
E1) Show that the following equations have a solution in the interval given
alongside.
a) x 3 − x − 5 = 0, [0, 2] .
π
b) sin x + x = 1, 0, .
6
E2) Use Rolle’s theorem to show that there is a solution of the equation
π
cot x = x in 0, .
2
1 3
E3) Let f ( x ) = x + 2 x . Find a number x 0 in ] 0, 3[ such that
3
f (3) − f (0)
f ′( x 0 ) = .
3− 0
E4) Find all the numbers x 0 in the interval ] − 2, 1[ for which the tangent to
the graph of f ( x ) = x 3 + 4 is parallel to the line joining the end points
(−2, f (−2)) and (1, f (1)) .
f ( n ) (x 0 )
Pn (x ) = f ( x 0 ) + ( x − x 0 ) f ′( x 0 ) + L + (x − x 0 )n (1)
n!
You may note that Pn ( x 0 ) = f ( x 0 ), P1′ (x 0 ) = f ′( x 0 ),K , and
Pn( n ) ( x 0 ) = f ( n ) ( x 0 )
(x − x 0 ) ( x − x 0 ) ( 2)
f ( x ) = f (x 0 ) + f ′( x 0 ) + f (x 0 ) + L
1! 2! 17
Block 1 Solution of Nonlinear Equations in One Variable
(x − x 0 ) n ( n )
L+ f ( x 0 ) + R n +1 ( x ) (2)
n!
( x − x 0 ) n +1 ( n +1)
R n+1 ( x ) is the error term and is equal to f (c) , where c is a
(n + 1)!
point between x 0 and x .
The series given in Eqn. (2) is called the nth order Taylor’s expansion of
f(x) at x 0 .
f ( x ) = Pn ( x ) + R n +1 (x )
( x − x 0 ) n+1 ( n+1)
R n +1 ( x ) = f (c ) .
(n + 1) !
R n+1 ( x ) depends on x , x 0 and n . R n+1 ( x ) is called the remainder (or error)
of the nth Taylor’s expansion after n + 1 terms. We shall discuss this error in
detail in Sec. 1.4
h2 hn h n +1 ( n +1)
f (a + h ) = f (a ) + hf ′(a ) + f ′′(a ) + L + f ( n ) (a ) + f (a + θh ) (3)
2! n! n + 1!
Remark 4: You can see that the mean value theorem as a special case of
Taylor’s theorem. Suppose we put x 0 = a , x = b and n = 0 in Eqn. (2). Then
Eqn. (2) becomes
f (b) = f (a ) + f ′(c) (b − a )
or equivalently
f (b) − f (a ) = f ′(c) (b − a ) , which is the result of Lagrange’s mean value
18 theorem.
Unit 1 Errors and Approximations
Let us consider an example.
E5) If Pn denotes the nth order Taylor polynomial then show that
Pn (x 0 ) = f ( x 0 ), Pn′ ( x 0 ) = f ′( x 0 ), K, Pn(1) ( x 0 ) = f ( n ) ( x 0 ).
We shall recall few more theorems from the course BMTC-131, which are
related to finding roots of the polynomial equations. You will see that we will
use these theorems to locate the root in Unit 2 onwards in this block.
= 1x 4 − 15x 2 + 7 x − 11
We count the changes in the sign of the coefficients. Going from left to right
there are changes between 1 and − 15 , between − 15 and 7 and between 7
and − 11 . The total number of changes is 3 and hence it can have at most 3
positive roots.
Now we consider
P(− x ) = (− x ) 4 − 15(− x ) 2 + 7(−x ) − 11
= x 4 − 15x 2 − 7 x − 11
Here is only one change between 1 and − 15 and hence the equation cannot
have more than one negative root.
We now give another theorem for locating the real roots of polynomial
equation.
Corollary 1: An equation of odd degree with real coefficients has at least one
real root whose sign is opposite to that of the last term.
Corollary 2: An equation of even degree whose constant term has the sign
opposite to that of the leading coefficient, has at least two real roots one
positive and the other negative.
Now, you can try to solve some problems using the above theorems.
20
Unit 1 Errors and Approximations
Error can be positive or negative. We want to find the error which is close to
the true value. Therefore, it can be on either side of the true value. So, we are
interested in absolute value of the error which is defined as
error = | True value (x T ) − Approximat e value (x A ) |
Now if an ‘error’ in approximation is considerably small, then we say that ‘ x A
is a good approximation to x ’.
Sometimes, when the true value is very large or very small we prefer to study
the error by comparing it with the true value. This is known as Relative error
and we define this error as
Therefore,
error = x T − x A = 3.14159265K − 3.14285714 K
= − 0.00126449... = 0.00126449...
0.00126449K
Re lative error = = 0.00040249966 K
3.14159265K
***
Let us look at Example 8 again. You can see that the numbers appearing in
x T , x A and error consist of 8 digits after the decimal point followed by dots.
The line of dots indicates that the digits continue and we are not able to write
all of them. That is, these numbers cannot be represented exactly by a
terminating decimal expansion. Whenever we use such numbers in
calculations we have to decide how many digits we are going to take into
account. For example, consider again the approximate value of π . If we
approximate π using 2 digits after the decimal point (say), chopping off the
other digits, then we have
π ≈ 3.14
If we use 3 digits after the decimal point, then using chopping we have
π ≈ 3.141
In this case the error is given by
Here, 0.00040734 < 0.00059265. This means the error is smaller in case of
rounding-off. Therefore, in general whenever we want to use only a certain
22
Unit 1 Errors and Approximations
number of digits after the decimal point, then it is always better to use the
value rounded-off to that many digits because in this case the error is usually
small. The error involved in a process where we use rounding-off
method is called round-off error. Errors given by Eqns.(4) and (5) are
round-off errors.
We now discuss the concept of floating point arithmetic to see how number of
digits after decimal point relates with the round-off error.
For example, we give in Table 1 below the representation of the number 537
in the normalized floating point representation for n = 1, 2 and 3.
Table 1
The difference between the true value of a number x and rounded-off fl( x ) is
the round-off error. You may observe from Table 1, as the value of
n increases, the round-off error decreases.
Next definition gives us a measure by which we can conclude that the round-
off error occurring in an approximation process is negligible or not.
Example 9: Find out to how many decimal places the value of 22 / 7 obtained
in Example 8 is accurate as an approximation to π = 3.14159265K ?
Solution: We have already seen in Example 8 that
22
π− = 0.00126449K
7
(
Solution: We have f (100000) = 100000 100001 − 100000 . )
The value of 100001 using six-digit rounding-off is
100001 ≈ 316.229347
= 0.316229347 × 10 3.
Therefore,
( )
fl 100001 = 0.316229 × 10 3. [rounded-off to six-digits]
Similarly,
( )
fl 100000 = 0.316228 × 103. [rounded-off to six-digits]
(( ) ( ))
fl fl 100001 − fl 100000 = 0.1× 10 −2
Thus,
fl(f (100000) = fl(100000) × (0.1× 10 −2 )
= (0.1× 10 6 ) × (0.1× 10 −2 )
= 100.
24 ***
Unit 1 Errors and Approximations
Now we make an important remark.
355
E9) In some approximation problems, the value is used as an
133
approximation to π = 3.14159265K . To how many decimal places the
355
value is accurate as an approximation to π ?
133
E10) Consider the numbers x = 0.66662 × 105 and y = 0.66649 × 105. Find the
difference x − y using floating point representation correct upto four
decimal places by (i) rounding-off and (ii) chopping. Also, compare the
results.
As you have seen above the truncation error occurs due to the truncated
terms. That is, the terms which are excluded. Let us now try to estimate this
error.
∞
f ( n ) ( 0) n
f (x) = n!
x (8)
n =0
| R n+1 ( x ) | = | f ( x ) − Pn ( x ) | < M
− M < (f ( x ) − Pn ( x ) ) < M
Pn ( x ) − M < f (x ) < Pn ( x ) + M
f ( x ) ∈ ] Pn ( x ) − M, Pn ( x ) + M [ .
Now, if M is considerably small for some n , then this interval becomes very
small. In this case, we say that f ( x ) is approximately equal to the value of
the nth Taylor polynomial with error M . Thus, we use remainder to determine
a bound for the accuracy of the approximation.
There are some functions whose Taylor’s expansion is used very often. Using
Theorem 4, we shall list their expansions here.
x x2 xn x n +1 c
ex = 1+ + +L + + e K (9)
1! 2! n ! (n + 1)!
x3 x5 (−1) n −1 x 2n −1 (−1) n x 2n +1
sin x = x − + +L + + cos (c) (10)
3! 5! (2n − 1)! (2n + 1)!
26
Unit 1 Errors and Approximations
2 4 n 2n n +1 2n + 2
x x (−1) ( x ) (−1) x
cos x = 1 − + −L + + cos (c) (11)
2! 4! ( 2n ) ! (2n + 2)!
1 x n+1
= 1+ x + x 2 +L + x n + (12)
1− x (1 − c) n+ 2
Solution: You may note that the point x = 0 lies in the given interval. Further,
the function f ( x ) = ln (1 + x ) has continuous derivatives of all orders in the
interval ] − 1, 1[. The derivatives are given by
1
f ′( x ) = , f ′(0) = 1
1+ x
−1
f ′′( x ) = , f ′′(0) = −1
(1 + x ) 2
(−1) 2 2 !
f (3) ( x ) = , f ( 3 ) ( 0) = 2
(1 + x ) 3
K
K
K
(−1) n−1 (n − 1) !
(n )
f (x ) = , f ( n ) (0) = (−1) n −1 (n − 1) !
(1 + x ) n
x2 x3 x 4 (−1) n −1 x n
ln (1 + x ) = x − + − +L+ + R n +1 ( x )
2 3 4 n
(−1) n n !x n +1
where R n +1 ( x ) = , and 0 < c < x.
(n + 1)!(1 + c) n +1
Let us now consider the behaviour of the remainder in a small interval, say,
[0, 0.5] . Then for x in [0, 0.5] , we have
(−1) n n !x n +1
R n +1 ( x ) = , where 0 < c < x .
(n + 1)! (1 + c) n +1
1
Also, since, c > 0 , < 1, and we get
(1 + c) n +1
1
| R n +1 ( x ) | <
n +1
27
Block 1 Solution of Nonlinear Equations in One Variable
1
Now can be made as small as we like by choosing n sufficiently large
n +1
1
i.e., lim = 0 . This shows that lim | R n+1 ( x ) | = 0 .
n →∞ n + 1 n →∞
The above example shows that if n is sufficiently large, the value of the nth
Taylor polynomial Pn ( x ) at any point x 0 will be approximately equal to f ( x 0 ),
the value of the given function f at x 0 . In fact, the remainder R n+1 ( x ) tells us
how close the value Pn ( x 0 ) is to f ( x 0 ) .
***
1 1
f ′( x ) = , f ′(0) =
2 1+ x 2
1 1
f ′′( x ) = − (1 + x ) −3 / 2 , f ′′(0) = −
4 4
3 3
f ′′′( x ) = (1 + x ) −5 / 2 , f ′′′(0) = .
8 8
1 1 1
1 + x = 1 + x − x 2 + x 3 (1 + c) −5 / 2 ,
2 8 16
where c is a point lying between 0 and x .
x3
The error is given by R 3 ( x ) = (1 + c) −5 / 2
16
(0.2) 3
R 3 ( 0. 2) = , where 0 < c < 0.2, Since, c > 0 we have
16(1 + c)5 / 2
1
< 1.
(1 + c) 5 / 2
Hence,
(0.2)3
| R 3 (0.2) | ≤ = 0.0005 = 0.5 × 10 −3
16
Hence, the bound of the error for second order Taylor’s expansion about
x = 0.2 is 0.0005.
***
Example 13: Using Taylor’s expansion for sin x about x = 0 , find the
28 approximate value of sin 10 o with error less than 10 −7.
Unit 1 Errors and Approximations
Solution: The nth Taylor expansion for sin x about x = 0 given in Eqn. (10) is
x3 x5 (−1) n −1 x 2n −1 (−1) n x 2n +1
sin x = x − + +L + + cos (c) , (13)
3! 5! (2n − 1)! (2n + 1)!
where x is the angle measured in radians.
π
Now, in radian measure, we have 10 o = radians.
18
π
Therefore, by putting x = in Eqn. (13) we get
18
3 5
π π 1 π 1 π π
sin = − + + L + R n +1
18 18 3! 18 5! 18 18
π
where R n +1 is the remainder after (n + 1) terms.
18
2 n +1
π (−1) n π
Now, R n +1 = cos c .
18 (2n + 1)! 18
π π
If we approximate sin by Pn , then the error introduced will be less
18 18
−7
than 10 , i.e.,
2 n +1
1 π
< 10 −7 (14)
(2n + 1) ! 18
Using the calculator, we find that the value of left hand side of Ineqn. (14) for
various n as given in Table 2.
Table 2
n 1 2 3
Left hand side of Ineqn. (14) 0.89 × 10 −3
0.13 × 10 −5
0.99 × 10 −9
From the table we find that the ineqn. (14) is satisfied for n = 3 . Hence, the
required approximation is
3 5
π π 1π 1π
sin = − + = 0.1745445
18 18 3! 18 5! 18
3
| R n +1 (1) | ≤
(n + 1)!
Table 3
n 1 2 3 4 5 6
Bounds for R n +1 1.5 0.5 0.125 0.025 0.004 0.0006
1 1 1 1 1 1957
e ≈ 1+1+ + + + + = ≈ 2.71806
2 6 24 120 720 720
***
Theoretically we can use this formula for truncation error for any sufficiently
differentiable function. But practically it is not easy to calculate the nth
derivative of many functions. Because of the complexity in differentiation of
such functions, it is better to obtain indirectly their Taylor polynomials by using
one of the standard expansions.
2
For example, consider the function f ( x ) = e x . It is difficult to calculate the nth
derivative of this function. Therefore, for convenience, we obtain Taylor’s
2
expansion of e x using Taylor’s expansion of e y by putting y = x 2 . We shall
illustrate this in the following example.
2
Example 15: Calculate a bound for the truncation error in approximating e x
by
30
Unit 1 Errors and Approximations
4 6 8
2 x x x
ex ≈ 1+ x 2 + + + for x ∈ ] − 1, 1[ .
2! 3! 4!
2
Solution: Put u = x 2 . Then, e x = e u . Now, we apply the Taylor’s theorem to
the function f (u ) = e u about u = 0 . Then, we have
u u2 u3 u4 ec u 5
e = 1+ u + + + + R 5 (u ) , where R 5 (u ) = ,
2! 3! 4! 5!
and 0 < c < u. Since, | x | < 1, u = x 2 < 1 i.e., c < 1 . Therefore, e c < e < 3 . Thus
3u 5 3 1
| R 5 (u ) | ≤ < = = 0.025
5! 5! 40
2
Hence, the truncation error in approximating e x by the above expression is
less than 0.25 × 10 −1.
***
Remark 6: If the absolute value of the TE is less, then we say that the
approximation is good.
In the practical situations we should be able to find out the value of n for
which the summation Σa n x n gives a good approximation to f ( x ) . For this we
always specify the accuracy (or error bound) required in advance. Then we
find n such that the absolute error | R n +1 ( x ) | is less than the specified
accuracy. This gives the approximation within the prescribed accuracy.
x2 x2 x4 x6 x8 e x x 10
e ≈ 1+ + + + with TE = .
1! 2! 3! 4! 5!
Now we use this approximation to calculate the integral. We have
1 1
x4 x6 x8
x2
e dx ≈ 1 + x 2
+ + + dx (15)
0 0
2 ! 3! 4!
1 2
e x x 10
with the truncation error TE = 5!
dx .
0
1 2 1 2
e x x10 | e x | | x |10 3
We have | TE | = dx ≤ dx ≤ = 0.25 × 10−1
0
5! 0
5! 5!
Integrating the right hand side of Eqn. (15), we get the required approximate
value of the integral as
1
1
x2 x 4 x 6 x8
1
x3 x5 x7 x9
2
e dx ≈ 1 + x + + + dx = x + + + +
0 0
2! 3! 4 ! 3 5 × 2! 7 × 3! 9 × 4! 0 31
Block 1 Solution of Nonlinear Equations in One Variable
1
x3 x5 x7 x9
= x + + + +
3 10 42 216 0
1 1 1 1
=1+ + + +
3 10 40 216
= 0.0048.
***
Remark 7: The magnitude of the truncation error could be reduced within any
prescribed accuracy by retaining sufficiently large number of terms. Likewise
the magnitude of the round-off error could be reduced by retaining additional
digits.
1 1
E11) Obtain the nth Taylor expansion of the function f ( x ) = in − , 1
1+ x 2
about x 0 = 0 .
E13) Obtain the 8th order Taylor expansion of the function f ( x ) = cos x in
π π
− 4 , 4
about x 0 = 0 . Obtain a bound for the error R 9 ( x ) .
E14) Using Maclaurin’s expansion for cos x , find the approximate value of
π
cos with the error bound 10 −5 .
4
2
E17) a) Calculate the truncation error in approximating e − x by
x4
1− x2 + , −1 ≤ x ≤ 1.
2
b) Using the approximation in (a) calculate an approximate value of
0.1
e
−x 2
dx .
0
32
Unit 1 Errors and Approximations
We end this unit by summarising what we have learnt in this unit.
1.5 SUMMARY
In this unit we have covered the following points:
(x − x 0 ) ( x − x 0 ) ( 2)
f ( x ) = f (x 0 ) + f ′( x 0 ) + f (x 0 ) + L
1! 2!
33
Block 1 Solution of Nonlinear Equations in One Variable
(x − x 0 ) n ( n )
L+ f ( x 0 ) + R n +1 ( x )
n!
( x − x 0 ) n +1 ( n +1)
R n +1 ( x ) is the error term and is equal to f (c ) ,
(n + 1)!
where c is a point between x 0 and x .
1.6 SOLUTIONS/ANSWERS
E1) a) The given equation is of the form f ( x ) = c , where,
f ( x ) = x 3 − x − 5 and c = 0 . f is a continuous function in the
interval [0, 2] and f (0) = −5 and f (2) = 1 . Then, 0 lies between
f (0) and f (2) . Therefore, by Theorem 1, the equation f ( x ) = 0
has a solution in the interval ]0,2[.
Pn′ ( x 0 ) = f ′( x 0 ) + 0 + 0 K = f ′( x 0 ) .
Note that apart from the first term, all other terms in the R.H.S. contain
the factor ( x − x 0 ) and therefore when we put x = x 0 , there terms
35
vanish.
Block 1 Solution of Nonlinear Equations in One Variable
By differentiating Eqn. (16) further, we get Pn(i ) ( x 0 ) = f ( i ) (x 0 ), i = 2, K , r .
E7) P( x ) = 3x 7 + x 5 + 4x 3 + 10x − 6 = 0 ,
P(− x ) = −3x 7 − x 5 − 4x 3 − 10x − 6 = 0 ,
P( x ) = 0 has no negative real root, as there is no change in the sign of
the coefficients in P(− x ). There is only one change in the sign of the
coefficients in P( x ) = 0, therefore, P( x ) = 0 can take at most one
positive real root.
Here, f (0) = −6 < 0
f (1) = 12 > 0
Thus, the equation p( x ) = 0 has one positive root lying between 0 and
1, using Theorem 1.
E8) P( x ) = x 4 + x 3 − 2 x 3 + 4x − 24 = 0.
Here the sign of the constant term is negative where as the sign of
leading coefficient is positive. Therefore, using corollary 2 of Theorem 7,
P( x ) = 0 has two real roots, one positive and the other negative.
355
E9) = 3.14159292K and
113
π = 3.14159265K
355
| error | = π − = 0.00000027
113
1 1
Then 10 −7 < 0.00000027 < × 10 −6
2 2
Therefore the approximation is accurate to 6 decimal places.
1
E11) f ( x ) = , f ( 0) = 1
1+ x
−1
f ′( x ) = , f ′(0) = −1
(1 + x ) 2
(−1) (−2)
f ′′( x ) = , f ′′(0) = 2
(1 + x ) 3
(−1) (−2) (−3)
f ′′′(x ) = , f ′′′(0) = (−1) 3 3!
(1 + x ) 4
..................................................................
..................................................................
2 3 (−1) n +1 n n
= 1 − x + x − x + L + (−1) x +
(1 + c) n +1
x x2 x3 x4
cos x = cos 0 − sin 0 − cos 0 + sin 0 + cos 0
1! 2! 3! 4!
x5 x6 x7 x8 x9
− sin 0 − cos 0 + sin 0 + cos 0 − sin c
5! 6! 7! 8! 9!
x2 x4 x6 x8 x9
= 1− + − + − sin c
2 ! 4! 6! 8! 9 !
The remainder is given by
x9
R 9 (x ) = − sin c
9! 37
Block 1 Solution of Nonlinear Equations in One Variable
π π π
Since, x lies in − , , and we have | x | ≤ < 1,
4 4 4
therefore, we get
1
| R 9 (x ) | ≤ = 0.00000275573 .
9!
E14) We have seen in E12) that the remainder in the 8th order Taylor
expansion of cos x is such that
| R 9 (x ) | ≤ 10 −5
x2 x4 x6 x8
cos x ≈ 1 − + − +
2! 4 ! 6 ! 8!
π
Putting x = , we get
4
2 4 6 8
π π π π
π
cos ≈ 1 − 4
+ 4
− 4
+ .
4
4 2! 4! 6! 8!
x n +1 c
E15) | R n +1 | = | e x − Pn ( x ) | = e
(n + 1)!
where c lies between 0 and x .
x n +1e c e
Therefore, | R n +1 | = ≤ [Q| x | ≤ 1 and | e c | ≤ e.]
(n + 1)! (n + 1)!
e
Now, we have to find an integer n such that ≤ 10 −5 .
(n + 1)!
e
This is satisfied if n = 8 because ≈ 0.749 × 10 −5 .
9!
Therefore, n = 8 is the required number.
x3 x5 x7
sin x = x − + − + R 8 (x ) ,
3! 5! 7 !
x8 1
where | R 8 (x ) | = sin (c) ≤ = 0.000024802
8! 8!
Therefore, the truncation error T.E. = R 8 ( x ) = 0.24802 × 10 −4.
x3 x5 x7
b) sin x = x − + − + R 8 (x )
38 3! 51 7 !
Unit 1 Errors and Approximations
Hence,
sin x x 2 x 4 x 6 R 8 (x )
=1− + − +
x 3! 5! 7 ! x
R 8 ( x ) x 8 sin c x 7
where = = sin (c)
x 8! x 8!
Thus,
1
sin x
1
x2 x4 x6 1
R (x)
x
dx = 1 −
3!
+
5 !
− dx + 8
7 ! x
dx
0 0 0
1 1
R 9 (x ) x7
Now x dx = 8!
sin (c) dx
0 0
1
1 1
≤ x 7 dx = ≤ 0.24802 × 10 −4
8! 0 8 × 8!
1
x7
1
sin x x3 x5
Therefore, we have x
dx ≈ x − + −
3! 3 5! 5 7! 7 0
0
1 1 1
= 1− + −
3! 3 5! 5 7 ! 7
= 0.946
with an error less than 0.25 × 10−4.
2
E17) a) Put u = − x 2 . Then e − x = e u . We consider the 2nd order Taylor
expansion of e u given by
u2
eu = 1 + u + + R 3 (u )
2
ecu 3
where R 3 (u ) =
3!
ec u 3 | e c | | u |3
| R 3 (u ) | = ≤
3! 3!
1 1
Since, u ≤ 0, e c ≤ 1 . Hence | R 3 (u ) | ≤ =
3! 6
−x 2 x4 2
b) From (a) we have e =1− x + + R 3 (−x 2 ) .
2
Hence,
0.1
−x 2
0.1
x4
0.1
e 1 − x + dx + R 3 (− x 2 ) dx
2
dx =
0 0 2 0
0.1 0.1 2
e−x x 6
R
2
Now, 3 (− x )dx ≤ dx
0 0
3!
39
Block 1 Solution of Nonlinear Equations in One Variable
0.1
x7
0.1
x6
≤ 3!
dx =
3! 7 0
0
(0.1) 7
= 10 −7
3! 7
Therefore,
0.1
0.1
−x 2
0.1
x4 x3 x5
e dx ≈ 1 − x 2 + dx = x − + = 0.099667666
2 3 10 0
0 0
40