Professional Documents
Culture Documents
NUMERICAL ANALYSIS
Academic Press
Textbooks in Mathematics
Consulting Editor: Ralph P. Boas, Jr.,
Northwestern University
James Singer
Department of Mathematics
Brooklyn College
Brooklyn, New York
This book is written with two sets of readers in mind, the practicing scientific
worker and the "pure" mathematician. The practicing scientific worker-the
chemist, the physicist, the engineer, the economist, anyone who is concerned
with the quantitative aspects of the physical, biological, social and applied
sciences-knows only too well that much of his effort is directly or indirectly
devoted to the determination of numerical results and to the derivation of
natural laws, which are nothing but relations between numbers endowed with
"dimensions." This book aims to tell him how to obtain a numerical result
and how to judge the reliability or trustworthiness of his answer. The scientific
worker will find many of the necessary formulas and many special tables to
help him in his computations, he will find detailed descriptions of the methods
and procedures, he will be aided by many illustrative examples worked out
in the text, he will be guided by many remarks, observations, and words of
caution.
The "pure" mathematician is usually interested, if at all concerned, with
the art rather than the practice of computation. This book attempts to give
him a .coherent, systematic and, I trust, lucid treatment of the classical or
traditional theory of mathematical computation. He will find careful and honest
proofs where proofs are given; and he will learn that there is frequently an
amazing amount of real mathematics behind a prosaic numerical answer,
correct to five decimal places.
It is my earnest hope, however, that as far as possible the two sets of readers
merge into one. It has always been my contention that the scientific worker
interested in a numerical answer would do well to delve into the foundations
of his methods, to learn "why" as well as "how"; an understanding of the
underlying concepts is a powerful tool when he must cope with new problems
or with old problems in new dress. On the other hand, it is my hope that those
not now intrigued with computation will nevertheless plunge in to help discover
new and better methods and more sound results if for no other reason than
the fun of it.
For these reasons, the text not only includes set algorithms and tables, but
attempts to give the reader some feeling for and insight into the subject so
that he will be more than ready to strike out on his own.
This book is intended as a first course in numerical computation. It is not
geared to electronic computers although it will serve as an introduction for
those interested in high speed calculators. The methods and procedures that
vii
Vlll PREFACE
are described can readily be modified, if modifications are needed, for use on
electronic computors; but fundamentally, the procedures were intended to be
carried out on desk calculators or even longhand.
For an understanding of most of the text, the reader will need a good intro-
ductory course in calculus; for some portions, some advanced calculus and
differential equations will be necessary; for some of the material, not even the
calculus is necessary. The references listed at the end of the book are few in
number; they have been listed either because they can be used for supplementary
reading or because they themselves contain extensive bibliographies. Various
tables, not readily found elsewhere, are included in the text, but the serious
reader should supply himself with a set of ordinary tables including the usual
trigonometric, logarithmic and exponential tables.
The reader will find two chapters not usually covered in present day texts,
one on geometric methods and nomography and one on curve fitting; he will
also find many illustrative examples throughout the text. It is suggested that
these be more than read; the reader should also work them out and compare
his results with those in the text. In some cases, the examples worked out are
merely illustrations of theory or algorithms previously discussed in the text;
in some cases, the examples worked out serve as the vehicle for the explanations
of new theory or modes of operation.
The text can be covered thoroughly in two semesters. Those who desire a
faster pace can cover a good portion of it in one semester and finish it in a
second semester with further topics such as matrix solutions or partial differential
equations that are omitted from this book.
A final word addressed to the teacher. The examples, by and large, were
intended to be worked out with the aid of desk calculators but if these are not
available, the number of required significant figures or decimal places should
be cut to prevent prohibitively long calculations.
JAMES SINGER
Brooklyn, New York
Contents
PREFACE vii
NUMERICAL ANALYSIS
Chapter 1
For example, the numerical units of the numbers 3.04, 0.0700, 67,
are hundredth, ten-thousandth, and unit, respectively. The numerical
unit of 67,000 may be a thousand, hundred, ten, or unit and if not
implied by the text must be explicitly stated.
The last illustration indicates that two numbers may be numerically
equal but can have different numerical units. We wish to emphasize
this point. Consider the numbers 3.04 and 3.040. They are numerically
equal but differ in form; the numerical unit of the first is a hundredth;
that of the second is a thousandth.
It is convenient to extend the concept of a numerical unit. We shall
regard it not only as the name of a place in the decimal representation
of a number but also as a number which is an appropriate power of 10.
Thus, the numerical units a thousandth and a hundred will be represented
by the powers 10-3 and 102 , respectively. If the numbers above are
written in the forms
3.04 = 304 X 10- 2 ,
0.0700 = 700 X 10-4 ,
67 = 67 X 10,
67,000 = 67 X 103 = 670 X 102 = 6700 X 10 = 67,000 X 100,
the power of lOin each case indicates the numerical unit. In general,
any number n can be written in the numerical unit form
where nil has the same digits as n' in the numerical unit form but has
just one nonzero digit left of the decimal point. Thus, 3.04, 0.0700,
and 67 are
3.04 X 10,
7.00 X 10- 2 ,
6.7 X 10,
ILLUSTRATIONS
they are rounded off to five significant digits to 3.1421 and 3.1428
(or 3.1429), respectively, they remain incorrect to five significant digits.
But when they are rounded off to four significant digits to 3.142 and
3.143, respectively, the first becomes correct to four significant digits
as an approximation to 1T. The latter becomes correct when rounded
off to three significant digits. We are thus led to the following extension
of Definition 3.
6 1. NUMBERS AND ERRORS
EXERCISE 1.1
1. State the numerical unit of each of the following numbers and write each numerical
unit in the form IOu.
a. 436 b. 750.2 c. 2.006 d. 0.05 e. 0.000050
f. 400.0 I. 0.00000 h. 1.976530 i. 1.000001 J. 883.09000.
2. Do the same for each of the following numbers; give all the possibilities if there are
several.
a. 956000 b. 906000 c. 1000000 d. 1000001 e. 999999 f. 3020010.
1. How many significant digits are there in each of the following numbers?
a. 4029 b. 40.29 c. 53.670 d. 0.0002 e. 190
f. 2.000000 I. 2.000006 h. 3.0002 I. 83.10400 J. 0.08040.
4. Write each number in examples 1,2, and 3 in standard notation.
5. Round off each of the following numbers to four significant digits.
a. 4.32974 b. 682.548 c. 28.9956 d. 102843.1 e. 0.0765402
f. 8976.49 I. 0.999996 h. 1.35000 I. 407.391 J. 32.1089.
6. Write each of the following numbers correct to four significant digits.
a. 22/7 b 'IT c. 100000/3 d. cos O e. cos 25' f. VO:OOS09
I. {/6~00000685 h. IO! I. 'ITa J. the number of inches in a mile.
7. Write each of the numbers of example 6 correct to the nearest tenth.
S. The first number in each of the following pairs is an approximation to the second
number. Write each approximation as a decimal if not already so written and state the
number of correct significant figures in the approximations.
a. 563.201,563.257 b. 0.00632,0.00636 c. 52,000,000,52,475,913
d. 4.732093,4.732102 e. 3800,3826.4 f. V3/IO, sin 10
I. 3/4, log 5.624 h. I, cos 30' I. 19/6, v'W J. {/3.87, 'IT/2.
1.2. Errors. It was pointed out in the last section that for a variety
of reasons a number used by a scientific worker is usually an approxima-
tion to some true value. We propose to examine these errors a Htth
further in this section.
1.2. ERRORS 7
(1.2: 1) e = n - a,
whence
(1.2:2) n = a + e.
The relative actual error is defined by the statement
(1.2:3)
(1.2:4) 100,%.
e = 17 - 22/7
= 3.14159265+ - 3.14285714+
= -0.0012645-;
the relative actual error is
- 0.0012645- _ 000040+'
r - 3.14159265+-' ,
0.040+%.
e= 17 - 3.14
= 3.14159+ - 3.14
= 0.00159+,
- 0.00159+ _ 000050+
r - 3.14159+ - . .
8 1. NUMBERS AND ERRORS
Note that in these two illustrations the actual and relative actual errors
can be calculated to as many significant figures as we wish provided
that 1T is given with a sufficiently great number of correct significant
figures.
Let us now imagine that the mem bers of a class read, one by one,
a barometer furnished with a vernier scale. Their readings will not be
all alike and range, say, from 761.5 to 762.5 mm; let us suppose that
it is decided to record the atmospheric pressure as 762 mm. This value,
762 mm, is, of course, an approximation to the true value of the atmo-
spheric pressure and is the a of formula 1.2: 1. However, the true value
n is not known and therefore the value of e is not known. The best we
can say is that n is between 761.5 and 762.5 and that the actual value
of e is at most 0.5.
In general, if the true value of a number t is not known but it is
known that it differs from an approximation a by an amount which is
less than a positive number h, we have
(1.2:5) a- h ~ t ~ a + h.
We call h the margin of error or the maximum error of a; the ratio
(1.2:6) m = I~ I
is called the maximum relative error of a; and
(1.2:7)
is called the per cent maximum relative error. Note that the maximum
relative error has the approximate number in the denominator whereas
the relative actual error has the exact value in the denominator. The
approximate number must be used here because the exact value is not
known. Some authors use the approximate value in all cases, but it seems
more natural to use the exact value when it is known.
To illustrate these definitions, suppose that the height of a mountain
is given as 6703 ft but is in error by 6 in. or less, that is, the margin
of error or the maximum error is 6 in. The true height of the mountain
is between 6702.5 and 6703.5 ft; the maximum relative error is approxi-
mately 0.0000746 or 0.00746%. Again, suppose the width of a paper
is measured as 10.0 in. with the true value so mew heres between 9.95
and 10.05 in. The maximum error is 0.05 inches and the maximum\
relative error is 0.005 or 0.5 %. Thus, the maximum error in the first
1.3. ACCURACY AND PRECISION 9
case is 120 times as great as it is in the second, but the maximum relative
error is about (1 /67)th of the maximum relative error in the second case.
Let us also recall that whenever we write a number in the decimal
notation and the actual error or margin of error is not stated or other-
wise implied, it will be assumed that the margin of error is one-half
of the numerical unit.
EXERCISE 1.2
1. Each pair listed below is a number followed by an approximation; give for each pair
the actual error, the relative error, and the per cent relative error.
/-
a. V 2, 1.4 b. e,2.7
c. V150, 49/4 d. 1902 ,36000
e. {/19700,27 f. 1000/909, 1.1
h. tan 939', 0.17
I. inches in a meter, 40 J. millimeters in an inch, 25.
2. What is the maximum error and the maximum relative error in each of the following
numbers?
a. 17.03 b. 0.3200 c. 47 d. 8043 e. 9500
f. 0.00003 g. 8765.1 h. 0.301 i. 1.9 ;. 2.
3. Find the value of." - tan 7220.5' correct to three significant figures.
4. Find the numerical difference between (e/2)v'aand (V 2)"/ 2 correct to three significant
figures.
doubt, for while the actual error in 4,100,000 is much greater than the
actual error in 22/7, the relative error is smaller.
Since there is no compelling reason to choose one type of error over
the other as a criterion of the goodness of an approximation, we adopt
two measures for the degree of closeness, precision and accuracy.
EXERCISE 1.J
1. Determine the accuracy and precision of a 12 in. ruler if it actually is 12.01 in. long.
2. Determine the accuracy and precision of a weight intended to be 1000 gm but
actually is 999.2 g.
J. The thickness of a sheet of paper is measured as 0.004 in. by use of a micrometer
which can be read to the nearest thousandth of an inch. What are the precision and
accuracy of the measurement?
4. The Empire State building is 1250 ft high to within 6 in. A 3-in. cylinder is ground
with a tolerance of one one-thousandth of an inch. Which measure is the more precise?
The more accurate?
5. Assume that the error is spread evenly over the ruler of Example I. Three distances
measured with this ruler are found to be 3 in., 6 in., and 2 ft, respectively. What are the
precision and accuracy of each measurement?
6. Is the number of correct significant digits in a stated measurement directly related
to the accuracy or to the precision of the measurement? Explain your answer.
(1.4: 1) T= 2n~;
expresses the time of a complete swing of a pendulum in terms of its
length and the acceleration of gravity. Students evaluating T from the
12 1. NUMBERS AND ERRORS
results of recorded data or, more generally, students and others making
similar calculations are frequently perplexed with a variety of questions
concerning the number of significant figures to be used or kept. The
answers to most of these questions can be found in the answers we
will give to the two following questions. First, how precise or accurate
is the result of a calculation performed upon numbers whose errors or
maximum errors are known? And second, how precise or accurate must
each of a set of numbers used in making a calculation be in order to
obtain a result of preassigned precision or accuracy?
We attack the first of these questions in the present section and the
second in the next section. We first wish to remark, however, that the
number of significant figures used to express a measurement depends
directly on the construction and capability of the measuring instrument
and on the quality of the magnitude that is being measured. Suppose
we are using an ordinary cheap protractor to measure an angle. The
very best we can do with it is to determine a carefully drawn angle
to the nearest half degree. If the angle were drawn freehand with chalk
on a blackboard, the nearest multiple of 5 would be precise enough.
If, furthermore, the measure of such an angle where 25, say, and it
were necessary to indicate one-third of the angle, the measure of the
smaller angle should be written as 8; neither the drawing nor the
instrument justify the use of 8!0, and he who uses 8.33333 is obviously
living in a world of illusion.
Also, one should suit his instrument to the character of the magnitude
to be measured. Thus, to measure the length of a shadow (in order to
find the length of a flagpole, say) it is quite unnecessary to have a steel
tape graduated to sixty-fourths of an inch. A close examination of a
shadow, even one cast by a pole on a bright day, will reveal that its
edge is rather nebulous; the best we can do is to obtain its length
correct to the nearest eighth of an inch. Similarly, in the notoriously
crude calorimeter experiments it is unnecessary to use thermometers
capable of measuring a variation in temperature of one-thousandth of
a degree.
We turn now to the study of the first of the two questions just raised,
namely, how precise or accurate is the result of a calculation performed
on approximate numbers? Or, to put the question in lither words,
how many significant figures shall we use in writing the result of a
computation performed upon approximate numbers? Let Xl , XI , . , Xn
be the numbers involved in the computation and let y be the result
of the computation; y is then some function of the x's which we write as
(1.4:2)
1.4. COMPUTATIONAL ERRORS 13
(1.4:3)
whence
+ ...
+ [f(Xl , X2 , ... , X"-l , X" + Jx,,) - f(Xl 'X 2 , "', Xn-l , x,,)].
It follows from the Law of the Mean that the successive brackets on the
right-hand side of this equality are equal to
respectively, where all the 8's are positive quantities less than unity.
14 1. NUMBERS AND ERRORS
Since the partial derivatives that occur here are continuous functions,
they are, in turn, equal to
(1.4:6)
where El , E2 , ... , En are functions of the x's and their increments that
approach zero as LlXl , LlX2 , ... , Llxn approach zero. Hence
(1.4:7) Lly = !"I(xl , ... , xn) LlXl + !.,z(xl , ... , xn) LlX2
+ ... + !"n(x xn) Llxn
l , ... ,
(1.4:8) dy = !"I(Xl' ... , x,,) dXl + !"z(Xl' ... , x,,) dX2 + ... + !"n(Xl' ... ,x")dx,,.
Then dy and Lly differ by the amount
(1.4:9)
(1.4:11)
an expression for the relative error dy/y in terms of the relative errors
dXl/X l , dX 2/X 2 , ... , dxn/xn , where for the sake of brevity we omitted
1.4. COMPUTATIONAL ERRORS 1S
from the!'s the arguments Xl' X2 , , X" . Since the preceding remark
applies here too (indeed, the relative error was defined as an absolute
value), we rewrite the preceding formula as
(1.4:14)
(1.4:15) dy =y;,
1
(1.4:17) I dT I ~ I!gi (21g I d1T I + 1Tg I d/l + 1T/I dg I).
On substitution, we find the error to be I dt I ::::;; 7.8 X 10-6 Hence,
T = 1.437388 0.000078. The relative error is 0.000054- or 0.0054-%.
The error and relative error are usually written with at most two signif-
icant figures.
An alternate method for calculating the error and relative error is
based on formula 1.4: 16 and usually involves far less computation. We
first calculate the relative error and then the value of the error. Since
the relative error of a product is equal to the sum of the relative errors
of the factors and the relative error of a quotient is equal to the sum
of the relative errors of the dividend and divisor-see examples 2(b)
and (c) at the end of this section- and since the relative error of a
square root is equal to one-half the relative error of the radicand-
example l(b)-the relative error in T is equal to the relative error in 1T
plus one-half the sum of the relative errors in I and g. We obtain by
this shorter method the same results as before.
EXERCISE 1.4
All numbers in examples 3-19 are correct as far and only as far as they are written
unless otherwise implied or known to be exact. Give all numerical answers with as many
correct significant figures as possible.
1. Derive for each of the following functions an expression for the error in y in terms of
x and the error in x and an expression for the relative error in y in terms of x and the
relative error in x.
y = x"; b. in particular, y = vx;
c. y = sin x (x in radians); d. y = cos x (x in degrees);
e. y = In x = log. x; f. y = loglo x;
g. y = e"; h. y = aZ , a > O.
2. Prove:
if s = XI X2 ... x .. , then I ds I < I dXI I + I dX 2 I + ... + I dx .. I;
b. if P = XIX2 ... x .. , then I dp I < ~;:'I I pIx, I I dx, I and I dp/p I < ~:"I I dx./x, I;
c. if q = x/y, then I dq/q I < I dx/x I + I dy/y I .
1. The length of a side of a square is 23.4 mm. Find its perimeter, the length of a
diagonal, and its area.
4. The radius of a circle is 9.S in. Find the circumference, the area, and the length of a
chord 7 in. from the center.
EXERCISES 17
5. The hypotenuse c of a right triangle is 13.4 cm, one leg a is 9.2 cm. Determine the
precision and accuracy of sin A calculated from the formula sin A = a/c.
6. Find the area of a triangle whose sides are 23.4 ft, 30. I ft, and 45.9 ft.
7. The diameter and length of a right circular cylinder are 4.13 and 12.90 in., respec-
tively. Find the accuracy and precision of the total area and the volume.
8. A solid sphere of radius 2.50 in. is made from a metal that weighs 0.223 Ib/cu in.
Determine the accuracy and precision of the weight.
9. Find the accuracy and precision ofF given by the formulaF = kmM/,2 if m = 0.32,
M = 53.74, , = 200, and k is a constant, known exactly.
10. Determine the accuracy and precision of F given by the formula F = Ma'/,' if
M = 9.2, a = 3.0, x = 1.2" = 6.1.
11. An equation for simple harmonic motion is s = a cos t. What are the maximum and
relative maximum errors in s if a = 23.8, and t = 0.9?
12. The distance s in centimeters of an oscillating point from an origin is given by
s = ~e-'cos
22'
(~+ 8)
where t is time (in seconds) and 8 is an initial angle (in radians). If t and 8 are 2.0 sec and
0.3 rad, respectively, find the maximum error and relative maximum error in s.
11. The cosine of an angle is computed from the sine by use of the identity
cos 2 8 = I - sin 8. Show that for angles close to 45 the maximum error in cos 8 is
approximately equal to the maximum error in sin 8. In general, prove that the maximum
error in cos 8 is approximately equal to the maximum error in sin 8 multiplied by tan 8
and that the maximum relative error in cos 8 is approximately equal to the maximum
relative error in sin 8 multiplied by tan 2 8.
14. Solve the equation 1.37x' + 2.05x - 3.21 = O.
15. Find the error in a root, of the equation aoxn + a1Xn - 1 + ... + an = 0 for given
errors in the coefficients ao , al , ... , an .
16. The earth is an oblate spheroid with equatorial radius 3963.3 mi, polar radius
3949.9 mi. Find its volume. (An oblate spheriod is formed by the rotation of an ellipse
about its minor axis. If a and b are the major and minor axe~, respectively, of the ellipse, the
volume of the ellipse is given by the formula V = ~1Ta2b.)
17. If air resistance is proportional to the square of the velocity, the velocity v in
em/sec of a body falling from rest is given by
gt
v = ktanh k ,
where g is the acceleration of gravity, k is the maximum velocity, and t is the time. If
k = 5275 cm/sec, g = 980.6 cm/sec, find the velocity at the end of 1.0 sec. When is the
velocity 500 cm/sec? 1000 cm/sec ? 2000 cm/sec? 5000 cm/sec ?
18. The standard length Ho of a mercury barametric column in millimeters, at a
temperature OC, at a point at latitude L, and at a height h ft above sea level, is given by
Ho = 760 + 1.9456 cos 2L + 0.00004547h.
18 1. NUMBERS AND ERRORS
19. Find the value of the following determinant; assume all numbers are exact.
D =
32.1
I -1.6
5.3 7.0 I
12.7 7.2 .
35.0 5.8 7.4
What is the maximum error in D if the element 7.0 is correct only to the nearest tenth?
If the element 7.2 is correct only to the nearest tenth? What are the maximum and
minimum values of D if every element is correct only to the nearest tenth?
error in y and solve for 1dX I I, 1dX 2 I, "', 1dX n I. This method uses what
is known as the principle of equal effects.
A second but essentially equivalent method uses the formula 1.4: 12.
In this case we first compute y and then the relative error 1 dy/y I.
We then impose the condition that each term of the right-hand member
of 1.4:12 contribute equally to the allowable error 1dy/y I. Since this
method is similar to the preceding one and yields the same results, it
needs no further elaboration.
The preceding two methods for determining the unknowns take the
easiest way out, so to speak. A third and somewhat more reasonable
method would go about as follows. The number 7r can be obtained to
any practical degree of precision by merely looking it up in a table;
we may then assume that for the problem at hand, d7r is zero. Assuming
further that the length of the pendulum and the acceleration of gravity
can be obtained with equal precision, we put dl equal to dg. Under
these assumptions, 1.5: 1 becomes
On substituting the given numerical values for I and g (and using 3.142
for 7r, a value which does not effect the first two significant figures in
dg), we find
1dll = 1dg 1 ~ 0.0068.
It follows that the error in T will not exceed the allowable limit 0.0001
if the length I and the acceleration of gravity g are each determined to
within six units in the third decimal place and if the value of 7r is taken
correct to six significant figures. Comparing these results with those
previously obtained, we see that this time I need be determined some-
what less and g somewhat more precisely than before.
In general, we would use the principle of equal effects to determine
the allowable errors in the quantities Xl' X2 , "', Xn involved in the
computation of a result y that are necessary to yield an error dy in y
which does not exceed a preassigned limit if and only if we have
absolutely no guide to the imposition of conditions on the errors
dX I , dX 2 , "', dX n . Whenever possible, however, the last method should
be used. It assumes, of course, that one is familiar with his instruments,
both physical and mathematical and that the user knows what numbers
can be easily obtained with great precision and what numbers can be
obtained only with great difficulty. Even when this information is
EXERCISES 21
EXERCISE 1.5
The examples referred to below are the examples of Exercise 1.4. In each case, state
clearly the assumptions made regarding the distribution of the errors.
1. How precisely must the length of the side be measured (example 3) to determine the
perimeter to within 0.02 mm ? The area to within 5 sq mm ? How precisely must the side
be measured to determine the perimeter to within 0.03 % ? The diagonal to within
0.03 % ? The area to within 0.03 % ?
2. How accurately must the radius be measured (example 4) to determine, to within
one part in a thousand, the circumference? the area? the chord?
3. How precisely must a and c be measured (example 5) to ensure five correct signi-
ficant figures in sin A ?
4. How precisely must the sides be measured (example 6) if the area is desired to
within 10 sq in.?
5. How precisely must the radius be determined and to how many significant figures
must the weight in pounds per cubic inch be known (example 8) if the total weight is
desired to within 0.1 oz ?
6. How accurately must m, M, and r be determined (example 9) if F is desired to
within 0.35 % ?
7. How precisely must a and t be known (example 11) if s is desired to within 5 % ?
8. How precisely must t and 8 be measured (example 12) if s is desired to within a
thousandth of a millimeter?
t. What are the allowable errors in the coefficients (example 14) if each root is desired
correct to three decimal places? if each root is to have a maximum relative error of 0.0006 ?
10. How precisely must the values of b, A, and B be determined if a, given by
bsinA
a = sin B '
is desired with a maximum error of 0.005 if, approximately, b = 42.36 em, A
B=5312'?
11. Find R, its maximum and relative maximum errors if
G- I
R = Jc--
G '
and J = 778, c = 0.339, G = 1.25. Ii is known that c can be determined about twice as
accurately as either J or G; use this information to determine the allowable maximum
errors (actual and relative) in J, c, and G so that R is correct to within one part in a
thousand.
Chapter 2
and used and on our ability to estimate E(x) [the error must always be
an estimate, for if it were known exactly, f(x) would be known exactly
and there would be no need for a(x)]; it is this twofold problem which
is our main concern in this and the next few chapters.
To appreciate some of the reasons why it is advisable at times to
replace a function by a simpler one, consider the differential equation
d 28
1-
dt 2
= -gsin8
four decimal places are used but large and dominant when ten places
are used. (Note that the rounding-off error in a number correct to
four decimal places is at most 0.00005, at most 0.00000 00000 5 when
the number is correct to ten decimal places.) It is for these reasons that
linear interpolation was adequate when a four-place table was used and
inadequate when a ten-place table was used.
What can we do, then, if we wish to compute log 2.956 correct to
ten decimal places by use of a ten-place table? Since in linear inter-
polation log x was replaced by a first degree polynomial, it is reasonable
to try the substitution of a polynomial of higher degree for log x. As a
matter of fact, if log x is approximated by a suitable third degree
polynomial, the cubic will yield the value of log 2.956 correct to ten
decimal places.
The succeeding sections will develop and elaborate the underlying
concepts.
ao + a 1x O + + ... +
a2x 02 anxo" = f(x o),
a1 +2aro + ... + nanx~-1 = f'(x o),
for ao , a1 , "', an . We solve the last equation for an , then the preceding
one for an-I, and so on. It develops that the a's are uniquely determined
and are given by
f'")(x )
~ = ----;;r-o .
If we multiply these equations by 1, X, X2, "', x n , respectively, and then
sum the right-hand members by diagonals that slope up and to the right,
we find that
(2.2:5)
Pn(x) = f(x o) + (x - xo)f'(xo) + (x -;t )2 f"(xo) + ... + (x -:!.'t
o o)" f'n)(x o)
The expression for the error term can be put into the equivalent but
slightly more compact form
(2 2 8) E(x) = (x - xo)1I+l f (1I+U(X)
. : (n + 1)1 '
f(x) - p(x)
f(x) - q(x) (x - XO)n+lg(X) + (x - XO)kt(X)
(x - XO)1I+l-kg(X)
(x - XO)n+l-kg(X) + t(x) .
Consequently
This means that for values of x close to Xo the error made by replacing
/(x) by p(x) is smaller in absolute value than the error made by replacing
/(x) by any other polynomial of max-degree n.
The reader will have noticed that in deriving a polynomial that
approximated a given function we stressed the form 2.2:5 rather than
the form 2.2:2 wherein the coefficients are replaced by their values
given in 2.2:4. Although the latter seems to be the more natural form,
there are reasons for preferring 2.2:5. Not only is the form 2.2:5 simpler
in appearance and easier to use, but it possesses a virtue not shared
by 2.2:2. If a function /(x) is approximated first by a polynomial Pn(x)
of max-degree n and then by a polynomial Pn+l(x) of max-degree
n + 1, and they are written in the form 2.2:5, Pn+I(X) is precisely Pn(x)
plus an additional term; whereas if form 2.2:2 is used, every coefficient
of Pn(x) must be modified to yield Pn+l(x), except in the special case
when Xo = O. Hence we will almost always use form 2.2:5.
1 1
Y = 1.61 + S (x - 5) - 50 (x - 5)2,
The reader will find it instructive to graph y = In x and the six poly-
nomial curves on the same set of axes.
28 2. APPROXIMATING POLYNOMIAL; APPROXIMATION AT A POINT
whence
E x = (x - xo)n+l . _1_ = __1_ ( x - x'l)n+l
n( ) n+1 Xn+l n+1 X .
y= x,
x3
Y = x - 3! '
x3 x5
y=x-3T+5f;
then the value of sin x determined by the fifth degree polynomial will
differ from its true value by not more than a half unit in the fifth decimal
place.
We see from the answer that sin X could have been replaced by
! instead of unity; this would have extended the allowable range of x
about 20 , a refinement not usually called for in practice.
EXERCISE :1.2
t. Approximate VI + x 2 at x = 0 by a polynomial of max-degree 2.
2. Approximate sin x 2 by the "best" parabola at x = 1. Evaluate sin (0.81) from your
answer and compare it with the value taken from a table.
3. Approximate y = eZ /2 by a polynomial of max-degree 4 at x = O. Find the value of e
from your answer and compare it with the actual value.
4. Approximate y = eZ( I - X)-l at x = 0 by a polynomial of max-degree 2 and estimate
the magnitude of the error at an arbitrary point.
5. Approximate f(x) = x - 2xs by a polynomial p(x) of max-degree 3 at x = 1. In
how large an interval about x = I will p(x) differ from f(x) by an amount less than 0.1 ?
6. Approximate f(x) = eZ/1 - x' by a polynomial of max-degree 3 at x = O. Use the
polynomial to approximatef(l). Estimate the error in the approximation and determine the
actual error.
7. Approximatef(x) = vi
+ In vx
by a polynomial of max-degree 3 at x = 1. Use
the polynomial to approximate f(1.5) to three decimal places. Estimate the error in the
approximation and determine the actual error.
8. Approximate loglo(x + 3) by a polynomial of max-degree 3 at x = O. Through what
interval may x range if the value of log(x + 3) computed from the polynomial is to be
correct to three significant figures ?
9. Approximate y = cos 2x - In (x + I) at x = 0 by a polynomial of max-degree 3.
Estimate the maximum error in the range I <: x <: 2. What is the actual error at x = 1.5?
to. Approximate cos (x/2) by a polynomial p(x) of max-degree 4 at x = O. Through
what interval may x range if the absolute value of the error, I cos (x/2) - p(x) I, is not to
exceed 0.000005 ?
U. Approximate cos 28 at 8 = .,/6 by a polynomial of max-degree 4. Through what
interval about .,/6 may 8 vary if the approximation is allowed to differ from the actual value
by less than 0.01 ?
t2. Approximate each of the functions at the indicated points by polynomials of max-
degree 5 and calculate the errors (use formula 2.2:8). Draw the graphs of the functions
and their approximating polynomials in the neighborhoods of the given points.
a. sin 2x, (.,/4, I).
b. x 8 - 2x + I, (1, 0).
c. In cos x, (0, 0).
d. In (sin x/x), (0, 0), where sin x/x is defined to be unity at x = O.
e. ellna , (0, I).
t l. Show that the error tenn given by 2.2:8 is equal to
(2.2:10) E(x) = -
I fa-a. t nf'n+1l(x - t) dt.
nl 0
30 2. APPROXIMATING POLYNOMIAL; APPROXIMATION AT A POINT
2.3. Power Series. It was observed in the last section that a function
of x
(2.3: I) y = f(x)
(2.3:4)
where Xo and the a's are arbitrary constants is called an infinite power
series in x - Xo The a's are called the coefficients of the infinite power
series. As a rule the adjective "infinite" is usually omitted and we
refer to 2.3:4 as a power series. It is implied in the expression for a
power series that there is no last term. A power series determines in
an obvious fashion the sequence of polynomials
Po(x) = ao,
Pl(X) = a o + al(x - xo),
(2.3:5) P2(X) = a o + a1(x - xo) + a2(x - XO)2,
2.3. POWER SERIES 31
converges to the limit k. If the power series does not converge at x',
that is, if the sequence 2.3:6 does not approach a limit, the power
series is said to be divergent at x = x'. It can be shown that if the power
series converges for a value x', then it converges for any x satisfying
the inequality
I X-Xo 1< R.
32 2. APPROXIMATING POLYNOMIAL; APPROXIMATION AT A POINT
called, as the reader most certainly already knows, the Taylor expansion
of f(x). If Xo = 0, the power series is called the Maclaurin expansion
of f(x).
The direct calculation of the successive coefficients of the Taylor
expansion by means of 2.3:9 is often quite laborious. We then mention
briefly some of the results of the so-called Algebra of Power Series
and indicate other means to facilitate the computations.
Let f(x) be given by 2.3:8 and the function g(x) by
(2.3:10)
(2.3: 11)
f(x) g(x) = ("0 bo) + (a l bl)(x - xo) + ... + (aft b,,)(x - xo)" + ... ;
and
(2.3:12)
where
Co = "ob o ,
Cl = aobl + albo ,
(2.3:13) C. = aob. + albl + a.bo ,
Also,
(2.3:14) f(x) = d
g(x) 0
+ d1(x - x ) +-
0
... + d,.(x - x )"
0
+ ... ,
where
bodo
bodl + bldo
(2.3:15) bod. + bldl + b.do
If ao =F- 0, it follows from the first of these equations that division will
be possible only if bo =F- 0.
34 2. APPROXIMATING POLYNOMIAL; APPROXIMATION AT A POINT
We list below some of the better known or more useful power series
and their radii of convergence with some brief explanations.
(2.3:16.1)
. ~ ~ ~nB
sm x = x- 3f + Sf ... + (_l)n (2n + I)! + ... ; R = co.
(2.3:16.2)
x. X4 x2n
cos X = I - 21 + 4! ... + (-I)n (2n )1 + ... ; R = co.
(2.3:16.3)
x x. xn
e'" = I + If + 2! + ... + n! + "', R = co.
(2.3:16.4)
x. x3 x n+1
In(1 + x) = x- 2 +3 =f ... + (-I)n -n:tT + "', R=1.
(2.3:16.5)
(x-I). (X_I)n+l
In x = (x - I) - ... + (-I)n + ... R=1.
2 n+I'
The power series listed above can be determined simply by direct
use of formula 2.3:9. Before we extend the list, we define the binomial
coefficient (~), where u is any number and r is a positive integer by
The series will represent the function only for such x's that satisfy
the inequality I <p(x) I < R; and will be a power series only if <p(x) is
of the form (x - a)k, where a is a constant and k a positive integer.
Thus, we have by substituting sin x for x in 2.3:16.3,
x x"
1+-+"'+
2! (n + I)!
+ ...
If we put
X
- - = B +_X+~X2+
BI B B"
... +-x"+'"
eZ - 1 0 1! 2! n!
1 Bo
TIor = 1,
1 Bo 1 BI
21 or+ TIl!
= 0,
1 Bo 1 BI 1 B2 = 0,
3! or + 2! 11 + TI 2f
or
The B's are called Bernoulli numbers; they occur frequently in power
series and other computational formulas. Sometimes. the odd indexed
Bernoulli numbers that are equal to zero are deleted; the remaining
ones alternate in sign. The signs are dropped and the numbers are
reindexed. We have. in the new classification.
(2.3:16.7)
- -x - = 1i i 1
- -x + - x2 - --x8
Bn
+ ... + (2n)!
_Lx2n + ... R= 2.
e:D - 1 2 12 720
(2.3:16.10)
_x_ = 1 + !x2 + 2-x4 + ... + (_I)n-1 (22n - 2)B2n x2n + ... R = 71.
sin x 6 360 (2n)!'
All the signs in the expansion of x cot x are negative after the first
one, all the signs in the expansions of tan x and x/sin x are positive.
Proceeding further, if y = arcsin x, then (for the principal value of
the angle)
dy
dx
1 13 135
= 1 + 2x 2 + 22 . 2! oX' + 23. 3! xl + ....
Consequently,
or
. 1 xl 1.3 Xi (2n)! x2n+!
(2.3:16.11) arcsin x = x + 23+ 22 . 2! 5 + ... + (2nnl)2 2n + 1 + ... ,
R=l.
In a similar manner it can be shown that
xl Xi x2n+!
(2.3:16.12) arctan x = x- 3 +5 =f ... + (-I)n 2n + 1 + ... , R=l.
We also have
2 3
the I's are determined by the following system of linear equations:
10 = 1
-1 /0+ / 1 = 0,
(2.3:22) 1/0-i /l + 12 = 0,
1 1 1
(-1)"--/0 + (-1)"-1-/1 + (-1)"-2--12 + ... +1" = O.
n+l n n-l
(2.3:24)
10 = 1, II = 1/2, 12 =
= 1/24, I, = -19/720,
-1/12, 13
16 = 3/160, 18 = -863/60480, 17 = 275/24192,
Is = -33953/3628800, Ie = 8193/1036800, 110 = -3250433/479001600.
Hence
(2.3:16.15)
xii 1
In(1 + x) = 1 + 2 x - 12 x 2 + 24 xl =f ... + Inx" + ... , R=1.
In(1
X
+ x) = II (1 + x)t dt
0
2.3. POWER SERIES 39
and
Hence,
(2.3:16.15')
In(1 + x) = 1 + X II0 (1t ) dt + x2 II0 (2t ) dt + ... + x" II0 (nt ) dt + ....
x
Since 12 = l2'
1
(2.3:27) 6n(n - I) < 11.. 1 < 6n' n = 3,4, ....
(2.3:28)
(2.4:1)
we can compute f(x) to any degree of precision (for any given x within
the interval of convergence) by taking enough terms of the series.
Hence power series afford us one of the most powerful tools we have
for the evaluation of a function and they are frequently used by
computers for the calculation of the entries in a table of the function.
But in order to know how many terms are enough to insure that the
2.4. COMPUTATION WITH POWER SERIES 41
(2.4:2)
One such estimate has already been given in formula 2.2:8 (2.3:3) and,
in another form, in formula 2.2: lO. However, it is sometimes advisable
to obtain an estimate of the magnitude of the error directly from the
power series itself for a twofold reason. In the first place, we can
frequently obtain better estimates of the magnitude of the error from
the power series then we can from formula 2.2:8. See example 2 below.
Secondly, the (n + l)st derivative may be very difficult or laborious to
compute compared with the difficulty or labor involved in estimating
the error directly from the power series. See example 3 below.
A special but often occuring type of series is the alternating series.
A series is said to be alternating if it is of the form
(2.4:5)
from an alternating series the terms from an on is not greater than the
absolute value of the very first term deleted, with the proviso just
mentioned.
(0.7)fHl
(n + 1)1 < 0.000005.
The first positive integral n for which this inequality holds (obtained
by trial and error) is n = 7. Hence, a polynomial of max-degree 7 is
necessary to attain the desired precision. On the other hand, we deduce,
if we use 2.4:6 to estimate the error,
(0.7),,+1
(2n + 1)! < 0.000005,
whence n = 4. That is, the first four terms of 2.3: 16.1 are sufficient
to yield sin 40 correct to five significant figures; a result equivalent to
the preceding one. We have
sin 40 = 0.64279.
x n +1 x n +2
< - - + - - + ...
n+I n+I
x n +1
= --(1 + x + x 2 + ... )
n+1
x n +1 1
= n+I I-x
If x = t, the last expression becomes 1/2n(n + I) and we must now
find the first n for which this is less than 0.000005. This time, n = 14.
This estimate of the error gives us a far better result in the shape of
a much smaller n than the previous one.
By taking the first fourteen terms ofthe series we find In 2 = 0.693143+.
If the error committed in neglecting terms from x 16/15 onward is
0.000002-, or less, the value of In 2 is 0.69314; but if the error is between
0.000002 and 0.000005, then In 2 is 0.69315. We must then compute
one or two terms more of the series. Since 1/15 .216 = 0.000002+,
In 2 = 0.69315, correct to five decimal places.
This is an alternating series and it can be easily shown that six terms
are sufficient to yield, for x = t, 1/2e1J.26 = 0.38940, a value which is
correct to five decimal places.
In example 2 above we computed In 2 from the Maclaurin expansion
t
of In [1/(1 - x)] by substituting for x. We saw that fifteen terms were
necessary to obtain the answer correct to five significant figures. It is also
possible to compute In 2 from series 2.3: 16.4 by substituting one for x
(the series does converge at x = I). We obtain
1 1 1 1
In 2 = 1 - - + - - - ... + (-I)" - - + ...
2 3 4 n+l
EXERCISE 2.4
t. Evaluate, correct to five significant figures, 1: (ellt) dt for x = 1.1, 1.3, 1.5,2, 3 by use
of power series.
2. Evaluate, correct to five significant figures, f: r,l dt for x = 0.1,0.2,0.5, 1,2, 5 by
use of power series.
3. Evaluate, correct to four significant figures, f: \I' I + t dt for x
3 = 1.1, 1.3, 1.5, 2, 3,
5 by use of power series.
4. Find the power series expansions of the functions below at the indicated points;
find an expression for the general term.
a. loglo(l + x), x = 0; b. cos x, x = 90 (x in degrees);
c. x sin 4x I, x = 0; d. sin l x, x = o.
5. Use power series to evaluate, correct to four significant figures, sin xIx and its first
three derivatives at x = 0.1, 0.2, 0.5, I, 2, 4.
6. We have
Four terms of the binomial expansion are sufficient to yield, correct to seven significant
figures, \1'2 = 1.414214. Evaluate similarly by use of appropriate binomial expansions
Since
~
I-x
= ~ (! +
2x
I)/! (! - I) ,
2x
for x"# 0,
it follows that
9. Prove that the I's defined by the system of equations 2.3:22 or by 2.3:23 are also
given by
, -1
~"
I
10 = I, II = -(-1), I. = 1 ! 13 = -
-1 _~ I, !-1
-1 ! -1
-1 I o o o
i -1 I o o
-1 i -1 o
.......................................
It = (-1)'
( _1)1-1 ( -1)1-1 ( _1)1-3 ( -1)'-'
t t - I t - 2 t - 3
( _1)' ( _1)'-1 ( -1)1-1 ( _1)1-3
t+ I t - I t-2 -1
to. It can be proved that the even indexed Bernoulli numbers defined in the text
satisfy the inequalities
(2n)! I (2n)1
2 (21T)ln < (_I)n- BIn < 4 (21T)ln .
Use these inequalities to find expressions for the errors committed in truncating the
series 2.3:16.7-10 at their nth terms.
11. Put
x x
f(x) =~+2.
Similarly, obtain
qo(X) = (x - xo) ql(X) +b l ,
E (x) = (x - xo)n+lf(n+l)(X}
n (n + I)! '
where X is a number between x and x o . If, for a fixed x, say x = a,
limn_HoC En(a) = 0, then the value of f(a) can be determined to any
degree of precision by taking enough terms of the power series
is an infinite series (actually a power series in l/x) from which the value
of e1 / Z , x =1= 0, can be calculated to any degree of precision by taking a
sufficiently large number of terms. Again, we can compute the value
of 1T/sin 1TX for any nonintegral value of x to any degree of precision by
taking enough terms of the infinite series
- 1T
. 1 2x [ 1
- = -+ - 1 ... + (_1)"-1
sm 7rX x 12 - x 2 22 - x 2
where 0 < 8n < 1. This time, the absolute value of the remainder
term 8n( n + I)! / I Xn+l I will, if x is large, first tend to decrease as n
increases but will then increase rapidly-unless 8 tends to zero even
more rapidly-so that the series if continued indefinitely would diverge
for every x. Hence given a particular value of x, say x = a, we cannot
calculate J(a) to any preassigned degree of precision, the best we can
do is to determine J(a) to within the minimum (absolute) value of the
error term 8n(n +
l)!/an+l. We may find in practice that this error
term is small enough to yield usable results. Thus, if x = 10, the value
of J(lO) can be computed from the first nine terms of the series just
above with an error E8(l0) < 9!/109 = 0.00036. For x = 100, the
value of J(IOO) can be calculated with an error which is less than
9 . 10-41
2.S. ASYMPTOTIC SERIES; EULER'S SUMMATION FORMULA 49
2 at a an
(2.5:1) ao+-+-+"'+-+"',
x x2 x"
where the a's are constants. The series may converge for some value
of x, it may diverge for every value of x. Put
such that
f'" -e-tt dt = -c -
II)
In x +x - x2
--
2 . 2! +-x3
3 .-
3! =f ". + (-1)"-1 -
x"
- ". ,
n . n!
50 2. APPROXIMATING POLYNOMIAL; APPROXIMATION AT A POINT
e" f"-t
oo e-I
dt = -X1 - -x112 + -x3
2!
=f ... + (_1)n-1
(n - I)!
xn
+ (-I)n En .
Put
f(x) = ell: f" e-tt dt,
oo
-
n
1 II
S (x) = - - ---.:.
X x2
... + (_I)n-l (n-l)I
xn
.,
1 11 2! (n - i)!
f(x)"'---+-=f"'+(-I),,-1
x x2 x3 xn
....
1 1 2 6
f(5) '" 5" - 52 + 53 - 54 = 0.16640.
Hence
foo
1
e-I
-
t
dt = 0.1664Oe-6 = 0.00112,
with an error whose absolute value does not exceed e-6(4!/5 6 ) = 0.00005.
The value of the integral, correct to five decimal places, is 0.00 115.
Take x = 8, n = 3; then
1 1
f(8) "'8 - 82 + 823 = 0.11325,
and
f oo
8
e-I
-
t
dt = 0.11325e-8 = 0.00004,
2.5. ASYMPTOTIC SERIES; EULER'S SUMMATION FORMULA 51
f"" -
1 + t2
o
1 2'
x:x;3
4'
- dt = - - --.:.. + --.:. =F ... + (-I)n - ' + (-I)n+lE
rIO:
x 5 x2n+l
(2n)'
n ,
where
E
n <
(2n + 2)!
x2n+3
Once more, the resulting asymptotic series is very convenient for the
evaluation of the integral for large values of x.
We turn to the development of a summation formula due to Euler
after we consider some preliminaries. We will need a set of polynomials
(2.5:5a) Bo(x) = I,
Bo(x) = I,
Bl(X) = X -!,
(2.5:6) B2(X) = !X2 - ! x+ T~'
Ba(x) = ixS - iX2 + l2 x,
B ( ) -!!.L k
k X - k!O! x + (k _BlI)! I! x k-l
+ ~_
(k _ 2)!2! x
k-2
+ .. . + O!k!
Bk
In particular,
yp,(x)
'3 ,~ /5 ,1; x
FIG. 2.5:1.
2.5. ASYMPTOTIC SERIES; EULER'S SUMMATION FORMULA 53
i
i-I
i r1-1
f'(x) dx = -(Yo + Y1 + ... + Yn) + (n + I)Yn
-I
nYn = r o
xf'(x) dx + r
0
f(x) dx,
iYi
i-O
= Yn + r 0
f(x) dx + r0
(x - [xl - I)f'(x) dx.
54 2. APPROXIMATING POLYNOMIAL; APPROXIMATION AT A POINT
But
t .r: f'(x) dx = t (Yn - Yo),
so that
iYi
i-O
= r0
f(x) dx + t (Yo + Yn) + r
0
(x - [x] - t)j'(x) dx,
(2.5:11) ~
t.{k"+T =
1
In n + 21 ( 1 + n
1)
- fn-
0
J PJ(x)
(x + 1)2 dx.
f kk+1 PJ(x)
(x + 1)2 dx < 0,
then
0> f
n-
0
J PJ(x) 1
(x + 1)2 dx ~ - 2
f n-
0
J
(x
1
+ 1)2 dx = - 2
1(
1- n1) .
It follows that
f OO PJ(X)
1)2 dx = n-+oo
hm
. f n- J PJ(x)
(X + 1)2 dx
o (x + 0
.
(2.5.12) C -!~
_. [~1
f:to k + 1 - In n -
] _ 21- foo PJ(x)
0 (x + 1)2 dx
or
+ fo- p (x)
n 1
(2.5:14) In n! = (n + t)ln n + 1 - n _1
x
-ldx.
+
This equality too leads to some interesting and very important results.
We shall prove in a moment that
(2.5:16) In n! = (n + l)ln n - n + An ,
where
A = 1 + fn- 1
P 1(x) dx
.. 0 x+l '
.';;=~.~ .....
v 71 1 3
2k
2k - 1 'VI 2k 2+ 1 8't,
56 2. APPROXIMATING POLYNOMIAL; APPROXIMATION AT A POINT
or
(2.5: 17)
and therefore
(2.5:18)
[Exercise 2.5, example 7(a)], hence the last factor in 2.5:19 is greater
than one and
(2.5:20)
We shall now prove that the limit asserted in 2.5: 15 does indeed
exist. We then employ the method used in the proof to extend and
improve the simple Euler summation formula after we complement the
inequality 2.5:20.
We note first that the P(x),s like the B(x)'s satisfy the condition
and therefore
(2.5:23) f"-1 x+
o
Pl(X) _
1 dx -
~
12
(! _)1 + f"-1 _p.~
n ( 1)2 dx.
0 x+
Since p.(x) is bounded, and .r
(x + 1)-. dx exists, the limit of the
integral on the right-hand sideD of 2.5:23 and hence the limit of the
integral on the left exists as n -- "'. This is what we wanted to prove.
We go on to use the very last equality to rewrite 2.5: 14 as
. /-
In v 2'7T - 1 =
f'" xPl(X)
0 + 1 dx = - 12 +
1 f'" (xp.(x)
0 + I). dx,
or
f'o" (x
p.(x)
+ I). dx
/-
= In v 2'7T - 12 .
II
58 2. APPROXIMATING POLYNOMIAL; APPROXIMATION AT A POINT
Hence
In n! = (n + l)ln n + 1 - n + A(~ - 1)
,- 11 foc P 2(x)
+ In v 21T - 12 - "-1 (x + I). dx
_ " ,- 1
- In n v 2n1T - n + 12n -
foc"-1 (x
p.(x)
+ 1)2 dx
or
We combine the last inequality with 2.5:20 into the single statement
(2.5:26) n" v2n1T rn < n! < n" v2n1T exp (l~n - n).
""
~Yi =
i-O
f f(x) dx + Yo -
0
B
-rt(y" - Yo)
+ f"0 P 1(x)f'(x) dx
= 5: f(x) dx + Yo - ~t (Y1l - Yo) + ~. (Y,,' - Yo') - 5: p.(x) rex) dx
= fn '"( )
0 J' X
dX B1 (y,,- Yo ) + B.
+ Yo - TI 2! (
y"' - Yo ') - Bs
3! ("
y" - Yo")
+ 5: Pa(X)J<3)(X) dx,
and, in general,
2.5. ASYMPTOTIC SERIES; EULER'S SUMMATION FORMULA 59
where
This is the important Euler summation formula. Since all the B's with
odd subscripts greater than one are equal to zero, it is more usual to
write the formula as
(2.5:28)
~Yi =
" "
i=O
f f(x) dx + 1(Yo + y,,) + ~ (2;)1,
0
B
(y~2i-1)
;-1
k
'J'
- y~2i-l') - R2k ,
where
(2.5:31)
certainly have the same algebraic sign for j = 2, 4, 6, ... , if all the
derivatives of f(x) tend monotonically to zero; if, in addition, f(x) is
of constant sign and itself tends to zero (for x > 0), then it can be
shown that I R2k I is less than the absolute value of the first term neglected,
that is,
, _
In n. - n In n - n + 1 + 1"2" In n + ~
i-I
B2i (2i - 2)1
~ (2 ')'
,. n
2i-! - (2i - 2)!
)
fo
,,-1 PI (x)
x +1
dx = i
i-I
B2i
(2i)1
(2i - 2)! - (2i - 2)!)
n2t 1
'f,,-1 P 2k+1(X) d
+ (2k ). 0 (x + 1)2k+l X.
( P ) P 2HI
n
~jP
i-I
nPH
= __ + -1 n P + t=1
P+ 1 2
k B
~ ~ (2i - I)!.
(2,). 2, - 1
n -
;-1 P+ 1 2 ;-1 2, 2, - 1
.
sm t = -1 - -
t
cost sint
- + --
t
+~ B
~(-I)t-1 ~ (t lt - I cos t -
2 t-I (2,).
tIt-I)
! sin t = i (l - cos t)
i=O
k B .
~ ( -1)t (2. I); t lt - I + (-1 )k+lt 2k
I
f P!k(X) sin tx dx,
I
EXERCISE 2.5
1. Evaluate r: (te')-I dt, correct to five decimal places, by use of asymptotic series.
2. Use the asymptotic expansion of
[o ~dt
I +t l
- fn- I
o
PI(X)
---dx
(x + 1)1
for integral values of n greater than unity. Use this table, a table of the natural logarithms,
and formula 2.5: II to find, correct to three decimal places, the values of
10 I 1000 I 100 I
a. ~-; b. ~~ c. ~ -;.
I-I J I-I J 1-100 J
n - r- o
I
-PI(x)
(x+
-dx
1)1
2 0.0569
3 0.0681
4 0.0720
5 0.0739
6 0.0749
7 0.0755
8 0.0759
9 0.0762
10 0.0764
11 0.0765
12 0.0766
13 0.0767
14,15 0.0768
16,17 0.0769
18-22 0.0770
23-35 0.0771
36-", 0.0772
2.6. OTHER METHODS OF APPROXIMATION 63
[.
Hlflt: evaluate
It
t-l
Pl(X)
- - - . dx.
(x + I)
]
r
n_1X
(2.6:1) i = 0, 1, "', n,
The last equality describes the sense in which Pn(x) is the best approxi-
mating polynomial.
On the other hand, suppose that f(x) is defined in a neighborhood
of Xo and that there exist polynomials Pi(x), i = 0, 1, "', n, such that
for each i
f"'o+1I
"'0- 11
(f(x) - Pn(x)) dx.
For a given h, does P..(x) exist such that P..(xo) = f(x o) and such that
the absolute value of the integral is smaller than the corresponding
value for a q..(x) , different from P..(x)? A moment's reflection will
convince us that our question is too naive. Since the integral represents
the algebraic area between f(x) and Pn(x) in the interval from Xo - h to
Xo + h, the integral may well be equal to zero for a great many different
polynomials of the same max-degree. We must then replace the integrand
f(x) - P..(x) by some closely associated integrand which is non-negative.
In view of this requirement, we consider and examine the integrals
(2.6:5) f "'o+1I
"'0- 11
If(x) - Pn(x) I dx
2.6. OTHER METHODS OF APPROXIMATION 6S
and
(2.6:6) f "'o+ll
"'0-1&
(f(x) - p..(X))2 dx.
For a given (small) h, does there exist a Pn(x) which minimizes the
value of the integral 2.6:5? the integral 2.6:6? In either case, can a
Pn(x) be found which is independent of h ? Can we find a Pn(x) such that
(2.6:9) A = r -1&
(I ! x + 1x I) - mx 1dx
is a minimum? We have
A = r
-/&
1-mx 1dx + r0
1(1 - m) x 1dx
= - 1m 1 f o
-1& 1x 1dx + 11 - mi. 0
fl&
x dx
h2
= (I m 1+ 11 - m I) 2 .
Now
1 - 2m for m < 0,
Iml+ll-ml= 11 for 0:::;; m :::;; 1,
2m -1 for m> 1.
66 2. APPROXIMATING POLYNOMIAL; APPROXIMATION AT A POINT
(2.6:10)
We have
B= r (i(x+ Ixl)-mx)2dx.
-II
f
B = m2 o x2 dx
-II
+ (1 - m)2 f" x dx
0
2
h3 h3
= m2 -
3
+ (1 - m)2-
3
+ 2m2 ) -h3
3
= (1 - 2m
EXERCISE 2.6
1. Graph, on the same set of axes, the function 2.6:4 and its approximating polynomial
Y = IX.
2. Determine, where possible, and discuss as in the text, approximating polynomials of
max-degree I, at the orgin, for the functions
a. Y = 1 x I;
b. y = 1 x I/x for x*0, y = 0 for x = 0;
c. y = -x for x < 0, y = Xl for x ;;;. o.
3. Same as example 2a and 2b, but find polynomials of max-degree 2.
4. Prove the assertion made in the second paragraph of this section concerning the
existence of the first n derivatives of f(x}.
Chapter 3
67
68 3. THE APPROXIMATING POLYNOMIAL; APPROXIMATION IN AN INTERVAL
(3.1:4) Is = ra
(f(x) - p..(X))1 dx
be a minimum.
We prove first by an example that the two conditions are not equivalent.
Take f(x) = Xl, Po(x) = c, [a, b] = [0, 1]. Then
IA = fII
o
Xl - e I dx
= r'
o
(e - Xl) dx + r_
VC
(Xl - e) dx
= 1- e + tel;
hence 1A is a minimum when c = l On the other hand,
Is = (Xl - e)ldx
= 1- ie + e l
J o
= -I (ao + alx + a2x2)1 dx + f 0(ao + (al -
I
1) X + a2x2)1 dx
laoao = 4,
I 40al -
-
Ial40 -.4:
- 3 '
I asa. -- 3"'
4
lao = I al = I al = 0,
14040 l40al l40aa
.
Th ese con d ItlOns . fi ed 1f a o = 32'
are satls 3 a l = 32'
16 a 2 = 32'
15 an d
therefore y = l2 (3 + 16x + l5x 2 ) is the required polynomial. It is
suggested that the reader graph this parabola and y = t(x + I x I) on
the same set of axes.
lal = -2 r
0
x(sin x - (a o + a 1x + ar2)) dx
= -2 ('TT - ~0'TT2 - ;1'TT3 - ~ w4),
12
ao = w3 (172 - 10) = -0.050,
60
a 1 = -rr4 (12 - r) = 1.312,
60
a2 = -rr5 (172 - 12) = -0.418,
Y 12 [r - 10 + :5; . (12 -
= w3 172 ) X + 1752 (172 - 12) x2]
EXERCISE 3.1
1. If f(x) = I x I, find the polynomials of max-degree 1 and max-degree 2 which
minimize the integral Is given by 3.1:4 in the interval [-1, 1]; in the interval [-1, 2].
Draw the graphs of the given function and your answers.
2. Same as example 1, but withf(x) = e'".
(3.2:6) i = 0, 1, ... , n,
where
Xo ... X~-l Yo x~+1 xu"
Xl . X~-l YI x~+1 xt"
Di=
X.. ... X~-l Y.. x~+1 ... X....
and
1 Xo ... xo"
1 Xl Xl"
D=
1 x .. ... x ....
72 3. THE APPROXIMATING POLYNOMIAL; APPROXIMATION IN AN INTERVAL
0 0 .. 0 0 0 .. 0
Xo ... X~-l
Xi Xi+l ... Xo"
0 Y 0
Xi
I Xl ... X~-l YI Xi+lI
... Xl"
.............................................
Xi X" ... X~-l y" XHI ... X "
" " "
Hence Xi Di is equal to
o 0 0 .. 0
Yo Xo ... X~-l XOi x~+l .. xu"
o 1 X x2 .. x"
THEOREM. If (xo, Yo), (Xl' YI)' ... , (X.. ,Y.. ) are n + I points with
distinct abscissas, there is one and only one polynomial of max-degree n,
y = P..(x), whose graph passes through these points, that is, such that
y., = P..(Xi), i = 0, I, ... , n.
y X x'l.
o -1 1
= 0,
o 0 0
1 1 1
y 1 X Xl x3
-log 2 1 l -1 .l8
0 1 1 1 1 = 0,
log 2 1 2 4 8
2 log 2 1 4 16 64
or y = log 2( -104 + 147x - 49x2 + 6x3 )/21.
EXERCISE 1.2
Note: all required equations in this exercise are of the form
y = Qo + Q1X + Q1Xl + ... + QnXn
and are to be found by means of determinants.
1. Find the equation of the parabola determined by the points
(-I, -I), (1,0), (3, S).
2. Find the equation of the cubic determined by the points of the preceding example
and (4, 0).
1. Find the equation of max-degree 3 determined by the points
(-2, -17), (0, -I), (1,4), (4,7).
4. Find the equation of max-degree 3 determined by the points
(-2,-17), (0,-1), (1,4), (4,8).
5. Find the equation of the parabola which coincides with y = sin (xI2) at x = 0, .,,13,
.,,/2. Draw the graph of each curve using the same axes.
6. Find the equation of the parabola which intersects y = e' at x = -I, 0, I. Draw the
graph of each curve using the same axes.
7 . Find and graph the equation of max-degree 2 which coincides with y = I x I at
x = -1,0, I.
b. Find and graph the equation of max-degree 2 which coincides with y = I x I at
x = 1,2,4.
3.3. LAGRANGE INTERPOLATION FORMULA 75
= ~Li(X)Yt'
i~O
The form 3.3:3 is called the Lagrange Interpolation formula and the
coefficients of the y's given by 3.3:2 are called the Lagrange coefficients.
This form of the approximating polynomial is very useful and important
since many of our later developments will be based on it.
EXAMPLE. The polynomial through the points (- 2, 3), (0, 0), (1, 4).
(5, -1) is given by
(3.3:4.0)
L () I x - Xk (x - Xk)(X - xa) (x - Xk)(X - xa)(x - Xb)
kx = + Xk - Xa + (Xk - Xa)(Xk - Xb) + (Xk - Xa)(Xk - Xb)(Xk - xc)
+ ... + (x - Xk)(X - xa) ... (x - Xg) .
(Xk - Xa)(Xk - Xb) ... (Xk - x h) ,
(3.3:4.1)
= x - Xa
Xk - Xa
II + x - Xk
Xk - Xb
+ (x - Xk)(X - Xb)
(Xk - Xb)(Xk - xc)
(3.3:4.2)
(x - xa)(x - Xb)
(Xk - Xa)(Xk - Xb)
(3.3:4.(n - I))
= (x - x,,)(x - Xb) ... (x - Xg)
(Xk - Xa)lXk - Xb) ... (Xk - xo)
II +
(3.3:4.n)
(x - xa)(x - Xb) ... (x - xg)(x - Xh)
= (Xk - Xa)(Xk - Xb) ... (Xk - Xg)(Xk - x h) .
The last form is the same as 3.3:2; we have included it for the sake
of completeness. To verify that anyone of the other forms holds, add
the first two terms within the braces, add the result to the third term,
add that result to the next term, and so on; multiply the final result
by the fraction in front.
3.4. DIVIDED DIFFERENCE FORM 77
EXERCISE 3.]
1. Find the polynomial equations of lowest degree determined by the following sets of
points. Use the Lagrange Interpolation formula.
a. (-I, 2), (0,-1)
b. (-2,7), (1,9)
c. (3, 4), (2, 4)
d. (-I, -I), (1,0), (3,5)
e. (-1,0.2), (1,2.3), (4, -6.8)
f. (-I, -I), (1,0), (3,5), (4,0)
g. (-2, -17), (0, -I), (1,4), (4,7)
h. (-2, -17), (0, -I), (1,4), (4,8)
I. (-4,3), (1,7), (-2,0), (5, -I), (7,0)
;.(-2,-13), (10,11), (0,1), (4,17), (6,19).
2. Do examples 5, 6, and 7 of Exercise 3.2, this time using the Lagrange Interpolation
formula.
]. Alongside is an abbreviated table of natural logarithms.
Find the polynomials, P..(x), that coincide with the logarithmic x Inx
function at x equal to
400 5.9914645471
a. 402, 403, n = I; 401 5.99396 14273
b. 402, 403, 404, n = 2; 402 5.99645 20886
c. 401, 402,' 403, 404, n = 3; 403 5.99893 65619
d. 401, 402, 403, 404, 405, n = 4; 404 6.00141 48780
e. 400, 401, 402, 403, 404, 405, n = 5. 405 6.00388 70671
f. Use ordinary (linear) interpolation to find In 402.6.
g. Use each of your answers to a, ... , e, in turn, to find In 402.6.
h. Compare your answers to f and g. What is the value of In 402.6?
4. Prove l:~=OLi(X) Xit = xt, 0 < k ..; n, where Li(X) is defined by 3.3:2. [Hint: use
3.3:3 with y = xlt].
S. Derive the Lagrange Interpolation formula 3.3:3 directly from 3.2:7 by expanding the
determinant in terms of the elements of the first row.
(3.4:1)
(3.4:2) i-::pj,
78 3. THE APPROXIMATING POLYNOMIAL; APPROXIMATION IN AN INTERVAL
(3.4:3)
etc.
Also,
(3.4:2.1)
and we have
(3.4:5)
(3.4:8)
* The context will make it clear whether the symbol [x] signifies the zeroth order
divided difference or the greatest integer in x.
3.4. DIVIDED DIFFERENCE FORM 79
Xo Yo
[XoXl]
Xl Yl [XoXIXI]
[XIXJ [XoXIXIXS]
XI Y. [XIXsXS] [XoXIXsXsXC]
[XsXs] [XIXaXsXc]
Xs Ys [XsXsx,]
[XsxJ
X, y,
-2 234
-112
0 10 391
2625 50
5 13135 441 25
2184 150
-1 31 741
-39
2 -86
If the x's are arranged according to size, the array takes on the form:
-2 234
-203
-1 31 91
-21 -25
0 10 -9 25
-48 150
2 -86 891
4407
5 13135
80 3. THE APPROXIMATING POLYNOMIAL; APPROXIMATION IN AN INTERVAL
[XoXI] = Yo
Xo - Xl
+ Xl YI
- Xo
~~= h
(xo - XI)(XO- X2)
+ (Xl - ~
XO)(XI - X2)
+ (X2 - h
XO)(X2 - Xl)
A simple induction proof yields
(3.4:10)
Yt.
+ ... + -:----.,..,.....---:----;------:-
(x. - X )(x. - x, ) ... (x. - x ).
1, '0 I, .1 I, ',.-1
3.4. DIVIDED DIFFERENCE FORM 81
(3.4: 11)
(where, since the order of the x's written within a pair of brackets is
immaterial, they may be rearranged so that the subscripts occur in
natural consecutive order) is called a sequence chain if the first term of
the sequence is one of the y's, the last term is the one and only divided
difference of the nth order, and the intervening terms have the property
that each is adjacent in the difference table to its predecessor and to
its successor. Of the 2n possible sequence chains (we leave it to the
reader to prove that there are exactly 2n distinct sequence chains), we
take special note of four: first, the sequence chain
(3.4:12)
(3.4:13)
whose terms form the lowest ascending diagonal. Then, if n is even and
equal to 2m, say, we mark the sequence chains
In either case, the terms of the last two sequence chains we have marked
for special attention start with the middle y or y's of the difference
table and zigzag to the final nth order divided difference.
Because of the manner in which new subscripts are introduced into
the successive divided differences 3.4:12-15, 14', IS', we call the
sequence chain 3.4: 12 a sequence chain of forward divided differences,
3.4: 13 a sequence chain of backward divided differences, and the remainder,
82 3. THE APPROXIMATING POLYNOMIAL; APPROXIMATION IN AN INTERVAL
To prove the statement made above, we have, from 3.4:4 and 3.4: 10,
Yi I+
I
x - Xi
0 + (x - xd(x - xd
0 I + ... + (x - xd ... (x -
0
Xi
n_1
)!
o XiO - Xii (XiO - Xil)(XiO - Xi a) (XiO - Xii) ... (XiO - Xi n)
+ i
X - Xi
0 I
I+ X - Xi
I + ... + (X - Xi ) ... (X - Xi
I A_I
)!
Y I Xii - XiO Xii - Xiz (Xii - Xi.) ... (Xii - Xi n)
+ ........................................... .
(X - XiO)(X - Xii) ... (X - Xi n _ l )
+ Yin (X.In - X10 )(X.In - X.)
11
... (X.1ft - X'n-l).
Y = 234 - 112(x + 2)
+ 39lx(x + 2) + 50x(x + 2)(x - 5)
+ 25x(x + 2)(x - 5)(x + I)
= -86 - 39(x - 2) + 741(x,- 2)(x + I) + 150(x - 2)(x + I)(x - 5)
+ 25x(x - 2)(x + I)(x - 5)
= 10 - 2lx + 9lx(x + I) - 25x(x + I)(x + 2)
+ 25x(x + I)(x + 2)(x - 2),
etc.
The divided difference form, 3.4: 16, of the polynomial through the
n +I points
(3.4: 18)
(3.4:20)
and stopping the process when succeeding terms no longer affect the
answer (or when we run out of points). See the second half of Section 6.
EXERCISE 3.4
t. Write out the complete divided difference table for each set of points of example I,
Exercise 3.3.
2. Write out the divided difference table for the set of points (0, sin 0), (10, sin 10), ... ,
(90, sin 90), as far as the column of third order differences. (Obtain the values of the
sines from any five-place table.)
3. Do examples 1,2,3 of Exercise 3.3 using divided differences.
4. Prove
I ,,-I
Xo Xo Xo Yo
t ft.-I
x. X,. x" Y.
[XoXl . x,,] = ....:...._....;:..-=---:--....;:..-....:...;;;..-
Xo xo ... xo"
I Xl XII... Xl"
(3.5:2)
be r +I of the n +I points, and, introducing a new notation, let
(3.5:3)
be the polynomial through the first r points of 3.5:2 and
(3.5:4)
the polynomial through the last r points of 3.5:2. Then
(3.5:5)
Hence
(3.5:6)
=. 1 I X - Xio {x;o} ,
X
'I
-x'0 x-x. {x}
I 'I il
86 3. THE APPROXIMATING POLYNOMIAL; APPROXIMATION IN AN INTERVAL
are the polynomials through the first, the first two, and the first three
points of 3.5:2, respectively.
Analogous to the divided difference table, we can form polynomial
tables; in particular, the tables (illustrated for n = 5):
Xo {Xo}
Xl {Xl} {XoXl}
XI {XI} {XoX.} {XoX1X.}
Xa {Xa} {XoXa} {XoX1Xa} {XoX1XaXa}
X, {X,} {xoX,} {XoX1X,} {XoX1XaX,} {XoX1X.XaX,}
X, {X,} {xoX,} {XoX1X,} {XoX1X.X,} {XoX1X.XaX,} {XoX1X.XaX,xa}
and
Xo {Xo}
{XoXl}
Xl {Xl} {XoX1X I}
{XiX.} {XoX1XaXa}
XI {XI} {X1X.Xa} {XoX1X.XaX,}
{X.Xa} {X1XaXaX,} {XoX1XaXaX,X,}
Xa {Xa} {XaXaX,} {X1XaXaX,X,}
{xaX,} {x.x.x,x,}
X, {X,} {XaX,X,}
{x,x,}
X, {X,}
(3.6: 1)
(3.6:3) y = f(x),
then it is natural to regard Pn(x) as an approximation, in some sense,
to f(x). In particular, we may regard Pn(x) as an interpolating polynomial
for f(x), that is, for a value x' of x, f(x') can be approximated by
evaluating Pn(x'). We will then want an estimate of the magnitude of the
error E(x) = f(x) - Pn(x) at x = x'.
To this end, put y' = f(x'). Construct the polynomial through the
n + I points 3.6:2 and the point (x', y') by the method of divided
differences. If Pn+l(x) is this polynomial and if x' is the last entry of the
first column of the difference table used in its construction, then it
follows from the form of equation 3.4: 16 that
(3.6:4)
where X is some value between the smallest and the largest of the
numbers Xo , Xl , "', Xn ,x'. (Compare this result with the error term
in the previous case, formula 2.2:8.)
The number X is not known in actual practice, hence it is customary
to replace pn+lI(X) by the maximum absolute value of pn+ll(x) in the
interval in question. As a rule, this replacement causes an exaggerated
estimate of the error.
Formula 3.6:6 deserves some special comment. Let us first rewrite it as
jnl(X)
(3.6:8) [XoXl ... xn] = - - I-
n.
.
The last two results are restated and rounded out in the
(3.6:9)
and conversely, if y = f(x) is a single-valued function defined for every x,
and if for every set Xo , Xl , , X" of n + 1 distinct numbers and the
corresponding set Yo, YI , ... , y" determined by f(x) Eq. 3.6:9 holds, then
f(x) is a polynomial of max-degree n whose leading coefficient is an .
The proof of the converse is immediate. Let p,,(x) be the polynomial
of max-degree n determined by Xo , Xl , , X" and the corresponding
Yo = f(x o), YI = f(x l ), ... , y" = f(x,,). Let x' be a number distinct
from Xo , Xl , , X" Since by assumption all nth-order differences are
constant, all (n + l)st-order differences are zero, and hence, by 3.6:5,
p,,(x') = f(x:); or f(x) = p,,(x).
We illustrate some of the preceding ideas by two examples.
y: eZ \_0-2-.7-18-7-.3-28-9-54-.5-:-8
0 1.000
1.718
2.718 1.477
4.671 1.209
2 7.389 6.311
23.605
4 54.598
Hence
y = 1 + 1.718x + 1.477x(x - 1) + 1.209x(x - 1)(x - 2)
y =
x
eZ
I 0.6
1.822
0.7
2.014
0.8
2.226
~
2.718
1.0
0.6 1.822
1.92
0.7 2.014 1.00
2.12 0.33
0.8 2.226 1.13
2.46
1.0 2.718
(3.6:11 )
1 E(x') 1 = If(x') - Pn(x') 1 .::;:; (n : I)! 1 (x' - xo)(x' - Xl) ... (X' - Xn) I
This last expression for the magnitude of the error does not involve
the (n + l)st derivative.
Another method of approach is also of interest. The statement
The last form was obtained on the assumption that pn+l)(x) existed
in a certain interval [a, b]. On the other hand, we can write the form
just above whether the derivative does or does not exist and we have
there a usable estimate of the error in approximating f(x) by Pn(x)
provided we know something about tp(x). In particular, if in the interval
[a, b], I tp(x) I < K, we are back to the estimate given in 3.6: 11.
The determinant 3.2:7, the Lagrange interpolation formula 3.3:3, the
divided difference form 3.4:16, and the last entry, {XoXl ... x n }, in the
Aitken-Neville tables are all the polynomial through the n + 1 points
(xo , Yo), ... , (x n , Yn). Each form has its particular uses, advantages,
and disadvantages. The determinant form is easy to differentiate and
is convenient for some special purposes, but as a rule, it is seldom used
for either approximation or interpolation because of its unwieldy nature.
The Lagrange form is good for further theoretical purposes and is most
convenient for interpolation for a single value of the argument. The
divided difference form is also good for further developments and is
convenient for interpolation if many values are desired. The Aitken-
Neville process is cumbersome if the polynomial is wanted, but is
convenient for interpolation for many values of the argument. The
various methods and convenient forms for the arrangement of the
computations, are exhibited in the example below, an elaboration of
example 2.
0.6 1.82212
1.91630
0.7 2.01375 1.00800
2.11790 0.36167
0.8 2.22554 1.15267 0.10254
2.46370 0.43345 0.01919
1.0 2.71828 1.41274 0.11789
3.17007 0.51597
1.3 3.66930 1.72232
3.85900
1.4 4.05520
Then (we will use the forward difference form 3.4: 17), we evaluate
1 I' x -
1 x -
Xo 1
Xo
x -
(x - xo)(x -
Xl
Xl)
II (x - xo)(x -
x - X"_l
Xl) (x - X"_l)
The entries in the second row are multiplied into the corresponding
entries of the uppermost descending diagonal of the divided difference
table, and the results added to yield 2.45960. It takes 45 steps to compute
the difference table and about 20 more steps to reach the final result.
Since the same divided difference table can be used to evaluate additional
values of ez (in the range 0.5 ::::;;; x ::::;;; 1.5), only 20 steps are necessary
to calculate each additional value.
94 3. THE APPROXIMATING POLYNOMIAL; APPROXIMATION IN AN INTERVAL
and
process are precisely the values of the polynomials of 3.4: 19 for the
given value of the argument. Hence, if these values are unaltered at
the end, as in the example above, we are assured that the error inherent
in the interpolation process is too small to affect the last significant
digit. Since rounding-off errors may mount up, some computers use
one, sometimes two, significant digits more in their computation entries
than in the given data to reduce the rounding-off errors; the final
answer is, of course, written with the proper number of digits. This
was not done in the example worked out above; the final answer is,
nevertheless, correct as far as it is written.
EXERCISE 1.6
t. Find by use of the determinant form, the Lagrange formula and the method of
divided differences, the cubic polynomial determined by each set of points.
a.(-3,-I), (-2,2), (1,-1), (3,10);
b. (- 3.10, -1.05), ( -1.98, 2.13), (1.01, -0.83), (2.64, I Q.42).
2. Find by use of the Lagrange formula and the method of divided differences, the
polynomial of. max-degree determined by each set of points.
a. (-5,87), (-1,7), (0, -3), (2, -II);
b. (-5, -8.345), (-3, 1.756), (0, -2.003), (1,7.984).
1. Find, by any method, the polynomial P.(x) which has the same values as x' at
x = -I, 0, I, 3. Approximate 2' by evaluating P3(2) and estimate the error. What is the
actual error? Approximate 2 5 by the Aitken-Neville processes using the given values of x
and the corresponding values of y.
4. Find the polynomial equation y = pz(x) whose graph intersects the graph of
y = sin x at x = 0, .,/4, .,/3. Use pz(x) to approximate sin (.,/6), sin (.,/2), sin 200. Esti-
mate the respective errors and determine the actual errors. Find each of the required values
by the Aitken-Neville processes from the given data.
Sa. Find the equation of the parabola which intersects the cosine curve at 100, 20 0,
400 (use a five-place cosine table). Calculate the value of cos 300 from the polynomial
equation. What is the actual error? the predicted error?
b. Same problem as a, but this time use the equation of the quintic which coincides
with the cosine curve at 0 0, 100, 200, 400, 500, 600.
c. Same problem as a, but this time use the equation of the parabola which coincides
with the cosine curve at 20 0, 25 0, 35 0.
6. Find the missing entries and estimate their margins of error wherever possible.
x
a.---
I-I 0 2 3 5 7
y = e z/Z i 0.6065 1.0000 2.7183 12.1825
arcsin k 5 6 7 8
c.
r.'1
o
d~
d. Day 1I 2 3 4
Altitude of star 4615' 4625' 4702'
7. The following table is self-explanatory:
vx correct to:
2 sig 3 sig 4 sig 5 sig 6 sig 7 sig 8 sig
x fig fig fig fig fig fig fig
(I) (2) (3) (4) (5) (6) (7) (8)
900 30 30.0 30.00 30.000 30.0000 30.00000 30.000000
950 31 30.8 30.82 30.822 30.8221 30.82207 30.822070
1000 32 31.6 31.62 31.623 31.6228 31.62278 31.622777
1050 32 32.4 32.40 32.404 32.4037 32.40370 32.403703
1100 33 33.2 33.17 33.166 33.1662 33.16625 33.166248
1150 34 33.9 33.91 33.912 33.9116 33.91165 33.911650
1200 35 34.6 34.64 34.641 34.6410 34.64102 34.641016
1250 35 35.4 35.36 35.355 35.3553 35.35534 35.355339
1300 36 36.1 36.06 36.056 36.0555 36.05551 36.055513
to. Same as problem 8, if a log sin table, to five decimal places, is used.
t t. Same as problem 8, if a log tan table, to five decimal places, is used.
t2. Linear interpolation is inaccurate for log sin x for very small angles. What degree
interpolation will suffice for interpolation in the range 10 < x < r if a five place table
with entries at minute intervals is used?
t3. If y = f(x) has a continuous nth derivative, and x, approaches Xo , i = I, 2, ... , n,
prove lim [Xo:&l x,,] = j1n'(xo)/nl. [Hint: use 3.6:8.]
t... If y = f(x) has a continuous nth derivative, define [xoxo xo], where Xo occurs
,. + 1 times, to be the limit in the preceding example. Use this definition to define
[xo:&o ... X1Xl x"xt ...], where x, occurs n, times, i = 0, I, ... , k, and Xo , Xl , Xt are
distinct.
tSa. Form the complete divided difference table for the function Xi for the values
x = I, I, 1,2,4,7.
b. Form the complete divided difference table for the function V x - I for the values
x = 5,5,5,10,17,17.
t6. Find the polynomial equation y = p(x) of max-degree 3 whose graph intersects the
graph of y = In x at x = 2, 5, and which is tangent to it at x = 1. [Hi,.t: use the divided
difference table for x = I, 1,2,5.]
t7. Find the polynomial of max-degree 4 which has third order contact with cos x at
x = O. Compare your answer with the Maclaurin expansion of cos x.
(3.7:3) i, j = 0, 1, ... , n.
(3.7:5)
and, in general, an rth-order finite difference is defined by
(3.7:6)
Finite differences are more convenient than divided differences because
they do not involve divisions.
There is a finite difference table for finite differences analogous to the
divided difference table discussed in Section 3.4. The general finite
difference table will have the appearance of the array:
Xo Yo
..::IYo
x, Y, ..::IzYo
..::Iy, ..::1 3"0
Xz Yz ..::I.",
..::IYz
X3 Y3
For example, the finite difference table for the previously given data
IS:
0.4 1.492
0.330
0.6 1.822 0.074
0.404 0.014
0.8 2.226 0.088
0.492
1.0 2.718
It follows directly from the definitions of the divided and the finite
differences and from 3.7:3 that [xoxll = LJYo/h, [xoxlx21 = LJ2Yo /2!h 2;
by induction it can be shown that
1 r .
(3.7:9) -..., ... x] -
[x 17'"1 ~(-I)'-i Y.
, - h' i-O
~ I( - I)1.
I r
(3.7:10) .1'Yo =
i-o
(-I)'-i (~) Yi ,
I
r = 1,2, ... , n,
(3.7:11) r = 0, 1, ... , n,
100 3. THE APPROXIMATING POLYNOMIAL; APPROXIMATION IN AN INTERVAL
(3.7:12) r = 0, 1, ... , n,
(3.7:14) r = 0, 1, ... , n;
(3.7:15) r = 0, 1, ... , n.
From formula 3.7:7 and the theorem in Section 3.6, we have imme-
diately the corresponding:
and conversely.
3.B. POLYNOMIAL THROUGH n + 1 EQUALLY SPACED POINTS 101
EXERCISE 3.7
t. Form the complete finite difference table for each of the following sets of numbers.
(-3,1.76), (0,0), (3,2.S9)
b. (10, 7S.54), (II, 95.03), (12, 113.10), (13, 132.73)
xl 3.0 3.2 3.4 3.6 3.S
c.
~I -3.025 - 3.000 -2.965 -2.922 -2.S74
~I
-2 -1 0 2
d.
yl 0.S102 0.S059 0.S036 0.8025 0.S019
Xl 9.1 9.2 9.3 9.4 9.5 9.6
e.
~12.43 2.47 2.49 2.46 2.44 2.45
1. Obtain the values of log sin x from a five-place table; then form the complete
finite difference table for log sin x for each of the following sets of values of x:
20,40, 60, SO, 100
b. 2",4, 6, So, 10
c. So, SOlO', S020', S030', S040'
d. So, SOl:, S02', S03', S04'.
e. Discuss the effecta of polynomial approximation errors and rounding-off elrors on
the entries of the tables.
3. Derive the identity 3.7: 10 directly from the definitions 3.7:4-6, that is, without
using divided differences.
1
(3.8:1) or u = h (x - xo)'
Hence
(3.8:2) x- Xt = (u - i) h, i = 0, 1, ... , n.
or
(3.8:4) i = 0, I, ... , n.
(3.8:5) Y = (n
u )n
+ I) (n + 1 ~
( -I )n-i
u_ i
(n)i Yi
Note that this form of the interpolating polynomial through the n + 1
equally spaced points cannot be used for u = i because of the presence
of u - i in the denominator; we know, however, that y = y., for u = U i .
EXAMPLE 1. Find the value of eo.? from the following set of values:
_x_/ 0.4 _0_.6_ _0._8_ _ __
y = e'l 1.492 1.822 2.226 2.718
(3.8:7) Y = ~.1Yo
n . (U)..
i-O '
We also have from 3.7:3 that
(x - xa)(x - xa+l) ... (x - Xa+,_l) = (u - a)(u - a-I) ... (u - a - r + I) hr
(3.8:8) r= I,,n-a+ 1.
3.S. POLYNOMIAL THROUGH n + 1 EQUALLY SPACED POINTS 103
(3.8:9) Y = n
k.1 iYn_i
(U - n +. i-I)
i-O '
(3.8:10)
Y = ~ 2'
~.1 IYm_i
(U - m - 1+
2i
i) + ~
~.1 I-Ym+1_i
2' I (U - m - 1+
2i _ 1
i) .'
i-O i-I
(3.8:11)
(U - m + i) (U - m - 1+ i) .'
~.1 + ~.1
_ m 2i m 2i-1
Y - Ym-i 2i Ym-i 2i _ 1
(3.8:11')
m I ' m I '
_
Y -
~
.12i
-4 Ym+1-i
(U - m 2i- + ') ~ .12i+1
+ 1=0
-4 Ym-i
(U - 2im+- I + ') .
1=0
Xm+l, Xm , X m +2 , X m _ l , , X n ,
XO'
(3.8:12)
(3.8:12')
The last term can be omitted without affecting the answer which is
correct to six figures.
We compute sinh 1.8276 as an additional illustration. We use formula
3.8: 10' again with x' = 1.8276, Xo = 1.60, h = 0.1, u = 2.276,
n = 2m + 1 = 5; we obtain
table confirms these observations and explains why the table was
truncated at the column of fifth differences. The entries in that column
were more or less erratic but fairly constant implying that in the use
of a fifth degree polynomial, the inherent error will be negligible
compared to the computational error. (A similar reason explains why
ordinary or linear interpolation is usually adequate in the use of the
ordinary trigonometric tables.)
We conclude from the preceding observations that a difference table
should be carried out until a column is reached in which the entries
are more or less constant (but read the remarks further on on page 113).
The last column will determine the degree of the polynomial to be used.
An entry in the last column which deviates greatly from the other entries
should be avoided if possible. The deviation is usually due to rounding-off
and computational errors and may result in an error slightly larger than
necessary. This is why the entry 0.00012 was suspicious in the table
on page 105.
We present the two difference tables below to illustrate the relation
between the number of decimal places and the degree of the approxi-
mating polynomial. Each was carried out until a column of more or
less constant entries was obtained. To obtain a value for sinh x with a
precision approximately equal to the precision of the given values, a
polynomial of degree 3 should be used in the first case and one of
degree 8 in the second. We also observe that the number of the column
of (more or less) constant differences will also depend on the size of
the argument interval h; the reader should construct examples to
illustrate this relation. In general, we find that for a given function and
for a. given range of the argument, the smaller the argument interval
and the fewer the number of significant figures required, the smaller
will be the degree of the interpolating polynomial necessary.
We turn next to the choice of the entry to be called Xo In the examples
worked out above, we chose six points quite arbitrarily provided only
that Xo < x' < X5 , where x' was the value of the argument for which
we were interpolating. There was no compulsion about the choice of Xo ,
indeed, it was not necessary to satisfy the preceding inequality although
it will develop that greater precision will result if it is satisfied. However,
it is convenient for the sake of simplicity and greater precision to
rewrite formulas 3.8:7, 9-11,10', II' by introducing a new variable t
and raising or lowering all subscripts in such a manner that the two
arguments in the table that bridge x' are called Xo and Xl when we use
forward differences (or when we use a central difference formula that
starts with a forward difference) and X-I' Xo when we use backward
differences (or when we use a central difference formula that starts
108 3. THE APPROXIMATING POLYNOMIAL; APPROXIMATION IN AN INTERVAL
(3.8: 13)
where x' = Xo + th, or t = (x' - xo)/h. The only change has been the
renaming of the variable u. For the revision of formula 3.8:9, we put
t = u - n + 1, whence X = Xn - l + tho We also have
(3.8:14)
(3.8: 15) Y = ~
[nIB] .
.:jBY _ i
(t - 21 + i) + [("+1)/B].
~ .:jB.-IYI _ i
(t -21_+1i) '
i-O I i-I I
(3.8:16) _
[ .. /B]
~ ABi
(t - 1 + i) + [(.. +1)/B]
~ A2i-1
(t - 2 + i)
Y- ~~ Y-i 2 ~ ~ Y-i 2 - 1 '
;-0 ' i=1 '
y y
700
300 600
500
200 400
300
200
200
-300
-200 -400
-500
-300 -600
FIG. 3.8:f1.
_
y - Yo +~ 1.12
~ I y-.
(t - 2i1 + i) + .12.-1Yl-. (t 2i- -1 +1 i) I\'
.-1
or
(3.8:17)
(3.8:19)
(3.8:20)
equally spaced in the interval I so that the first abscissa is a and the
last is b. The sequence 3.8:20 is called the polynomial interpolation
sequence for f(x) in the interval 1. This sequence is analogous to the
3.8. POLYNOMIAL THROUGH n + 1 EQUALLY SPACED POINTS 113
0
-2
-I 4
2 -8
2 -4 16
-2 8
3 -I 4 -16
2 -8
4 -4
-2
5 -I
-3 -0.2000
-0.1333
-2 -0.3333 -0.5334
-0.6667 3.2001
-I -1.0000 2.6667 -8.5335
2.0000 -5.3334
0 1.0000 -2.6667 8.5335
-0.6667 3.2001
0.3333 0.5334 -3.6573
-0.1333 -0.4572
2 0.2000 0.0762
-0.0571
3 0.1429
3.8. POLYNOMIAL THROUGH n + 1 EQUALLY SPACED POINTS 115
-4 0.0588
0.0412
-3 0.1000 0.0588
0.1000 0.1412
-2 0.2000 0.2000 -0.1412
0.3000 0.0000 -1.0588
-I 0.5000 0.2000 -1.2000
0.5000 -1.2000 3.6000
0 1.0000 -1.0000 2.4000
-0.5000 1.2000 -3.6000
I 0.5000 0.2000 -1.2000
-0.3000 0.0000 1.0588
2 0.2000 0.2000 -0.1412
-0.1000 0.1412
3 0.1000 0.0588
-0.0412
4 0.0588
-4 -1.5874
0.1452
-3 -1.4422 0.0371
0.1823 0.0405
-2 -1.2599 0.0776 0.6220
0.2599 0.6625 -2.0246
-I -1.0000 0.7401 -1.0426
1.0000 -0.740\ 1.4026
0 0.0000 0.0000 0.0000
1.0000 -0.7401 1.4026
1.0000 -0.7401 1.4026
0.2599 0.6625 -2.0246
2 1.2599 -0.0776 -0.6220
0.1823 0.0405
3 1.4422 -0.0371
0.1452
4 1.5874
116 3. THE APPROXIMATING POLYNOMIAL; APPROXIMATION IN AN INTERVAL
1.0 2.718
0.635
1.1 3.353 0.233
0.868 0.097
1.2 4.221 0.330 0.055
1.198 0.152 0.020
1.3 5.419 0.482 0.075 0.028
1.680 0.227 0.048 0.001
1.4 7.099 0.709 0.123 0.029
2.389 0.350 0.077 0.019
1.5 9.488 1.059 0.200 0.048
3.448 0.550 0.125 0.034
1.6 12.936 1.609 0.325 0.082
5.057 0.875 0.207 0.081
1.7 17.993 2.484 0.532 0.163
7.541 1.407 0.370 0.095
1.8 25.534 3.891 0.902 0.258
11.432 2.309 0.628 0.235
1.9 36.966 6.200 1.530 0.493
17.632 3.839 1.121 0.390
2.0 54.598 10.039 2.651 0.883
27.671 6.490 2.004 0.770
2.1 82.269 16.529 4.655 1.653
44.200 11.145 3.657 1.450
2.2 126.469 27.674 8.312 3.103
71.874 19.457 6.760
2.3 198.343 47.131 15.072
119.005 34.529
2.4 317.348 81.660
200.665
2.5 518.013
EXERCISE 3.8
t. Find, from a table of square roots or otherwise, Vx correct to four decimal places for
x = 400, 402, 404, 406, 408, 410. Find, by interpolation, V401, v405.2, V409.25.
Estimate the errors of the approximations and determine the actual errors.
2. Copy the values of tan x from a five-place table for x = 20, 25, 30, 35, 40,
45,50,55,60.
a. Use an appropriate finite difference formula and as many of the above values as
are necessary to find tan 21 to five decimal places.
b. Find tan 42" by use of three different formulas.
3.9. EXTRAPOLATION 117
3. Use appropriate finite difference formulas and as many entries as are necessary from
the corresponding tables below to find the required values as precisely as possible.
a. Find lOOe-e.oz, lOOe- B.33 , lOOe-B.U6.
b. Find the values of y for x = 1.371, 1.403, 1.468, 1.4296.
c. Find the values of y for x = O.oI 1,0.019, 0.028, 0.0193, 0.0117,0.0284,0.02015.
d. Find the values of 1= 2/vwf:e-t"dtforx = 0.13,0.41,0.92,0.137,0.149,
0.925,0.1371,0.4192,0.9258.
e. Find fo{2.015), fo{2.381), fo{2.407), fo{2.926); ].(2.115), J,(2.507), J,(2.604),
J,(2.834).
a b c d e
6.0 0.2479 1.37 4.9131 0.0100 0.819544 0 0.00000 2.0 0.2239 0.5767
6.1 0.2243 1.38 5.1774 0.0125 0.780009 0.1 0.11246 2.2 0.1104 0.5560
6.2 0.2029 1.39 5.4707 0.0150 0.742470 0.2 0.22270 2.4 0.0025 0.5202
6.3 0.1836 1.40 5.7979 O.oI 75 0.706825 0.3 0.32863 2.6 -0.0968 0.,4708
6.4 0.1662 1.41 6.1654 0.0200 0.672971 0.4 0.42839 2.8 -0.1850 0.4097
6.5 0.1503 1.42 6.5811 0.0225 0.640816 0.5 0.52050 3.0 -0.2601 0.3391
1.43 7.0555 0.0250 0.610271 0.6 0.60386
1.44 7.6018 0.0275 0.581251 0.7 0.67780
1.45 8.2381 0.0300 0.553676 0.8 0.74210
1.46 8.9886 0.9 0.79691
1.47 9.8874 1.0 0.84270
4a. Estimate the error due to linear interpolation in the several parts of example 3.
b. How can one determine if linear interpolation is adequate for a given table?
5. Where possible, do example 3 using Lagrange coefficient tables.
6. Derive formulas 3.8; 17-19.
EXAMPLE 1. Compute sinh 1.32 from the difference table on page 105.
We use formula 3.8:7; we have x' = 1.32, xo = 1.50, h = 0.1,
u = -1.8, also m
= -1.8, = 2.52, m = -3.192, m = 3.8304, m
m = -4.443264. Hence
EXERCISE 3.9
Extrapolate for the values below by using appropriate finite difference formulas and the
tables from the corresponding examples of Exercise 3.8. Estimate the error in each case
and, where possible, determine the actual error.
1
- "8 = -0.12500 00000
3
2 0.02343 75000
128
5
3 - - = -0.0048828125
1024
35
4 0.0010681152
32768
63
5 - 262144 = -0.0002403259
231
6 0.00005 50747
4194304
120 3. THE APPROXIMATING POLYNOMIAL; APPROXIMATION IN AN INTERVAL
All the fractions and the first three decimals are exact, the last three
decimals are rounded-off numbers.
Although, as we have remarked above, the problem of subtabulation
may be considered solved, another method of attack is far more expedi-
tious when a great many new entries are to be added to a table. We use
small letters, Xi' Yi = !(Xi)' to represent the entries in the original
table and capital letters, Xi' Y i = !(Xi ), to represent the entries in
the enlarged table. Specifically, we fix on some particular argument to
be called Xo and put
Xl = Xo + h-q = Xo + H,
X2 = Xo + -2hq = Xo + 2H,
(3.10:4)
m
X i=XO+-=xo+'H,
q
so that
(3.10:5)
and
with Yo , Llyo , etc.; suppose that (for some fixed n) the nth-order diffe-
rences are more or less constant (at least for a certain range). We then
solve for LI Yo, Ll2Yo , Llsyo , ... , in terms of Yo, Llyo, Ll2yo , .... Note
carefully that LI Yo, Ll2Yo , ... , refer to differences formed from the
enlarged table whereas Llyo, Ll2yo, ... , refer to differences formed from
the original table. We have, using formula 3.8: 13, and writing Q for l/q,
to obtain
or
r = 1,2, ... , n.
We use the relations 3.10:7 as a check not only for ordinary arithmetic
mistakes but for errors due to rounding-off, computation, etc.; as soon
as there is a discrepancy which may affect the precision of the desired
results, a new set of differences must be computed. Because of the
piling up of computational errors, it is usually advisable to use several
decimal places more in the actual calculations than are required in the
final entries.
As an illustration of the method of subtabulation, we extend that
portion of the table of square roots which begins:
x y = vi
300 17.3205081
301 17.3493516
302 17.3781472
303 17.4068952
304 17.4355958
305 17.4642492
by inserting the square roots of 300.1, 300.2, ... ; we desire the answers
correct to five decimal places. We carry out the subtabulation by a
two-step process, first, we subtabulate for the square roots of 300.2,
300.4, ... , and then we will find the square roots of the remaining
numbers.
The difference table determined by these values is:
x y Ay Aly A3y
300 17.3205081
288435
301 17.3493516 -479
287956 3
302 17.3781472 -476
287480 2
303 17.4068952 -474
287006 2
304 17.4355958 -472
286534
305 17.4642492
3.10. SUBTABULATION 123
(~) =
1
"5 0.2, ef)= - 25
3
=-0.12,
(~) = -
2
25= -0.08, ef)= 8
125
0.064,
(~) = -=
6
125
0.048, ef)= 7
125 = 0.056;
We then determine the square roots of 300.2, 300.4, ... , from the
difference table:
300.0 17.3205081
57725
300.2 17.3262806 -19
57706
300.4 17.3320512 -19
57687
300.6 17.3378199 -19
57668
300.8 17.3435867 -19
57649
301.0 17.3493516 -19
57630
301.2 17.3551146 -19
57611
301.4 17.3608757 -19
57592
301.6 17.3666349 -19
57573
301.8 17.3723922 -19
57554
302.0 17.3781476
EXERCISE ].10
1. Expand the following table to include the cube roots of 150.1, 150.2, ,154.9,
correct to five decimal places.
150 5.313293
151 5.325074
152 5.336803
153 5.348481
154 5.360108
155 5.371685
2. Expand the following table to include the reciprocals of all integers between 100 and
150 correct to five decimal places.
n lIn
100 0.0100000
105 0.0095238
110 0.0090909
115 0.0086957
120 0.0083333
125 0.0080000
130 0.0076923
135 0.0074074
140 0.0071429
145 0.0068966
150 0.0066667
]. Expand the following table to include values of the sine function at intervals of ten
minutes; write answers correct to five decimal places.
x sinx
0 0.0000000
5 0.0871557
10 0.1736482
15 0.2588190
20 0.3420201
25 0.4226183
30 0.5000000
35 0.5735764
40 0.6427876
45 0.7071068
126 3. THE APPROXIMATING POLYNOMIAL; APPROXIMATION IN AN INTERVAL
(3.11:1) y = f(x)
by a function
(3.11:2) y = a(x)
EXAMPLE 1. Approximate
(3.11:5)
(3.11 :7)
We find
EXAMPLE 3. Approximate
1
C2(x) = 48172 (15 - 2172 - 16 cos 217(X - !) + cos 41T(x - !.
It appears that the approximation is good from about x = ! to about
x = ! in the period from 0 to 1.
Questions similar to the ones asked in the sections on polynomial
approximation and power series can be raised here too. Is it possible
to find a function of type 3.11:3 with n sufficiently large so that it will
approximate a given periodic function to within a preassigned degree
of precision for all (real) values of x? If n is allowed to tend to infinity,
under what circumstances will the resulting infinite series converge?
What periodic functions can be represented exactly by such infinite
series? These questions will not be answered here; they lead into the
domain of Fourier series and the interested reader is referred to the
texts in that subject for further study.
(3.11:9a)
3.11. NONPOL YNOMIAL APPROXIMATION 129
V3e - 2elvs + 1
Q o= = 1.302
v3-1
2elv's - e - 1
QI = = 1.416
v3-1
= 1 - V3e - 2e + 1 = -0.302.
1vs
bi
v3-1
Hence
CI(x) = 1.302 + 1.416 sin x - 0.302 cos x
is the required equation. Its graph and the graph of y = es1nz should
be drawn on the same set of axes by the reader.
The diagram indicates what we might have expected from the choice
of points, the approximation is good from x = 0 to x = 7r/2 (in the
period interval from 0 to 27r) but not good in the rest of the interval.
To secure a better over-all approximation, we take five points scattered
from x = 0 to x = 27r as in
(3.11:10)
so that the graph of this equation passes through the five points
Its graph and the graph of y = es1nz indicate that C 2(x) is a good
approximation to y = es!nz for all values of x.
It might be well to remark that because of the periodicity of the
trigonometric functions, we are now more likely to run into a system
of inconsistent linear equations (in the a's and b's) than we were in
polynomial approximation. For example, no curve whose equation is of
130 3. THE APPROXIMATING POLYNOMIAL; APPROXIMATION IN AN INTERVAL
(3.11:12) y = lx
at the origin.
(It may seem strange to require an approximation to the simple
linear function y = lx by the relatively complicated function 3.11: 11.
The justification is found, as we stated previously, in the use of electrical
machines where sinusoidal curves are easier to obtain than straight
lines.) We impose the conditions
y'(O) = A~(O),
whence
y = ~ (45 sin x - 9 sin 2x + sin 3x).
A diagram shows that the approximation is good from x = -17/3 to
x = 17/3.
EXAMPLE 8. Approximate
(3.11:13) y = f(x) = (x 2 - 1)10
by an exponential function of type
(3.11:14) y = a(x) = be'"
at x = 2, where band c are constants.
Since the two constants band c are to be determined, we impose
the conditions a(2) = f(2), a'(2) = 1'(2), or
be2 = 310 = 59,049,
bee2 = 40 . 39 = 787,320.
Solving for ~ and c, we find the required equation to be
y = 1.5489 . 10-7 e'0"'/3.
The table below shows some comparative values of f(x) and a(x) for
values close to x = 2:
EXERCISE 3.11
is periodic of period 2. Approximate the function in the interval [0. 2] by a function of type
3.11:3 for each of the eight combinations of nand m in the range O. 1. 2.
omitting n = m = O. choosing. for each case. an appropriate number of points in the
interval.
b. Graph the given function and each of the answers.
6a. Approximate y = eC08Z in one period interval by a function of type 3.11:3 for each
combination of nand m such that n + m = 4. using five points whose coordinates
satisfy the given equation.
b. Graph the function and each of the answers.
7. Determine a function type axe"" which coincides with xl at x = 3 and 5. What are
the errors at x = 2. 4. 6 ?
8. Determine a function of type aJ! which coincides with x! at x = 3 and 5. What are
the errors at x = 2. 4. 6 ?
9. Let (xo Yo). (Xl. Yl) ..... (X n Yn) be a set of n + 1 points with distinct abscissas;
let a(x) be a function such that a(x_) is defined. i = O. 1..... n. and a(x_) #- a(x/) fori #- j.
a. The function
[a(x) - a(xl)] [a(x) - a(xs)] ... [a(x) - a(xn)]
(3.11:15) y= ~
[a(xo) - a(xl)] [a(xo) - a(x.)] ... [a(xo) - a(x n )]
[a(x) - a(xo)] [a(x) - a(xa)] ... [a(x) - a(xn)]
+ [a(xl) - a(xo)] [a(xl) - a(x.)] .. , [a(xl) - a(xn )] ~
+ ................................. .
[a(x) - a(xo)] [a(x) - a(xl)] ... [a(x) - a(xn_l)]
+ [a(x n) - a(xo)] [a(x n ) - a(xl)] ... [a(x n) - a(xn_l)]
~
is of the form
(3.11:16)
and is satisfied by the coordinates of the n + 1 points.
3.12. ADDITIONAL METHODS OF INTERPOLATION 133
The function
(3.11:17) Y = (Xjo> + (XjOXjl> [a(x) - a(xjo)]
+ (XjOXjlXjl> [a(x) - a(xjo)] [a(x) - a(xjl)]
+ .............................. .
+ (XjO
... Xj > [a (x) - a(xj \] ... [a(x)
ne'
- a(xj
n-l
)]
is of the form 3.11: 16 and is satisfied by the coordinates of the given n + 1 points.
c. Compare the functions 3.11:17 determined by various permutations of the
subscripts with the function 3.11:15.
10. Find the functions 3.11:15 and 3.11:17 for the following functions and points:
a. a(x) = e"; (0, 2), (1, 3), (2, - 2).
b. a(x) = e"1; (I, I), (2,10), (3,100).
c. a(x) = x + sin x; (-1, I), (0, I), (2, 3).
d. a(x) = cosx; (-1,2), (0,0), (2,4), (3,0).
e. a(x) = Xl; (-3,1), (-1,0), (1,4), (5, -1).
that is, the logarithm of sin 8 is equal to the logarithm of the number
of seconds in 8 plus the S number for that angle. A full explanation of
the use of these tables can usually be found in the trigonometry texts.
Again, suppose that we are interpolating for hyperbolic sines and a
table of hyperbolic cosines is available, as it usually is since the two
functions are ordinarily tabulated together. It is well known that
+ 0.00040 (t +
4
1) '
or
2t 4 + 62t 3 + 1813t 2 + 37623t - 37314 = o.
Various methods of solving this equation will be developed in the suc-
ceeding chapters. It turns out that t = 0.947, whence from X = X_I + th,
sinh-l 4.00000 = 2.0947. The result is correct as far as it goefl
Chapter 4
O~+---------~----------~------------L3X
-I
-2
FIG. 4.2:f1.
4.2. GRAPHICAL METHODS 139
The function is defined in the real domain only for positive values
of x; the graph of y = Xl - 3.6 loglo x - 2.7 for x between 0 and 3 is
shown in Fig. 4.2:fl. It appears that there are two roots, one between
0.1 and 0.2 and the other between 1.9 and 2.0. If the roots are desired
y y
1.0 0.25
-010
FIG. 4.2:f2.
more precisely, we draw the graphs for the ranges 0.1 ::::;; x ::::;; 0.2,
1.9 ::::;; x ::::;; 2, on a larger scale. See Fig. 4.2:f2. The roots appear to be
about 0.182 and 1.93. If the roots are wanted to yet more decimal
places, the relevant portions of the graph are drawn on a still larger
scale. See Fig. 4.2:f3. At this stage, the graphs differ from straight
lines by so little that it is sufficient to plot the points representing the
function at the end points of the interval and join the endpoints by
a line segment. Appropriate scales should be used throughout. The
roots, from Fig. 4.2:f3, are approximately 0.1817 and 1.9310.
Alternate method. It may be more convenient in some cases to
y
y 0.03
0.02
0.02
0.01
0 It
-0.01
FIG. 4.2:f3.
140 4. GEOMETRIC METHODS
8
7
6
5
4
3 ",,,,.""
.,--
--y=x 2
2 /' '" ----y = 3.6 log lOX + 2.7
I
o1 ,"
--~~~--~----~2~----~3-------x
-I
-2
FIG. 4.2:f4.
y
0.2
0.12
, ,
0.16 .... 0.20 It
-0.2
,,
-0.4
,,/
-0.6
,"
-08 ,, "
-1.0
FIG. 4.2:f5.
4.3. CONSTRUCTION OF SCALES AND RULES 141
y y
0.10 3.770
0.08
0.06
0.04
,,
0.02
0
-0.02
FIG. 4.2:f6.
EXERCISE 4.2
Find, graphically, the real roots of the following equations, correct to the indicated
number of decimal places.
1. x 3 - 4Xl - X - 3 = 0, (3 dp).
2. Xi - 3x - I = 0, (3 dp).
J. 2x - v;+4 = 0, (3 dp).
I
4. e- Z +3 - x - - = 0,
x
(2 dp).
5. 2z - Xl = 0, (3 dp).
6. x cos x = 2 + 2x - Xl, (3 dp).
7. r - 10 cos x = 0, (3 dp. Find all positive roots and the three
largest negative roots).
10. loglo(1 + x) = arcsin v' I - Xl, (2 dp. Find all positive roots and the three
largest negative roots).
A scale is a curve, called the carrier curve, usually but not necessarily
a straight line or a circular arc to whose points numbers are attached.
The number attached to or associated with a point is called the coordinate
of the point; the totality of such numbers is called the coordinate system
of the scale. A rule is a scale or a set of scales used in conjunction for
measuring or calculating purposes; however, usage is not uniform in
this respect and the terms "scale" and "rule" are often used inter-
changeably. Certain points of a scale or rule are distinguished by dots,
strokes, or other means; such points are called marks. Only the marks
of a scale or rule will have their coordinates explicitly indicated, but
not every mark need have its coordinate actually shown. Those marks
that do have their coordinates explicitly shown are called the numbered
marks of the scale or rule.
A coordinate system on a scale or rule is frequently established on a
curve by use of distance. Let 0 be a fixed point on a curve on which
a scale is to be constructed and let a convenient but arbitrary unit of
distance be chosen. We suppose that the curve is well behaved so that
distance can be measured along it from 0 and that the usual conventions
are observed with regard to algebraic signs. If s stands for the distance
measured along the curve from 0 to a point P whose coordinate is x,
the coordinate system of the scale is determined by an equation of the
form
(4.3:1) s = f(x),
(4.3:2) s = a + dx,
where a and d are given numbers. The linear scale is then a curve
graduated by equidistant marks whose coordinates form an arithmetic
progression. Some examples are shown in Fig. 4.3:1. Familiar rules
based on the linear scale are the common foot rules, thermometers,
barometers, clocks, and the like.
4.3. CONSTRUCTION OF SCALES AND RULES 143
o 2 4 5 6 7 8 9 10 II 12
-12 -8 -4 0 4
I I I I I I I I I
6.4 6.6 6.8 7.0 7.2 74
II II I I I I II II I I I I
n ~
2345
-2 lOI 2 o 6
-I
-3 3 -2 7
FIG. 4.3:f1.
s,1-
If
(b)
u
-2 0 2 2.5
(e) x1,,1 I II I I I I
~
u
s'log,olf
I 2 3 4 5 6 7 8 9 10 15 20
(d) ~A~-L~~I~'~'~lIwl~-LI~,~I~,~I~,~Ilul~du,~I~~,uul~lIu'ud~~ ..
u
FIG. 4.3:f2.
144 4. GEOMETRIC METHODS
(4.3:3)
(4.3:4) s = -x1
is shown in Fig. 4.3:f2b together with the unit distance. Note that no
point on the scale has the coordinate 0, that is, there is no zero point,
and the origin has no coordinate.
We show next in Fig. 4.3:f2c the scale determined by the function
(4.3:5) s = e"'.
This time there is a point whose coordinate is zero, but the zero point
is not the origin.
As the last example of a scale on a line, we picture in Fig. 4.3:f2d the
one defined by
(4.3:6)
In all of these illustrations the unit segment was placed so that its
left end coincided with the origin of the scale.
A scale is frequently named after its defining function; thus, we
refer to the scales in Fig. 4.3:f2 as the square scale, the reciprocal
scale, the exponential scale, and the logarithmic scale, respectively.
Scales not on a straight line are often constructed by the use of
parametric equations and generalized coordinate systems. Let XX' and
YY' be two distinct lines intersecting in a point 0; the lines are called
the x- and y-axes, respectively. The lines are usually but not necessarily
chosen perpendicular to each other. Establish an x-scale on the x-axis
and a y-scale on the y-axis using the point 0 as the origin in each case;
the scales are usually but again not necessarily chosen as linear scales
but each of the defining functions is to be so chosen that a given point
of either scale has at most one coordinate. Let P be an arbitrary point
in the plane, let A be the point on the x-axis such that PA is parallel
to the y-axis and B the point on the y-axis such that PB is parallel to
4.3. CONSTRUCTION OF SCALES AND RULES 145
(4.3:7)
x = /(t),
y = g(t),
FIG. 4.3:f3.
146 4. GEOMETRIC METHODS
If we take
x = t 2,
Y = it 3,
we get the scale on the carrier curve C shown in Fig. 4.3:f3. If we take
x = t - 2,
Y = 51og1ot,
we get the scale on the carrier curve C shown in Fig. 4.3:f4.
y
10
II' -5 15 II
-5
y'
FIG. 4.3:f4.
y
I
10
\~
o
II'~-+~~+-----~--~--~~~~~~~~II
0.5 i 0.7 :0.9 I 2 3 4 5 6 7 8910 15
0.6 0.8
y'
FIG. 4.3:f5.
EXERCISE 147
EXERCISE 4.3
Construct scales on straight lines determined by the functions given in examples 1-10
for the indicated ranges of the variables. State or clearly mark the unit of distance in
each case.
1.xl -3x+l, -5'" x'"
5.
2. 1/(x + 1), 0", x '" 100.
3. tan lx, - ../2 '" x '" ../2.
4. ek ,
O"'x'" 1.
5. loglo x, 0.5 '" x '" 1.
6. loglo x, 1 '" x '" 10,000.
7. loglo loglo x, 10 '" x '" 10,000.
8. sinh x, -2'" x '" 2.
9. 2.30pl.I, 15", P '" 25.
x ..
10. -sin-, -2.0 '" x '" 0.1.
.. x
Construct the scales determined by the following pairs of parametric equations for the
indicated ranges. Use ordinary Cartesian coordinates with the same scales on the x- and
y-axes.
11. x = 3t, Y = 1 - t; -10", t '" 10.
12. x = Vt+1, y = 5'; 0", t '" 2.
13. x = 2 cos w, y = 3 sin 2w; 0", w '" 2.
1 u
14. x = v'~II-+I' y = -v'' ' 'u=I=+=I-= -20", u '" 20.
Let the x- and y-axes intersect to form the given angles; scale the axes by use of the given
functions with the intersection point as the common origin and the given relation between
the unit distances, u and v, on the x- and y-axes, respectively; then construct the scales
determined by the parametric equations for the indicated ranges.
1.f8 4. GEOMETR'C METHODS
(4.4:2) x = cp(y),
(4.4:3) y = t/J(x).
70 90
I 2 3 47 8 9 105 6 20 30 40 50 60 : 80; 100
"':1""""'1""""'1'
y:
o
'I r 1,1,1'1 '1""""'1""'1"'1'
I i I I01 I I
0.1 02 03 0.4 05 0.6 0.7 0.8 0.9 1.0 1.1
1,'01'1,1.1
r
1.2 1.3 14 1.5 1.6 1.7 1.8 1.9 2.0
I I I I I \
FIG. 4.4:1.
4.4. STATIONARY SCALES 149
FIG. 4.4:f2.
FIG. 4.4:f3.
10,000
9000 /
8000 /
7000
/
/
~
6000
- -
~
.. 5000
/ v
~
"
> 4000
/ f..-- f..--
3000 ~V
V
2000
/
1000 /
0
V 2 3 4 5 6 7 8 9 10
Time (seconds)
FIG. 4.4:f4.
150 4. GEOMETRIC METHODS
EXERCISE 4.4
t. Construct a double scale on a horizontal line by graduating the "upper" half using
the first function and graduating the "lower" half using the second function. Use the same
origin and unit of distance for each of the two scales; label each half of the line and
indicate the unit of distance. A range is given for one variable in each case; choose a range
for the other variable so that the two associated scales are roughly the same length.
a. $ = x, $' = y3; -10 < x < 10.
b. $ = sin x, $' = cos y; 0< x < fr.
c. Tl = P + 0,
TI = 2p + pO.I,
Ta = Tl/(Tl + T.); 20 < p < 300.
4. Construct a double scale showing the length of a circular arc and its chord in a
circle of radius 100 for angles ranging from 0 to 90 at intervals of one degree.
5. Let h be the measure in feet of the sag of a 50-ft flexible chain which is suspended at
points A and B at the same distance above the ground. Construct a scale showing corre-
sponding values of h and the distance AB as AB varies from 0 to 50 ft if the chain forms an
arc of a parabola.
4.5. SLIDING SCALES 151
0 P, p.
A:
, Po
, , ,
B: I I I
0' 0, O.
FIG. 4.5:1.
or
Xl X2
(4.5:7)
YI Y2
That is, for any setting of the scale B against the scale A, coordinates
of coincident points are in a constant ratio. (The value of the ratio
depends, of course, on the setting.)
Also, Eq. 4.5:6 yields
log X 2 - log Xo = logY2,
log X2 = logY2'
Xl
X2
(4.5:8) -=Y2'
Xo
(4.5:9)
Equations 4.5:7-9 imply that two log scales constructed so that one
can slide against the other can be used to find the fourth term of a
proportion when we are given three of them; and in particular, we can
find the quotient and product of two numbers. Thus, by setting the
scales as in Fig. 4.5:f2, we find that
1.6 2 4 6.5
-1- = 1.25 = 2.5 = 4.05 = etc.
4.5. SLIDING SCALES 153
2 3 4 5 6 7
"'I!!.!""I""II)'.!'''''! I, I
iii' Iii i I Iii i i Ii iii ,Iiii,""j ,
2 3 4
FIG. 4.5:f2.
~:~ =
6
T.6 = 3.75, 5.94, etc.,
and
1.6 X 3 = 4.8, 1.6 X 5.1 = 8.16, etc.
, 1
s =-.
y
or
etc.
FIG. 4.5:f3.
154 4. GEOMETRIC METHODS
EXERCISE 4.5
1. Construct two sliding scales F and T by use of the distance functions s = log fl,
s' = log t, respectively, for the ranges I < f < 22, 0.001 < t < 5. (These scales, if
marked with the f-numbers and shutter speeds of a camera, will give, for any particular
setting, the equivalent shutter speeds for the various f-numbers.)
2. Construct a scale A and a sliding scale B using the respective equations s = x and
s' = (9/IO)y. If the zero mark 0' of the B scale falls between the marks m and m + I of the
A scale, and the mark k of the B scale coincides with the mark m + k of the A scale,
o < k < 10, then 0' is k-tenths of the way from m to m + I. Hence explain the con-
struction and use of a vernier scale.
1. The stationary scale of a transit is graduated to show quarter degrees. Show how
to construct a sliding vernier scale to take readings to the nearest minute.
(4.6:3)
4.6. NOMOGRAPHY 155
D b c -2 -2 -2
Y If r y If r
10
9
8 4000
3000
2000
6
10
5 9
8
7
4 6
5
4
3
3
FIG. 4.6:f4.
4.6. NOMOGRAPHY 157
Let us suppose that the volumes to be computed are for radii that
range from 5 to 15 cm and for altitudes that run from 3 to 500 cm.
Examination of Fig. 4.6:f4 shows that the nomogram is, on the one
hand, not extensive enough, and, on the other hand, contains much that
is useless. It is then desirable to reconstruct the nomogram to acco-
modate volumes for the desired ranges of rand h; for greater precision,
it is advisable to make the rand h scales as large as possible and approxi-
mately of the same lengths. This usually can be done by suitable choice
of r 1 and r 2 We go back to Eq.4.6:3, multiply through by r 1 + r 2 ,
and put
(rl + r 2 ) cp(V) = log V,
rJ(r) = 2 log r,
rlF(h) = 0.497 + log h.
Hence
/(r) = 21;: r ,
F(h) = 0.497 + log h .
r1
2 0.954
/(15) - /(5) = -r (log 15 - log 5) = -r - ;
2 2
r1 2.222
r2 = 0.954
For our purposes, it is sufficient and convenient to take integral values
for r 1 and r 2; the values r 1 = 2, r 2 = I, will do here. Using these
values, we find
cp(V) = 1log V,
/(r) = 210g r,
F(h) = ! (0.497 + log h) = 0.249 + ! log h.
We choose the origins so that the line joining the point with coordinate
158 4. GEOMETRIC METHODS
5 on the T-scale and the point with coordinate 3 on the h-scale is hori-
zontal. The corresponding nomogram is shown in Fig. 4.6:f5.
500
400peO
400
300p00
300
200,000
15
200
14 IOOPOO
eo.oo 150
13
60,000
50,000
12 100
40.000
80
30.000
II 70
20,000 60
10 50
40
10peO
9 8000 30
6000
8 4000 20
3000
15
2000
7
10
1000 8
800
6 6
600
500 5
400 4
300
3
V h
FIG. 4.6:f5.
cp(K) = log K,
f(P) =--
Tl + Ta Iogp,
T2
= 0.67r1 + r2.
r1
[Note that since r 1 and r 2 are positive, the coefficient of log V in F(V)
is negative, hence the coordinate of a point increases as the point
descends on the V-scale. It follows that F(200) - F(lOOO) and not
F(lOOO) - F(200) is the positive distance on the V-scale.] We find on
equating the two lengths that r 1 : r 2 = 0.67: 1.18. The values r 1 = I,
r2 = 2, which yield
cp(K) =
log K,
f(P) = l.S log P,
F(V) = -2.88 log V,
will be adequate for our purposes. The nomogram, not fully graduated,
is shown in Fig. 4.6:f6.
200
0.5
75 0.4
250
70
0.3
60
300
50 0.2
40 350
0.1
30 400
0.09
0.08
25 0.07
0.06
20 0.05 500
0.04
15
0.03 600
0.02 700
10
800
0.01
0.009 900
0.008
0.007 1000
5
0.006
p K V
FIG. 4.6:f6.
160 4. GEOMETRIC METHODS
EXERCISE 4.6
(4.7:2)
x = ft(u), x = f2(V), x = f3(W),
y = gl(U), y = g2(V), y = g3(W),
coordinates u' , v', w'. It is well known that P, Q, and R will be collinear
if and only if
(4.7:3)
(4.7:4)
The entire theory of three scaled nomograms has its foundation in this
determinant equation.
We show how the parametric Eqs.4.7:2 and the preceding deter-
minant equation lead to nomograms by several examples.
EXAMPLE I. Take
x = -1, x = 0, x = 1,
y = u, y = v, y=w.
-1 u 11
1 o v 1 = 0,
1 w 1
or
v = !(u + w).
We recognize this nomogram as the one previously given in Fig. 4.6:f2.
EXAMPLE 2. Take
x = l/u, x = 0, x = -l/w,
y = l/u2 , y = -l/v, y = o.
Then Eq. 4.7:4 becomes
l/u l/u2 1 I
I o -l/v 1 = 0,
-l/w 0 1
or
1 1 1
-+-+-=0.
vw uv u2w
162 4. GEOMETRIC METHODS
(4.7:5) ul + uw + v = o.
The first pair of parametric equations determines a scale on a parabola,
the second determines a scale on the y-axis, the third a scale on the
x-axis. The nomogram is shown in Fig. 4.7:1, where the coordinates
-0.5
u
u
W~--r---'--.-r-r,-~~~9n-'-.-r-r-'r---.--'W
0.5 0.6 -0.6 -0.5
2
1.5
1.2
1.0
0.8
0.6
0.5
FIG. 4. 7:t I.
on the vertical and horizontal scales are the v and w coordinates, respec-
tively. A line joining the point with scale coordinate w to the point
with scale coordinate v will intersect the parabola in points whose u
coordinates satisfy Eq.4.7:5. We have here, then, a nomogram for the
solution of a quadratic equation (real roots only).
4.7. NOMOGRAPHY, GENERAL THEORY 163
EXAMPLE 3. Take
x = -rl' x = r2 , X= 0,
y = F(u), y = G(V), y = H(w),
l
- r1 F(u)
r2 G(v)
II
I = 0,
or
H(w) I
Except for the change in notation, this is exactly the functional relation
of the nomogram developed at the beginning of Section 4.6; compare
Eq.4.6:3.
The problem of interest and importance, however, is not to discover
what nomogram will arise from some arbitrary choice of the functions
in the parametric equations 4.7:2 but to determine what these functions
should be to yield a desired nomogram. In the application of nomography
in engineering and elsewhere, we always begin with some equation we
wish to solve and our job is to find a suitable nomogram, that is, to
determine suitable functions for Eq. 4.7:2.
We consider the determinant
where the functions in the first (second, third) row are constants or
functions of u (v, w) only, and the value of the determinant is not
identically equal to zero. By adding suitable multiples of the first
and second columns to the third, we can arrange to obtain a determinant
whose elements in the third column are not identically zero; if we then
divide each element in the first (second, third) row by the last element
in that row, and then equate the result to zero, we obtain Eq.4.7:4.
It is possible, of course, to transform the determinant 4.7:7 into
the left member of 4.7:4 in many ways. For example, the value of the
determinant
164 4. GEOMETRIC METHODS
-5 -4 -3 -2 -I
w-~~~~~~~~~~w
5 2 3 7
-5 -4 2 3 4 5 6 7
FIG. 4.7:f2.
4.7. NOMOGRAPHY. GENERAL THEORY 165
(4.7:11) 9'(u, v, w) = 0
(4.7:14)
F 2(v) = a;
(4.7:15)
G1(u) = f(u),
(4.7:16)
H 1(u) = b =F o.
166 4. GEOMETRIC METHODS
(4.7:18)
(4.7:19)
(4.7:20)
whence
bF3(w) _ h(w)
CF3(W) - aH3(w) -
(4.7:21)
abG3(w) _ k(w)
CF3(W) - aH3(W) - .
(4.7:22)
then
adh(w)
F3(W) = ch(w) - b '
(4.7:23)
dk(w)
G3(w) = - ch(w) - b .
o f(u) b
a g(v) c = O.
(4.7:24)
adh(w) dk(w) d
ch(w) - b ch(w) - b
4.7. NOMOGRAPHY. GENERAL THEORY 167
0
a
,,-
/(u)
g(v)
(4.7:25)
c c
= 0;
ah(w) k(w)
ch(w) - b ch(w) - b
if c = 0, 4.7:24 becomes
o /(u) b
(4.7:26)
a g(v) o = o.
ah(w) k(w)
- - b - -b-
If we add the first column to the third and then divide each row by its
last element, the last equation becomes
/(u)
0 -b-
(4.7:27)
g(v)
=0.
a
ah(w) k(w)
ah(w) - b ah(w) - b
a ah(w)
x = 0, oX =-, X=
c ch(w) - b '
(4.7:28)
/(u) g(v) k(w)
Y = -b-' y = -c-' y = - ch(w) - b '
which determine the scales for the nomogram. The arbitrary but
nonzero constants a, b, and c determine the distance between the vertical
scales and the distances between units on each of the three scales;
convenience will dictate their choice in any particular problem. The
equality 4.7:27 leads to similar results.
We remark, first, that the preceding result is not at all unique and,
second, that the reader possessed with some ingenuity can frequently
circumvent the lengthy process leading to the determination of the
168 4. GEOMETRIC METHODS
functions in the equality 4.7: 10. Thus, in the preceding example, the
form of Eq. 4.7: 13 suggests the partial determinant
I -I -II
g(V)
k(w) h(w)
I/(U)
g(v)
k(w)
-I
0
h(w)
-II
0
-I
which can be transformed easily into the left member of either 4.7:25
or 4.7:27.
Chapter 5
x3 - 3x2 + 3x - 6= o.
The work is shown below.
1-3+3-6 ~
+2-2+2
1-1+1-4
+2+2
1 +I+3
+2
1 +3
1 +30+300-4000 J~
+ 7 + 259 + 3913
1 + 37 + 559 - 87
+ 7+308
1 + 44 + 867
+ 7
1 + 51
EXERCISE 5.1
(5.2:1)
(5.2:2)
(5.2:3)
172 S. ALGEBRAIC AND TRANSCENDENTAL EQUATIONS IN ONE UNKNOWN
whose roots
(5.2:4)
are related to the desired roots 5.2: I by the equalities
(5.2:5) i = 1,2, "', n.
To obtain F(x) from f(x), we note that
(5.2:8)
The right-hand member shows that (-I)n f(x) f( -x) contains only
even powers of x, hence, if we write for the moment, U = X2, then
(5.2:9)
are the roots of
(5.2:10) (-I)n f(x)f( -x) = g(u) = (u - '1 2)(U - '22) ... (u - 'n 2).
where
(5.2:14) i = 1,2, ... , n,
bo bl b. ba b, b, ba
Co CI C. Ca C, C, CI
Each Ci is the sum of the entries in the rectangle immediately above it.
The method is illustrated in:
EXAMPLE 1. Find the equation whose roots are the 8th powers of the
roots of 2x' + 2x3 - 6x 2 - 4x + 1 = O.
We rewrite the equation as x' - (-1) x3 + (- 3)X2 - 2x + 0.5 = O.
and then enter the coefficients bo = 1, bI = -1, b2 = - 3, b3 = 2,
b, = 0.5 as in the table below. It is not really necessary to divide by 2
to make the leading coefficient unity, but doing it reduces the size of the
coefficients. Then, as above, we obtain the numbers written in the line
marked (2); these are the successive coefficients (with alternating signs)
of the equation whose roots are the squares of the roots of the given
equation. The remainder of the table is filled out in a similar fashion.
The equation whose roots are the 8th powers of the roots of the original
equation is thus found to be
x' - 244x3 + 7938.37Sx2 - 17sl.687Sx + 0.00390625 = O.
and put
(5.2:16) i = I, 2, ... , n - l.
174 S. ALGEBRAIC AND TRANSCENDENTAL EQUATIONS IN ONE UNKNOWN
(I) -I -3 2 0.5
I 9 4 0.25
6 4 3
I
(2) 7 14 7 0.25
49 196 49 0.0625
-28 -98 -7
0.5
and
(S.2:18) i = 1,2, ... , n - 1.
We have
(S.2:19) 0 < I (Xi I ~ 1, i = 1, 2, ... , n - I,
and
(S.2:19a) i = 1,2, ... , n - 1.
We also recall the well known relations between the roots and the
coefficients of the Eq. 5.2:3:
"
~ Ri = RI + R2 + ... + R,. = BI ,
i-I
"
~ RiR ; = RIR2 + RIR3 + ... + R"_IR" = B 2,
i<1
(S.2:20)
5.2. THE ROOT-SQUARING METHOD 175
(5.2:21) i <j;
and then, from 5.2:20,
Bl = Rl(l + Pl*)'
B2 = R 1R 2( 1 + P2 *),
(5.2:22)
where each f3* is a sum of terms, each term being the product of one
or more f3's. Hence
(5.2:23)
Case 1. There are no equalities in 5.2: 15, and hence in 5.2: 17 and
5.2: 19. Since the coefficients in 5.2:2 are assumed real, there are, in
this case, n distinct real roots such that no root is the negative of another.
Since for every i, I (Xi I < 1, I f3i I can be made arbitrarily small for
m sufficiently large and hence each f3* and f3* * can be made arbitrarily
small for m sufficiently large. Hence, for m sufficiently large, we have,
for any preassigned degree of precision, the approximations
(5.2:24)
176 S. ALGEBRAIC AND TRANSCENDENTAL EQUATIONS IN ONE UNKNOWN
(The last is, of course, a true equality and not an approximation.) Since
the B's are known, the successive equations yield Rl , R2 , ... , Rn, in
turn. The absolute values of the roots, 1ri I, i = 1,2, ... , n, are then
calculated from 5.2:5. The algebraic signs of the roots are determined
by substitution, root location, or other means.
The equality 5.2:23 indicates that for sufficiently large m,
1 2Bk_iBk+i/Bk2 1 can be made arbitrarily small; that is, 1 2B k- i B kti 1
(I) -I -3 2 0.5
I 9 4 0.25
6 4 3
I
(2) 7 14 7 0.25
49 196 49 0.0625
-28 -98 -7
0.5
-0.12433 - 0.00027 *
*
(32) 1.78180 3.86398 111 9.41520 11 2.32831 -10
-0.00773 * *
*
(64) 3.16708 18 1.49303 31 8.86460 III 5.42103 -10
Similarly,
I '1'2 18' = B2 = 1.4930 X lO31,
logl '21 = 0.19802, and 1'21 = 1.5777;
I '1'2'a 18' = Ba = 8.8646 X lO25,
logl '3 I = 9.91834 - 10, and I '3 I = 0.8286;
I '1'2'3', 1M = B, = 5.42lO X 'lO-20,
logl " I = 9.29354 - 10, I " I = 0.1966.
178 5. ALGEBRAIC AND TRANSCENDENTAL EQUATIONS IN ONE UNKNOWN
*
(32) 2.55590618 2.214849" 7.682542 u 1.15741 5 83
6.532655" 4.905556 8' 5.902145 &6 1.33960 9 U8
f g h
* * m
* *
*
180 5. ALGEBRAIC AND TRANSCENDENTAL EQUATIONS IN ONE UNKNOWN
(5.2:26)
The entries for the table for the transformed equations are evaluated
as in Case I; this time, however, the double cross products directly
underneath Bg2, B:+l , B:+S- 1 will not become small or negligible.
We illustrate the procedure in:
appears that there are two roots with equal absolute values, then three
roots with equal (and smaller) absolute values, then a sixth root, and
finally, two more roots of equal absolute values.
Incidentally, because the number of significant figures decreases from
step to step in this example, it is necessary to start with a large number
of significant figures to get a reasonably reliable set of answers.
If we change the usual notation and call the distinct roots of the
final equation Rl , R2 , R3 , R" then the approximate equations 5.2:26
(for all eight roots, and again using equality rather than approximation
signs) become
1'1 I = R~/84 =( -+
B )1/84
= 3.165,
B )1/84
I ' 2 I = Rl/84
2
= (_3_
3B2 = 2.
994
,
B )1/84
I ' 3 I = Rl/84
3
= (_8_
B5 = 2000
.,
B )1/84
I '4 I = R!/84 = ( 2~8 = 1.414.
Substitution into the original equation will determine the signs of the
roots. Since I '21 occurs three times and both 2.994 and -2.994 appear
to be roots, the sign of the third corresponding root can be obtained
from the sum (= -1) of all the roots, or otherwise. [It may be well to
recall that if f'(x) is the derivative of f(x) with respect to x, then an
s-fold root of f(x) = 0 is an (s - 1)-fold root of f'(x) = 0.] The actual
roots of the equation are yTO, 3, -3 (a double root), 2, Y2.
Case 3. There are equalities in 5.2: 15 due to the presence of imag-
inary roots.
Multiple roots of the given equation f(x) = 0 can be detected by
finding the highest common factor of f(x) and its derivative f'(x) and
182 5. ALGEBRAIC AND TRANSCENDENTAL EQUATIONS IN ONE UNKNOWN
and it can be shown that in place of the approximation for Bf/ given
by 5.2:24, we have
(5.2:28)
(5.2:30)
In the rare cases where there are imaginary roots but all the coefficients
remain positive, they may be detected when the suspected roots are
substituted into the equation. This complication may arise if a root
Tg = U + iv is such that v is very small so that both Tg and Tg+l are
approximately equal to u.
If a pair of imaginary roots has been detected from the tabulations,
we find, as before, R 1 , , Rg - 1 Then Rg and Rg+l can be found from
5.2:30, and from them, Tg and Ta+l , using 5.2:27 or DeMoivre's theorem,
or we can proceed as in example 4. We continue in a similar fashion
until all roots have been found.
(1) 5 8 3 -3
2.5 1 6.4 1 9 9
-1.6 -3.0 48
-0.6
(2) 0.9 1 2.8 1 5.71 9
8.1 1 7.84 3.249 3 8.1
-5.6 -10.26 -0.504
0.18
(4) 2.5 1 -2.24 2.745 3 8.1
6.25 5.0176 ' 7.53503 I 6.561 3
0.01739 -15.19311 *
*
(32) 1. 77341 11 -7.63396 11 3.28627 17 1.85302 16
0.00015 -11.65581 *
*
(64) 3.14513 II -5.8280881 1.07996 I i 3.43368 80
EXERCISE 5.2
1. Find by the root-squaring method, correct to three decimal places, the roots of the
equations of example I, Exercise 5.1.
2. Find by the root-squaring method, correct to three decimal places, all the roots of
a. x' + Xl - 9x - 6x + 18 = O.
b. 9x' - 6x1 - 5x + lx + 1 = O.
c. 5x' - 16x' - 36xl + 110x + 57x - 187 = O.
3. Find by the root-squaring method, correct to three decimal places, all the roots of
the equations of example 2, Exercise 5.1.
4. Find by the root-squaring method, correct to three decimal places, all the roots of
a. lx' - 4Xl - Xl + 12x + 18 = O.
b. x' - 6x' + IOx3 + 11x - 6lx + 70 = O.
c. x' - lxl + 4x - 28x + 196 = O.
5.3. THE METHOD OF ITERATION 185
If the sequence 5.3:1 has a limit, say limn ...."" r n = r, and 9'(x) is continuous
at x = r, then
(5.3:3) r = 9'(r) ,
(5.3:6)
(5.3:9) IT - Tn I ~ IT - TO I mn.
This statement could also be derived just as 5.3:7 itself was derived
if we start with T - Tl = 91(T) - 91(TO) = (T - TO)91'(S). The right-hand
member of 5.3:9 gives a bound for the error in approximating T by Tn
We also have
(5.3:10) IT - Tn I ~ IT - Tn-l I,
that is, T' I is at least as close to the root T as T,,_1
It remains to show how a given equation to be solved,
(5.3:11) f(x) = 0,
5.3. THE METHOD OF ITERATION 187
can be put into the form 5.3:4 so that 5.3:5 or 5.3:8 holds and a root
r of f(x) = 0 can be found by iterated substitution in 9'(x). We suppose
that r is an isolated root of 5.3:11; that is, there is a neighborhood N r
of r which contains no other zero of f(x) (in the contrary case, which
we do not consider here, f(x) will have infinitely many zeros in any
neighborhood of r). Consider
(5.3:13) x = x - g(x)/(x),
(5.3:14) x = x _ I(x)
f'
and
I(x)
(5.3:15) x = x - f'(x)
f'(x) = 2x _ 3.61og e ,
x
( )_ x2 - 3.61og x - 2.7 .
9' x - x - 3.2 '
FIG. 5.3:fI.
the diagram, that the slope is positive and the curve is concave upward
in the neighborhood of the point R, the intersection of the curve with
the x-axis, whose abscissa is T. Other cases can be treated similarly.
If RoAI , RIA2 , ... , are perpendicular to the x-axis and AIRI , A2R2 , ... ,
are tangents to the curve at Al , A2 , ... , respectively, and if the abscissa
of Ro is To, then the abscissas of RI , R2 , ... , are the values TI , T2 , ... ,
respectively, given by 3.5: 15. See example 33 of Exercise 5.3.
The geometric interpretation of the iteration process determined by
5.3: 14 is similar to the preceding one. This time, the lines AIRI , A 2R2, ... ,
are not tangents but lines having a constant slope. See Fig. 5.3:f2.
Another geometric interpretation is also of considerable interest.
The problem of finding a value T to satisfy the equation x = <p(x) IS
o
RO x
FIG. 5.3:f2.
190 S. ALGEBRAIC AND TRANSCENDENTAL EQUATIONS IN ONE UNKNOWN
y=x
--~~-----------------x
FIG. S.3:f3.
EXERCISE 5.3
In examples 1-26, find all the (real) roots if there are three or fewer roots in the equation,
find the three roots of smallest absolute values if there are more than three roots; find all
roots correct to the indicated number of decimal places (dp) or significant figures (sf).
Assume all stated numbers are exact.
1. x~ + 3x - 100 = O. (S dp)
2. y;-+ 4 + 4 sin x = O. (3 dp)
3. ez(y; - 1) = 1. (3 dp)
4. ez + e- = 4.
Iz (3 dp)
5. x - Se- z + IS = O. (3 dp)
6. (1 - x) e1+IZ = 3. (3 dp)
7. SQeZ/3 - 4Sx - 1 = O. (3 dp)
8. xe l / z = 2.72. (3 dp)
9. xez/I - 3xl + 3x - 1 = O. (4 sf)
10. Xl." - S.22x - 2.01 = O. (3 dp)
19. x + -xI =
.
3 sm x. (3 dp)
n. x sinh 10 - 15 = O.
x
(3 dp)
af(b) -- bf(a)
(5.4:1) ro = f(b) -- f(a) ,
or
b--a
(5.4:2) ro = a -- f(b) __ f(a/(a).
Hf(ro) = 0, ro is the root and the process stops; if ro is in the left (right)
interval, it is regarded as a new a (b) and combined with the old b (a) or
with a new b (a) selected in the right (left) interval to yield a second
approximation. The process is continued until we have an approximation
to the root of desired precision. Since we can always contrive to enclose
the root and an approximation in an interval of arbitrarily small length,
we have a self-contained evaluation of the maximum error.
----------~r_~~~--------x
A (0, f(a))
FIG. 5.4:fI.
5.4. THE METHOD OF FALSE POSITION; THE METHOD OF CHORDS 193
xf(b) - bf(x) b- x
(5.4:3) tp(x) = f(b) _ f(x) = x - f(b) _ f(x/(x),
then for b close to the root " tp(x) is suitable for iteration. Compare
5.4:3 with 5.3: 13 and 5.3: 15. In the example just worked out, start
with b = 1.2 and '0 = I. We obtain on successive substitutions into
5.4:3, '1 = 1.14, '2 = 1.09, '3 = 1.097, '4 = 1.0955, '5 = 1.0957,
with no further change in the fourth decimal place.
194 5. ALGEBRAIC AND TRANSCENDENTAL EQUATIONS IN ONE UNKNOWN
That is, if f(a) and f(b) are of unlike sign, then the weighted average
5.6:6, where the weights are determined by 5.4:5 (so that 5.4:7 holds),
is likely to be a good approximation to a root r of f(x) = O.
The method of chords is an adaptation of the method of false position.
In some problems, it may be advantageous for computational arrange-
ment to rewrite the equation to be solved, f(x) = 0, in the form
G(x) = g(x) so that a root r of f(x) = 0 becomes the abscissa of a point
of intersection R of the graphs of y = G(x) and y = g(x). We assume
that G(x) and g(x) are single-valued and continuous in a neighborhood
of r and that G(x) - g(x) has opposite signs in suitably small left and
right neighborhoods of r. Let the chord joining A: (a, G(a and B:
y = g(x)
A'(O, g(o)
FIG. 5.4:f2.
(b, G(b meet the chord joining A': (a, g(a and B': (b, g(b in the
point R 1 See Fig. 5.4:f2. It is readily determined that the abscissa
r 1 of Rl is given by
(5.4:8) '1 = a + h,
5.4. THE METHOD OF FALSE POSITION; THE METHOD OF CHORDS 195
where
x G(x) g(x)
2 0.33 0.30
3 0.25 0.48
0.33 -0.30
h = (3 - 2) = 0.1
0.33 - 0.30 + 0.48 - 0.25
EXERCISE 5.4
2. Solve the following equations by the method of false position or by the method of
chords. Follow the directions of Exercise 5.3 .
lO(x - 2) + 5x - II = O. (3 dp)
b. (x - 1)1/3 = In 2x. (4 sf)
C. 21+1/Z - 7 cos x = O. (3 dp)
d. I sin x I - ez - 2 = O. (4 sf)
e. 5(x + I) I log x I = J. (3 dp)
each of which is close to the root r (and where ai and hi are real) such
that the absolute values of
(5.5:3)
(where ai and f3i are real) are small. Graph the three points representing
the numbers r 1 , r 2 , ra in an x~plane and the three points representing
the numbers f(r 1)'/(r2)'/(ra) in an f(x)-plane. See Fig. 5.5:fl. (We will
find it convenient to refer to the point representing a number x merely
as the point x, etc.) If r 1 , r 2 , and ra are indeed close to the root, and
if f(x) is sufficiently regular (as it usually is in practice), then the points
fer 1)' fer 2)' and fer a) will be fairly close to their origin (the zero point
of the plane) and the triangle whose vertices are rl ' r2' ra will be
approximately or roughly similar to the triangle whose vertices are
/(r1)'/(r 2), f(ra)
b
21
/3
i 21
f~ ) f(r3)
r2 2
-O~--~--~----~--~2--0 a
-2 -I 0 f(rl)
-I
x- plane -21
f(x)-plane
FIG. 5.5:fl.
f3 + m2f32 + m3f33 .
= m1f31
m1 +m2 +m3
198 s. ALGEBRAIC AND TRANSCENDENTAL EQUATIONS IN ONE UNKNOWN
This means that the origin will be the center of gravity of the triangle
whose vertices are f(r l ), f(r2),j(ra) if the vertices are weighted with the
masses ml , m 2 , ma , respectively, given by 5.5:4. Since the origin IS
the point 0 + Oi = f(r), it is reasonable to expect that the point
(5.5:5)
where
aI' = mlal + m~2 + maaa
(5.5:6)
bl ' = mlb l + m2b2 + maba ,
will be a good approximation to the root r. We can now combine r l ' with
two of the previous numbers, or with new numbers, to secure a still
better approximation. The process can be repeated over and over until
an approximation to the root is obtained with the desired degree of
precision.
We illustrate this method by using it to find the root of example 1.
We have, choosing the arguments more or less by guess, f(1.5 + %) =
0.7 - 0.2i, f(l.4 + 0.5%) = - 1.0 + O.4i, f(1.45 + 0.7%) = -0.6 + 0.4i.
Next,
1- 1.0 04 1- 06 04
-0.6 0.4 1 2 0.7 -0.2 1 2
ml = m2 = = 3'
1 0.7
-0.2 3' 1 0.7
-0.2
-1.0 0.4 -1.0 0.4
-0.6 0.4 : 1 -0.6 0.4 :1
I-1.0
-0.21
0.7
0.4 1
ma=
-0.2 = -3
1 0.7
-1.0
-0.6
0.4
0.4 :I
Hence we expect -i( 1.5 + %) + l(l.4 + 0.5%) - l( 1.45 + 0.7%) =
1.45 + 0.77i to be a good approximation to the required root. Indeed,
5.5. IMAGINARY ROOTS 199
1-00.15.25 0.16
m, ~ 1- 0.33
-0.25
-0.07
0.27
0.16
0.0065
= - 0.0256 = -0.254,
0.15 -0.07 ;I
1-0.33
0.15 -0.07
m, ~ 1- 0.33
-0.25
. 0.27
0.27
0.16
0.0174
0.0256 = 0.680,
0.15 -0.07 :I
1--0.25
0 .33 0.27
. , 1-
~ 0.33
-0.25
0.16
0.27
0.16
0.0147
0.0256 = 0.574.
0.15 -0.07 :I
The new value of r is -0.254(1.45 + O.77t) + 0.680(1.48 + 0.80t) +
0.574(1.50 + 0.90i) = 1.499 + 0.865i. The last value is a good approx-
imation to the root.
EXERCISE 5.5
Y
25
I 20
I
I
I
I
I 15
I ,,
\
\ 10
\
\ ,,
"-
"',
-15 -10 -5 10 15 20
I
, II
,I
'"
"' .... - -5
,, l "
, -10 - - - - 11 3 + 2y2 -50=0
,I
I
-15
I
I
I -20
x = '\jIso -2 x3
- log x '\j
(/so -2 xi + 1) ,
and then compute the entries in the following table:
II III IV V VI VII
x Xl
50 -
2
Xl
vm x(IV) + I log (V) (IV) - (VI)
The entries in the last column are the values of the right-hand member,
call it F(x), of the preceding equation for x = 2.7 and 2.8, respectively.
Since F(2.7) > 2.7 and F(2.8) < 2.8, the desired root is between
2.7 and 2.8. Furthermore, the slope of F(x) at any point within the
interval from 2.7 to 2.8 is approximately equal to the slope of the
chord joining the endpoints of the graph of F(x) in this interval which
is (2.69 - 2.83)/(2.8 - 2.7) = -1.4. Substitute this value in the
formula for q:>(x) given in example 30, exercise 5.3; we obtain
/SO-x3 (/SO-x3)
'\/ 2 - log x '\/ 2 + I + l.4x
x= ---------------=~--------------
2.4
II III IV V VI VII
X= - ' \ /
Iso -2 x3 (
-log l-x,\/
/ SO -2 x3 ) .
Iso - x3
z=l-x,\/ 2 '
the relevant portion of whose graph is shown in Fig. 6.1 :f2. The curve
crosses the x-axis at about x = 0.20005 and x = 3.68034 and ends
6.2. THE METHOD OF ITERATION 203
15
FIG. 6.1:f2.
EXERCISE 6.1
1. Plot the following pairs of equations and find the real solutions correct to three
decimal places .
x + 2y - 2 = 0, y8 = lxl - 3 + v'x + 2.
b. Xl - lx + yl - 8 = 0, yxl = 3.
c. y = e"/', Y = 2/(1 + x 8 ).
d. sin x + cosy = I, (x - y)1 = x.
e. e"' + e' = 5, y = 4(x3 - x).
2. Find the real solutions ofthe following sets of equations correct to two decimal places
x = y8 - 2, y = x 8 - z, Z = y8 - lx.
b. x + y = I, Xl + yl = z, x 8 + Zl = 4.
respectively. Now if
(6.2:3) x = xo , y =Yo,
(6.2:4) Y =Y1,
(6.2:5)
Y =Y2'
(6.2:8) x = T, Y = s,
that we are trying to find of Eqs. 6.2: 1. We have
and therefore
where
It follows that
Now suppose that for all points within a certain region R around the
point (T, s),
M
(6.2:12) IF., I, IFill, I G., I, I Gill < 2"' where 0 < M < 1.
The inequality 6.2: II then yields
(6.2:13) I r - Xl I + I s - Yl I ::;;; {I r - Xo I + I s - Yo I} M.
Similarly,
where a(x, y), h(x, y), e(x, y), d(x, y) are functions to be determined.
It is quite clear that the solution 6.2:8, x = r, y = s, of the original
equations 6.2: 1 will be a solution of the preceding equations 6.2: 16
provided that a(r, s), h(r, s), c(r, s), d(r, s) exist. We have
where LI(x, y) is given by 6.2: 19, they will be in forms suitable for
iteration, provided that the functions represented by capital letters
in the right-hand members of 6.2:20 exist and are bounded in the
neighborhood of the solution. In particular, if x = xo , y = Yo is a
good approximation to the solution, the preceding forms may be
replaced by
1
x = x - .1(xo ,Yo) [gl/(xo ,'vo)/(x,y) - II/(xo ,yo)g(x,y)],
(6.2:22)
y = Y + .1(xo1,Yo) [g",(xo ,Yo)f(x,y) - I",(xo ,Yo) g(x, y)].
(6.2:23)
.12
Y=Y+Lf
10
,.--....,
~ , 1
I
I
I
-10 5 10 I
----L-----~/~----~~7=~===-~-----x
I
I
I
I
I
: ",/ -5
" .... _-",.,.
-10
FIG. 6.2. I.
The other solutions can be found in the same way. Had we used
6.2:22 in place of 6.2:21 (6.2:23), it would have taken more steps to
find a particular solution, but each step would have involved less
computation.
EXERCISE 6.2
3. Find, correct to three decimal places, the real solutions of the following pairs of
simultaneous equations.
x + y2 = 7, y + x 2 = I I.
b. 4x - y2 + 6y - 33 = 0, 3x 2 - lxy - y2 - lOx + 6y + 6 = O.
C. 4x2 + y - 9 = 0, cos x + cos xy = I.
d. y2 = x 2(2 - x), If' + e",2 = 4.
(6.3:2)
(6.3:3) x' = Xl + h,
where
(6.3:4)
Xl' = 2.754,
YI' = 3.81525, Y2' = 3.81376,
Y I ' = 3.81493, Y 2' = 3.81620,
whence
3.81525 - 3.81493
h = (2.755 - 2.754) 3.81525 _ 3.81493 + 3.81620 _ 3.81376 = 0.00012.
We then have
X~' = 2.75412, X~' = 2.75411,
Y~' = 3.8150696, Y~' = 3.815085,
Y~' = 3.8150902, Y~' = 3.815078.
(In the last group, the entries on the left were calculated first. Since it
turned out that Y~' was less than Y~', the abscissa of the solution is less
than 2.75412. The values on the right were then calculated.) We thus
obtain the solution X = 2.75411, Y = 3.81508.
EXERCISE 6.]
is different from zero, then the system has one and only one simultaneous
solution
(that is, L1i is the determinant obtained from LI by replacing the column
of coefficients of Xi by the column of constants).
If LI = 0, then either Eqs. 6.4: I are inconsistent and there are no
solutions, or they are consistent and dependent and there are infinitely
many solutions. We will assume in the following discussion that the
equations are consistent and independent, that is, that LI i= O.
The theoretical solution 6.4:3 is simple enough, but it may be of
little value in actual practice if n is large because of the tremendous
amount of labor necessary to evaluate a determinant of high order.
Hence we investigate other means of obtaining the values of a solution.
Two systems of equations are said to be equivalent if any solution of
either system is also a solution of the other system. If any equation
of the system 6.4: I is multiplied by a nonzero constant, or if an arbitrary
multiple of one equation is added to another equation, the new system
is equivalent to the old. It follows that a system of equations derived
from 6.4: 1 by a finite number of transformations of the two types is
equivalent to 6.4: 1. We use this concept of equivalence to simplify the
determination of a solution.
Let ali, be any nonzero coefficient of the first equation of 6.4: I
(there must be at least one nonzero coefficient since, as we assumed,
LI i= 0). Multiply the first equation by aijJa1i, and subtract from the
ith equation for i = 2, 3, ... , n. All the coefficients of Xi, in the trans-
formed system will be zero except the coefficient in the first equation.
The second equation of the transformed system will have at least one
nonzero coefficient, say the one in column j2 . As before, we can multiply
212 6. SIMULTANEOUS ALGEBRAIC AND TRANSCENDENTAL EQUATIONS
3x + 2y - z + w = 8
x + 4y - 3z - 2w =
(I)
6x- y- z+4w=20
Sx - 3y + 2z + 2w = 7.
3x + 2y - z + w= 8
-8x - 2y - Sw = -23
(II)
3x - 3y + 3w = 12
llx+ y + 4w = 23.
6.4. SIMULTANEOUS LINEAR EQUATIONS 213
3x+2y-z+ W= 8
-8x - 2y Sw = -23
(III)
21 93
ISx +T w = T
3 23
7x + 2w = T
3x + 2y - z + w = 8
-8x - 2y Sw = -23
(IV)
21 93
ISx +T w = T
34 34
'fx 7
3x + 2y - z + w = 8
4x+ y
(V)
ISx +~w= 93
2 2
3 23
7x + 2 w = T
214 6. SIMULTANEOUS ALGEBRAIC AND TRANSCENDENTAL EQUATIONS
Divide the third equation by 21/2, multiply the result by 3/2 and subtract
from the last equation to obtain
3x + 2y - z + W = 8
4x+ y +~w=23
2 2
(VI)
to 31
7 x + W= 7
5 19
"1x -z =-
7
3 3
-x+y
7 "1
(VIII)
to + W = 31
7 x 7
34 34
7 x =7
6."'. SIMULTANEOUS LINEAR EQUATIONS 215
Divide the last equation by 34/7; we eliminate the x terms in the first
three equations by multiplying the resulting fourth equation by 5/7 and
subtracting from the first equation, multiplying by 3/7 and subtJ acting
from the second equation, and by 10/7 and subtracting from the third
equation. We end up with the solution previously found.
The values obtained by any method in a solution of the system 6.4:1
will be approximate values if the coefficients and constants of the system
are themselves approximate and not exact numbers. The problem of
evaluating the magnitude of the errors in a solution due to errors in
the given numbers of a system is a rather difficult one and is not
considered here. Furthermore, even if the given coefficients and constants
of a system are exact, the values of a solution may be in error because
of rounding-off steps. These errors may be considerable because of the
large number of steps necessary in any method of solution. Hence it
is wise to use several decimal places more in the calculations than are
required in the answers and, in any event, the answers should be checked
by substitution into the original equations.
I teration methods and other processes have been developed to lessen
the number of steps leading to a solution and to improve an approximate
solution. These methods are usually based on a study of matrices and
are beyond the scope of this text.
EXERCISE 6.4
1. Solve the following systems of equations; assume all coefficients are exact and obtain
the exact answers.
. 3x - 6y + 2z - w = -7
4x + 2y - 5.8' -31
4x + 3y + 8.8' + 5w = 33
2x + 5y - 6.8' - 3w = -21.
b. 15x + 30y - 15.8' = 166
12x - 6y - 6w = -I
60x + 60.8' - 30w = -29
15x + 15y + 15.8' + 30w = -41.
c. x - 2.ly - 3.5.8' + 8.9w = 0.571
5.2x + 3.4y + 1O.2z - w = 29.970
0.5x + 0.6y - 7.7.8' - l.4w = -32.888
3x + 2y - 8.3.8' + 2.5w = -36.603.
d. 2.3x + 5.ly + 8.2z + 10.5" + 2.9v = 97.727
6.1x - 8.3y 2.3" + 14.lv = 137.531
0.3x + 5.7.8' - 9.8" - 4.4v = 1.394
2.4y + 3.3.8' 6.5v = -32.308
8.5x + 3.7y - 1.9.8' + 6.4" = 151.334.
216 6. SIMULTANEOUS ALGEBRAIC AND TRANSCENDENTAL EQUATIONS
2. Solve the following systems of equations; obtain answers to three decimal places.
a. 0.333x + 2.904y - 1.507% - 2.286w = 8.268134
1.492.% - 1.732y - 0.304% - 1.665w = 10.593883
1.973x + 2.008y - 2.432% - 1.084w = 25.729042
2.088x - 1.414y + 2.567% + 2.093w = -15.439019.
b. 3.054x - 9.240y - 0.807% - 2.61 lu + 4.402v = -37.777518
1.606.% - 3.876y - 2.955% + 3.171u - 3.578v = -51.092002
3.880x - 4.232y + 3.067% - 1.055u - 3.023v = -58.904530
2.294x + 7.057y - 4.229% - 2.526u - 6.604v = -3.452426
3.823x + 5.549y + 5.628% + 3.277u + 5.1000 = -3.903743.
Chapter 7
(7.1:2)
Let Pi(x) be the polynomial derived from P(x) by deleting the factor
X - Xi , that is,
(7.1 :3)
Pi(x) = (x - xo) ... (x - Xi_l)(X - Xi+l) ... (x - x,,), i = 0, I, ... , n;
or
(7.1:4) P,(X) = P(x) , i = 0, I, ... , n.
x - Xi
7.1. INTRODUCTION 219
(7.1 :9)
(7.1:10)
Hence
j =j::. k;
(7.1: 11)
, n 1
Li (x;) = ~ _.
i-O x; x,
(i".;)
220 7. NUMERICAL DIFFERENTIATION AND INTEGRATION
n n 1
(7.1:12) p'(x) = ~ [~ Xk - Xi
Ci"okl
This formula can be used for the derivative of p(x) but usually we pay
little attention to it and resort to direct differentiation of the polynomial
3.3:3 or some equivalent form when the abscissas of the points 7.1: 1
in terms of which the function is known are not equally spaced.
We consider some interesting and useful particular cases of some of
the preceding results when the abscissas Xo , Xl , "', Xn are the integers
0, 1, "', n. We then introduce new notations for the polynomials P(x)
and P1.(x) suggested by the notations for the binomial coefficients to
which these polynomials are closely related. We put (notice that n has
been replaced by n - 1)
(7.1: 15)
(7.1:16)
ml
= nl (:), for m ~ n;
[:J (m - n)!
(7.1:17)
(7.1:18)
[:L = (_I)n-m-l ml(n - m - 1)1
(_I)n-m-l(n - 1)1
for 0::::;;; m < n;
(n: 1)
=m-i n'
n! (m) for m ~ n.
THEOREM I.
(7.1 :20) Q(x; n) =
i-O
(-I)i (~)[
' n
x ].
+1 I
= (-I)nn!
X]1 i =
[n + c.'.V"
_..,n + c. 1.1
x n - 1+ ... + c. I,n ,
i = 0, 1, ... , n,
then
(7.1:21) ~(-I)1
n .
. Ci,i (n) = 0, j = 0, 1, ... , n - 1,
i-O '
THEOREM 2.
(7.1 :23)
t! (_~)(-1
"
t
( X.) = (X) "-1_1.'
n-t n ~X-t
The left-hand member of this equality is a polynomial A(x) of max-
degree n - 1. If m is one of the integers 0, I, "', n - 1 then
~ (-I )i-l ( m )
A(m) = ~. .
t
i=1 n- t
= t
i-,,-m
(_I.)i-l (
t
m.)
n- t
[m ~ I]
_ (-I)"+m-lm!(n - m - I)!
- n!
1 ,,-1 X
=,~[],
n. i-O n i
7.2. NUMERICAL DIFFERENTIATION IN TERMS OF FINITE DIFFERENCES 223
B(m) = ~! %[~L
(_l)n-m-1m!(n - m - I)!
n!
EXERCISE 7.1
n . t
(7.2:1) Y = ~Ll'yo (.),
i=O t
dy _ ~ d
-d - ~.1Yod- .,
(t)
x i=1 X I
Since
d (t) dt d (t)
dx i = dx dt i'
and
(7.2:2) ~ (~)
dt I
= (t.) ~_1_. =
I ;-0 t- J
i-I
(_1,>;-1 (. t .),
J I - J
(7.2:3) dy
dx
= y ' = !h ~ [~
~ ~
(-1 )H ( t )] Ai
. . _. '" Yo .
,=1 ;=1 J I J
(7.2:4)
The last two expressions are the general formulas for the derivative
of the polynomial 7.2: I at an arbitrary point.
Of special interest, however, are the values of the derivatives at the
points 7.1: 1. These can be obtained by putting t = 0, I, ... , n, in turn,
in either of the last two formulas. We have, putting t = 0,
(7.2:5)
(7.2:6) Y
,
= Ii1 ~d At
~ t.t'" Yo ,
t=1
7.2. NUMERICAL DIFFERENTIATION IN TERMS OF FINITE DIFFERENCES 225
TABLE 7.2:t1a
VALUES OF d,., FOR NUMERICAL DIFFERENTIATION
y/ = ! ~ d,., A'yo
h 1-1
2 3 4 5 6 7 8 9 10
1 1 1 1 1
o 2 3 4 5 6
-
7 8 9 10
1 1 1 1 1 1
2 6 12 20 30 42 56 72 90
3 1 1 1 1
2
2 3 12 30 60 105 168 252 360
5 11 1 1 1
3
2 6 4 20 60 140 280 504 840
7 13 25 1 1
4 -
2 3 12 5 30 105 280 630 1260
9 47 77 137 1 1
5 -
2 6 12 60 6 42 168 504 1260
11 37 57 87 49 1 1
6
2 3 4 10 20 7 56 252 840
13 107 319 459 223 363 1
7
2 6 12 20 20 140 8 72 360
15 73 533 743 341 481 761 1 1
8
2 3 12 15 35 35 280 9 90
17 191 275 1879 2509 3349 4609 7129
9
2 6 4 20 30 70 280 2520 10
19 121 1207 1627 2131 2761 3601 4861 7381
10
2 3 12 10 12 21 56 252 2520
where
(7.2:6.1) de
.=~(-l)H(
~ . .
t). ,
;-1 J 1- J
The identity,
(7.2:6.2) d ei = de- 1 e- 1 + de-I.; ,
can be readily derived from the definition of the d's. Note that this is
actually an identity in the variable t; however, we shall use it only to
226 7. NUMERICAL DIFFERENTIATION AND INTEGRATION
compute the coefficients of Llyo , Ll2yo , LlSyo , "', in the expressions for
Yt"Y2',yS', "', by putting t = 1,2,3, "', in turn.
The d's, up to and including the coefficients of LllOyo, are given in
Tables 7.2:tlabc. The coefficients in the first row are obtained directly
from 7.2:5; the same formula also tells us that every coefficient in the
first column is unity. The remaining coefficients are computed by
means of 7.2:6.2, each is the sum of the one directly above and the one
just above and to the left. In Table 7.2:tla, the coefficients are given
in fractional form and are exact values; in Table 7.2:tl b, the coefficients
TABLE 7.2:tlb
VALUES OF d,., FOR NUMERICAL DIFFERENTIATION
, 1 ~ (-I)-d,.,
Y-t=;; , 1 .d'Y-i
,-1
:1 2 3
-- - - - - - - - - - - -
4 5 6 7 8 9 10
0 2520 -1260 840 -630 504 -420 360 -315 280 -252
1 2520 1260 -420 210 -126 84 -60 45 -35 28
2 2520 3780 840 -210 84 -42 24 -15 10 -7
3 5220 6300 4620 630 -126 42 -18 9 -5 3
4 2520 8820 10920 5250 504 -84 24 -9 4 -2
5 2520 11340 19740 16170 5754 420 -60 15 -5 2
6 5220 13860 31080 35910 21924 6174 360 -45 10 -3
7 2520 16380 44940 66990 57834 28098 6534 315 -35 7
8 2520 18900 61320 111930 124824 85932 34632 6849 280 -28
i
9 2520 21420 80220 173250 236754 210756 120564 41481 7129 252
10! 2520 23940 101640 253470 410004 447510 331320 162045 48610 7381
were written with the common denominator 2520 and the numerators
only were entered in their proper places; in Table 7.2:tlc, the coefficients
were written in decimal notation and they are, for the most part, correct
only as far as written.
The table is used in the most obvious fashion. Thus, if y = f(x) =
S
X - 8x + 5, xo = 0, h = I, we find on forming the difference table
that Llyo = -7, Ll2yo = 6, LlSyo = 6, and, of course, Ll4yo = Ll5yo =
... = o.
7.2. NUMERICAL DIFFERENTIATION IN TERMS OF FINITE DIFFERENCES 227
TABLE 7.2:tlc
VALUES OF d, FOR NUMERICAL DIFFERENTIATION
\0 I
2
-0.50000 00000
3
0.33333 33333
4
-0.25000 00000
5
0.20000 00000
I I 0.50000 00000 -0.1666666667 0.08333 33333 -0.05000 00000
2 I 1.50000 00000 0.33333 33333 -0.08333 33333 0.03333 33333
3 I 2.50000 00000 1.83333 33333 0.25000 00000 -0.05000 00000
4 I 3.50000 00000 4.33333 33333 2.08333 33333 0.20000 00000
5 I 4.50000 00000 7.83333 33333 6.4166666667 2.28333 33333
6 I 5.50000 00000 12.3333333333 14.25000 00000 8.70000 00000
7 I 6.50000 00000 17.83333 33333 26.58333 33333 22.95000 00000
8 I 7.50000 00000 24.33333 33333 44.4166666667 49.53333 33333
9 I 8.50000 00000 31.83333 33333 68.75000 00000 93.95000 00000
10 I 9.50000 00000 40.33333 33333 100.58333 33333 162.70000 00000
~ 6 7 8 9 10
Hence
Note that the value of the derivative at a particular point, say /,(6),
can be found in several ways. Indeed, we have
Y':e I
= ~ d e1 ..:Ilyo,
1=1
Ye' = ~ ~ (-1)1-1 de1 ..:IIY_I
1-1
2 3 4 5 6 7 8 9 10
3 11 25 137 49 363 761 7129 7381
2 6 12 60 20 140 280 2520 2520
5 13 77 87 223 481 4609 4861 55991
2
2 3 12 10 20 35 280 252 2520
7 47 57 459 341 3349 3601 42131 44441
3
2 6 4 20 10 70 56 504 420
9 37 319 743 2509 2761 32891 35201 485333
4
2 3 21 168 126
-- 1260
-
12 15 30
11 107 533 1879 2131 25961 28271 395243 420983
5 ---
2 6 12 20 12 84 56 504
-- 360
-
13 73 275 1627 20417 22727 323171 348911 522109
6
2 3 4
-10
- -60- -35- - -280- 180 -- 168
-
15 191 1207 15797 18107 263111 288851 312875 134159
7 --- - - - - ------ --- - -18-
2 6 12 60 30 210 120 72
17 121 2074783
8 -2- - -1691
- -2021 - 30233 474742
-30- - -
261395 1135670
- - -56- - - 126
- - -126
--
3 12 5 210
19 299 763 11899 96163 108175 477745 8842385 5713839
9 --- ---- ------ - - - - - - - -
2 6 4 20 60 28 56 504 168
21 181 3013 25361 48975 44185 831225 8161705 33464927
10 -2- -3
--12
-30- 20 7
- -56- - -252
--
- - 504
7.2. NUMERICAL DIFFERENTIATION IN TERMS OF FINITE DIFFERENCES 229
(7.2:7)
= Y' = ~ d~ (1
dy
d
X
~
(-I)' ~Y-I
.-0Ai
x,-.t).
Put z = 1 - t, then
d
dx
(1 -i t) =dxd (Z)i =dxdz
dz d (Z)
i
= _!
h ;-1
(-IY-l (. Z .)
J ' - J
(by 7.2:2)
Hence
dy= Y '=!~(_I)'A'
h~
.~(-I);(I-t)
~Y~~ . .,
dX i-I ;-1 J ' - J
or
(7.2:8) Y ,=!~[~(-I)H(I-t)]
h~ ~ . . i
. .1Y_i,
1-1 ;-1 J ' - J
, 1 ..-1 1- t .. 1 .
(7.2:9) Y = h- ~ (-1)1 ( .) [~ ~.1'y_;] .
i-O ';=1+1 J '
If we put t = 1, we obtain
(7.2:10) , ~ 1 Ai
Yo = ~-:~y-i'
1-1 '
230 7. NUMERICAL DIFFERENTIATION AND INTEGRATION
As before, y' can be computed exactly from the entries in the table
if Y = f(x) is a polynomial of max-degree 10. This table too can be
extended backward and, in any case, it gives us a derivative in terms
of differences that form an ascending diagonal in the difference table.
If we start with formula 3.8:15, namely,
(7.2:11) -
[n/2]
~ Ll2t
(t - I + i) + [(n+1)/2]
~ Ll2i-1
(t - I + i)
Y- ~ Y-i 2' ~ Y1-i 2' - I '
i-O I i=1 I
we obtain
(7.2:12)
, _ ! l[n/2]
Y - h :t LI 2iY -[2ii :(_I)H
t.
(t -2' I_ +. i)]
i-I ;-1 J I J
(_Iy-l (t - I + i)] I
+ :t Ll2t _lYl-i [2i-l
[(n+1)/2]
i-I
:t --.--
J;-1
2i - I _.
J
.
If t = 0,
(7.2:13) '_!I[n/2]
Yo - h :t LI 2iY-i:t
i-I
[2i (-I)H(i-I)]
J
. 2i _ .
;=1 J
[n/2] . (t - i + I) [(n+l1/2]. (t - 2+ i)
(7.2:14) Y ~ .1 2Y_i
= i-O 2 + ~ .1 2.-1Y_i 2-1 '
I i-I I
we obtain
(7.2:15)
, _ 1 ![n/2]
Y - h ~.1
2i
Y-i
[2i
~
(-I)H
(t 2i- _1 +. i)]
i-I ;-1 J J
+
[('I+U/2]
~ .1
2i-l
Y-i
[2i-l
~
(-I)H
(t2i -_ 21+_.i)]1 .
i=1 ;=1 J J
If t = 1,
(7.2:16)
, _ ! l[n/2]
Yo - h
[2i (-I)H ( i
~.1 Y-i ~
2i
. 2i _ .
)]
i-I i-I J J
+ li60 .1 10Y_6 =f .1
Formulas 7.2:13 and 7.2:16 give formally different but actually equal
expressions forj'{xo).lfwe add and divide by 2, we obtain the particularly
simple formula
This formula could have been obtained from 3.8: 17 as the preceding
formulas were obtained from their predecessors.
Formulas for the second and higher derivatives,
Y
"
=
d2y
dx 2 '
Y
If'
= day
dx3' ... ,
TABLE 7.2:t3a
'"w
VALUES OF Ck,i FOR NUMERICAL DIFFERENTIATION '"
h It ylk)
0 = ~Cti'. .diy0, hky(k)
o
= ~ (-I)1'+ickit: .diy-i
i=k i-k
SJ 2
1
--
3
1
-
4 5
-
6
--
1
7
-
8
--
1
9
1
10 11 12 13 14
2 3 4 5 6 7 8 9 10 11
11 5 137 7 363 761 7129 671 :'"I
21 - 1 -- Z
12 6 180 70 560 1260 12600 1260 c
3 7 15 29 469 29531 1303 16103 3:
3 1 - m
2 4 8 15 240 15120 672 8400 '"n
17 7 967 89 4523 7645 -
r-
41 -2 --
6 2 240 20 945 1512 2"T1
5 25 35 1069 285 31063 "T1
m
5 I
2 6 6 144 32 3024 '"Zm
23 3013 781 -I
61 -3 -9 -- ;;
4 240 48 -I
7 91 105 4781 0
71 -- z
2 12 8 240 -
Z
29 55 10831 0
8 -4
3 3 360 Z
-I
9 99 1747 m
9 12 C)
2 4 40
175 65 491
'"-I
-
10 -5 0
12 2 8 Z
TABLE 7.2:t3b ......
i"
VALUES OF Ct . FOR NUMERICAL DIFFERENTIATION Z
C
:I
m
hty(t)
o
= kC
._k k,i
L1'y
0 '
hty(:' = k (-I)HiCt ,. L1iy _. ""n>
.-t
r-
Q
~
.."
.."
m
2 3 4 5 6 7
""Zm
-I
1 I -0.5 0.33333 33333 -0.25 0.2 -0.1666666667 0.1428571429 ;;
2 I 1 -1 0.9166666667 -0.83333 33333 0.7611111111 -0.7 -I
0.."
_1 _____
.."
8 9 10 11 12 13 14
Z
----- =i
m
-0.125 0.11111 11111 -0.1 0.09090 90909
0.64821 42857 -0.60396 82540 0.56579 36508 -0.53253 96825 Q
.."
1l
.."
-1.9541666667 1.95310 84656 -1.93898 80952 1.9170238095 m
4.0291666667
-5.8333333333
-4.45
7.42361 11111
4.7862433862
-8.90625
-5.0562169312
10.2721560847
""zm
5 , n
6 ' 5.75 -9 12.5541666667 -16.2708333333 m
II>
7 -3.5 7.58333 33333 -13.125 19.9208333333
8 -4 9.66666 66667 -18.33333 33333 30.08611 11111
9 1 -4.5 12 -24.75 43.675
10 -5 14.58333 33333 -32.5 61.375 ....
w
w
234 7. NUMERICAL DIFFERENTIATION AND INTEGRATION
EXERCISE 7.2
b C d
b. If the numbers in the first row of the table are multiplied by I/ll. those in the
second row by 1/2! ... those in the kth row by Ilk! ... then the sum of the numbers in
any column after the first is zero; the sum of the positive numbers is t.
c. The ith diagonal (of the original table) is an arithmetic progression of order i - I
(read diagonals down and to the right).
(7.3:2)
and
(7.3:3) dy
dx
= y' = ! 2 (t) [
h i=u I ;-i+l
(-I )H-l . ~ .
J I
k-O
(-I );-k (i)k Yk] ,
where t = (x - xo)Jh. These formulas give dyJdx at an arbitrary point
in terms of the ordinates Yo , YI , ... , Yn .
The formulas for the values of the derivatives at the equally spaced
points (xo, Yo), (Xl' YI)' (x n , Yn), are of particular importance. These
can be obtained from the entries in Table 7.2:tl by use of 7.3:1. This
time it is necessary to list the formulas for each value of n separately
since the coefficient of a particular ordinate, Yi , will ordinarily change
as n changes. The results will be found in Table 7.3:tl.
The entries in this table can be found directly without recourse to
the formulas of the preceding section by interesting and instructive
methods. We recall that the notation was so chosen that
TABLE 7.3:tl
VALUES OF Ck./ AND K FOR NUMERICAL DIFFERENTIATION
K ..
Y/ = h ~ Ck,/Yi
/-0
.k A 0 I 2 3 4 5 6 7 8 9 10
2 0
1
l -3
-I
4
0
-I
I
3 0 1 -ll 18 -9 2
"6
I -2 -3 6 -I
4 0 1 -25 48 -36 16 -3
12
I -3 -10 18 -6 I
2 I -8 0 8 -I
5 0
I
lo -137
-12
300
-65
-300
120
200
-60
-75
20
12
-3
2 3 -30 -20 60 -15 2
8 o slo -2283 6720 -1l760 15680 -14700 9408 -3920 960 -105
I -105 -1338 2940 -2940 2450 -1470 588 -140 15
2 15 -240 -798 1680 -1050 560 -210 48 -5
3 -5 60 -420 -378 1050 -420 140 -30 3
4 3 -32 168 -672 0 672 -168 32 -3
9
~ 2120 -7129 22680 -45360 70560
-280 -4329 10080 -1l760
-79380 63504 -35280 12960
11760 -8820 4704 -1680
-2835
360
280
-35
2 35 -630 -2754 5880 -4410 2940 -1470 504 -105 10
3 -10 135 -1080 -1554 3780 -1890 840 -270 54 -5
4 5 -60 360 -1680 -504 2520 -840 240 -45 4
10 0 2120 -7381 25200 -56700 100800 -132300 127008 -88200 43200 -14175 2800 -252
I -252 -4609 11340 -15120 17640 -15876 10584 -5040 1620 -315 28
2 28 -560 -3069 6720 -5880 4704 -2940 1344 -420 80 -7
3 -7 105 -945 -1914 4410 -2646 1470 -630 189 -35 3
4 3 -40 270' -1440 -924 3024 -1260 480 -135 24 -2
5 -2 25 -150 600 -2100 0 2100 -600 150 -25 2
--------------------------------------------------------------
7.3. NUMERICAL DIFFERENTIATION IN TERMS OF ORDINATES 237
(7.3:5)
and
if n < 2j,
(7.3:7) if n = 2j,
if n > 2j.
L'( ) - (-1)-2 _I
o Xl - -I
(~)!h -__ 4h~ '
(1)
L'()
2 Xl =
(1)0 I
- I
(~) IiI =
(1) 3
2h '
238 7. NUMERICAL DIFFERENTIATION AND INTEGRATION
L' (x ) = (_I)(n-k,-(n-,,-l
. 1 (n ~ k) 1-
n-k n-; (n - k) - (n - j) ( n .) h '
n -J
= (_I)H-l _._1_ 1 (n ~ k)
J-k(n.)h
n -J
Therefore
(7.3:8)
L~_;(xn_;) = - ~ ( n - ; + 1 + ... + n - 1
(n - j)
)
L~-i(xn-i) = i( n - (n ~ j) + 1 + ... + n ~ j )
= i C! 1 + ... + n ~ J) = -L/(xi)'
7.3. NUMERICAL DIFFERENTIATION IN TERMS OF ORDINATES 239
(7.3:9)
The equalities 7.3:8, 9 imply that if we have the formula for the
derivative at a point in terms of the ordinates, say
m = 0, I, ....
Here, too, the subscripts can all be increased or decreased by the same
integer.
If in a formula for an (m + 1)st derivative in terms of the mth deriva-
tives we replace the latter by their values in terms of (m - l)st deriva-
tives, and these in turn by their values in terms of (m - 2)nd derivatives,
and so on, we finally obtain a formula for the (m + I )st derivative in
terms of the ordinates. Thus (we use y' and y" in place of ylll and yIZI):
(7.3:10) i = 0, I, ... , n;
then
where, if
we have
(7.3:15) I C(l) 1= O.
EXERCISE 7.3
1. Do examples 1,2,3 of Exercise 7.2 by use of Table 7.3:tl.
2. Use 7.3:9-13 and Table 7.3:tl to derive similar tables for the higher derivatives.
3. Prove that the matrix Cln" 7.3: 12, is of the form
la b e d
i a b c d ...
(7.4:2)
no one of which is identically equally to zero, at the fixed (equally
spaced) points
(7.4:3)
then it will be an exact formula for any linear combination of these
functions, that is, for
(7.4:4)
at the same points, where C1 , C2 , , Cm are arbitrary constants not all
simultaneously zero.
Let xi+l - Xi = h as usual and let
(7.4:5)
be any set of n + I equally spaced points with the same spacing as the
first set so that xi+l - Xi* = h, and suppose xo* - Xo = g. If we
assume that each fi(X) of 7.4:2 has the property that for an arbitrary
constant g the associated function fi(X + g) is expressible as a linear
combination of the functions in 7.4:2, then for a given set of constants
C 1 , C2 , '.', Cm , there will exist a corresponding set of constants
C1 , C2 , .", Cm such that
(7.4:7)
(7.4:9)
ao + a1 + a2 + ... + a,. = 0,
a1 + 202 + ... + no,. = 1,
(7.4:11) a1 + 22a2 + '" + n2a" = 2k,
for the determination of the a's. Since the determinant of the coeffi-
cients, namely,
1 1 1
o 2 ... n
o 22 ... n2 ,
EXERCISE 7.4
1. Derive formulas of the indicated forms exact for all polynomials of the stated
max-degrees.
, I
a. Yl = h (CoYo + CaYa + caY.); n = 2.
b Yl ' = h
I (coYo + CaYa + C.Y. + c,y,); n = 3.
, I
c. Yo = h (c_aY_. + C-1Y-l + C1Yl + caY.); n = 3.
, I
e. Ya = h (C-1Y-l + C1Yl + CaYa + c.Y. + c.Y.); n = 4.
2<% 7. NUMERICAL DIFFERENTIATION AND INTEGRATION
2. Derive formulas of the indicated forms exact for all polynomials of the stated
max-degrees.
n = 2.
n = 2.
n = 3.
,,1 I.
d. Yo = hs (c-aY-a + caYa) + h(d_1Y_l + doYo'); n = 3.
n = 2.
(7.5:1) y =/(x)
(7.5:2)
(7.5:3)
7.S. MAGNITUDE OF THE ERROR IN NUMERICAL DIFFERENTIATION 247
or in the form
(7.5:4)
and
respectively; whence
(7.5:5)
(7.5:6)
(7.5:7) , _,
f (x) - Pn (x) + Ll 71+1LJ(xo) [f'n+1'(X)! .!... ( t )
pn+1'(X1) h dt n + I
t ) d f'n+1'(X) ]
+ (n + I dx pn+1'(X1) .
f'n+1'(X) I d ( t )
(7.5:8) E(x) = f'(x) - Pn'(x) = Lln+lj(xo) [ pn+1'(X1) h dt n + I
t ) d f'n+1'(X) ]
+ (n + I dx pn+1'(X1) .
Values for d(,,!l)/dt for various values of t and n are given in Table
7.5:tl. These values can be computed directly or by use of 7.2:2. It
turns o~t that this table is identical with a portion of Table 7 .2:tl a;
TABLE 7.5:tl
VALUES OF THE DERIVATIVE OF THE BINOMIAL COEFFICIENT
:, C~ I)
n
2 3 4 5 6 7 8 9 10
I I I
o 3 4
-5 6
-
7 8 9 10 II
I I I I I I
6 12 20 30 42 56 72 90 110
I I I I 1 I
2 -
3 12 30 60 105 168 252 360 495
I I I I I
3 -
4 20 60 140 280 504 840 1320
I I
4 -5 30 105 280 630 1260 2310
I I I
5 - --
6 42 168 504 1260 2772
I I
6 -
7 56 252 840 2310
I I I
7
8 72 360 1320
I I I
8
9 90 495
9
10 110
10
II
7.S. MAGNITUDE OF THE ERROR IN NUMERICAL DIFFERENTIATION 249
indeed, the entry in Table 7.5:tl for a given t and n is the coefficient of
iJ1I+lYo/h in the expression for y/ in Table 7.2:tla.
Table 7.5:tl used in conjunction with 7.5:9 or 7.5:9' provides us with
estimates of the error inherent in the formulas for the numerical evalua-
tion of derivatives whenever our assumption is justified.
An alternate expression for the error 7.5:9 (or 7.5:9') can be found.
Not only do we make a weaker assumption-we shall assume only that
f'1I+lI(x) exists in the interval under consideration-but the derivation
employs an ingenious approach which allows of great generalization.
We have seen (Exercise 2.2, example 13) that if a functionf(x) possesses
an (n + l)st derivative in the neighborhood of x = xo , then
q>(X) = f "l(""
110(""
F(s, x) ds,
then
dq>(x) =
dX
f"l("" of(s, x) d _ F(
0 s
) dvo F( ) dV I
Vo , x d + VI , x d .
"0("" X X X
We use this formula to find
Now suppose we wish to find the expression for the error when the
derivative of a function f(x) is approximated by a formula, say the first
formula of Table 7.3:tl. The error at x = Xo (note that the Xo of 7.5:10
is purposely chosen as the Xo of the table) is given by
(7.5:12)
"'0
(xo - S)/,31(s) ds
(7.5:13)
The function U(s I a, b) is thus equal to unity in the closed interval from
a to b and is zero elsewhere; the function is sometimes called the char-
7.5. MAGNITUDE OF THE ERROR IN NUMERICAL DIFFERENTIATION 251
acteristic function of the closed interval [a, b] on the real axis. * Hence if
g(s) is any function of s, the function g(s)U(s I a, b) coincides with g(s)
in the closed interval from a to b and is equal to zero for all other values
of s for which g(s) is defined. We use the new function to write E(xo)
in the form
R(s) = 4(XI - S)I U(s I Xo , xl) - (XI - S)I U(s I XO, XI).
Fig. 7.5:fl. It follows that R(s) is never positive and therefore by the
Law of the Mean for integrals the identity 7.5: 15 may be rewritten as
(7.5:16) 1
E(xo) = - 4hf'3'(X) f"" R(s) ds,
"'0
where X is a value of x between Xo and X 2 The important feature of the
last expression for the error is that the integrand R(s) is independent
of the function f(x).
R(s)
----~--------~~--~~~~-------s
FIG. 7.5:f1.
= - 4
-3 (Xl - S)3 I",~o +"31 (XI - S)3 I",~0
On the other hand, take f(x) = (x - xo)(x - xl)(x - XI) so that f'(x) =
(x - xI)(x - x 2) + (x - xo)g(x) and f'3'(X) = 6. We find on equating
the values of E(xo) given by 7.5:12 and 7.5:16 that
7.5. MAGNITUDE OF THE ERROR IN NUMERICAL DIFFERENTIATION 253
Hence
as before. Consequently,
(7.5:17)
Let us compare this result with the result given by 7.5:9'. Since
t = 0, n = 2, we find by use of Table 7.5:tl that E(xo) = h2J<3)(X)/3,
exactly the same expression we found by the more elaborate derivation.
Then why bother with the lengthy procedure? Well, in the first place,
the second procedure is based on a weaker assumption and therefore
the results will hold if the stronger conditions of the first method are not
justified. Secondly, the second method is applicable to a large variety of
examples and approximation formulas over and above the formulas of
Table 7.3:tl. Before we turn to such an illustration, let us examine the
general case of an arbitrary formula chosen from Table 7.3:tl. The
expression 7.5:9' gives us the error inherent in such a formula; will
the lengthy procedure also end up with the same result?
To answer this question, let
+ ....................... .
:i
+ cn/J..(x,,) + (tl (x.. - s)"/,,,+1)(s) dS] .
"0
25.. 7. NUMERICAL DIFFERENTIATION AND INTEGRATION
Hence
+- -1 - f"~ (Xk -
(n - 1)1 "0
S)l-1p"+1I(S) ds
+ ................. .
+ e" r"
"0
(x" - s)"p"+1I(S) dS] ;
+ ....................... .
+ e" r"
"0
(x" - s)"p"+1I(s) dS]
+ ......................... .
+ e" r"
"0
(x" - s)" U(s I x o , X,,)p"+1I(S) dS]
7.5. MAGNITUDE OF THE ERROR IN NUMERICAL DIFFERENTIATION 255
= - h
-I I J"''
n m "'0
[-nmh(Xk - S),,-l U(S I Xo , Xk)
It can be verified that R(s) does not change sign in the interval from Xo
to Xn , hence by the Law of the Mean for integrals
(7.5:21) ,
E(Xk) =
P,,+1,(X)
nImh
J"'' R(s) tis.
"'0
or
(7.5:23)
This result is the same as the one given in 7.5:9' if in the latter Xk is
substituted for x. This is what we wanted to prove.
We illustrate the use of the lengthy procedure in another type of
formula. It can be shown that
(7.5:24)
E(xo) = -
f'31(X)
~
f"'s R(s) ds.
"'0
EXERCISE 7.5
1. Evaluate the errors in the formulas of Table 7.3:tl.
2. Evaluate the errors in the formulas derived in Exercise 7.3, example 2.
3. Evaluate the errors in the formulas derived in Exercise 7.4, examples 1 and 2.
4. Prove the statement made directly after 7.5:20 that R(s) does not change sign in the
interval from Xo to Xn
(7.6:1)
a
b
a
1
b
a
x o) dx + ... + a.. f (x -
b
a
xo)n dx + ...
Enough terms of the last series must be computed to ensure the required
precision in the definite integral. (See Sections 2.3 and 2.4.)
258 7. NUMERICAL DIFFERENTIATION AND INTEGRATION
r a
f(x) dx = r0
f(x) dx - r
0
f(x) dx.
r
The integral f(x) dx for arbitrary a and h can be found by suitable
transformation~ of the type x = mx' + q.
The error inherent in this method is determined by the dropped term
- R 2k The method involves laborious calculations and is rarely used
except as it gives rise to formulas to be developed later. We mention
it here mainly for historic reasons.
(7.7:1) ta
f(x) dx
0 ,
~ (~) =
dt,
;-1
(-IY-l (. t .),
} , -}
yields
(7.7:4) ~ (-1);-1
~ -=----,'.'--
;=1}
I'o'-}
( t) dt = (t),..
Ho = G)
1
--Ho+
2
HI = G)
1 1
-Ho-
3 2Hl + Hz = (;)
(7.7:5)
(_I)n-l
n Ho +
(_I)n-z
n _ 1 HI
1
+ ... - 2 Hn-z + Hn- 1 =
(t)n .
Hence
Ho = G),
HI = (~) + ~ G) ,
Hz = G) + ~ G) - 1~ G) ,
H 3 = (;) + ~ G) - 1~ G) + 2~ G) ,
260 7. NUMERICAL DIFFERENTIATION AND INTEGRATION
In general,
1
H. ~ ~ ~ [) + ~ W+ 1-:
- I-I! .1
-11
I 01I (
i k-2.)+
t -t -I!
- "4
1
"3 -
~
1
00 ( t)
I k-3,
-4 "3 - 1 --1 !-1
(7.7:6) ........................................... .
-l o o o
-! -1 I o o
-:1 1 -t I o
+ (-l)k
( _I)k-l (_I)k-2 (_I)k-a (_I)k-4 ...
k k-I k-2 k-3
(_I)k ( _I)k-l (_I)k-2 (_I)k-a I
k+I k k-I k-=-"2- ... - 2
This solution is readily obtained by using Cramer's rule for the solution
of simultaneous linear equations; note that the determinant of the
coefficients is equal to unity. Note too that the value of Hk does not
depend on the number n (~k) of equations. (See the statements
2.3:22-24; also, Exercise 2.4, example 9.)
In particular, the coefficients of the binomial coefficients in the expres-
sion for HID are, respectively,
I 19 3 863 275
(7.7:7) I, 2' - 12' 24' - 720' 160' - 60480' 24192'
33953 8183 3250433
3628800' 1036800' 479001600 .
( / dx = h !(D Yo
+[G)+~G)]~Yo
(7.7:8)
+ [G) + ~ G) - I; G)] ~2yo
7.7. NUMERICAL INTEGRATION IN TERMS OF FINITE DIFFERENCES 261
J'"'0" y dX h lI
- - (t) [Yo + 2~ .1Yo - ~ .1 2Yo
12 ~ .1 3Yo - 12.
+ 24 720 .1 Yo + ... J
4
+ (3t)[.12Yo + !.13
2 Yo
_ .l.14
12 Yo
.l.15 _
+ 24 Yo
19 .16
720 Yo + ...J
(7.7:9)
+ (4t)[.13Yo + !.14
2 Yo
_ .l.15
12 Yo + .l.16
24 Yo
_ 19_.17
720 Yo + ...J
+ (5t) [.14Yo + 21 .15Yo - 1 .16
12 Yo + 241 .17Yo - 19 .18
720 Yo + .. .]
+ ......................................... (,
where, in either case,
1
(7.7:10) t = Ii (x - XO)
The last two formulas give the value of the integral of a function y = f(x)
from the fixed lower limit xo to the variable upper limit x in terms of
the binomial coefficients and the finite differences. If we put t equal to
an integer k, we obtain a formula for the evaluation of
(7.7:11) J ydx.
"'k
"'0
Note that if k is a positive integer, all rows beyond the kth vanish in
the right-hand member of 7.7:9 and the right-hand member of 7.7:8
will have corresponding gaps. Also, if y = f(x) is a polynomial of max-
degree n, all rows beyond the (k + l)st vanish in the right-hand member
TABLE 7.7:tla
VALUES OF Ck,' FOR NUMERICAL INTEGRATION
.,...........
r%0
k f(x) dx = h k
i-O
Ct,. Lily.
r
Z_t
f(x) dx = h k(
i-O
-I)' Ck,' LIy_.
~ 0
1
2 12
2 3
24
4
19
720
5
3
160
---
863
60480
6 7
275
24192
----
8
33953
3628800
9
8183
1036800
10
3250433
479001600
~
z
1 37 8 119 9 8501 c
21 2 2 - 0 --- -- -- :I
m
3 90 90 3780 945 16200 1400 1496880
9 9 3 3 3 29 9 369 25 11899 '"
n
>
3 1 3 - 1971200
--- ,...
2 4 8 80 160 2240 896 44800 3184
0
20 8 14 8 8 107 94 547 ::;:;
41 4 8 - 0 --- .."
m
3 3 45 945 945 14175 14175 93555
25 175 75 425 95 275 275 175 25 114985 '"z
m
5 1 5 - --- -I
2 12 8 144 288 12096 24192 20736 3184 19160064 ;;
-I
123 33 41 9 9 537 5
61 6 18 27 24 0 z
10 10 140 1400 1400 92400
49 1225 26117 2499 30919 5257 8183 8183 84427 >
71 7
539
-- --- z
720 160 8640 17280 518400 1036800 13685760 0
2 12 24
208 3928 2336 18128 736 3956 2368 Z
-I
81 8 32 96 -- 0 --- m
3 45 45 945 189 14175 467775 Cl
91 9
81 405 1323 14661 4455 159219 103437 26649 25713
---
4671 '"-I
>
2 4 8 80 32 2240 4480 6400 89600 394240 5
425 800 6275 645 158975 17800 123575 20225 80335 z
10 \\ 10 50 - - ---
3 3 18 2 756 189 4536 4536 299376
-- -----
....
5 3 251 95 19087 5257 1070017 25713 26842253 :.....
-1 I -1 - - --- - 3628800
--- --
2 12 8 720 288 60480 17280 89600 95800320 z
c
3:
7 8 269 33 13613 736 67711 20225 35417513 m
-2 2 - ---
-21
3 3 90 10 3780 189 16200 4536 7484400 '"
n
>
r-
9 27 75 987 2499 4302 103437 1221201 2841201 14364223
-3 -3 -
2240 4480
- -44800
-- ---
89600
Z
2 4 8 80 160 394240 -I
m
Cl
-4 -4 8
44
24
1634 2336 67192
---
17800 1721263
----
26798
--
88671367 '">-I
3 45 45 945 189 14175 175 467775 0
z
2543875 7365875
-5 I -5
25 325 1225 12575
---
4455
----
12096
---
24192
- 8831375
-20736
-- 168091625
290304
14725896425
Z
2 12 24 144 32 19160064 -I
m
- 45
1833 645 74591
---
29304 1768401
----
368431 16082039 '"3:
-6 ! -6 18 96 II>
10 2 140 35 1400 200 6160 0"T1
49 833 1323 251027 966427 10401769 7054229 1712943127 2634975 530812423351 "T1
-7 I -7 --- Z
2 12 8 720 1440 8640 3456 518400 512 68428800 ~
m
...,
0-
w
TABLE 7.7:tlb
{kf(X) dx
%'0
= h k Ck.i
i-O
,diyo
{o f(x) dx = h
Z_k
k
i-O
(_l)iCk,i ,diY_i
0 2 3 4 5
:"'I
k
Z
1 I 0.5 -0.08333 33333 0.0416666667 -0.02638 88889 0.01875
c
:I
0.33333 33333 0 -0.01111 11111 0.01111 11111 m
2 2 2
3 3 4.5 2.25 0.375 -0.0375 0.01875 ""n-
4 4 8 6.66666 66667 2.66666 66667 0.31111 11111 0 r-
5 5 12.5 14.5833333333 9.375 2.9513888889 0.32986 11111 ~
."
6 6 18 27 24 12.3 3.3 ."
m
7 7 24.5 44.9166666667 51.0416666667 36.27361 11111 15.61875
8 8 32 69.33333 33333 96 87.28888 88889 51.91111 11111 ""Z
m
L
k
I
I
I
6
-0.0142691799
7
0.0113673942
8
-0.00935 65366
9
0.00789 25540
10
-0.00678 585
'"
n
>
,...
Z
-t
m
C)
f~ y dx = h !C ~ t) Yo
- [C ~ t) + ~ C~ t)] ~Y-l
+ [C ~ t) + ~ C~ t) - 1; C~ t)] ~2Y_2
- [C ~ t) + ~ C~ t) - I; C~ t) + 2~ C~ t)] ~aY_a
....................................... I
This expression can be obtained from 7.7:8 by replacing each binomial
coefficient m by (li'), ~iyo by ~iY_i' and alternating the signs in
front of the brackets. Note too the interchange of limits of the integral
and that now, t = (x - x_1)/h. If we give t the values 0, -1, -2, "',
in turn in 7.7:12, we obtain the formulas also given in Table 7.7:t1.
Similar formulas can be found by starting with central difference
expressions. However, an alternate method of derivation is noteworthy.
Let
(7.7:13)
(7.7:14) to
"-k
Y dx = h[coYo - C1 ~Y-l + C2 ~2Y_2 - Ca ~aY_a ...]
(7.7:15) tk
"0
Y dx = h[CoYk - C1 ~Yk-l + Cs ~2Yk_2 - Ca ~aYk_a ...]
7.7. NUMERICAL INTEGRATION IN TERMS OF FINITE DIFFERENCES 267
is also a valid formula. Since 7.7:13 and 7.7:15 are formulas for the same
definite integral, we obtain by addition and division by 2
(7.7:16)
~Ik) = ftlk)(i).
or
dr
dxrf(x}
I"'="'k
This form of the Euler summation formula can, of course, be used
for the evaluation of the integral but for greater facility in the com-
putations it is better to replace the derivatives on the right by their
values given in Table 7.2:t3. We first remark that if
Hence
00
The coefficients a2 i-1I2j-l+i are the numbers in the (2j - I )st row of
Table 7.2:t3. Using these values of B2i from 2.3:21, we find
(7.7:22)
fnf(x) dx = h [(lyo + Y1 + ... + Yn-1 + lYn)
"'0
(7.8:1) r
/J
f(x) dx
in terms of the ordinates Yo , Y1' ... , Yn' where (xo, Yo), (Xl' Y1)' ... ,
(Xn ,Yn) are n + 1 points on the graph of Y = f(x) spaced h units apart.
270 7. NUMERICAL DIFFERENTIATION AND INTEGRATION
(7.8:3) r o
y dx = boyo + blYI + ... + bnY" .
As before. the particular formula derived will be exact for all polynomials
of max-degree n for ordinates at these abscissas. We obtain exact formulas
for arbitrarily but equally spaced ordinates by multiplying the formulas
found for abscissas O. 1... n by h. instead of by l/h as formerly.
As an example. take k = 1 in formula 7.8:3. We must then determine
the coefficients in
I
bl + 2"b2 + ... + n"b,.. = -
n+1
-.
7.8. NUMERICAL INTEGRATION IN TERMS OF ORDINATES 271
Note that these equations differ in form from Eqs. 7.4:1 only in the
column of constants.
Thus, for n = 3, we have
bo + b1 + bz + ba = 1,
b1 + 2bz + 3ba = l,
b1 + 4hz + 9ba = -1,
b1 + 8b z + 27ba = i,
which is exact for all polynomials of max-degree 3 for any four equally
spaced points. Thus, from y = 2x3 - 8x, we find y = -6, -21/4, 0,
45/4, respectively, for x = 1, -t,
2, i; and therefore
Ii (2x3 -
1
8x) dx t [9(-6) + 19 (- -21) - 5(0) + -45] = - -95
= -24 4 4 32 .
Hence
which becomes the formula previously derived if we drop all the primes
indicating differentiation.
Note that since we used formulas from Table 7.3:tl that are exact
when Y is a polynomial of max-degree 4 in deriving the last formula
containing the primes, it is exact when the integrand is a polynomial
of max-degree 3.
However, the most expeditious method of obtaining numerical
integral formulas of the required type is by substitution in the finite
difference formulas. We use formula 3.7:13, namely,
f "'B
"0
3h
Y dx = 80 (9yo + 34Yl + 24Y2 + 14Ya - Y4)
(7.8:8)
%:U-2
Y dx = "3 (Y2/-1 + 4Y2i-l + Y2i), i = 1,2, ... , m,
TABLE 7.8:tl ....
....
VALUES OF COEFFICIENTS FOR NUMERICAL INTEGRATION
...
ft (f)x dx
Zo
= Kh ~ Ct.iYi
'-0
Exact for
Fonnula polynomials K 0 2 3 4 5 6 7 8 9 10
no. of max-degree :""'I
Z
I c
0 - :I
m
2
'"
n
>
2 5 8 -I r
12
Q
I .."
2 3 9 19 -5 .."
m
24
'"
m
Z
3 4
720 I I 251 646 -264 106 -19 -I
;;
-I
4 5 475 1427 -798 482 -173 27 0
1440 Z
- - - - -_._----- ._-------- --------
>
I Z
5 2,3 2 4 0
3
Z
-I
6 4 2 29 124 24 4 -I m
90 Cl
7 5
I
2 28 129 14 -6
'"-I>
90 0
Z
'oj
3 CD
8 2 3 0 3
4 z
c
3 ~
9 3 3 3 3 m
8
'"n>
10 4
3
3 9 34 24 14 -1 ,...
80 Z
3 -I
73 38 38 -7 m
11 5 3 17 C'I
160
12 6 3 685 3240 1161 2176 -729 216 -29
'"~
(5
2240 z
4 Z
13 3 4 0 2 -1 2
3 -I
m
2
14 4,5
45
4 7 32 12 32 7 '"
~
en
2 0
.."
15 6 4 143 696 192 752 87 24 -4
945 0
16 3
5
5 -11 55 -65 45
'"cZ
24
5
~
m
19 -10 120 -70 85 en
17 4 5
144
5
18 5 51 19 75 50 50 75 19
288
5
19 6 51 743 3480 1275 3200 2325 1128 -55
12096
5
20 7 5\ 1431 7345 1395 8325 2725 3411 -495
24192 ....
'oj
VI
.....
~
IZkj(X) dx = Kh ~ Ck Y.
2'0 i-o-
......
Exact for
Formula polynomials K 0 2 3 4 5 6 7 8 9 10 z
c
no. of max-degree ~
m
3
'"
n
21 4 6 11 -44 96 -84 41 >
r-
IO
3
2
"T1
22 5 6 0 11 -14 26 -14 II "T1
m
10
1 '"Z
m
23 6,7 6 41 216 27 272 27 216 41 55 -I
~
140
7 (5
24 5 7 -611 4277 -9618 12782 -8603 3213 z
1440
25 6
7
7 751 -840 8547 -11648 14637 -7224 4417
z>
0
8640
7 Z
-I
26 7 7 751 3577 1323 2989 2989 1323 3577 751 m
17280 C)
27 8
7
7 21361 116662 6958 155134 7840 105154 74578 31882 -1169
'">
-I
518400 (5
z
.....
a.
8 z
28 6 8 460 -2760 8706 -13904 13641 -7464 2266 c
945 ~
m
29 7
9
8 0 460 -954 2196 -2459 2196 -954 460 ""n
945 .-)-
4 Z
30 8,9 8 989 5888 -928 10496 -4540 10496 -928 5888 989 -I
14175 m
Cl
9
31 7
4480
9 -1787 16083 - 52839 105039 -126801 98361 -45069 11493 ""-I
)-
(5
9 z
32 8 9 2857 -4986 51966 -110322 182880 -177102 129666 - 50886 20727
44800 Z
9 -I
33 9 9 2857 15741 1080 19344 5778 5778 19344 1080 15741 2857 m
89600
9
""
~
III
34 10 9 60259 372252 -93015 736968 -417834 781056 -119382 335160 229527 88804 -2595 0
1971200 .."
5 0
35 9
4536
10 0 4045 -11690 33340 -55070 67822 -55070 33340 -11690 4045 ""0
Z
)-
36 10,11 16067 106300 -48525 272400 - 260550 427368 -260550 272400 -48525 106300 16067 -I
m
29:376 10 III
....
:::I
278 7. NUMERICAL DIFFERENTIATION AND INTEGRATION
"0
Y dx
h
= "3 (Yo + 4Yl + 2Y2 + 4Y3 + ... + 2Y2m-2 + 4Y2m-l + Y2"')
Also, since
we have
The two formulas just derived are exact for polynomials of max-degree 3.
EXERCISE 7.8
1. Do by the methods ofthis section examples 1-3 of Exercise 7.7.
2. Choose appropriate values for x o , h, and an appropriate formula to evaluate the
following integrals, correct to the indicated number of decimal places.
a.I:~dx; 2 dp
c. I HU
1-u
sin -
Xl
4
dx, for u = 0, i, i, t, 1; 2 dp
I. f"ovl+x
tan Xl
/ dx, for u = 0.5,0.7, I, 1.2, 1.24; 3 dp
7.9. MAGNITUDE OF THE ERROR IN NUMERICAL INTEGRATION 279
n = 3.
n = 3.
n = 2.
n = 6.
(7.9:1)
where Pn(x) is the polynomial through the points (xo , Yo), ... , (xu, Yn),
h = xHI - x" t = (x - xo)Jh, and X is a value of x between the largest
and smallest of Xo , Xl' . , Xn , x. Hence
Ca-zol/ll
(
n
t
+1
)
dt.
(7.9:5)
280 7. NUMERICAL DIFFERENTIATION AND INTEGRATION
(7.9:6)
(7.9:7)
But
hence
(7.9:8)
The error inherent in the last expression can be determined by the long
method of Section 7.5, and therefore, since 7.9:7 and 7.9:8 are equivalent
statements, the error in the former can be determined.
For example, Simpson's formula is
which is equivalent to
where
(X2 - S)4 2 3
R(s) = 24 U(s I Xo , x2) - 9 h(Xl - s) U(s I Xo , Xl)
It is not difficult to prove that R(s) :::;;; 0 for all values of s, hence
f"'. R(s) ds = -
"'0
hS .
90
Therefore
hSF(SI(X) h5j'(41(X)
E(x) = - 90
= - 90
.
The result is the same as the one obtained by assuming .f'4I(x) constant
in the interval from Xo to X 2
EXERCISE 7.9
(7.10: I) r a
f(x) dx = aof(xo) + ad(xI) + ... + aJ(xn),
where the a/s are constants and the x/s are abscissas to be determined,
which is exact for polynomials of higher max-degrees. Indeed, it is
reasonable to expect that since 2n + 2 constants, a o , a l , , an , Xo , Xl ,
... , xn , are at our disposal, it may be possible to obtain a formula which
is exact for polynomials of max-degree 2n + 1. We consider this
problem in this section.
It turns out that it is convenient to make the transformation
x' = (x - a)/(b - a), so that 7.10:1 becomes
Ao + Al + A2 + .. , + An = I
AoXo + A1x1 + A 2x 2 + ... + Anxn = i
(7.10:4) _.1.
-3
A x2n+1
o 0
+ A I x2nI +1 + A :"-2
_x2n+1 + '" + A x2n+1 =
n 11. 2n
I
+2
Since these equations are linear in the A's but not in the x's, their
solution presents a far from simple problem. To solve this problem we
turn to some apparently foreign but nevertheless closely related inves-
tigations.
7.10. GAUSS' FORMULAS; ORTHOGONAL POLYNOMIALS 283
!+ Ul + U2 + ... +--=
Un 0
1 2 3 I+n
!+ Ul + U2
+"'+~=O
2 3 4 2+n
(7.10:5)
!+~+~+
nn+1 n+2
.. +~-o
n+n- ,
for U 1 , U 2 , ... , Un' If we add the fractions on the left-hand side of the
kth equation, we get
rk + n] [k + n]
In + 1 n + U 1 n + 1 n-l + ... + Un n + 1 0
[k + n]
[k + n]
n+1
in the notation of Section 7.1. In virtue of Eqs. 7.10:5, the left-hand side
of this identity must vanish for k = I, 2, ... , n; since the denominator
on the right is positive for k = I, 2, ... , n, the numerator must vanish
for each of these values. But the numerator is a polynomial in k if
max-degree n, hence
(7.10:6)
or
u;(-I)ii!(n - i)! = (n + i)(n + i-I) ... (i + 1).
Hence
.= (-I)i (n + i)(n + i-I)'" (i + 1)
u, i!(n _ i)!
or
(7.10:7) i=I,2,",n.
or
(7.10:8)
TABLE 7.10:tl
LEGENDRE POLYNOMIALS Pn(X)
Pn(X) =
j-O
(-1)j C) r ; i) xj
I: Pn(X) dx = 0, n ;;;. 1
x X2 XS x X X6 X7 XS x x lO
Po
PI -2
P2 -6 6
Ps -12 30 -20
p. -20 90 -140 70
p. -30 210 -560 630 -252
P6 -42 420 -1680 3150 -2772 924
P7 -56 756 -4200 11550 -16632 12012 -3432
Ps -72 1260 -9240 34650 -72072 84084 -51480 12870
p. -90 1980 -18480 90090 -252252 420420 -411840 218790 -48620
P IO -110 2970 -34320 210210 -756756 1681680 -2333760 1969110 -923780 18475 6
7.10. GAUSS' FORMULAS; ORTHOGONAL POLYNOMIALS 285
In particular, we have;
Property b.
(7.10:10) ro
Pn(x) P",(x) =0 if n =F m.
Property c.
(7.10:11)
(7.'10:12)
r a
f(x) g(x) dx = 0,
the functions f(x) and g(x) are said to be orthogonal on the interval
from a to h. Any two distinct Legendre polynomials are then orthogonal
on the interval from 0 to 1. It should be remarked, however, that Legen-
dre polynomials are usually so defined that they are orthogonal on the
interval from -I to I (it is convenient for our purposes to define them
as we did). A suitable linear transformation can be used to send one
set of polynomials into the other. Orthogonal polynomials are of great
importance in mathematics and its applications and there is an extensive
literature concerning them.
We now prove that the Legendre polynomials have the four proper-
ties stated above. Consider first
k = 0, I, "', n - l.
286 7. NUMERICAL DIFFERENTIATION AND INTEGRATION
We have
= +,+
i=O k
(-.I)i
I,
(~) (n ~, i) .
But the last sum is precisely the left-hand member of the (k + l)st
equation of 7.10:5 and is therefore equal to zero. Hence
(7.10:13) k = 0, I, ... , n - l.
which equals
Hence
as we wished to prove.
We now prove the last property. It follows from the definition of
the Legendre polynomial, 7.10:8, that Pn(O) = 1, hence P,,(x) is certainly
7.10. GAUSS' FORMULAS; ORTHOGONAL POLYNOMIALS 287
s: P,,(x) dx = 0,
f: rex) P,,(x) dx = 0,
= ~ (-I)i _.1_ (n ~ I) (n + ~ + i)
i=O ' +I, ,
TABLE 7.10:t2
x. = 0;5 A. = I
5 9 X. 0.04691 00770
= A. 0.1184634425
=
Xl = 0.23076 53449 Al = 0.23931 43352
XI = 0.5 AI = 0.28444 44444
Xa = 0.7692346551 Aa = 0.2393143352
x, = 0.95308 99230 A, = 0.1184634425
8 15 X. 0.0198550718
= A. = 0.05061 42681
Xl = 0.1016667613 Al = 0.1111905172
XI = 0.23723 37950 AI = 0.1568533229
Xa = 0.40828 26788 Aa = 0.1813418917
x, = 0.59171 73212 A, = 0.1813418917
Xi = 0.76276 62050 A. = 0.1568533229
x. = 0.8983332387 A. = 0.1111905172
X7 = 0.9801449282 A7 = 0.0506142681
290 7. NUMERICAL DIFFERENTIATION AND INTEGRATION
where the b's are constants and the P's are the Legendre polynomials.
(It is a well-known theorem of algebra that any polynomial written in
powers of x can be written in the form 7.10: 15; as a matter of fact,
the theorem referred to is true if in the form 7.10:15 Pi(x) is any poly-
nomial of degree i. The converse of this theorem is obviously true.)
We drop the subscript S on Is and again suppose that a suitable trans-
formation has been made so that the limits of integration become 0 and 1.
7.10. GAUSS' FORMULAS; ORTHOGONAL POLYNOMIALS 291
(7.10:17) i = 0, 1, ... , n,
Ibi = -2 r o
Pi(x) [f(x) - Pn(x)] dx
= -2 [t o
Pi(x)f(x) dx - t 0
Pi(x)Pn(x) dX]
= -2 [f: Pi(x)f(x) dx - 2i ~ 1] .
(7.10:18) bi = (2i + 1) ro
Pi(x)f(x) dx, i = 0, 1, ... , n.
Furthermore,
2
01 =
ob.Ob.
, , Ib;bj = !2i
20
+1
if i =1= j,
if i =j.
(7.10:19) Pn(x) = i
i-O
(2i + 1) Pi(x) t 0
Pi(x)f(x) dx.
~+
TT
(10 _ 120) (1 _
1T 1TS
6X + 6X2)
EXERCISE 7.10
1. Rework Exercise 7.8. example 3. by the methods of this section making suitable
choices for the number of points.
2. Evaluate J~3 ~ I + lOx' dx by Gauss' method using 6 points in the interval [ - 3. 9];
by using 3 points in each of the intervals [ - 3. 3]. [3. 9].
3. Use the Legendre polynomials to find polynomials of the indicated max-degrees that
will minimize the integrals
6. If xo. Xl ..... xn are the zeros of the Legendre polynomial P n+1(x). prove that
Xi + x .._/ = 1.
7. If Ao. AI ..... An are the coefficients in 7.10:2 determined as in the text. prove
Ai = A .._,.
Chapter B
(8.1:2) f(x,y) = 0;
a form in which only the variables x and y and none of the derivatives
are involved. This equation is said to be a solution of the ordinary
differential equation 8.1: 1 if 8.1: 1 reduces to an identity when y', y",
... , y(n) are replaced by their values derived from 8.1 :2. This implies
that if (xo , Yo) is any point whose coordinates satisfy 8.1:2 and if Yo',
y~', ... , y~n) are the values of the successive derivatives evaluated (from
8.1:2) at this point, then xo , Yo , Yo', ... , y~n) will satisfy Eq. 8.1:1.
A differential equation usually has infinitely many solutions; indeed,
if the differential equation contains a derivative of the nth order but
none of higher order, a solution will normally contain n arbitrary
constants or parameters, say Cl , Cz , ... , Cn . A solution of the differential
equation is usually then written in the more suggestive manner
(8.1:4)
is a general solution of
(8.1:7) y = 2x + c2e-"',
are particular one-parameter families of the general solution 8.1 :4.
Particular solutions or particular families of solutions are usually
determined by the imposition of so-called initial or boundary conditions.
For example, if the condition is imposed that the solution have slope 0
when x = 0, the one-parameter family y = c1(x + e-X ) is determined
in the above illustration. If the additional condition is imposed that
x = 0, y = 2 satisfy the solution, the particular solution y = 2(x + e-X )
is determined.
The methods of obtaining solutions, either general or particular,
of differential equations are treated in the texts on that subject. Unfor-
tunately, it is quickly apparent that the standard methods can be used
to solve only a relatively small number of types of differential equations.
As a consequence, if a given differential equation does not belong to one
of these solvable types, the scientific worker must be satisfied with an
approximate solution.
These approximate solutions can be obtained in two ways. In the
first place, we can modify the differential equation in such a manner
that the new form is amenable to solution. For example, the equation
d 28 .
(8.1:8) I dt 2 = -g sm 8,
296 8. NUMERICAL SOLUTION ':>F ORDINARY DIFFERENTIAL EQUATIONS
where I and g are constants, is not easy to solve as it stands; if, however,
the angle 8 is small, 8 and sin 8 are almost numerically equal and hence
it seems reasonable to suppose that if this equation is replaced by
tJ28
(8.1:9) I dt Z = -g8,
(8.1:13)
(8.1:14)
dy
(8.1:15) dx = F(x,y).
""//~//IIII
_/ /////11
'" /////111
///1/1111
///1111111
///1111111
I I I I I I I , I I
11111111"
'/1/111111
" I I I I I " I
EXERCISE 8.1
1. Draw lineal-element diagrams for each of the differential equations in the neigh-
borhood of the given point and sketch several of the particular solutions .
. y'=3x, (-1,-1). b.y'=x+y, (0,0).
whence
(8.2:5) y = Yo + r
"'0
F(x,f(x dx,
or
(8.2:6) y = Yo + r
"'0
F(x,y)dx.
It should be made quite clear that so far we have done nothing but toss
the problem around.
We now consider an iterative process which generates a sequence of
functions
(8.2:7)
Y2 = !2(X) = Yo + r
"'0
F(x, Yl) dx.
Ya = !a(x) = Yo + r
"'0
F(x, Y2) dx,
(8.2:8) Yn = !n(x) = Yo + r
"'0
F(x, Yn-l) dx.
Yl = 1+ (x + I) dx, or
302 8. NUMERICAL SOLUTION OF ORDINARY DIFFERENTIAL EQUATIONS
or
-1 1
Y2 - + X + 23 x2 + 32._q 14 &
x- + 4 x + 20 x .
Similarly, we find
_ 1 3 2 4 x3 13 x4 49 & 13 6 233 7 29 8
Y3 - +x+ 2 x +3 + 12 + 60 x + 30 x + 1260 x + 480 x
31 9 + 1 10 + 1 11
+ 2160 x 400 x 44OO x .
Y = 1+ x + fx 2 + t x3 + ....
EXAMPLE 2. Find the particular solution of Y' = sin x + y2 which
passes through the point (0, 1).
It is again easy to verify that the conditions for a solution to exist
do hold. If we then start with Yo = 1, we obtain
EXERCISE 8.l
Find, by Picard's method, the indicated approximations with the given boundary
conditions.
1. y' = x + y, fifth approximation at (0, 0).
2. y' = x + y, fifth approximation at (I, 2).
3. y' = xy, fourth approximation at (I, I).
4. y' = ye- Z , fourth approximation at (0, I).
5. y' =yl, thirdapproximationat(I, -I).
6. y' = 2eO - y, third approximation if y' = 3 when x = O.
7. y' = 2eO - y, third approximation if y' = y" = I.
(8.3:2) y =f(x),
304 8. NUMERICAL SOLUTION OF ORDINARY DIFFERENTIAL EQUATIONS
this time by use of the assumption that the solution can be expressed as
a power series
(8.3:3)
(8.3:4)
and
2a2 = 2aual +1
3a3 = 2aua2 + a l2
8.3. POWER SERIES APPROXIMATIONS 305
Consequently,
point (0, 1) through which the graph of the solution must pass. If we
do use this point, we find, since x = and y = ao = 1, that al = 1,
a2 = 3/2, a3 = 4/3, a4 = 17/12, ali = 31/20, .... Consequently,
3 4 17 31
y = I + x + 2 x 2 + 3 xl + 12 x4 + 20 xli + ....
Compare the sequence of functions 8.2:7 with the sequence of partial
sums of this power series.
We can obtain the same result somewhat differently, and perhaps
more briefly, if we recall that
(8.3:7) nla
ft
= y(ft)
0
= y(ft)(x0) = d".ltheft'
(xo)
y" + 2yy',
= I
y(3) = 2(yy" + y'2),
y(4) = 2(yy(3) + 3y'y"),
y(l) = 2(yy(4) + 4y'y(3) + 3y"2),
.............. , .. , ........ .,
306 8. NUMERICAL SOLUTION OF ORDINARY DIFFERENTIAL EQUATIONS
whence, at (0, 1), y' = 1 and y" = 3, y(3) = 8, y(4) = 34, y(li) = 186,
.... Hence, ao = I, a l = I, a2 = 3/2, a3 = 4/3, a4 = 17/12, ali = 31/20,
... , as before.
sin x = x- -
x3
3!
+ -xli5! + ... + (_I)n+1 (2nX2n- - 1I)! + ... '
we now have
Hence, at the point (0, 1), y' = 1, y" = 3, y(3) = 8, y(4) = 33, y(l) = 184,
... j and ao = 1, a l = 1, a 2 = 3/2, a3 = 4/3, a, = 11/8, a& = 23/15, ... ,
as before.
whence, at (1, -1) and from the given differential equation, y' = -1,
y" = -2, y(3) = -8, y(4) = -36, y(5) = -196, .... Hence, as before,
ao = -1, a l = -1, a 2 = -1, aa = -4/3, a4 = -3/2, a5 = -49/30,
tPy dy
X dx 2 + dx + xy = 0,
ao + 12a l + 1 . 2a2 = 0
ao + a l + 22a2 + 2 . 3a3 = 0
al + a2 + 32a3 + 3 . 4a4 = 0
EXERCISE 8.3
1-7. Do examples 1-7 of Exercise 8.2 by use of power series. Where possible, find the
general term of the series.
8. Use power series to approximate a solution of xly' = y if y(l) = rl. Find enough
terms to calculate y(1.5) correct to four decimal places.
9. Find the first six terms of the power series solutions of
a. y" = y if y = I, y' = 0 at x = O.
b. y" = xy if y(O) = y'(O) = I.
c. y" + xy' - 2y = 0 if y(l) = 0, y'(l) = 1.
10. Find the first six terms of the power series which are general solutions. Where
possible, find a formula for the nth term of the general solution.
a. y" = I + xy.
b. y" + y' - xy = O.
c. y" + xy' + y = O.
d. y" + x'y' + xy = lx.
e. (x - x')Y" + 3y' + 2y = O.
11. Find the first six terms of the power series solution of 2y l31 - 9y" + lOy' - 3y = 0
if, at x = I, we have y = 0, y' = -2, y" = 2.
12. Find the first five terms of the power series solution of y"l = xy' if
y = y' = _y" = _y131 = I at x = 2.
(8.4:1)
(8.4:2)
(8.5:1)
(8.5:3)
where the a's are given by 8.3:7 and where X is between X and Xo The
polynomial
(8.5:4)
f(n+l'(X) n+l
(8.5:5) (n + 1)1 (x - xo) .
312 8. NUMERICAL SOLUTION OF ORDINARY DIFFERENTIAL EQUATIONS
Once Yl has been calculated, Yl', y~', ... , can be calculated from 8.5:2
and we then have
' " (n)
(8.5:10) I ! 2 +Llhl++~h"
YI =YI+Llh 21 I nl I
(8.5:11)
(8.5:12)
0 1 1 3 8 34
0.1 1.11649236 1.34655519 4.0068372 12.6736279 60.449283
0.2 1.27356426 1.82196592 5.6407814 21.0069147 115.17118
0.3 1.48802214 2.51420989 8.4824000 37.8865006 240.71111
0.4 1.78936 167 3.60181519 13.8899001 75.6542550 570.91877
0.5 2.23453307
(8.5:14)
dy' = 1 + 2ydy
dy" = 2(y dy + y' dy)
dy (3) = 2(y dy" + 2y' dy' + y" dy)
Knowing the error dYl in Yl we can compute the errors in Yl', y{', y1 3 ),
"', and then, from 8.5: 10, the resulting error in Y2 . It develops that this
error is not more than one unit in the eighth decimal place of Y2 .
Corresponding computations verify that the calculated values of Y3 ,
Y4' and Y5 are certainly correct to five decimal places. We remark again
that because of the accumulation of errors in the progressive tabulations
and calculations, it is necessary to start with at least eight decimal
places to be assured of five place precision in Y5 .
EXERCISE 8.5
Find, correct to the indicated number of decimal places, the values of y corresponding
to the given values of x so that the points are on the integral curve of the differential
equation which passes through the given point. [The notation x = a (h) b signifies the
values of x ranging from x = a to x = b at intervals of h units; thus, x = 2.30 (0.05) 3.50
stands for x = 2.30, 2.35, 2.40, 2.45, ... , 3.45, 3.50.]
1. y' = x + y; (0,0); x = 0 (0.05) 0.5; 4 dp.
2. y' = x + y; (1,2); x = 1 (0.1) 2; 3 dp.
3.y'=y2+1; (1,3); x = 1 (0.1) 2; 4 dp.
dy y
4. - = 2 - -; (1,3); x = 1 (0.2) 3; 3 dp.
dx x
5. y' = xy; (I, I); x = 1 (0.2) 3; 3 dp.
6. y' = xy; (1,2); x = 1 (0.2) 3; 3 dp.
7. y' = yr"; (2, I); x = 2 (0.3) 5; 3 dp.
8. y' = 1 + 0.0Ix2y; (2,2); x = 2 (0.2) 4; 3 dp.
9. y' = 2eo - y; (3,0); x = 3 (0.1) 4; 3 dp.
10. xy' = 1 + eO; (1,0); x = 0.5 (0.1) 1.5; 3 dp.
(8.6:1 )
(8.6:2)
316 8. NUMERICAL SOLUTION OF ORDINARY DIFFERENTIAL EQUATIONS
such that the points (Xi' Yi)' i = I, 2, 3, ... , lie on the particular integral
curve of the differential equation
x y F(x,y) hF(x,y)
The numbers in the first column are entered since all are known; also
the next two entries in the first row. The value of hl is found from 8.6:4
and the next two numbers are entered in the second row. The value of
h z is found and the next two numbers entered in the third row. Then
ha and the next two numbers in the last row are entered. The h./s are
entered in the fourth column and then h is found as indicated in the last
column. The "sum" refers to the sum of the two entries above. The
value of Yl is Yo +
h; the table is then continued by the same procedure
until the value of the last Y is found.
The entries for this example are:
x y F(x, y) hF(x,y)
Xo Yo F(xo, Yo) hi hi + h,
Xo + lh Yo + !hl F(xo + lh, Yo + Ihl) h. 3(h. + ha)
In detail:
0 I I 0.1 0.23376576
0.03333333 1.03333333 1.10111 II 0.11011 III 0.69816846
0.06666667 1.07677778 1.22611 71 0.12261171 0.93193422
0.1 1.11250060 1.3376576 0.13376576 0.11649 178
0.1 1.11649 178 1.3465539 0.13465539 0.31553845
0.13333333 1.16137691 1.4821297 0.14821297 0.94102689
0.16666667 1.21981962 1.6546266 0.16546266 1.25656534
0.2 1.26839686 1.8088306 0.18088306 0.15707067
0.2 1.27356245 1.8219613 0.18219613 0.43154802
0.23333333 1.33429449 2.0136751 0.20136751 1.28408925
0.26666667 1.41419792 2.2666224 0.22666224 1.71563727
0.3 1.48105 331 2.4935189 0.24935189 0.31445466
0.3 1.48801 711 2.5141949 0.25141949 0.60808045
0.33333333 1.57182361 2.8039628 0.28039628 1.80255894
0.36666667 1.68460 689 3.2045670 0.32045670 2.41063939
0.4 1.77949702 3.56660 96 0.35666096 0.30132 992
0.4 1.78934703 3.6017628 0.36017628 0.90290596
0.43333333 1.90940579 4.0791638 0.40791638 2.65818288
We note that the two values obtained for Y5 differ by about 2 units
in the sixth decimal place. It is then natural to inquire into the errors
inherent in the Runge-Kutta formulas or in similar formulas; however,
since the formulas were not derived here, it is not possible to give a
detailed discussion of the magnitude of the error. The end result is
this: if YmH is obtained in two steps from Ym and Ym+l by means of
Runge's, Kutta's, or similar formulas, and if y!aH is obtained from Ym
in one step, that is, by use of an interval of width 2h, then the value of
Ym+2 will usually be improved by adding to it the quantity
(8.6:6)
1 1
15 (Y2 - Y2*) = 15 (1.27356 255 - 1.27353566) = 0.00000 179.
The corrected value of Y2 , namely 1.27356 434, is used in the next part
of the main table and the work is continued as before.
Compare the values obtained here with the values obtained in the
previous section.
EXERCISE 8.6
Redo the examples of Exercise 8.5 using the Runge and Kutta formulas.
MAIN TABLE
X Y X + y2 h(x + y2)
0 I I 0.1 0.11736848
0.05 1.05 1.1525 0.11525 0.23210706
0.05 1.057625 1.1685706 0.11685706 0.34947554
0.1 1.11685706 1.3473697 0.13473697 0.11649185
0.1 1.11649 185 1.3465541 0.13465541 0.15849050
0.15 1.18381956 1.5514288 0.15514288 0.31272 159
0.15 1.19406 329 1.5757871 0.15757871 0.47121209
0.2 1.27407056 1.8232558 0.18232558 0.15707070
0.2 1.27356255
0.00000 179 (correcting term)
0.2 1.27356434 1.8219661 0.18219661 0.21692130
0.25 1.36466265 2.1123041 0.21123041 0.42644403
0.25 1.37917955 2.1521362 0.21521362 0.64336533
0.3 1.48877 796 2.5164598 0.25164 598 0.21445511
0.3 1.48801945 2.5142019 0.25142019 0.30601880
0.35 1.61372 954 2.9541230 0.29541230 0.59797212
0.35 1.63572 560 3.0255982 0.30255982 0.90399092
0.4 1.79057927 3.6061741 0.36061741 0.30133031
0.4 1.78934976
0.00001 155 (correcting term)
0.4 1.78936131 3.6018139 0.36018139 0.45522847
0.45 1.96945201 4.3287412 0.43287412 0.88019683
0.45 2.00579837 4.4732271 0.44732271 1.33542530
0.5 2.23668402 5.5027554 0.55027554 0.44514177
0.5 2.23450308
AUXILIARY TABLE
whence
(8.7:3) Yn+k = Y.. + f"'''+k
F(x,y) dx.
"'"
The ordinate Yo was given; let the ordinates Y1 , Y2 , .. , Y1I be computed
by means of infinite series or any other of the previous methods. We
then determine
(8.7:4) i = 0, I, ... , n,
by substituting the given x's and the computed y's into Eq. 8.7:1. The
basic feature of the methods of this section is the use of these F's and
one or more suitably chosen formulas of Table 7.7:tl or 7.7:t2 to evaluate
the integral on the right-hand side of 8.7:3 to determine Yn+k.
Thus, one of the formulas of Table 7.7:tl is
(8.7:5)
or
(8.7:6)
The last equation expresses the ordinate Y1I+1 in terms of the preceding
ordinate Y1I' h, and previously found F's and their differences.
322 8. NUMERICAL SOLUTION OF ORDINARY DIFFERENTIAL EQUATIONS
enter the values of x in the first column, that is, the numbers 0, 0.0 I, 0.02,
0.03, ... , and then the other two entries in the first row. We compute
the value (1.01015 1348) of y corresponding to the value 0.01 of x by
infinite series or some other one of the previous methods and then the
corresponding value (0.01030 40575) of hF which is found from the
differential equation. These values are written in their proper places in
the second row and the first first-order finite difference LJ(hF) is computed
and entered. We next compute, again by some previous method, the
value of y corresponding to x = 0.02, the corresponding hF, and then
the second first-order finite difference and the first second-order finite
difference. We continue in this fashion and obtain after seven steps that
portion of the table above the dotted line. When we compute the next y,
that is, the one corresponding to x = 0.07, and then the corresponding
values of hF, LJ(hF), ... , we note the oscillations in the columns for
LJ5(hF) and LJ6(hF) (the latter column is not included in the table). We
infer that the errors due to polynomial approximation and rounding-off
have finally caught up to us and hence we decide to disregard the column
of sixth differences. (We repeat that the number of the column in which
oscillations due to polynomial approximation and rounding-off first
appears is dependent on the nature of the functions involved and the
number of decimal places used.)
Further y's are now computed by means offormula 8.7:6 whose right-
hand member terminates in this example with the term (95/288)LJ5(hF).
Thus, the y for x = 0.08 is computed by use of the formula from the y
for x = 0.07 and from the entries in the lowermost diagonal of the
difference table already formed, that is, from the entries between the
dotted and solid lines of the table. After Ys (= 1.09034 6247) has been
found, the corresponding hF is found from the differential equation and
another diagonal is added to the difference table. Further y's are com-
puted in a similar fashion to obtain the remainder of the table.
Formulas similar to 8.7:6 can be derived from Tables 7.7:tl,2 for the
evaluation of the integral in 8.7:3 for successive values of k. Indeed, if
r-"'0
k
y dx = h( -CoYo +c
1 .1Yo - C2 .170 ... )
Hence
(8.7:7)
This formula gives us the value of the integral in 8.7:3 and enables us
to calculate Yn+k in terms of the ordinate Yn and the F's and their dif-
ferences evaluated at (xn , Yn), (x n- 1 , Yn-l), (x n- 2 ,Yn-2)' .... Note that
formula 8.7:7 can be obtained directly from Table 7.7:tl if all minus
signs in the table are changed to plus signs and tJiyo is replaced by
tJi(hFn-.J
To illustrate the use of formula 8.7:7, suppose that in the example
worked out above the values of Y for x = 0, 0.01, 0.02, ... , 0.10 have
been found and that the F's and their differences have been computed.
We can find Y20' the value of Y corresponding to x = 0.20, by taking
n = k = 10 in 8.7:7. We have
whence
f"l
"0
Y dx = h(
Yl -I:2 Llyo - 12
1 Ll2Y_l - 24
1 LlaY_2 - )
,
f.....
n+1
F dx = hFn+1 -
1 1
"2 LI(hFn) - nLl2(hFn_l) -
1
24 Ll3(hFn_2) - ....
r. t2Fdx = hFn+1
:1:,,+1
+ ~LI(hF7I) + I;Ll2(hFn_1) + ~Lla(hFn_2) + ....
r. t2
....
F dx = 2hFn+1 + iLl2(hFn_1) + j Lla(hFn_2) + ~~ Ll4(hFn_a)
(8.7:8)
values Fo = F(xo, Yo), ... , Fn = F(xn ,Yn) have already been found. We
had previously obtained the formula
(8.7:9)
r"+l
F dx = hFn+1 - i.:j(hFn) - 112 .:j2(hFn_1) - i4.:j3(hFn- 2) - ....
"'"
Equation 8.7:3 can then be written as
(8.7:10) 1 1 1
Yn+1 = Yn + hFn+1 - 2:.:j(hFn) - 12.:j2(hFn- 1) - 24.:j3(hFn- 2) - ....
If we now estimate a value for F n+1 (see the remark below), all the
terms of the right-hand member of the last equality can be calculated
and hence a value of Yn+1 based on the estimated value of Fn+l is deter-
mined. This tentative value of Yn+1 and the known xn+1 are substituted
into the differential equation 8.7: 1 to obtain a second estimate for
Fn +1. This second estimate and its differences are substituted into
8.7:10 to yield a second estimate for Yn+1 which in turn is substituted
into the differential equation to yield a third estimate for F n +1. The
process is kept up until there is no change in Fn+1 and the corresponding
Yn+1 . The successive ordinates are found in the same manner.
The method just described is analogous to the method of iteration
used to find the roots of algebraic and transcendental equations con-
sidered in Chapter 5. We discuss this somewhat more fully later.
We illustrate the method by an example and postpone for a moment the
question of the convergence of the process. However, we first remark
that a very convenient way of obtaining a good estimate for Fn+1 is to
work backwards on the difference table of the F's. We assume the next
entry in the last column of the difference table and by additions work
backward to .d 2(hFn_1 ), .d(hFn), hFn+1 . This method has the advantage
of yielding all the terms necessary for the evaluation of the right-hand
member of 8.7:10.
Thus, in the example worked out previously, suppose that we have
progressed so far as the entry YIO = 1.116492354. The corresponding F
and all the differences of the F's have been computed; we wish to com-
pute Yu. The last entry in the last column is .d5(hF5) = 25 X 10-10 ;
we guess the next entry .d 5(hFs) to be 20 X 10-10 (in place of the
17 X 10- 10 which is actually there). Five additions yield
.:j4(hF7) - 341 X 10-10
.:j3(hFs) 5869 X 10-10
.:j2(hFe) 125769 X 10-10
.:j(hF10) 4070731 X 10-10
hFll = 138726249 X 10-10
8.7. POINTWISE METHODS; FINITE DIFFERENCES 327
0 0.20000
1052
0.1 1.2052 0.21052 110
1162 13
0.2 1.4214 0.22214 123
1285 II
0.3 1.6499 0.23499 134
1419 16
0.4 1.8918 0.24918 150
1569
0.5 2.1487 0.26487
or approximately,
(8.7:11) e' = i-he.
(8.7:12)
the error in the new F 20 will be smaller than the absolute value of the
error in the original F 20 In other words, if the error e in the original
F 20 satisfies the inequalities
EXERCISE 8.7
Do the following examples by the methods of this section.
1-10. Rework the examples of Exercise 8.5.
11. y' = 311" - 2y; (0, -4); x = 0 (0.2) 2; 3 dp.
12. y' = x + y2; (0,0); X = 0 (0.1) I; 4 dp.
13. y' = x + y2; (3,2); x = 3 (0.02) 3.3; 3 dp.
14. y' = y2 _ ~ _ 2x . (_I I)' x = -I (0.2) )., 3 dp.
)+x 2 (I + X I )2' "
(8.8:2)
A: Yn+1 = Yn-3 + ~ h(2Y~_2 - Y~-1 + 2Yn')
c: Yn+1 = Yn-1 + ~ h(Y~_1 + 4Yn' + Y~+1);
(8.8:3)
A: Yn+1 = Yn-5 + 130 h(llY~_4 - 14Y~_3 + 26Y~_2 - 14Y~_1 + llYn')
r
"'0
Y' dx = t h(2Y1' - Y2' + 2Y3')
But
J"'. y'dx
"'0
= Y4 - Yo;
Hence
332 8. NUMERICAL SOLUTION OF ORDINARY DIFFERENTIAL EQUATIONS
These expressions for the errors were derived in Section 7.9; in particular,
they come from formulas 7.9:5 and 7.9:6 with a slight change of notation.
Here, y = f(x) is a solution of the differential equation and y' = j'(x) =
F(x). As before, X is a value of x between the largest and the smallest
of the x's under consideration and usually has one value for the advancing
formula and another value for the associated correcting formula. The
abscissa here called Xo is actually the abscissa X n - 3 of 8.8:2A, the abscissa
Xn-l of 8.8:2C, and so on.
We illustrate the present method of solving a differential equation by
doing
dy
(8.8:8) -=2+y-2x
dx
in) = i,,-lI.
At X = 0 we have Y = 1. y' = 3. y" = y(3) = ... = yIn) = 1. Hence
x2 x3 x"
Y =I+3x+-+-++-+
2! 3! n! .
x y y'
0 1.0000 3.0000
0.1 1.3052 3.1052
0.2 1.6214 3.2214
0.3 1.9499 3.3499
We see from the first form of the error term in 8.8:5A that the error
inherent in the formula 8.8:2A will not affect the fourth decimal place
of Yn+1 since in this example h = 0.1 and j'51(X) = 1. It turns out that
we do not need formula 8.8:2C to correct. but we shall use it as a check
on our calculations.
From 8.8:2A. we get
4
Y4 = 1.0000 + 30 [2(3.1052) - 3.2214 + 2(3.3499)] = 2.2918.
1
y, = 1.6214 + 30 [3.2214 + 4(3.3499) + 3.4918] = 2.2918.
334 8. NUMERICAL SOLUTION OF ORDINARY DIFFERENTIAL EQUATIONS
x y y'
0 1.0000 3.0000
0.1 1.3052 3.1052
0.2 1.6214 3.2214
0.3 1.9499 3.3499
0.4 2.2918 3.4918
0.5 2.6488 3.6488
0.6 3.0221 3.8221
0.7 3.4138 4.0138
0.8 3.8255 4.2255
0.9 4.2596 4.4596
1 4.7182 4.7182
Again, we have
4
Y6 = 1.3052 + 30 [2(3.2214) - 3.3499 + 2(3.4918)] = 2.6487.
Y6' = 2 + 2.6487 - 1 = 3.6487.
Hence
1
Y5 = 1.9499 + 30 [3.3499 + 4(3.4918) + 3.6487] = 2.6488.
This time the corrected value is one unit more in the fourth decimal place
than the tentative value. We enter these values in the table and continue
in the same fashion to find the remaining values of y.
We remark first that although the error due to the use of the formula
is too small to affect the last decimal place, rounding-off errors may
influence the results. As a matter of fact, the values of Y obtained
above are correct as far as written except that Y5 should be 0.6487 and
YIO should be 4.7183. The values can be checked from the solution
Y = 2x + eZ of the differential equation. We remark next that although
it is possible to obtain the values Y4 , Y5' ... from the Maclaurin series
as we pointed out above, it probably takes no more time to obtain these
results by the method used here.
Before we do a second example, we pause for some important observa-
tions. Strange as it may seem at first, it is the correcting formula that
plays the important, if sometimes hidden, role in this process. Although
the advancing formula does predict the new Yn+l , actually the corrector
and the differential equation can be used to iterate to the desired Yn+l .
8.8. POINTWISE METHODS; ITERATION USING ORDINATES 335
For example, suppose Yo' YI , ... , Y7 , Yo', YI" ... , Y7' of the preceding
example are known. We wish Ys . It is readily ascertained that the differ-
ential equation and the correcting formula become, for this particular
case
want is a value of Yn+1 which together with its derivative Y~+1 will satisfy
8.8:8 and 8.8:2C simultaneously. We get from 8.8:8
Substitute this value for Y~+l into 8.8:2C and solve for Yn+l; we obtain
and the value of the corresponding derivative in the table and continue
in the same manner to calculate the further entries. We have carried
out the work as far as the Y corresponding to x = 0.2; the further entries
are left to the reader.
x y y'
0 1.00000 1.00000
0.02 1.02061 1.06164
0.04 1.04249 1.12679
0.06 1.06571 1.19574
0.08 1.09035 1.26686
0.10 1.11649 1.34655
0.12 1.14425 1.42931
0.14 1.17370 1.51757
0.16 1.20499 1.61200
0.18 1.23823 1.71321
0.20 1.27357 1.82198
where y is the value obtained from 8.8:2A and e1 is the error given in
8.8:5A. But the exact value of Yn+1 is also given by
(8.8:14)
That is, the error inherent in formula 8.8:5C is roughly (1/29)th of the
difference between the value of Y predicted by 8.8:2A and the final
value of Y obtained from 8.8:2C. As long as this error does not affect
the significant figures used, we can rely on the values obtained by use
of these formulas. However, if the error is large enough to affect the
last decimal place retained, then either the final value of y obtained by
iteration must be modified in light of the error, or, what is far safer,
a smaller value of h should be chosen and used.
In examples 1 and 2 worked out above, it is readily ascertained that
e2 is too small to affect the results, at least as far as the work was carried
out. But suppose that in example 2 we had used the interval h = 0.1,
with Xo = 0, Xl = 0.1, x 2 = 0.2, etc. It turns out that the value of Y 4
predicted by the advancing formula is Y4 = 1.78661. The final value
of Y4 obtained by iteration of the correcting formula is :94 = 1.78961.
Hence e2 = -0.00010. The corrected value of Y4 is then Y4 = 1.78951.
It can be shown by other means, however, that the value of Y4 correct to
five decimal places is Y4 = 1.78936. The discrepancy shows that the
interval h = 0.1 is too large for this example if we wish to keep five
decimal places. Incidentally, the error e2 = 0.00010 differs so much from
the actual error 0.00025 because the conditions that e of 8.8: 15 be negli-
gible and the X's of 8.8:5A and 8.8:5C be equal are not satisfied here.
It is wise when solving a differential equation by this method to
keep an eye at each step on the difference Y - y, the difference between
the predicted value and the final corrected value of y. Some workers
go so far as to tabulate these differences in their work. Not only will the
successive differences tell us if the interval h is small enough, but also,
since these differences should vary but little from step to step, a difference
which is out of line will indicate a mistake in the calculations.
A sufficient condition for convergence of the iteration process is
readily obtained by the same method as the one outlined above. Let h
and Yn-l , Y~~l , Yn' be given. The differential equation 8.8: 1 becomes
Hence
(8.8:17)
This equation in which Yn+1 is the only unknown is the one used for
iteration. If follows from the discussion in Section 5.3 that we are assured
of convergence if
, Yn+1) I
(8.8:18) IdF(xn+1
dYn+1
is less than some positive number which is itself less than
(8.8:19) 3/h.
If formula 8.8:3C or 8.8:4C were used, convergence will be assured if the
absolute value 8.8:18 is less than a positive number which is itself less
than 45/14h or 140/41h, respectively. Note that as far as convergence
is concerned, very little is gained by the use of the longer formulas in
place of 8.8:2C. We repeat that even in the case of convergence, the final
value of Yn+1 is still subject to the error inherent in the formula. If
pm,(x) does not increase too rapidly with increasing m, then the longer
formulas will entail smaller errors than formula 8.8:2C.
In particular, the discussion in the preceding paragraph indicates
that in example 2 we can keep on finding Yk , Yk+l , .. until we reach a
value of Y which exceeds 75 since d(x +
y 2 )/dy = 2y (x is a constant in
this discussion) and h = 0.02.
EXERCISE 8.8
dYI
dx -_ F 1(x , Y 1, Y 2, ... , Y '" )
with given initial conditions. The example below will illustrate several
of the possible methods of solution. For the sake of simplicity in notation,
we designate the independent variable by t and the dependent variables
by x and y; also, unless otherwise stated, primes and other symbols
of differentiation indicate differentiation with respect to t.
As before,
yln)(I)
(8.9:4) bn = ---.
n!
y' = itx-1
y" = i - tx-2x' + X-I
y(3) = i- tx- 2x" + 2tx- (x')2 -
3 2x- 2x'.
Hence
2
x = "3 + (t - I) + 41 (t - 1
1)2 - 24 (t - 1)3 + 641 (t - 1)4 + ... ,
Y = 3 + (t - I) - 41 (t - 1)2 + 321 (t - 1)3 + ....
We find the desired values of x and y by substituting the given values
of t into the infinite series; they are listed in the following table.
x y
x=!+ (!(Y-I)dt
(8.9:5)
y=3+ I -dt.
2t
t
3x
1
We use the initial value 3 for y, substitute into the integrand of the first
equation of 8.9:5 and perform the integration; we obtain a first approx-
imation for x,
x=t-i
Similarly, we substitute the initial value 2/3 for x into the integrand
of the second equation of 8.9:5, integrate, and obtain
t2 5
Y=-+-
2 2
as the first approximation for y. Substituting this approximation for y
into the integrand of the first equation of 8.9:5 and carrying out the
integration, we obtain a second approximation for x
342 8. NUMERICAL SOLUTION OF ORDINARY DIFFERENTIAL EQUATIONS
x y
These values agree fairly well with the first set of values. It is apparent,
however, that they are beginning to diverge.
Solution by Runge-Kutta formulas. The formulas of Section 8.6
can be modified for use in solving systems of first order differential
equations. For example, the Runge formulas 8.6:4 are extended to read
ku = hFi(to , Xo ,Yo)
ki.2 = hFi(to + 1h, Xo + 1kl.l , Yo + ! k2.l)
(8.9:6) ki.a = hFi(t + ! h, Xo + ! kl.2 ,Yo + ! ku)
O
k i = i- (k i 1 + 2k i 2 + 2ki a + k i .,)
2t
F2 =-,
3x
and
After Xl and YI have been computed, all the appropriate subscripts are
stepped up by unity and the calculations are continued as before. The
generalization to m dependent variables is immediate.
The work for this example is shown in the table below; the arrange-
ment is essentially the same as it is in the table for one dependent
variable and requires no further explanation.
8.9. FIRST-ORDER SYSTEMS; HIGHER ORDER AND SPECIAL EQUATIONS l.ofl
kl,l k.,1
I t
X Y -(y - I) kl k.
20 15x
first four rows and first three columns of the following table. We find
hFl and hF2 from the differential equations, calculate their differences
(second differences are sufficient here) and enter them in the table.
We next calculate
We find hF1.4 and hF2.4 and then extend the difference table. Finally,
(8.9:8)
8.9. FIRST-ORDER SYSTEMS; HIGHER ORDER AND SPECIAL EQUATIONS 345
4
Y4 = 3.0000 + 30 [2(0.9535) - 0.9123 + 2(0.8771)] = 3.3665.
x y Fl.! F2.I
1 0.6667 3.0000 1.0000 1.0000
1.1 0.7691 3.0976 1.0488 0.9535
1.2 0.8763 3.1909 1.0955 0.9123
1.3 0.9881 3.2804 1.1402 0.8771
1.4 1.1043 3.3664 1.1832 0.8452
1.5 1.2247 3.4495
I
Y4 = 3.1909 + 30 [0.9123 + 4(0.8771) + 0.8452] = 3.3664.
We keep these values and go on to find Xs and Ys in the same way. The
values are shown in the table.
The various values obtained above can be checked from the particular
solution of the differential equation x = 2t3/2 /3, Y = 2tl/2 + 1. The
values of x and Y correct to four decimal places are:
x y
1 0.6667 3.0000
1.1 0.7691 3.0976
1.2 0.8764 3.1909
1.3 0.9882 3.2804
1.4 1.1043 3.3664
1.5 1.2247 3.4495
346 8. NUMERICAL SOLUTION OF ORDINARY DIFFERENTIAL EQUATIONS
The methods of solution used above are, of course, not the only
methods available for the solution of systems of equations of the form
8.9: 1. As we noted before, practically every method that applies to a
single first order differential equation can be used for simultaneous
first order equations. Also, the reader is cautioned not to judge the
efficiency of any particular method by what happened in this particular
example. The amount of labor involved in a method of solution depends
on the nature of the functions present, the number of decimal places
required, and the number of successive values wanted, among other
things. Only experience can teach one which method is apt to be the
most suitable for a given problem.
We consider next, although somewhat briefly, differential equations
of higher order. We have already seen, example 4 of Section 8.3, that
such equations can be solved by means of infinite series. Other methods
also exist, but all that we shall do is to point out that the solution of
the nth-order differential equation
(8.9:9)
where Q and the P/s are functions of x and y, can be reduced to the
solution of a system of first-order differential equations. Indeed, put
dy
dx = VI
d'y dV I
dxB = Tx = V2
dv]
dx = VB
(8.9:10)
8.9. FIRST-ORDER SYSTEMS; HIGHER ORDER AND SPECIAL EQUATIONS 347
dy
-=V
dx
x y v F 1( =v) Fa (= -y - ; )
1.0000 2.0000 2.0000 -3.0000
1.1 1.1855 1.7135 1.7135 -2.7432
1.2 1.3434 1.4493 1.4493 -2.5512
1.3 1.4758 1.2018 1.2018 -2.4003
1.4 1.5842 0.9684 0.9684 -2.2759
1.5 1.6699 0.7461 0.7461 -2.1673
dBy
(8.9:11) dx 2 = G(x, y),
dv
dx = G(x,y),
were computed by means of the formulas 8.9:12. All values are listed
in the table below.
x y G
0 0
0.2 1.4016 0.2803
0.4 1.8149 0.7260
0.6 2.2580 1.3548
0.8 2.7560 2.2048
1.0 3.3432 3.3432
EXERCISE 8.9
dx dy
2. -
dt
= x - y + 1' -
dt
= -x/to
'
x = y = 0 when t = 0; t = 0(0.2)2; 3 dp.
dx dy
3. dt = y - tl + I,
- = 3t - x
dt '
x = -I, y = 1 when t = 0; t ='0(0.1)2; 4dp.
dx dy dz
4. - = x - z - t - = x - 3t - 1 - = x - y - t l - t - I'
dt 'dt 'dt '
x=2, y=O, z=-I when t=O; t=O(O.I)I; 3dp.
5. dx + 2tT dy = 0, dy + ~ y dx = 0, dz _ dx = x;
dt dt dt 2 dt dt dt
x = 0, y = I, z = -I when t = I; t = 1(0.4)3; 3 dp.
Curve Fitting
(9.1:1)
is a set of numbers, what single number will "best" represent this set? If
(9.1:2)
(9.2:1)
of a quantity Xi say the measured values corresponding to the X's are
(9.2:2)
Alternately, the X's may be measured for the given values 9.2:2 of y, or
the values Xl and Y J , X 2 and Y 2' , Xn and Y n may be measured
simultaneously. The mathematical expression of the physical law is
an equation
(9.2:3) f(x,y) = 0
that is satisfied or almost satisfied by the number pairs or points
(9.2:4)
From one point of view the problem of determining f(x, y) may seem
trivial since we have seen, Section 3.2, that if the X's are distinct there
is a polynomial y = P(x) of max-degree n - 1 whose graph will pass
through these n points; however, this polynomial is usually undesirable
as the function f(x, y) for several reasons. First, a polynomial of degree
n - 1 may have as many as n - 2 turning points and hence may not be
smooth enough to express the physical law; second, physical or other
considerations may indicate that some other type of function, sayan
exponential or periodic function, is more appropriate; third, and most
important, the X's or the Y's, or both, were obtained by measurement
or other means involving some degree of error and are undoubtedly
inexact so that the points 9.2:4 should, by and large, lie not on the graph
of f(x, y) = 0, which is the "true" expression of the physical law, but
near the graph. These considerations lead us to believe that some
function other than the polynomial determined by the points is more
appropriate and desired.
9.2. THE STRAIGHT LINE lSl
If not the polynomial, then what kind of function should f(x, y) be?
As previously suggested, a prior knowledge of the physical laws involved
may indicate the type of function which seems appropriate; if the phe-
nomenon is entirely new or prior knowledge sheds no light, we assume
as simple a type of function as possible which seems to fit the points
9.2:4. This function is kept until accumulated evidence indicates the
necessity for a change. To illustrate: the points (0.5, 0.24), (0.8, 0.40),
(1.0, 0.52), (1.3,0.64) seem to lie on or close to a straight line through
the origin (the reader should draw a graph for himself); the graph of
y = x/2 is a good fit. But so are the graphs of y = 5 sin x/IO and
y = 0.05 x + In( I + 0.6x). Hence, lacking other information, we would
choose y = x/2 since it is the most simple equation for most purposes.
We suppose, for the remainder of this section, that a straight line
is sought as a fit for the points 9.2:4. The first, and simplest, method
of obtaining the line, the method of inspection, consists merely in plot-
ting the points on graph paper, taking a straightedge or ruler and ad-
justing it by eye until it seems to fit the points well, and then drawing
the line. The method is indeed simple, it is quick, and in the absence
of further information it may be as good, for all we know, as any other
line determined by the much longer methods described below. One
drawback, however, is that the equation of the line must yet be found.
This is done easily enough by selecting two points on the line (the
coordinates have to be approximated, of course) and then using the two-
point formula (y - YI)(X I - XI) = (YI - YI)(X - Xl) of analytic geo-
metry to determine the equation. Another drawback may be more
serious even though it is psychological in nature. Many people-
including many scientific workers who ought to know better- are
upset by the simplicity of the method of inspection and the lack of
prolonged calculations. For their sake, and because the methods to come
are indeed sometimes justified, we investigate more evaluatory proce-
dures.
Suppose first that the points 9.2:4 seem to lie on a vertical line; its
equation is of the form
(9.2:5) X= X.
T
P,' (X,', 'r/ ) .
"C(xi,Y;)
~~~--------~o~------------------X
s
FIG. 9.2:1.
9.2. THE STRAIGHT LINE 355
(9.2:7)
(9.2:8)
(9.2:9)
(9.2:10) ~ei = OJ
then
(9.2:11)
(9.2:12)
If we now impose the conditions that the sum of the errors of each
group of points be zero, we obtain
ft.' fl.'
(9.2:14) m~ X/ + n'b = ~ Y/ ,
i=1 i-I
n" n"
(9.2:15) m ~ X;' + n"b = ~ Y;' .
i-I i-I
EXAMPLE I. Fit a straight line to the set of points (2, -2.5), (4, -1.1),
(6, 1.3), (8,3.1), (10, 4.7), (12,6.9).
The plot of the points on graph paper (which the reader should draw)
indicates that the points do lie approximately on a straight line.
If we group the first three points and the last three, Eqs. 9.2: 14 and
9.2:15 become
12m + 3b = -2.3
30m + 3b = 14.7;
+ 3b =
ISm 3.5
24m + 3b = S.9;
If we put the two extreme points into one group and the remaining
four points into a second group, we obtain the inconsistent equations
14m + 2b = 4.4
28m + 4b = 8
EXAMPLE 2. Fit a straight line to the points (0, 3), (I, 2), (2, 2),
(3, I), (4, I), (5,0).
If we group the first, third, and fifth and the second, fourth, and
sixth points, we obtain
6m+3b=6
9m + 3b = 3.
m LX, +b= L Yo ,
n n
it is seen that the point whose abscissa and ordinate are the arithmetic
averages of the X's and Y's, respectively, that is, whose coordinates are
(9.2: 16)
will satisfy Eq. 9.2:6. The point 9.2: 16 is called the centroid or center
of gravity of the points 9.2:4.
The imposition of the condition 9.2: 10 forces the line 9.2:6 to go
through the centroid of the points 9.2:4; dividing the points into two
groups forces the line to go through the centroid of each group (and
through the centroid of all the points) and hence determines the line
unless all three centroids coincide. A line determined in this manner
358 9. CURVE FITTING
mX, - Y i +b
ei = vm2 + 1
and if we again impose condition 9.2:10, we are once more led to the
same result.
We have seen that if we separate the points 9.2:4 into two groups
and choose the line determined by the centroids as a fit for the points,
that not only will we usually get different lines for different methods
of grouping but, in some cases, the lines found are not good fits at all.
As another example, consider the four points A: (0.0, 2.2), B: (2.2, 2.4),
c: (3.0,2.7), D: (5.0, 3.3). The three ways of grouping these points
two by two yield the answers y = 0.24x + 2.03, y = 0.19x + 2.16,
y = -2.0x + 7.75. The first two answers are reasonably close together
and a graph will show that the lines are fair fits; the third, however,
represents a line that is almost perpendicular to the first two and is
not a good fit at all. The reason for this behavior is easy to find. In the
first two cases, the centroids are some distance apart so that a slight
shift in one or the other or both would not have a great effect on the line
through them, but in the third case the centroids are rather close together
so that a slight shift in either could cause a large shift in the line. It is
therefore advisable to group the points in such manner that the two
centroids are far apart to obtain a line that fits well.
The next method we consider for fitting a line to a set of points
involves considerably more computation than the preceding methods,
but it requires no exercise of judgment of just where to draw the line
or just how to group the points, and it always results in a good fitting
straight line.
Conditions other than 9.2: 10 may be imposed on the errors ei , how-
ever they may be defined, to determine the parameters m and b of the
equation 9.2:6. For example, we may impose the condition that :E I ei I be
a minimum. This condition is imposed rather rarely since the absolute
9.2. THE STRAIGHT LINE 359
(9.2:17) be a minimum.
and if
(9.2:20)
It follows that
Sb = 2 ~ (mXi +b- Y i ),
(9.2:22)
Set 8 b = 8 m = 0, then
m ~ Xi + bn = ~ Y i
(9.2:23)
m ~ Xi 2 + b ~ Xi = ~ XiYi .
These equations are consistent and independent if
(9.2:24) D= *0,
360 9. CURVE FITTING
+
that is, if (~Xi)2 - n ~ Xi 2 =1= O. But (Xi - X;)2 ~ 0, or Xi 2 Xi 2 ~
2Xi X i , with the equality holding only if Xi = Xi' Therefore,
~i<; (Xi2 + Xl) = (n - I) ~ Xi. 2 ~ 2 ~i<; XiX; and n ~ Xi 2 ~
~ Xi 2+ 2 ~i<j XiX j = (~Xi)2. The equality can hold only if
Xi = X; for every i and j. If we rule out this case, then
D= <0
= -4D>0
x y XI XY
0 3 0 0
I 2 I 2
2 2 4 4
3 I 9 3
4 I 16 4
5 0 25 0
15 9 55 13
15m + 6b = 9
55m + 15b = 13;
9.2. THE STRAIGHT LINE 361
x'=x-Jl
(9.2:25)
y' =y- Y,
(9.2:26)
nb' = 0
(9.2:27)
m~X? = ~X/Y/,
whence
(9.2:28)
b' =0
~X/Y/
m= ~X'2 '
j
The work for the example just done would then look as follows:
x y X'=X-Q y' = y -
2
t X'I X'y'
15 9 0 0 7014 -38/4
362 9. CURVE FITTING
Hence m = - 38/4 -;- 70/4 = -19/35 and 19x' + 35)" = O. This equa-
tion reduces to the original one if we transform back to the original
variables. One reason for translating the axes is to shorten the amount
of computational work when performed longhand.
If the X's are in error and the Y's are exact, case (ii), and the required
line is not horizontal, the desired equation can be written in the form
(9.2:29') x = py + a.
The same reasoning as before leads to the new normal equations
p ~ Yi + an = ~ Xi
(9.2:30)
P~ y;2 + a ~ Yi = ~ Xi Y i
(9.2:31)
(9.2:32)
(9.2:33)
We have
2
Tb = m2 + 1 k (mX; - Y; + b)
Tm = m2 ~ 1 k (mX; - Yi + b) Xi - (m 22: 1)2 k (mXi - Yi + b)2.
In virtue of 9.2:33, these two equations reduce to
(9.2:35)
(9.2:36) b = O.
That is, the line again goes through the centroid of the points. From
T m = 0 and b = 0, we get the equation
(9.2:38)
We find
(9.2:39) m=
-13 vex. 2 + 132
ex.
2n
Tbb = m2 + 1
4mnb
Tmb = T bm = - (m2 + 1)2
o 8n
4 (m 2 + 1)3 (ma: + fJ)
(m 2 + 1)2 (ma: + fJ)
The first factor on the right is evidently positive, hence the sign of
the determinant depends on the second factor ma + f3. But from
9.2:39, ma + f3 = V~ + f32, hence the determinant will be positive
if we choose the positive sign in front of the radical; that is, if
(9.2:40)
(9.2:41) m =0.
Also,
Tbb T bm I = 1
2n 0 I = 8nfJ
I
Tmb Tmm 0 4fJ
(9.2:42)
is the required line. If f3 < 0, it turns out that the required line IS
(9.2:42a) x = o.
If a = f3 = 0, then ~ Xi 2 = ~ Y i 2 and T reduces to T = ~ Xi2, an
expression independent of m. Hence any line through the centroid
will do.
As an example of caSl~ (iii), we fit a line to the points of example 2.
We first translate the axes so that the new origin is at the point whose
old coordinates are (t, t) and construct the following table (where
we have dropped the primes from the X's and Y's):
9.2. THE STRAIGHT LINE 365
x y XI XY Y
------
-5/2 312 2514 -1514 9/4
-312 112 9/4 -3/4 114
-1/2 112 1/4 -1/4 114
1/2 -1/2 114 -1/4 114
3/2 -1/2 914 -3/4 114
5/2 -3/2 2514 -1514 9/4
._-------
:E 0 0 70/4 -38/4 2214
- - - - - - - - - - ._---_._-------
0<= -2' P = ~
19
2 4
CO _ 22)
4
=6
' Y=-19'
12
m 12 -
= 19 ~ I + e2f
19 = -0.55
EXERCISE 9.2
1. Find equations of straight lines to fit each of the following sets of points by
(i) drawing a line with a ruler, judging the "best" position;
(ii) the method of averages;
(iii) the method of least squares for each of the three cases.
a b c d
x y x y x y x y
e I h
x y x y x y x Y
2. Find equations of straight lines to fit each of the following sets of points and to
satisfy the accompanying condition .
(-1,3.1), (1,2.8), (3,8.7), (6, 18.2), and passing through the origin.
b. (-5.1, 1.0), (-2.8,0.5), (4.2, -0.7), (10.0, -1.8), and passing through the
origin.
c. (-1.1, -5.2), (0, -2.8), (3.3, 3.9), (7.6, 12.1), and passing through the
point (I, -I).
d. The points of part c and parallel to the line y = lx.
e. (-3, -6.8), (I, -4.1), (5, -0.7), (13, 5.2), and tangent to the circle
Xl + yl - 4x - 6y - 12 = O.
1. In example I, define the error at a point P, in parts (i) and (ii), as the value of y found
by substituting the abscissa of P into the equation minus the corresponding observed or
given value of y; in part (iii), define the error as in the text. Determine the errors at the
given points. What light do these answers throw on the number of significant figures to be
used for the parameters ?
(9.3:1)
so that the graph of the polynomial is a good fit for the points
(9.3:2)
(9.3:4)
and set the sum of the errors in each group equal to zero. The resulting
m + 1 equations can be solved for the m + 1 parameters. If these
equations are inconsistent, a regrouping is necessary.
368 9. CURVE FITTING
aon + a 1 ~ Xi + ... + am ~ Xr = ~ Y i
ao~ Xi + al~ XiI + ... + am~X~+l = ~ XiYi
(9.3:7) + ... + am~
~ X~+2 =
I
~ x.ly'
~ I I
These are the normal equations for the determination of the polynomial
of max-degree m. It can be shown that these equations are consistent and
independent and the solution minimizes the sum of the squares of the
errors. Note again that the condition that the sum of the squares of the
errors be a minimum is sufficient to determine the m + I parameters
ao a 1 am
9.3. POLYNOMIAL GRAPHS 369
X y x XI x' Xy xy
-2 9 4 -8 16 -18 36
-I 6 1 -1 1 -6 6
0 3 0 0 0 0 0
1 -1 1 1 I -1 -1
2 -2 4 8 16 -4 -8
3 -3 9 27 81 -9 -27
5 -1 25 125 625 -5 -25
7 3 49 343 2401 21 147
~ 15 14 93 495 3141 -22 128
EXERCISE 9.3
1. Find equations of parabolas of the form y = a + bx + ex that fit the following sets
of points by the method of centroids, the method of averages, and the method of least
squares.
a b c d e f
----
x y x y x y x y x y x Y
2. Find equations of cubics that fit the following sets of points by the method of
centroids, the method of averages, and the method of least squares:
-3 -2 -I 0 2 3 4 5 6
:1 -5.4 -1.5 -0.2 0.0 0.1 1.4 5.5 13.0 25.0 43.0
-4 -3 -2 -I 0 2 3 4
XI -5
y -178 -40 -12 0 2 0 10 30 70
3. Find an equation of a parabola which is a good fit for the points ( -4, 29), (-2, 10),
(I, -2), (3, I) and which passes through the origin.
4. Find an equation of a parabola which is a good fit for the points (-I, - 3.8), (0, 0),
(2,2.1), (4, -4.0) and which passes through the point (I, 2).
5. Find an equation of a parabola which is a good fit for the points ( -I, 8.1), (0, - 1.0),
(3, 7.8) and which is tangent to the line 6x - y - 13 = 0 at (2, -I).
EXAMPLE 1.
Determine the parameters in y = aebz (e is not a para-
meter) so that the graph of the curve is a good fit for the points (0.5, 0.58),
(1.0,0.68), (2.0,0.90), (4.0, 1.65), (9.0, 7.45).
Solution by reduction to previous type. Take the natural logarithm
of both sides of the given equation; then In y = In a + bx. Put
y* = lny, a* = In a; then y* = a* + bx. From the given data, we
find the corresponding values of In Y, namely, -0.545, -0.386,
-0.105, 0.501, 2.011. The problem reduces to fitting a line to the points
(0.5, -0.545), (l.O, -0.386), (2.0, -0.105), (4.0,0.501), (9.0,2.011).
(It can be verified that these points lie approximately on a line by plotting
them on ordinary graph paper or by plotting the original points on semi-
log paper.) The line y* = -0.697 + 0.299x was found by the method
9.4. OTHER GRAPHS 371
(9.4:2)
x y x* y*
It can be verified that a straight line is a good fit for the x*, y* points
by plotting them on ordinary graph paper or by plotting the original
points on log log paper. Grouping the first two and the last three x*,
y* points, and using the method of averages, we obtain the equation
y* = -0.847x* + 0.543. The required equation is therefore y =
3.49/(2 + X)O.847.
Solution hy graph and special device. The given points are carefully
plotted and a smooth curve is drawn through them. It may help to note
that the x-axis is a horizontal asymptote and x + 2 = 0 is a vertical
asymptote. The given equation yields y' = ah(2 + X)b-l, whence
h = y'(2 + x)/y. Select about five more or less equally spaced points on
the graph (between -1 and 5) and at each determine x, y, and y'.
These values are substituted into the last equation to yield five values
for h. These, when averaged, should yield a fairly good approximation
for h, and then, as in example I, a value for a can be found. A good
result can be obtained with care.
If the points (x + 2.8. Y). (x + 3. Y). (x + 3.2. y) are plotted on log log
paper. or if the points (log(x + 2.8). log Y). (log(x + 3). log Y).
(log(x + 3.2). log y) are plotted on ordinary graph paper. it will be
seen that the points (x + 3.2. y) or (log(x + 3.2). log y) almost lie on a
straight line. whereas the others do not. Hence we take b = 3.2 and
proceed as in example 2.
An approximate value for b may also be found as follows. Plot the
given points on ordinary cross-section paper as before and draw a
smooth. good fitting curve. Let (Xi' Yi)' i = 1.2... be arbitrary points
on the curve so thatYi = a(b + Xi)c, Choose four points so thatYl: Y2 =
Ya: Y4'" then (b + x1)/(b + x2 ) = (b + xa)/(b + X 4)i whence. b =
(x ra - X1X4)/(X1 - x2 - Xa + x4). If several such tetrads are chosen.
the value of b calculated for each tetrad. and then the b's are averaged.
a fairly good result can be obtained if care is exercised.
The end result is Y = 10.5(3.2 + X)-1.5.
EXERCISE 9.4
1. Determine the parameters in each equation so that the graph of the curve is a good
fit for the given points. Make a suitable transformation in each case to reduce the problem
to a polynomial form.
a. y = ax&;
:..\I0.351
y 0.80
2 4
1.80 4.05
8 15
8.75
b. y = ax&; xl 10 15 20 25 30
;\ 6.25 6.90 7.45 7.90 8.30
e. y = ab~;
x 13.0 3.5 4.0 4.5 5.0
y 0.080 0.101 0.126 0.157 0.197
f. y = a2&~; 1.8 2.5 3.0 3.4
x 11.1
y 1.43 6.50 29.9 88.4 204
I. y = e"+N;
I I
X
y 3.560 2.095
2 3 4 5
1.235 0.725 0.430
I. y = a + blog,ox; xl 3 7 11 15 19
;16.60 7.70 8.30 8.75 9.05
J. y = a + be" + eel:!:;
:..1 0.4
0.8 1.2 1.6 2.0 2.2 2.4
y -2.00 -3.35 -4.85 -5.90 -4.90 -2.60 2.25
x 1200 300
40 0 50 0 600 700 800 900
y 0.950 1.025 1.015 0.940 0.840 0.750 0.665 0.640
I. y = a +b vx + ex + dx Vx;
xl 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 6.5 7.0 7.5
;1 -0.59 0.13 1.08 2.30 3.68 5.29 7.05 8.95 11.05 13.26 15.68 18.08
9.5. INCONSISTENT EQUATIONS 375
2. Determine the parameters in each equation so that the graph of the curve is a good
fit for the given points. Use whatever combination of methods seems applicable.
f. y = a(b + x)C; 3 4 5 6 7 8 9 10
xl 2
y 3.58 6.01 7.58 8.85 9.90 10.83 11.74 12.45 13.20
h. y = - - .
b + ex'
:It'
x
y
I0.505
2
0.876
3 4
1.27
5
---"---
1.72 2.20 2.69
6
-_.
7
-----
3.19
8 9
3.72 4.34
10
I. y = x"(1 + bx)<; 6 8 10 12 14 16 18
xl4 -_._---
y 7.15 9.16 11.1 12.9 14.7 16.4 18.0 19.5
will make the left- and right-hand sides equal or almost equal. In a
sense, the problem is complementary but similar to the problem of the
preceding sections.
We consider the set of m simultaneous linear equations in n unknows,
m >n,
allx1 + a l 2x 2 + ... + a1nXn = hi
(9.5:1) a2l x I + a22x 2 + ... + a2nXn = h2
2x+4y= II
3x - y = -5
2x+ y =
x + 5y = 15.
If we group the first two and the last two equations, we obtain
5x+3y= 6
3x + 6y = 16,
whence X = -4/7, Y = 62/21. If we group the first and third, and the
second and fourth equations, we obtain
4x + 5y = 12
4x + 4y = to
so that X = t, y = 2. If we group the first and fourth, the second and
third equations, we obtain
3x + 9y = 26
5x = -4,
and x = -4/5, y = 142/45.
9.5. INCONSISTENT EQUATIONS 377
(9.5:2) ~e,=O,
(9.5:5)
m m m m
(9.5:6) Xl ~ ai1 a t; +X 2 ~ ai2aij + ... + Xn ~ aina .; = ~ a,;bi ,
.-1 i-I .-1 ,=1
j = 1,2, ... , n.
These are the "normal" equations for the least square solution of
Eqs. 9.5:1.
To do the preceding example by the method of least squares, we form
the following self-explanatory table (and use X and Y in place of Xl
and X 2 ):
378 9. CURVE FITTING
2 4 II 4 16 8 22 44
3 -I -5 9 -3 -15 5
2 I I 4 2 2 I
5 15 25 5 15 75
18 43 12 24 125
Hence,
18X+ 12Y= 24
EXAMPLE 4. Find the equation of a circle which is a good fit for the
points (0.0, 4.58), (0.5, 4.96), (1.0, 5.20), (1.5, 5.34), (2.0, 5.38).
Solution I. Call the points A, B, C, D, E, in the given order. If
the five points were on one circle, the perpendicular bisectors of AB,
BC, CD, DE would meet in a common point, the center of the circle.
380 9. CURVE FITTING
Since the five points do not lie on one circle, the equations of the perpen-
dicular bisectors form the inconsistent set
x + 0.76y = 3.8752
x + 0.48y = 3.1884
x + 0.28y = 2.7256
x + 0.08y = 2.1788.
4x + 1.6Oy = 11.9680
l.60x + 0.8928y = 5.413056.
+ c = 20.9764
4.58b
0.5a + 4.96b + c = 24.8516
a + 5.20b + c = 28.0400
1.5a + 5.34b + c = 30.7656
2a + 5.38b + c = 32.9444.
EXERCISE 9.5
1. Find solutions which are good fits for the following sets of equations.
x I 1.0
1.2 1.4 1.6 1.8 2.0
y -2.296 -2.072 -1.878 -1.842 -1.792 -1.775
9. Let (Xi, Yi) be the given coordinates of a point in one of the examples 4-8; let Yi be
the corresponding value of y calculated from the equation after the parameters have been
found; determine the various errors Yi - Yi .
Bibliography
A brief list of books for supplementary reading and historical notes. Several
of the works cited contain extensive reference lists.
EXERCISE 1.1
EXERCISE 1.2
EXERCISE 1.3
EXERCISE 1.4
dx d.'t 7r
1a. nx"-l dx, n - C. cos x dx; x ctn x - d. - -sinxdx'
x x 180 '
7rX dx dx I dx dx loglo e dx
f logloe-; dx
- -tanx- e. - ; - - - --- I. eZdx; x -
180 x x Inx x x loglo X X x
dx
h. a Z In a dx; x In a - .
x
3. 93.6 0.2 mm or 94 mm; 33.09 0.08 mm or 33 mm; 548 3 mm S or 550 mm l
(2 significant figures).
4. 61.6 0.4 in. or 62 I in.; 302 4 sq in. or 300 sq in. (2 significant figures);
13.72 0.16 in. or 14 in.
5. P = 0.0063, a = 0.0092. 6. 312 2 sq ft.
I = 0.0018,1 dA 1 = 0.34 sq .m.; IVdV I = 0.003, 1dV 1 = 0.5 cu .m.
7. I A
dA
12. I I
d: = 0.42,1 dsl = 0.023. 14. r 1 = -2.452 0.011, rs = 0.956 0.004.
EXERCISE 1.5
1. If side of square is a, then: a. 1da 1 < 0.005 mm b. 1da 1 < 0.1 mm c. To within
0.007 mm d. To within 0.007 mm e. To within 0.0035 mm.
2a. Id; I < 0.001 b. Id; I < 0.0005 c. Id; I < 0.00049.
3. I da 1 = 1de 1 < 0.000039 cm. 4. 1da 1 = 1db 1 = 1de 1 < 0.002 ft.
5. Take 1dw 1 = 3 1dr I; 1dr 1 < 0.000029 in., w correct to 4 significant figures.
(Note: the value for 7r should be correct to 5 decimal places.)
6. Assume 1dm 1 = 1dM 1 = 2 1dr I; then I~ I < 0.0034, Id:: I < 0.00002,
Id; I< 0.0000027.
ANSWERS 385
EXERCISE 2.2
1. pb) = I + lx l
EXERCISE 2.4
EXERCISE 2.5
EXERCISE 2.6
2a. Il -1
II x I - mx I dx = hI and is therefore independent of m.
Il [I x I - mx]1 dx
-1
= Ih3(1 + ml) and is a minimum at m = O.
c. Il I~
f(x) - mx I dx = I + mhl -..!!...
3
if m ;;. 0 and h is so small that, for
Il
_1
(f(x) _ mx)1 dx = ~+~+
3 5
m (2h
3
3
_.!!....)
2
+m l 2h3
3
; minimum at
3h - 4
m=--8-'
3b. Il _1
(I x I - ax l - bX)1 dx
5
= a (2h" _ he) + h 3b
3
+ 2h3
3
. The coefficients a
EXERCISE 3.1
f'
-1
I
(I x 1 - a - bx - exl)1 dx is a minimum for PI(X) = - (28 - x + 40x' ).
-1 81
EXERCISE 3.2
I
2. y = - 10 (6x 8 - 23x l - IIx + 28).
I
3. y = -I + 6x - Xl. 4. y = 72 (-72 + 430x - 71x1 + x').
5 y 60-9 I 9-40
= ..I X + 2.. x = -0.05215xl + 0.53208x.
I
6. y = - [(e - 1)1 Xl + (el - I) x + 2e] = 0.54308xl + 1.17520x + I.
2e
7a. y = Xl b. y = x.
EXERCISE 3.3
EXERCISE 3,4
1a. -I 2 e. -I 0.2
-3 1.050
0 -I 2.3 -0.817
-3.033
4 -6.8
I. -4 3
0.8000
7 0.7667
2.3333 -0.1540
-2 0 -0.6190 0.0245
-0.1429 0.1151
5 -I 0.0714
0.5000
7 0
ANSWERS l87
EXERCISE l.6
I
1a. y = 60 (-18 - 97x+ 32x1 + 23x 3 ) b. y = 0.4599x3 +O.9401x'- 1.4305x - 0.8180.
l. y = IOx3 - 9x; y(2) = 62; estimated error = 90, actual error = 2.
Sa. y = 1.00212 - 0.OOO34x - 0.OOOI4x'; y(30) = 0.86592; actual error = 0.00011;
predicted margin of error = 0.0017 b. y = 1.000000 + 0.0000315x - 0.OOOI579x
+ 0.00000027x3; y(30) = 0.86621; actual error = -0.00018; predicted error = 0.00000
(actual error is due to rounding-off)
c. y = 0.93969 - 0.006676(x - 20) - 0.OOOI36(x - 20) (x - 25); y(30) = 0.88613;
actual error -0.00010; predicted error = 0.00005 (again, rounding-off influences
answer).
EXERCISE l.7
EXERCISE l.8
1. V40I = 20.0250; estimated error = 0.0000, actual error = 0.0000
EXERCISE l.9
1. V39s = 19.8752; estimated error" 0.0006, actual error = 0.0006
3a. (Actual values) 100e-i = 0.6738, 100e-i = 0.3028, 100e-aa = 0.1360, 100e-8 m
= 0.1216 c. (1.009)-10 = 0.8359, (1.04)-10 = 0.4564, (1.05)-10 =0.3769 e. 10(1)
= 0.7652, 10(1.9) = 0.2818,10(3.5) = -0.3801; 1,(1.95) = 0.5794,1,(3.02) = 0.3316,
1,(3.15) = 0.2812
EXERCISE 3.11
1a. y = 0.318 sin 'lTX, y = 0.381 sin 'lTX - 0.031 sin 2'ITx, y = 0.386 sin 'lTX - 0.040 sin 2'ITx
+ 0.006 sin 3'ITx.
3a. y = e'-z b. Errors are 0.029, 0.006, 0.004, 0.014, respectively.
EXERCISE 4.2
1. 4.384 3. 1.133 5. 2,4, -0.767
7. 1.224, -1.550, -4.713, -7.854 9. 2.78
EXERCISE 5.1
1a. 0.860,2.230,3.910 c. 0.893,2.270,2.838 d. 0.732,1.414, -1.414, -2.732.
la. 0.1716,5.8284.
EXERCISE 5.2
EXERCISE 5.4
EXERCISE 6.1
1a. 0.895,1.723 c. 0.588 e. 1.070, -0.399, -0.807, -1.265.
la. (x, y,.8') = (0.35, -1.53, 1.65), (1.53, 1.88,0.47), (-1.88, -0.35,3.88), (-2,0,4).
ANSWERS 389
EXERCISE 6.2
la. (x, y) = (3,2), (3.584, -1.848), (-2.805, 3.131), (-3.779, -3.283)
c. (x,y) = (0.175, 8.877), (1.475, 0.299), (1.518, -0.215).
EXERCISE 6.4
EXERCISE 7.2
EXERCISE 7.4
EXERCISE 7.7
EXERCISE 7.8
lao 0.87 C. 0.54, 0.81, 1.08, 1.34, 1.56 e. 1.406, 3.059, 5.179, 8.039, 17.736.
h h
lb. 24 (-Yo + 13Yl + 13YI - Ya) C. 3(Y-l - 2yo + 7YI)
EXERCISE 7.10
EXERCISE 8.2
x8 X3 X. Xl I
1. Y. = 2! + 3! + 4! + TI 3. Y3 = 48 (29 + ISxl + 3x + Xl).
5. Y8 = 1(-10 + 12x - 6Xl + x 3 ). 7. Y3 = I + X + Ix8
EXERCISE 8.3
x3 x3 x"+1
1. Y = -+-+ ... +---+ ....
21 31 (n + 1)1
X - I 2(x - 1)8 4(x - 1)1 a,,(x - I)"
3. Y = I + -11- + 21 + 31 + ... + n! + ....
where a" = a"_l + (n - I) a"_3 n = 2. 3. 4 ....
5. Y = -I + (x - I) - (x - 1)3 + (x - 1)1 =f ... + (-I),,-l(x - I)" + ....
X Xl x"
7. Y = I + - + - + ... + - + ....
11 21 nl
X - I (x - 1)3 (x - 1)1 (x - I) 19(x - 1)1
8. Y = e- 1 ( 1 + -I!- - -2-!- + -3-1- + -4-!- - 51
EXERCISE 8.5
1. (0.05. 0.0013). (0.10. 0.0052). (0.20. 0.0214). (0.30. 0.0499). (0.40. 0.0918).
(0.50.0.1487).
4. (1.2. 2.867). (1.4. 2.829). (1.8. 2.911). (2. 3.000). (2.6. 3.369). (3. 3.667).
7. (2.3. 1.036). (2.9. 1.084). (3.8. 1.120). (4.4. 1.131). (5.0. 1.137).
10. (0.5. -1.099). (0.6. -0.847). (0.8. -0.405). (1.0). (1.2.0.405). (1.5.1.099).
EXERCISE 8.7
EXERCISE 8.9
EXERCISE 9.2
EXERCISE 9.3
I
1. Least square solutions.a. y = -(40xl - 31x -78)
35
c. y = 1.430 + 1.003x - 0.237xl e. y = 2.4806 - 2.991Ox + 0.5014xl.
3. y = 1.08lxl - 2.914x. 5. y = 2.89xl - 5.56x - 1.44.
EXERCISE 9.4
EXERCISE 9.5