Anda di halaman 1dari 23

UNIT 1- REVIEW OF CALCULUS

Structure
1.1 Introduction
Objectives
1.2. Three Fundamental Theorems
Intermediate Value Theorem
Rolle's Theorem
Lagrange's Mean Value Theorem
1.3 Taylor's Theorem
1.4 Errors
Round-off Error
Truncation Error
1.5 Summary
1.6 Solutions/Answers

1 . INTRODUCTION

The study of numerical analysis involves concepts from various branches of mathematics
including calculus. In this unit, we shall briefly review certain important theorems in .
calculus which are essential for the development and understanding of numerical methods.
You are already familiar with some fundamental theorems about continuous functions from
your calculus course. Here we shall review three theorems given in that course, namely,
Intermediate value theorem, Rolle's theorem and Lagrange's mean value theorem. Then we
state another important theorem in calculus due to B. Taylor and illustrate the theorem
through various examples.

Most of the numerical methods give answers that are approximations to the desired
solutions. In this situation, 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
~ O S S errors
~ D ~ that can arise in computational procedures. In this unit we shall introduce you
to different forms of errors which are common in numerical computations.

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.

Objectives
After studying this unit you should be able to :
apply
i) Intermediate value theorem
ii) Rolle's theorem
iii) Lagrange's mean value theorem
iv) Taylor's theorem;
define the term 'error' in approximation;
distinguish between rounded-off error and truncation error and calculate these errors
as the situation demands.

1.2 THREE FUNDAMENTAL THEOREMS

In this section we shall discuss three fundamental theorems, namely, intermediate value
theorem, Rolle's theorem and Lagrange's mean value theorem. All these theorems give
properties of continuous functions defined on a closed interval [a, b]. We shall not prove
them here, but we shall illustrate their utility with various examples. Let us take up these
theorems one by one.
Solutions of Nun-linear Equations
in one Variable
1.2.1 Intermediate Value Theorem
The intermediate value theorem says that a function that is continuous on a closed interval
[a, b] takes on every intermediate value, i.e., every value lying between f(a) and f(b) if
f(a) # f(b).

Formally we can state the theorem as follows :

Theorem 1 :Let f be a function defined dn a closed interval [a, b]. Let c be a number lying
between f(a) and f(b) (i.e. f(a) < c < f(b) if f(a) < f(b) or f(b) < c < f(a) if f(b) < f(a)). Then
there exists at least one point xo E [a, b] such that f(xo) = c.

The following figure (Fig. 1) may help you to visualise the theorem more easily. It gives the
graph of a function f.

Fig. 1

In this figure f(a) < f(b). The condition f(a) < c< f(b) implies that the points (a, f(a)) and
(b, f(b)) lieon opposite sides of the line y = c. This, together with the fact that f is
continuous, implies that the graph crosses the line y = c at some point. In Fig. 1 you see
that the graph crosses the line y = c at (xo,c).

The importance of this theorem is as follows : If we have a continuous function f defined on


a closed interval [a, b], then the theorem guarantees the existence of a solution of the
equation f(x) = c, where c is as in Theorem 1. However, it does not say what the solution is.
We shall illustrate this point with an example.

7c 1
Example 1 :Find the value of x in 0 Ix 5 - for which sin (x)
2

1.
Solution : You know that the function f(x) = sin x is continuous on 10, f Since f(0) = 0
L LA
= 1, we have f(0) < Thus f satisfies all the conditions of Theorem 1.

1
Therefore, there exists at least one value 06 x, say xo, such that f(xo) = -, that is, the theorem
2
1
guarantees that there exists a point xo such that sin (xd = -. Let us try to find this point from
2

[ I;
the graph of sin x in 0, - (see Fig. 2).

Fig. 2
- 1
From the figure, you can see that the line x = - cuts the graph at the point
2 [E. i)~ e n c e
[ :]
there exists a point x - - in 0, - such that sin ((xo) = -.
0-: 2
1

Let us consider another example.

Example 2 : Show that the equation 2x3 + x2 - x + 1 = 5 has a solution in the interval [ l , 21.

Solution :Let f(x) = 2x3 + x2 - x + 1. Since f is a polynomial in x, f is continuous in [ l , 21.


Also f(1) = 3, f(2) = 19 and 5 lies between f(1) and f(2). Thus f satisfies all conditions of -
Theorem 1. Therefore, there exists a number xo between 1 and 2 such that f(xo) = 5. That is.
the equation 2x3 + x2 - x + 1 = 5 has solution in the interval [ l , 21.

Thus we saw that the theorem enables us in establishing the existence of the solutions of
certain equations of the type f(x) = 0 without actually solving them. In other words, if you
want to find an ~ntervalin which a.solution (or root) of f(x) = 0 exists, then find two
numbers a, b such that f(a) f(b) < 0.Theorem 1, then states that the solution lies in ]a, b[. We
shall need some other numerical methods for finding the actual solution. We shall study the
problem of finding solutions of the'equation f(x) = 0 more elaborately in Unit 2.

Why don't you try an exercise now.

El) Show that the following equations have a solution in the interval given alongside.

Let us now discuss another important theorem in calculus.

1.2.2 Rolle's Theorem


In this section we shall review the Rolle's theorem. The theorem is named after the
seventeenth century French mathematician Michel Rolle (1652-17 19).

Theorem 2 (Rolle's Theorem) :Let f be a continuous function defined on [a, b] and


differentiable on ]a, b[. If f(a) = f(b), then there exists a number xo in ]a, b[ such that
f(x,) = 0.
Geometrically, we can interpret the theorem easily. You know that since f is continuous, the
graph o f f is a smooth curve (see Fig. 3).

Fig. 3

You have already seen in your calculus course that the derivative f ( x d at some point xo
gives the slope of the tangent at (xo, f(xd) to the curve y = f(x). Therefore the theorem states
that if the end values f(a) and f(b) are equal, then there exists a point xo in ]a, b[ such that
the slope of the tangent at the point P(xo, f(xd) is zero, that is, the tangent is parallel to
x-axis at that point (see Fig. 3). In fact we can have more than one point at which f ( x ) = 0 as
shown in Fig. 3. This shows that the number xo in Theorem 2 may not be unique.
~ulutionsol'Non-~inrarEquations The following example gives an application of Rolle's theorem.
in one Variable

P1,
Example 3 1 Use_ Rolle's theorem to show that there is a solution of the equation
cot x = x in

Solution : Here we have to solve the eauation cot x - x = 0. We rewrite cot x - x as


cos x - x sin x
sin x
-. Solving the equation
cos x - x sin x
sin x
= 0 in
J
]O, $
L
is same as solving the
equation cos x - x sin x = 0. Now we shall see whether we can find a function f which
satisfies the conditions of Rolle's theorem and for which f ( x ) = cos x - x sin x. Our
experience in -diffvntiation suggests- that we try f(x) = x cos x. This function f is
10.1 and the derivative f (x) = cos x - x sin x. Also

requirements of Rolle's theorem. Hence, there exists


\ /
a point xo in ]a, b[ such that f'(xo) = cos xO- x0 sin xO= 0. This shows that a solution to the

equation cot x - x = 0 exists in 0, -


I :[ .

You can try the following exercise on the same lines as Example 3.

E2) Using Rolle's theorem show that there is a solution to the equation tan x - I +x =0
in 10, I[.
- - -

Now. let us look at Fig. 3 carefully. We see that the line joining (a, f(a)) and (b, f(b)) is
parallel to the tangent at (xo,f(xo)). Does this property hold when f(a) # f(b) also? In'other
words. does there exist a point xo in ]a, b[ such that the tangent at (xg. f(xo)) 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. ..

1.2.3 Lagrange's Mean Value Theorem


This theorem was first proved by the French mathematician Count Joseph Louis Lagrange
(1736-1813).

Theorem 3 : Let f be a continuous function defined on [a, b] and differentiab1e.h ]a. b[.
Then there exists a number xOin la, b[ such that

f (xo) =
0)- f(al ...
b-a
Geometr~callywe can interpret this theorem as given in Fig. 4.

Fig. 4

In this figure you can see that the straight line connecting the end points (a, f(a)j and
(b, f(b)) of the graph is parallel to'lsome tangent to the curve at an intermediate point.

You may be wondering why this theorem is called 'mean value theorem'. This is because of
the following physical interpretation.
Suppose f(t) denotes the position of an object at time t. Then the average (mean) velocity Review of Calculus
during the internal [a, b] is given by
f(b) - f(a)
b-a
Now Theorem 3 states that this mean velocity during an internal [a, b] is equal to the
velocity f(xo) at some instant xo in ]a, b[.

We shall illustrate the theorem with an example.

Example 4 : Apply the mean value theorem to the function f(x) = G i n [O, 21 (see Fig. 5).

Fig. 5 :Graph of f(x) = fi.

Solution : We first note that the function f(x) = fiis continuous on [O, 21 and differentiable
I
in ]0,2[ and f (x) = --
2.1;; '

Therefore by Theorem 3, there exists a point xo in ]0,2[ such that

f(2) - f(0) = f (xo) (2 - 0)

1
Now f(2) = fiand f(0) = 0 and f(xo) = --
2%'

Therefore we have

[$ . $1
Thus we get thatcthe line joining the end points (0,O) and (2, fi)of the graph off is parallel
m the tangent to the curve at the point

We shall consider one more example.


.
Example 5 :Consider the function f(x) = (x - 1) (x - 2) (x - 3) in [O, 41. Find a point xo in
]0,4[ such that

Solution :We rewrite the function f(x) as


f(x) = (x - 1) (x - 2) (x - 3) = x3 - 6x2 + 1l x - 6
We know that f(x) is continuous on [O, 41, since f is a polynomial in x. Also the derivative
f ( x ) = 3 x 2 - 12x+ 11
Solutions of Non-linear Equations
exists in ]0,4[. Thus f satisfies all conditions oi the mean value theorem. Therefore, there
in one Variable exists a point xo in ]0,4[ such that

This is a quadratic equation in xo. The roots of this equation are

6+26 6-26
and -
8 8
Taking 6 d 1.732, we see that there are two values for xo lying in the interval ]0,4[.

The above example shows that the number xo in Theorem 3 may not be unique. Again, as
we mentioned in the case of Theorems 1 and 2, the mean value theorem guarantees the
existence of a point only.

Why don't you try some exercises on your own?

I
E3) Let f(x) = - x3 +,2x. Find a number xo in ]0,3[ such that
3

E4) Find all numbers xo in the interval 1-2, 1[ for which the tangent to the graph of
f(x) = x3 + 4 is parallel to the line joining the end points (-2, f(-2)) and (1, f(1)).
E5) Show that Rolle's theorem is a special case of mean value theorem.

So far we have used the mean value theorem to show the existence of a point satisfying
Eqn. I . Next we shall consider an example which shows another application of mean value
theorem.

Example 6 :Find an approximate value of using the mean value theorem.

G.The number nearest to 26


for which the cube root is known is 27, i.e. f(27) = ==
Solution : Consider the function f(x) = x113.Then f(26) =
3. Now we shall apply the mean
value theorem to the function f(x) = x113in the interval ]26,27[. The function f is
continuous in [26,27] and the derivative is
I
f (x) = -
3x213
Therefore, there exists a point xo between 26 and 27 such that

The symhol = means


approximately equal to. Since xo is close to 27, we approximate - -1 - by -- 1 .
1.e.;
3x;I3 3(27)2/3'
Substituting this value in Eqn. (2) we get Review of ~ a l c t l l u s

Note that in writing the value of G w e have rounded off the number after three decimal
i
places. Using the calculator we find that the exact value of G i s 2.9624961.

We have given this example just to illustrate the usefulness of the theorem. The mean value
theorem has got many other applications which you will come across in later units.

Now we shall discuss another theorem in calculus.

1.3 TAYLOR'S THEOREM

You are already familiar with the name of the English mathematician Brook Taylor
(1685-173 1) from your calculus course. In this section we shall introduce you to a
well-known theorem due to B. Taylor. Here we shall state the theorem without proof and
discuss some of its applications.

You are familiar with polynomial equations of the form f(x) = a. + a , x + . . . + an xn where
ao, a,, . . . ,an are real numbers. We can easily compute the value of a polynomial at any
point x = a by using the four basic operations of addition, multiplication, subtraction and
division. On the other hand there are functions like ex, cos x, In x etc. which occur
frequently in all branches of mathematics which cannot be evaluated h the same manner.
For example, evaluating the function f(x) = cos x at 0.524 is not so simple. Now, to evaluate
such functions we try to approximate them by polynomials which are easier to evaluate.
Taylor's t h e o r e ~ ~ ~ ius
v eassimple method for approximating functions f(x) by polynomials.

Let f(x) be a real-valued function defined on R which is n-times differentiable (see MTE-01
Calculus Unit 6, Block 2). Consider the function

where xo is any given real number.

Now Pl(x) is a polynomial in x of degree 1 and P1(xO)= f(xo) and F I ( x o )= f(xo). The
polynomial P,(x) is called the first Taylor polynomial of f(x) at xo. Now consider another
function

Then P2(x) is a polynomial in x of degree 2 and P2(xO)= f(xo), P12(xO)= f(x0) and
PI12(xO)= f'(xo). P2(x) is called the second Taylor polynomial of f(x) at xo.

Similarly we can define the rth Taylor polynomial of f(x) at xo where 1 I r 5 n. The rth
Taylor polynomial at xo is given by

You can check that Pr(xo) = f(x& P,(xo) = f(xo) , . . .

p;)(xo) = f(')(xo) (see E6)


1
Let us consider an example.

Example 7 :Find the fourth Taylor polynomial of f(x) = In x about x, = 1.

t Solution :The fourth Taylor polynomial of f(x) is given by


~oluticbnsof Non-linear Equations Now, f(1) = In1 = 0
in one Variable
1
f(x)=-; f(l)=l
X

- 1 2 + x - ~( ~ - 1 ) ~
Therefore, P4(x) = (X- 1) - - -
2 3 4 "

Now, you can try some exercises.

E6) If P, denotes the rth Taylor polynomial as given by Eqn (3). then show that
Pr(xo) f(xo), P,(x,) = f (x,), . . . P~)(x,,) = flr)(xo). Q

E7) Obtain the third Taylor polynomial of f(x) = ex about x = 0.

W e are now ready to state the Taylor's theorem.

Theorem 4 (Taylor's Theorem) :Let f be a real valued function having (n + 1) continuous


derivatives on ]a, b[ for some n 2 0. Let xo be any point in the interval ]a, b[. Then for any
x E ]a, b[, we have

where c is a point between xo and x.

The series given in Eqn. (4) is called the nth Taylor's expansion of f(x) a t xo.

W e rewrite Eqn. f4$ in the form


f(x) = Pn(x) + R,, + ,(x)
where Pn(x) is the nth Taylor polynomial of f(x) about xo and

Rn I(x) depends on x, xo and n. Rn I(x) is called the remainder (or error) ofkhe nth
+ +

Taylor's expansion after n + 1 terms.

Suppose we put xo = a and x = a + h where h > 0,in Eqn(4). Thefiany point between a and
a + h w i l l b e o f t h e f o r m a + 8 h , O < 8 < I,.

Therefore, Eqn (4) can be written as

h2 hn ),n +l
f(a+h)=f(a)+hf(a)+-f"(a)+..
2!
. +,&")(a)+-f("+')(a+~h)
n. n + l!
...(5)

Let us now make some remarks &the Taylor's theorem.


Remark 1 : Suppose that the function f(x) in Theorem 4 is a polynomial of degree m. Then
f(')(x) = 0 for all r > m. Therefore R,, ,(x) = 0 for all n 2 m. Thus, in this case, the mth
+

Taylor expansion of f(x) about xo will be

Note that the right hand side of the above equation is simply a polynomial in (x - x0).

Therefore, finding Taylor's expansion of a polynomial function f(x) about xo is the same as
expressing f(x) as a polynomial in (x - x d with coefficients from R.

Remark 2 : Suppose we put xo = a, x = b and n = 0 in Eqn. (4). Then Eqn. (4) becomes

or equivalently

which is the Lagrange's mean value theorem. Therefore we can consider the mean value
theorem as a special case of Taylor's theorem.

Let us consider some examples.

Example 8 :Expand f(x) = x4 - 5x3 + 5x2 + xc+ 2 in powers of (x - 2).


Solution :The function f(x) is a polynomial in x of degree 4. Hence, derivatives of all
orders exist and are continuous. Therefore by Taylor's theorem, the 4th Taylor expansion of
f(x) about 2 is given by

Here f(2) = 0
f ( x ) = 4 x 3 - 15x2+ 1 0 x + 1 , f (2) = -7
f'(x) = 12x2- 30x + 10 , f'(2) = -2
F3)(x)= 24x - 3 0 , t(3)(2)= 18

p4)(x)= 24 , p4)(2)= 24
Hence the expansion is

= - 7 ( ~- 2) - (X- + 3 ( -~213 + (X- 2)4


Example 9 :Find the nth Taylor expansion of In (1 + x) about x = 0 for x E 1-1, 1[.

Solution :We first note that the point x = 0 lies in the given interval. Further, the function
f(x) = In (1 + x) has continuous derivatives of all orders. The derivatives are given by
i.
1
f (x) = -
l+x'

(-1)"- '(n - I)!


P")(x) = ,P"L(O)=(-I)"- '(n - I)!
(1 + x)"
Solutions of~on-linearEquations Therefore by applying Taylor's theorem we get that for any x E 1-1, 1 [
in one Variable

where c is a point lying between 0 and x.


Now, let us consider the behaviour of the remainder in a small interval, say, [O, 0.51, Then
for x in [O, 0.51, we have
1 1

where 0 < c < x.

Since I x I < 1, I x I "+ ' < 1 for any positive integer n.


Also since c > 0, < 1. Therefore we have
(1 +c)"+'

Now can be made as small as we like by choosing n sufficiently large i.e.


n+l
lim --I - 0. This shows that lim I Rn l(x) 1 = 0.
+

,+, n+ 1 n+-

The above example shows that if n is sufficiently large, the value of the nth Taylor
polynomial P,(x) at any xo will be approximately equal to the value of the given function
f(xo). In fact, the remainder Rn I(x) tell(s) us how close the value Pn(xo) is to f(xo).
+

Now we shall make some general observations about the remainder Rn + ,(Y; ,n the ~'aylor's
expansion of a function f(x).
Remark 3 :Consider the nth Taylor expansion off about xo given by

Then Rn I(x) = f(x) - Pn(x). If lim Rn I(x) = 0 for some x, then for that x we say that we
+ +

n+-
can approximate f(x) by P,(x) and we write f(x) as the infinite series.

f(2)(~,,) 2 f(")(xO)
f(x) = fO(x)+ f (x)(x - x,,) + ----- (X- x0) + . . . + --n! (X- x0)" + . .
2!

You are already familiar with series of this type from your calculus course. This series is
called Taylor's series of f(x). If we put xo = 0 in Eqn. (6) then the series

is called Maclaurin's series.

Remark 4 :If the remainder Rn+ I(x) satisfies the condition that I Rn+ I(x) I < M for some
n at some fixed point x = a, then M is called the bound of the error at x = a.
Inthis case we have Wetic% t ~Calculus
f

I Rn + ,(XI1 = 1 f(x) - Pn(x) I < M


That is, f(x) lies in the i'nterval I P,(x) - M , P-(x) + M I.

approximation.
We shall explain these concepts with an example.
Example 10 :Find the 2nd Taylor's expansion of f(x) = in )-I. 11 about 9~ = 0. Find
'
the bound of the error at x = 0.2.
I Solution :Since f(x) = G.
we have

k Applying Taylor's theorem.to f(x), we get

where c is a point lying between 0 and x.

x3 1 + c)-'I2.
The e m is given by R,(r) = %(

1 When x = 0.2. we have

where 0 < c < 0.2. Since c > 0 we have

Hence,
.- -. a

I
I R3(02) I d 16
= (0.5) l(r3

Hence the bound of the enm for n = 2 at x = 0.2 is (0.5)


Why don't you try some exercises now?

E8) Obtaii the nth Taylor expansion of the function f(x) = -k ) i . l[alW%=O.
1+ x
E9) Does f(x) = 6have a Taylor series expansion about x = 03 Justify your answer.

El01 Obiain the 8th Taylor expandon of the function f(x) = ccrr x in
Obtain a bound for the e m &(x).
Solutionsof Non-linear, Equations
in one Variable
There are some functions whose Taylor's expansion is used very often. We shall list their
expansions here.
1
X x2 xn, X " + '
e x = 1 +-+-+. . .+--+-----eC.. . . . . (7)
l! 2! n! (n + l)!
x3 x5
Sinx=x.--+-+.
3! 5!
..+ (2n - l)!
(- l)n x2n + 1
+ cos (c) .
(2n + I)!
x2 x4
Cosx=l--+--..
2! 41
.+ (-1)"(2n)!
(x12"

(-1 )n + 1 X2n + 2
I n.." (n\

where c, in each expansion, is as given in Taylor's theorem.

Now, let us consider some examples that illustrate the use of finding approximate values of
some functions at certain points using truncated Taylor series.

Example 11 : Using Taylor's expansion for sin x about x = 0, find the approximate value of
sin 10" with error less than

Solution :The nth Taylor expansion for sin x given in Eqn. (9) is

(-1)n X2n + 1
+ (2n + I)!
cos C .
where x is the angle measured in radians.

Now, in radian measure, we have


7t
10" = - radians.
18
X:
Therefore, by putting x = -in Eqn. (1 1) we get
18

where Rn

Now
+

("ig1.
I IS the remainder after (n + 1) terms.

If we approximate sin then the error introduced will be less than if

= I (-lln [z)
(2n + l)! 18
2n+l
coscI < 10-7.

Maximizing cos c, we require that


. \2n + 1
Using the calculator, we find that the value of left hand side of Eqn. (12) for various n is Review of Calculus

1
-

Left hand side .89x10-l ' , I ..13xl0'~ .99 x

From the table we find that the inequality in (12) is satisfied for n = 3. Hence the required
approximation is

sin [+); - 4[$+ +(+J = 0.1745445

i with error less than 1.0 x


I Let us now find the approximate value of e using Taylor's theorem.

Example 12 :Using Maclaurin's series for ex, show that ez2.71806 with error less than
0.001. (Assume that e < 3).

Solution :The Maclaurin's series for ex is


-

Putting x = 1 in the above series, we get

Now we have to-find n for which


I e -pn(l) I = I R,+ 1(1) I c0.001:

Since we have chosen xo = 0 and x = 1, the value c lies between 0 and 1 i.e. 0 < c < 1. Since
eC< c < 3, weget

The bound for Rn 1(1)for different n is given in the following table.


+

1 Bounds for R, + I 1 1.5 .5 .1 1 .I25 1 .004 1 .0006

From thh table, we see that

R,+l<.001ifn=6 \

Thus P6 (1) is the desired approximation to e. i.e.

See if you can do the following exercises.

It
E l 1) Using Maclaurin's expansion for cos x, find the approximate value of cos - with the
4
error bound l(r5.
E12) How large should n be chosen in Maclaurin's expansion for ex to have
.%lutions of Nun-linear Equations in In numerical analysis we are concerned with developing a sequence of calculations that will
une Variable give a satisfactory answer t~ a problem. Since this process involves a lot of computations,
there is a chance for the presence of some errors in these computations. In the next section
we shall introduce you to the concept of 'errors'~hatarisein numerical computations.

1.4 ERRORS

In this section we shall discuss the concept of an 'error'. We consider two types of errors
that are commonly encountered in numerical computations.
You ate already familiar with the rounding off a number which has non-terminal decimal
expansion from your school arithmetic. For example we use 3.1425 for 22n. These rounded
off numkrs are approximations of the actual values. In any camputatbnal procedure we
make use of these approximate values instead of the true values: Let xT denote the true value
and xA denote the approximate value. How do we measure the goodness of an
approximation xA to xT? The simplest measure which naturally comes to our mind is the
difference between xT and x,. This measure is called the 'error'. Formally, we define error
as a quantity which satisfies the identity.
True value xT = Approximate value xA + error.

Now if an 'error' in approximation is considerably small (according to some criterion), tht!n


we say that 'xA is a good approximation to x'.

Let us consider an example.


Example 13 :The true value of x is 3.14159265. . .In same mensuration problems the
value 22/7 is commonly used as an approximation to u. What is the error in this
approximation?
Solution :The true value of x is

Now, we convert 22n to decimal form, so that we can find the difference between the
approximate value and true value. Then the approximate value of u is

-
error = True value approximate value = - 0.001 26449 . ..(IS)
Note that in this case the error is negative. Error can be positive or negative. We shall in
general be interested in absolute value of the enor which is defined as
1. h r 1 = I True value - approximate value 1
For example, the absolute Error in Example 13 is
I error 1 = 1 -0.00126449.. :1 ~0.00126...
Sometimes, when the true value is very ldrge or very small we p f e r to study the cnw by
comparing it with the true value. This is known as Relative ~ W O Pand we &fine this error as

1 Relative crm t = True value - approximatevalue


True value
In the case of Exampk 13.

But note that in certain canp1tatbm, the nue value rrmy not be available. In that ccrse we
replace ihe mee value by the camputed qpmdmafe value in the &finition of nlrtive ens.
In numerical calculations, you will encountermainly two types of emm:nnud-off e m and
truncation ma.We shall discuss these mars in the next two s u ~ t i o n s1.4.1 and 1.4.2
.
respec'tively
1.4.1 Round-off Error I u

Let us look at Example 13 again. You can see that the numbers appearing in Eqns (13).
( 14) and (15) 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 wrife 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 a. If we approximate ~r
using 2 digits after the decimal point (say). chopping off the other digits, then we have

The error in this approximation is


error = 0.00 159265 ... ....(16)
If'we use 3 digits after the decimal point. then using chopping we have

In this case the error is given by


error = - 0.UMI59265. . . ... (17)
Now suppose we coqsider the approximate valuc rounded-off to three decimal places. You
already know how to round off a number which has non-terminal deci~nalexpansion. Then
the value of a rounded-off to 3 digits is 3.142. The error in this case is
error = - 0.00040734 . . .
which is smaller. in absolute value than 0.00059265 ... given in Eqn. (17). Therefore in
general whenever we want to use onl) a cenain 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 iavolved in a process where we use rounding off
method is called round-off error.
We now discuss the concept of floating point arithmetic.
In scientific computations a real number x is usually represented in the form
x = k ( . d , d,... d,) 10'"

...
where dl, 4.. d,, are natural numbers between 0 and 9 and m is an integer called
exponent. Writing a number in this form is known as floating point representation. We
denote this representation by fl(x). Such a floating point number is said to be normalized if
d l # 0. To translate a number into floating point representation we adopt any of the two
methods -rounding and chopping. For example. supposc we want to represent the number
537 in the normalid floating point represuntation kith n = I. then we get
fl(537) = .5 x ld chopped
, = .5 x i d rounded
In this case we are getting the same r;presentation in rounding and chopping. Now if we
take n = 2, then we get
fl(537) = .53 x l d chopped -
= .54 x rounded
In this case, the representations are different.
Now if we take n = 3, then we get
fl(537) = 537 x lo3chopped

The number n in the floating point representation is called precision.


The difference between the tme value of a number x and rounded fl(x) is called round-off
e m . Fmm the earlier discussion it is clear that the round-off error decreases when p&ision
increases.
soiutions of Non-linear E:quations in Mathematically we define these concepts as follows :
one Variable
Definition 2 :Let x be a real number and x* be a real number having non-terminal decimal
expansion, then we say that x* represents x rounded to k decimal places if

I x - x* 1 5 2 where k > 0 is a.positive integer.

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.

Definition 3 : Let x be a real number and x* be an approximation to x. Then we say that x*


is accurate to k decimal places if

Let us consider an example.

Example 14 : Find out to how many decimal places the value of 2217 obtained in Example
13 is accurate as an approximation t o n = 3.14159265 ?

Solution :We have already seen in Example 13 that

Now .0005 < .00126 . . . < 0.005

Therefore the inequality (18) is satisfied f o r k = 2.

Hence. by Definition 3. we conclude that the approximation is accurate to 2 decimal places.

Here is an exercise for you.

355 .
E13) In some approximation problems where graphic methods are used, the value - 1s
133
used as an approximation to IT = 3.14159265 . . . . To how many decimal places the
355
value is accurate as an approximation to IT?
---

133

Now we make an important remark.

Remark 5 :Round-off errors can create serious difficulties in lengthy computations.


Suppose we have a pro'blem which involves a long calculation. In the course of these
computations many rounding errors (some positive, and some negative) may occur.in a
number of ways. At the end of the calculations these errors will get accumulated and we
don't know the magnitude of this error. Theoretically it can be large. But, in reality. some of
these err.ors (between positive and negative errors) may get cancelled so'that the
accumulated error will be much smaller.

Let US now define another type of error called 'Truncation error'

1.4.2 Truncation Error


\Ve shall first illustrate thiserror with a simple example. In Sec 1.3. we have already'
discussed how to find approximate value of a certain function f(x), for a given value of x,
using Taylor's series expansion. Let

denote the Taylor's series of f(x) about xo. In practical situations, we cannot, in general, find
the sum of an infinite number of terms. So we must stop after a finite number of terms, say, Review of Calculus
N. This means that we are taking
N

and ignoring the rest of the terms, that is, an (x - xdn.


n=N+l
There is an e m r involved in this truncating process which arises from the terms which we
exclude. This error is called the 'truncation error'. We denote this error by T E. Thus we
have.
N m

You already know how to calculate this e m from Sec. 1.3. There we saw that using
Taylor's theorem we can estimate the error (or remainder) involved in a truncation process
in some cases.

Let's see what happens if we apply Taylor's theorem to the function f(x) about the point
xo = 0. We assume that f satisfies all conditions of Taylor's theorem. Then we have

where an = -
fin'(0) and 0 < c < x.
n!
N
Now, suppose that we want to approximate f(x) by an xn.
n=O

N
Then Eqn (19) tells us that the truncation error in approximating f(x) by an xn is given by
n=O

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 we have listed in Sec. 1.3.

For example consider the function f(r)= ex'. It is difficult to caiculate the nth derivative of
this function. Therefore, for convenience, we obtain Taylor's expansion of ex' using
Taylor's expansion of e!' by putting y = x2. We shall illustrate this in h e following example.

Example 15 :Calculate a bound for the truncation e m r in approximating ex' by

2
Solution :Put u = x2. Then ex = eU.Now we apply the Taylor's theorem to function
f(u) = eUabout u = 0. Then, we have
u2 u3 u4
eU=1 +u+-+-+-+R5(u) where
2! 3! 4!
bolulionsof %on-linuur Equations and 0 < c < u. Since I x I < 1. u = x' < 1 Le. c < 1. Therefore, eC< e < 3. Thus

, Hence the truncation error in appm~imatingeXLby


the above expression is less than
25 x lo-'.

If the absolute value of the TE is less, then we say that the approximation is good.

Now, in practical situations we should be able to find out the value of n for which the
summation Can X" gives a good approximation to f(x). For this we always specify the
accuracy (or error bound) required in advance. Then we find n using formula (20)such that
the absolute error I Rn I(x) I is less than the specified accuracy. This gives the
+
,

approximation within the prescribed accuracy.


Let us consider an example.
Example 16 :Find an approximate value of the integral

with an error less than 0.025. I

Solution :In Example 95 we observed that

,x2 ,lo
with TE = -
5!
Now we use this approximation to calculate the integral. We have

with the truncation error


I ex2 xIO
TE=f - dx.
0
5! -
We have

Integrating the right hand side of (21). we get

Here is an imporfant remark.


Remark :The magnitude of the truncation e m could be reduced within any prescribed
accuracy by retaining sufficiently large number of tenns. Likewise the magnitude of the
round-off error could be duced by retaining additional digitsr
You can now try the following exercises. Review oTCalculus

E14) a) Calculate a bound for the truncation error in approximating


-- f(x) = sin x by
x3 x5 x7
s l n x = 1--+-+-where-1 5 x 2 1.
3! 5 ! 7!
L b) Using the approximation in (a), calculate an approximate value of the integral

with an error 1 ~ ~ .
E15) .
a) Calculate the truncation error in a~vroximatinrr . -
2
ePX by I - x 2
,+ x4 , -1 2 x 2 1.
L

b) Using the approximation in (a) calculate an approximate value of eex2dx


0
within an error bound of

We end this unit by summarising what we have learnt in this unit.

1.5 SUMMARY

In this unit we have :


recalled three important theorenis in calculus, namely
i) Intermediate value theorem
ii) Rolle's theorem
iii) Lagrange's mean value theorem
state Taylor's theorem and demonstrated it with the help of examples.
The nth Taylor's expansion :

(x - xg) (x - x0l2
f(x) = f(x& + -f (x,,)+ ----
l! 2! fi2'(xo)

...+
(X - x0Y (x - x0)" + ' 6" + "(c)
n! f(n)(xd+( n + l ) !
defined the term 'error' occurring in numerical computations.
discussed two types of errors namely
i) Round-off error :Error occumng in computations where we use rounding off
f ii)
method to represent a number is called round-off error.
Truncation error :Error occuning in computations where we use truncation
process to represent the sum of an infinite number of terns.
explained how Taylor's theorem is used to calculate the truncation error.

1 1.6 SOLUTlONSiANSWERS
-

El) a) The given equation is of the form f(x) = c where f(x) = x3 - x - 5 and c = 0.
f is a continuous function in the interval [O, 21 and f(0) = -5 and f(2) = 1. Then 0
lies between f(0) and f(2). Therefore by IV theorem, the equation f(x) = 0 has a
solution in the interval [O, 21.
Solutions of Non-linear Equations b) Here the equation is of the form f(x) = c where f(x) = sin x + x and c = 1.
in one Variable
f is a continuous function defined on

= 0.5 + 0.523 = 1.023. Thus f(0) c 1 c f .Therefore by IV theorem, the


result follows.
E2) Let f(x) = (x - 1) sin x
= x sin x - sin x
Then f (x) = x cos x + sin x -cos x
=(x-l)cosx+sinx
Now f (x) = 0 implies that (x - 1) cos x + sin x = 0. That is (x - 1) + tan x = 0.
This shows that there exists a function f(x) = (x - 1) sin x such that f is continuous in
[O, 11 and differentiable on ] 0, 1[ and f (x) = tan x - 1 + x.
Therefore by Rolle's theorem there exists a point xo in 10, 1[ such that
f (xo) = tan xo - 1 + xg = 0.
E3) Note that f is a continuous function in [O,31 and differentiable in ]0,3[ and
f(x)=x2+2
Therefore by Lagrange's mean value theorem there exists a point xo in 10.31 such tha

But f(xo) = x i + 2 and f(3) = 15 and f(0) = 0. Thus

x0 = 6,since xo is a point in 10, 31, we consider only the positive value.

E4) f(x) = x3 + 4 satisfies :he requirements of Lagrange's mean value theorem in the
interval 1-2, I[. Therefore there exists a point x,, in 1-2, 1[ such that the slope f'(xo)
of the tangent line at xo is the same as the slope of the line joining (-2, f(-2)) and
(l,'f(l)).

But f (xo) = 3x8


Therefore we get

i.e. xi = 1
Since xo lies in [-2, I[, we don't consider the positive value. Therefore there exists
only one point xo = - 1 satisfying the theorem.

E5) Suppose f is a function defined on [a, b] which satisfies all the requirements of
Lagrange's mean value theorem. Then there exists a point xo in la, b[ such that
f (xo) = -f(b)
---
- f(a)
b-a
Suppose in particular f satisfies the condition that f(a) = f(b), i.e. f(b) - f(a) = 0, then
we get f(%) = 0. This is what the Rolle's theorem states. Hence we deduce that, in
the statement of L.agrange's mean value theorem, if we put the extra condition that
f(a) = f(h). theri we get the Rolle's theorem.
E6) Put x = xo in Eqn. (3). then we get Review of Calculus

P,(xo) = f(%)
To calculate, P',(%), we diffa-entiate both sides of Eqn. (3). Then we have

2f'(xo) (x - xo) 3Y(x0) (x - x0)2


Pr(x)=f(%,)+ 2! + ---3! + . . .(*)
Putting x = xo on both sides of the above expression, we get

F",(xo) = f (x,) + 0 + 0 . . . = f (x,).


Note that apart from the first term, all other terms in the R.H.S. contain the factor
(x - x,) and therefore when we put x = xo, these terms vanish.

By differentiating * further, we get P(,')(xo)= fli)(xo),i = 2, . . . . r.

The 3rd Taylor polynomial of f(x) = e x about x = 0 is P3(x)


x2 x3
= f(0) + xF(0) + - f'(0) + - - f"(0).
2! 3!
Heref(0)=eO=1
f ( x ) = e X , f(O)= I
Similarly f'(0) = 1 = f"(0)
x2 x3
Therefore P3(x) = 1 + x + - + --.
2! 3!

-1
f (x) =: --- , f(O)=-1
(1 + x)2

The function f(x) and its derivatives of different orders are continuous in
Therefore by Taylor's theorem

where c is a point lying between 0 and x.


No. Because the derivatives of f(x) are not defined at x = 0.
8th Taylor expansion of f(x) = cos x about xo = 0 is
Solutions of Nan-linear I*:quativns The remainder is given by
in one Variable
x9
R9(x) = - - sin c.
9
Tc
Now sincex liesin wehave 1.x I S - < 1
4
Therefore, we get

E l 1) We have seen in E 10 that the remainder in the 8th Taylor expansion of cos x is such
that

i.e. 1 cos x - P9 (x) 1 I 10-5

This shows that we can approximate f(x) by 8th Taylor polynomial with error bound
1 o - ~i.e.,

71
Putting x = -, we get
4

El?) I ex-Pn(x) I = l(n+l)'ecI


Xn + 1

where c lies between 0 and x. Since I x 1 I1, we get that 1 eC 1 I e. Therefore

e
Now, we have to find an integer n such that - < lo-5.
( n + I)! -

This is satisfied if n = 8 because 59 . =0.749 x


Therefore n = 8 is the required number.

El3)
355
' - = 3.141 5 9 3 9 1 . . . (using a scientific calculator) and x = 3.14159265 . . .
113

I I
Then -- 1 < 0.00000027 < -- x 1O4
2 2
Therefore the approximation is accurate to 6 decimal places.
E14) a) We apply Taylor's iheorem to the function f(x) = sin x in ]-I, I[ about x = 0.
- Then for n = 7, we have
x3 x5 x7
sin x = x - 7+ - - - + R8(x)
3. 5! 7!

where 1 R8(x) 1 =

Therefore. the truncation Prror T. E. = R8(x) is .24802 x lo4


Review or <Jalculus

Hence
sin x -I--+----+-
-- x2 x4 x6 Raw
X 3! 5! 7! x
Rg(x) xa sin c x7
where----- - - sin (c)
x 8! x 8!
Thus

' R x x
NOW
X
dx = j s! sin (c) dx
0 0

Therefore we have

=1 1 1 1
,
1

0
-=
si:x
x3 + -
x - --- x5
3!3 5!5
-

3!3 5 ! 5 7!7
= 0.946

with an error less than 0.25 x lo4

E15) a) Put u = -x2. Then eTx2= eU We consider the 2nd Taylor expansion of eU given
by
I
u2
e U =1 +u+-+R3(u)
2
t
eCu3
where R3(u) = -
3!

1 1
Since u I 0, eCI1. Hence I R3(u) I I - = -
3! 6
2 4
X
b) From (a) we have e'-X = 1 - x2 + - + R~ (-x2)
2
Hence

Now. 7
0
e-x x6
1 ~ i) -dx
~ ~ ( - dx
3! ,
0.1

0
2

e r
0.1
e Jex
0
2
z
0.1
J (I - x2 +
0
) x'
= x - -+ - = OW667666.

Anda mungkin juga menyukai