You are on page 1of 407

ELEMENTS OF

NUMERICAL ANALYSIS
Academic Press
Textbooks in Mathematics
Consulting Editor: Ralph P. Boas, Jr.,
Northwestern University

HOWARD G. TUCKER. An Introduction to Probability and


Mathematical Statistics

EDUARD l. STIEFEl. An Introduction to Numerical Mathematics

WILLIAM PERVIN. Foundations of General Topology

JAMES SINGER. Elements of Numerical Analysis

PESI MASANI, R. C. PATEL and D. J. PATIl. Elementary Calculus


ELEMENTS OF
NUMERICAL ANALYSIS

James Singer
Department of Mathematics
Brooklyn College
Brooklyn, New York

NEW YORK ACADEMIC PRESS LONDON


COPYRIGHT 1964, BY ACADEMIC PRESS INC.
ALL RIGHTS RESERVED.
NO PART OF THIS BOOK MAY BE REPRODUCED IN ANY FORM,
BY PHOTOSTAT, MICROFILM, OR ANY OTHER MEANS, WITHOUT
WRITTEN PERMISSION FROM THE PUBLISHERS.

ACADEMIC PRESS INC.


II Fifth Avenue, New York, New York 10003

United Kingdom Edition published by


ACADEMIC PRESS INC. (LONDON) LTD.
Berkeley Square House, London W.I

LIBRARY OF CONGRESS CATALOG CARD NUMBER: 64-18216

PRINTED IN THE UNITED STATES OF AMERICA


To Hand Rand J
Preface

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

Chapter 1 Numbers and Errors


1.1 Significant Figures I
1.2 Errors 6
1.3 Accuracy and Precision 9
1.4 Computational Errors 11
1.5 The Inverse Problem 18

Chapter 2 The Approximating Polynomial; Approximation at a Point 22


2.1 Introduction 22
2.2 Representation of a Function by a Polynomial 24
2.3 Power Series 30
2.4 Computation with Power Series 40
2.5 Asymptotic Series; Euler's Summation Formula 47
2.6 Other Methods of Approximation 63

Chapter 3 The Approximating Polynomial; Approximation in an Interval 67


3.1 Introduction 67
3.2 Polynomial through n + I Points; Determinant Form 70
3.3 Polynomial through n + I Points; Lagrange Interpolation Formula 75
3.4 Polynomial through n + I Points; Divided Difference Form 77
3.5 Polynomial through n + I Points; Aitken-Neville Forms 84
3.6 Magnitude of the Error in the Polynomial through n + I Points 87
3.7 Equally Spaced Points; Finite Differences 97
3.8 Polynomial through n + I Equally Spaced Points 101
3.9 Extrapolation 117
5.10 Subtabulation 118
3.11 Nonpolynomial Approximation 126
3.12 Additional Methods of Interpolation 133
3.13 Inverse Interpolation 135

Chapter 4 The Numerical Solution of Algebraic and Transcendental Equations


in One Unknown; Geometric Methods 137
4.1 Introduction 137
4.2 Graphical Methods 138
4.3 Construction of Scales and Rules 141
4.4 Stationary Scales 148
4.5 Sliding Scales lSI
4.6 Nomography 154
4.7 Nomography, General Theory 160
ix
x CONTENTS

Chapter 5 The Numerical Solution of Algebraic and Transcendental Equations


in One Unknown; Arithmetic Methods 169
5.1 Horner's Method 169
5.2 The Root-Squaring Method 171
5.3 The Method of Iteration 185
5.4 The Method of False Position (Regula Falsi); The Method of Chords 192
5.5 Imaginary Roots 196

Chapter 6 The Numerical Solution of Simultaneous Algebraic and


Transcendental Equations 200
6.1 Introduction 200
6.2 The Method of Iteration 203
6.3 The Method of Chords 209
6.4 Simultaneous Linear Equations 210

Chapter 7 Numerical Differentiation and Integration 217


7.1 Introduction 217
7.2 Numerical Differentiation in Terms of Finite Differences 223
7.3 Numerical Differentiation in Terms of Ordinates 235
7.4 Method of Undetermined Coefficients 242
7.5 Magnitude of the Error in Numerical Differentiation 246
7.6 Numerical Integration; Introduction 257
7.7 Numerical Integration in Terms of Finite Differences 258
7.8 Numerical Integration in Terms of Ordinates 269
7.9 Magnitude of the Error in Numerical Integration 279
7.10 Gauss' Formulas. Orthogonal Polynomials 281

Chapter 8 The Numerical Solution of Ordinary Differential Equations 294


8.1 Statement of the Problem 294
8.2 Picard's Method of Successive Approximations 299
8.3 Power Series Approximations 303
8.4 Pointwise Methods; Introduction 310
8.5 Pointwise Methods; Power Series 311
8.6 Pointwise Methods; The Runge-Kutta Formulas 315
8.7 Pointwise Methods; Finite Differences 320
8.8 Pointwise Methods; Iteration Using Ordinates 330
8.9 First-Order Systems; Equations of Higher Order; Special Equations 339

Chapter 9 Curve Fitting 351


9.1 Introduction 351
9.2 The Straight Line 352
9.3 Polynomial Graphs 366
9.4 Other Graphs 370
9.5 Inconsistent Equations 375
BIBLIOGRAPHY 382
ANSWERS 383
SUBJECT INDEX 393
ELEMENTS OF

NUMERICAL ANALYSIS
Chapter 1

Numbers and Errors

1.1. Significant Figures. In this chapter we develop some of the


basic properties of numbers that are peculiar to the science (or art) of
computation. The reader will please bear with us if we begin with some
very elementary considerations.
Numbers used by the scientific worker are usually written in the
decimal notation. Let us recall that in this notation the successive
places to the left of the decimal point are the unit's, ten's, hundred's,
thousand's, ten-thousand's, etc., places and the successive places to the
right of the decimal point are the tenth's, hundredth's, thousandth's,
ten-thousandth's, etc., places. We use the convention of enumerating the
digits of a number written in decimal form from left to right to simplify
some of the later definitions; the first digit is then the one on the extreme
left and the last digit is the one on the extreme right.
The decimal representations of 22/5, 22/7, and 17 are different in
character. The first decimal expression terminates or is finite, the second
is nonterminating but periodic, the third is non terminating and nonperiodic.
Since the scientific worker rarely if ever uses any but the first kind of
decimal expression, we too, unless otherwise indicated, shall use only
finite or terminating decimals. This implies that frequently a written
number is only an approximation to some other number. (We remark
that any number, be it 22/5, 22/7, y2, or 17, is exact; it becomes
"inexact" or "approximate" only when it is considered as an evaluation
or representation of some other number.) We now pave the way to a
better understanding of these approximations.

DEFINITION 1. The numerical unit of a number written in the decimal


notation is the name of the place occupied by the last digit, except in
the case of a whole number which terminates in one or more zeros (all
to the left of the decimal point). The numerical unit in the exceptional
case, if not implied by the context, must be specifically stated and may
be either the name of the place occupied by the last nonzero digit or
the name of the place occupied by anyone of the zeros to the right of
the last nonzero digit.
2 1. NUMBERS AND ERRORS

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

(1.1:1) n = n' X 10",


where n' is a whole number and lOu is the numerical unit of n. (We use
the notation 1.2:3 to signify that the corresponding formula, equation,
or statement is in Chapter I, Section 2, and is numbered third in that
section.) It follows, of course, that u, too, is an integer, positive, negative,
or zero. If all the digits of a number are zero, as in 0.00, we put n'
equal to zero.

DEFINITION 2. The significant digits or figures of a number n are


the digits in n' when n is written in the numerical unit form.
Thus, 3.04, 0.0700, 67, and 0.00 have 3, 3, 2, and I significant digits,
respectively. The number 67,000 may have 2, 3, 4, or 5 significant
digits depending on the numerical unit. Omitting this exceptional case
of an integer that terminates in one or more zeros, the number of
significant figures of a number written in the decimal notation is ~e
number of its digits excluding all digits that precede the first nonzero
digit.
1.1. SIGNIFICANT FIGURES 3

The significant figures of a number are so named because they are


the ones that specify the number of numerical units.
We call the attention of the reader to another notation often used
similar to the numerical unit form. It is frequently used in the printing
of tables and in the tabulation of data and is called the scientific or
standard notation or form. A number is written in the standard notation
as
(1.1 :2) n = nil X 10",

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,

respectively, in standard notation. The number zero shall be written as


0.00 X lOu in the standard notation. The standard notation is particularly
useful for numbers like 0.0000720 or 95,000,000 (where the numerical
unit is a million, say) which are written as 7.20 X 10-5 and 9.5 X 107 ,
respectively.
Generally speaking, a number used by a scientific worker arises in
one of three ways. It may, first of all, be a "pure" number, that is,
one which is the result of a count, or one which is the result of a mathe-
matical or other definition. As examples of pure numbers we have the
number (three) of sides of a triangle, the ratio of the circumference to
the diameter of a circle, the value of sin 23, or n e- /2 dt, the number
of feet in a mile, the number of days in a week, the number of pounds
in the maximum load of an elevator. Secondly, there are numbers that
arise as values of direct measurements. (By a direct measurement we
mean one in which the result is read off some measuring instrument
such as the measurement of a distance by a ruler or the measurement
of a temperature with a thermometer.) Thirdly, there are numbers that
arise as results of computations performed on numbers of the first two
types.
But, as we know, relatively very few numbers can be written exactly
as finite decimals, measurements are at best approximate, and calculations
are subject at the very least to all the inaccuracies of the numbers
involved. Hence a number used by a scientific worker is usually an
approximation to some "true" value. It is therefore important that he
should indicate in some fashion the goodness of the approximation, the
reliability, or the margin of error of a stated number. This can be done
4 1. NUMBERS AND ERRORS

in a variety of ways. He may write 6.040 0.003 to indicate that the


correct value is in the range from 6.037 to 6.043, inclusive. Note that
if one wants to indicate a margin of error of 0.0003, say, one should
not write 6.04 0.0003 but 6.0400 0.0003. The scientific worker will
also use 6.04- to indicate that the true value of a number is less than
6.04 but closer to it than to 6.03. Likewise, 6.04+ indicates a true value
greater than 6.04 but closer to it than to 6.05. These methods of writing
approximate numbers clearly indicate that the numbers are approximate
and give the margins of their errors but as matters of notation they
are just a bit clumsy. The scientific worker will most frequently write
6.04 with the intent and understanding that this does not represent the
number 6.04 exactly but a number which is closer to 6.04 than it is to
6.03 or 6.05. Likewise, 6.040 indicates a number which is closer to
6.040 than it is to 6.039 or 6.041.
The last notation determines a number with a margin of error equal
to one-half the numerical unit; the preceding notation also determines a
number with the same margin of error but also indicates whether the
error is one of excess or default. The first notation like the last does
not indicate the direction of the error but usually indicates a more
precise margin of error.
Let us note in passing that the margin of error is closely linked
with the numerical unit of the stated number and is, in the last notation,
just one-half of that unit. Thus the margin of error in 6.040 is one-
tenth the margin of error of 6.04. Since the number of significant figuns
in a number and the numerical unit of the number are themselves closely
related, one must beware of using more significant figures than are
warranted in writing a number. Just how many one should use will
appear shortly.
The following definition will be useful.

DEFINITION 3. If a number a with k significant figures is an approxima-


tion to a number n and is the best approximation to n of all numbers
with k significant figures, then a is said to be correct to k significant
figures as an approximation to n.
Thus, 3.1, 3.14, 3.142, and 3.1418 are correct to 2, 3, 4, and 5 signifi-
cant figures, respectively, when considered as approximations to 28/9,
{/31, fT, and loglo 1386, respectively.
It is desirable for some purposes to "round off" a number which is
written in the usual decimal notation with k + m significant figures to
one that has only k significant figures. We do this by deleting those of
the last m digits that are to the right of the decimal point and substituti'rig
zeros for those that are to the left of the decimal point. No further change
1.1. SIGNIFICANT FIGURES 5

is necessary if the m deleted or replaced digits represent less than one-


half unit in the kth place; but if the deleted or replaced digits represent
more than one-half unit in the kth place, the kth significant figure is
increased by unity. (If the kth significant figure is 9, it changes to 0
and the preceding digit is increased by unity. Note the last illustration
in the table below.) If the deleted or replaced digits represent exactly
one-half unit in the kth place, usage varies. Some people treat this case
like the preceding one and increase the kth digit by unity; others
increase the kth digit by unity if it is odd and leave it alone if it is even.
The reasoning behind this latter rule is specious; in actual practice,
it matters little which system is used.

ILLUSTRATIONS

Rounded off to:

Number 5 significant 4 significant 3 significant 2 significant


figures figures figures figures

32.0769 32.077 32.08 32.1 32


0.856025 0.85603 0.8560 0.856 0.86
123456 123460 123500 123000 120000
1234.56 1234.6 1235 1230 1200
1.34996 1.3500 1.350 1.35 1.3
0.999777 0.99978 0.9998 1.00 1.0

In particular, note that 1.34996 becomes 1.3 when rounded off to


two significant figures and 1.35 when rounded off to three significant
figures. If, however, we were given 1.35 and told to round it off to
two significant figures, the correct answer is 1.4. Many authors write
1.33 to indicate 1.35-; rounded off to two significant figures, this
number is 1.3. In brief, to round off a number with k + m significant
figures to one with k significant figures is to rewrite it correct to k
significant figures as an approximation to its original form.
The numbers 3.14209 and 3.14285 are approximations to
1T = 3.14159 .... Neither one is correct to six significant figures. If

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

DEFINITION 4. If a number a with k + m significant digits when


rounded off to k + 1 significant digits is not correct to k + 1 significant
digits as an approximation to a number n but when rounded off to k
significant digits is correct to k significant digits, then a is said to be
correct to k significant digits as an approximation to n.
Thus, 1.33530 is correct to four significant digits when considered
as an approximation to sec 41 30' = 1.3352 and is correct to two
significant figures when considered as an approximation to t. Similarly,
t expressed as a decimal would be correct to two significant figures
as an approximation to sin 1930' = 0.33381 and to three significant
figures as an approximation to vo]TI = 0.33317.

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

The difference e between a number n and an approximation a to


it is defined as the actual error in a; in symbols,

(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)

and the per cent relative actual error is defined as

(1.2:4) 100,%.

It is to be noted that for a and n real, e may be positive, negative, or


zero, whereas the relative errors are zero or positive only.
Thus, the 'actual error committed in approximating 17 by 22/7 is

e = 17 - 22/7
= 3.14159265+ - 3.14285714+
= -0.0012645-;
the relative actual error is

- 0.0012645- _ 000040+'
r - 3.14159265+-' ,

and the per cent relative actual error is

0.040+%.

The actual error in approximating 17 by 3.14 is

e= 17 - 3.14
= 3.14159+ - 3.14
= 0.00159+,

and the relative actual error is

- 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.

1.3. Accuracy and Precision. Consider the entries in the following


table.

Number Approximation Actual error Relative error


------
." 22/7 -0.0013- 0.0004+
Vi31 76/5 -0.0013+ 0.00008+
45' 4,100,000 625 0.00015+

Which is the best approximation? If we compare the first two rows, we


would say that 76/5 is a better approximation to V23T than 22/7 is to
1T because their actual errors are about the same and the relative error
of 76/5 is only about ith oUhe relative error in 22/7. Also, 76/5 is a
better approximation to V231 than 4,100,000 is to 45 4 because its
actual and relative errors are smaller than the corresponding errors of
4,100,000. Thus, 76/5 appears to be the best approximation to its true
value. Which is the poorest approximation? Here there is legitimate
10 1. NUMBERS AND ERRORS

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.

DEFINITION 1. Of two given approximations to two given numbers,


the one with the numerically smaller actual error is called the more
precise; and the one with the smaller relative error is called the more
accurate.
Hence, 22/7 is the most precise of the three approximations above
and 4,100,000 is the least precise; 76/5 is the most accurate and 22/7
the least accurate.
In the case of measurements or in the case of numbers whose maximum
errors are known but whose actual errors are not, we state this rule:

DEFINITION 2. Of two given approximations to two numbers of which


only the margins of errors are known, the one with the smaller maximum
error is called the more precise, the one with the smaller maximum
relative error is called the more accurate.
In short, precision is gauged by the actual or maximum error while
accuracy is gauged by the relative or maximum relative error. Thus, in
the illustrations at the very end of the last section, the mountain approxi-
mation is the more accurate but the less precise. Also, to give the precision
of a result we state the actual or maximum error; to give the accuracy
we state the relative or maximum relative error.
Let all the significant figures of an approximation a to a number n
which is known exactly or to within its margin of error be correct, and
let lOu be the numerical unit of a; then the actual error satisfies the
condition
(1.3:1)
and the maximum error h satisfies the condition
(1.3:2) h = 5.10.. - 1
Also, the relative error r satisfies the condition
5 . 10..- 1
(1.3:3) T ~ In I '
and the maximum relative error m is given by
5 . 10..- 1
(1.3:4) m=
Ia I
1.4. COMPUTATIONAL ERRORS 11

which becomes, if we put a = a' . lOu,


1
(1.3:5) m = 2Td!'
We see at once from the forms of the right-hand members of relations
1.3:3 and 1.3:5 that the greater the number of correct significant figures
in the approximation a (and hence the smaller the numerical unit lOU),
the smaller the values of these two fractions. That is, the upper bound
for the relative error and the value of the maximum relative error
decrease as the number of correct significant figures increases.
We shall frequently omit the adjectives "actual" and "maximum"
and talk merely of the errors and the relative errors when the context
makes the meanings clear.

REMARK. It should be pointed out that the terminology regarding


"accuracy" and "precision" is not uniform either in usage or in the
literature. Some authors reverse the meanings of the two words as
they are used here; some use them with slightly different meanings;
some use the' two words more or less interchangeably. The words are
also used, in different but allied context, to designate the reliability
of the arithmetic mean of a series of measurements of the same quantity.

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. Computational Errors. The well-known formula

(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

We can regard the x's as independent variables and y as a variable


dependent on them; we assume that the function I and its partial deriva-
tives Ix 1 ,Ix2 , "', Ix exist and are continuous, at least in a neighborhood
of the values under consideration. If we assign the (positive, negative,
or zero) increments LlXI , Llx2 , "', Llx" to Xl' X2 , "', X,,, respectively,
y takes on an increment Lly and we have

(1.4:3)

whence

If we now consider Xl , X 2 , "', Xn as approximations to the respective


"true" values Xl + LlXI , X2 + LlX2 , "', X" + Llx" occuring in the com-
putation, then Lly given by 1.4:4 is the error in the result of the com-
putation due to the errors LlXI , Llx2 , "', Llx" , respectively. We seek a
more easily estimated form for this error. The right-hand member of
the equality 1.4:4 can be put into the form

+ ...
+ [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

fzt(x 1 , X2 + 82 Jx 2 , Xa+ Jxa , "', x" + Jx,,) Jx 2,


(1.4:5) f".(x 1 'X 2 , Xa + 8a JXa , X4 + Jx, , "', .:t" + JXn) JXa ,

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 , ... ,

+ El LlXl + E2 LlX2 + ... + E" Llx" .


We now rename LlXl ,Llx2 , ... , Llxn; we call them dx1 , dx2 , ... , dXn ,
respectively, and then define the "total differential" dy by

(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)

which ordinarily is small compared to dy. Consequently, the value of the


total differential dy given by 1.4:8 is a good estimate of the error com-
mitted in the computation on the approximate numbers Xl , X 2 , , Xn .
We remark that each term on the right-hand side of 1.4:8 may be
positive or negative since, apart from the partial derivatives, the
differentials may be positive or negative. Hence, to find the maximum
error in y, we put 1.4:8 in the form

(1.4:10) I dy I ~ 1!"I(xl' ... , x,,) II dX1 I + 1!"a(x1 , .. , x,,) II dx2 1


+ ... + I!"n(xl , ... , x,,) II dXn I
\
We obtain from 1.4:2 and 1.4:8,

(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: 12) I; I~ IXl;Zl II ~:1 I+ IX;ZI II ~21 + ... + IXn~Zfi II ~n I


We summarize the preceding results. If the absolute values of
dx l , dX 2 , ... , dXn are the maximum errors in the approximate numbers
Xl' X2 , , Xn , respectively, and if y is the result of the computation
1.4: 1 performed on these numbers, then the maximum error I dy I in y
is given by formula 1.4: 10 and the maximum relative error I dy/y I is
given by formula 1.4:12. More precisely, the right members of 1.4:10
and 1.4: 12 are good estimates of the maximum magnitudes of the
respective errors.
If, in particular, y is a function of a single variable X, then

(1.4:13) dy = f'(x) dx,

(1.4:14)

where the primes indicate differentiation with respect to x.


We also note the algebraic identities

(1.4:15) dy =y;,

(1.4:16) Idy 1= Iy II; I


We illustrate the use of formulas 1.4: 10 and 1.4: 12 by an example ..

EXAMPLE. Determine T, its maximum error, and its maximum


relative error from formula 1.4: 1, given 1T = 3.1416, 1 = 51.32 cm,
g = 980.62 cm/sec2 (It is understood that all significant figures are
correct. Also, it should be remarked that this well-known formula
from physics is itself inaccurate. The present discussion makes no
attempt to gauge the errors resulting from the inexactitude of the
formula; we are here supposing that the formula is exact and we wish
to determine the errors in T due to the errors in 1T, I, and g.)
The errors in 1T, I, andg are d1T = 0.00001, dl = 0.005, and dg = 0.005
respectively. Note that for the purpose of this discussion, 1T must be
16 1. NUMBERS AND ERRORS

considered a variable. Taking the total differential of T and replacing


each term by its absolute value, we find

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

Find the standard lengths of barametric columns at the following places:

Place Latitude Altitude (ft)


- - - - - - - - - - - - - _ ..
Brooklyn 4036' N 50
Foot of Empire State b'ldg 4044' N 46.7
Top of Empire State b'ldg 4044' N 1296.7
Pt. Barrow, Alaska 71 23'30" N Sea level
New Orleans 2956'53" N Sea level
Washington, D. C. 3855'15" N 150
London 5130' N 100
Mt. Cotopaxi 035'20" S 19,498

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?

1.5. The Inverse Problem. In the preceding section we estimated


the maximum error and the maximum relative error in the result of a
calculation due to stated errors in the numbers involved. In this section
we discuss the inverse problem, namely, how precise or accurate must
the numbers used in a calculation be to obtain a result of preassigned
precision or accuracy? We answer this question and explain the various
methods by means of an example.

EXAMPLE. The time T is to be calculated from formula 1.4: 1. If the


values of 1 and g are about 51.3 cm and 980.6 cm/sec2, respectively,
just how precisely must the values of 1T, I, and g be taken if the error
in T is not to exceed 0.0001 sec?
We refer first to formula 1.4: 17 which we now write in the form

(1.5:1) I dT I ~ 21tg-11 d1T I + 1THg-! I dll + 1T1!g-i I dg I ~ 0.0001.


This time, I dT I (~0.0001), I, and g are the known quantities; I d1T I,
I d/l, and I dg I are the quantities to be determined. Essentially, then,
we are faced with the algebraic problem of solving a single linear
equation in three unknowns, I d1T I, I d/l, I dg I, in which the coefficients
are not exact. We simplify the problem by supposing for the moment
that the coefficients are exact. Elementary algebra tells us that we have
a double infinity of solutions or that we are free to impose two additional
1.5. THE INVERSE PROBLEM 19

conditions on drr, dl, dg. These conditions can be imposed, of course,


in a great variety of ways.
One method of imposing two additional conditions is to demand,
quite arbitrarily, that each term of the middle member of 1.5: I con-
tribute equally to the error dT in T. This is equivalent to stating that

(1.5:2) 21!g-! I drr I = rrHg-I I dll = rrl!g-il dg I ~ 0.000033.

Substituting 51.3 for I and 980.6 for g, and solving, we find


I drr I ~ 0.000073, I d/l ~ 0.0024, I dg I ~ 0.045.
These results mean that if rr is taken as 3.1416, so that the error
in rr is actually less than 0.00001, if I (about 51.3 cm) is measured to
within two-thousandths of a centimeter, and if g (about 980.6 cm/sec S)
is determined to within four-hundredths of a centimeter per second
per second, then the error in T will be at most 0.0001 sec. Roughly,
the error in T will be within the prescribed bounds if the values of rr,
I, and g are each taken correctly to five significant figures.
The values for I drr I, I d/l, and I dg I were calculated on the assumption
that the original values for I and g were exact. Since we found out that
both I and g had to be measured somewhat more precisely, it is natural
to ask: are the answered affected? That is, what are the errors in I drr I,
I d/l, and I dg I due to the errors in I and g? We have
I drr I = 0.0000167Hgl;
whence
d I drr I = 0.0000167(- ! l-ig! I dll + ! l-lg-ll dg I).
We find by substituting the values of I, g, dl, and dg in the right-hand
member of this equality that the value of d I drr I, that is, the error in
I drr I, is indeed insignificant compared to drr itself. Similar results hold
for d I d/l and d I dg I. Hence the inexactitude of the coefficients in
1.5: 1 does not affect the answers.
Reference to the inequalities 1.5: 1 and 1.5:2 shows that for a fixed
I and g, multiplication of dT by an arbitrary constant has the effect of
multiplying each of I drr I, I d/l, and I dg I by the same constant. That is,
the error in T will not exceed O.OOOlk if the errors in rr, I, and g do
not exceed 0.000073k, 0.0024k, and 0.045k, respectively.
The example we have just completed exhibits the general procedure.
To determine the maximum errors in the quantities Xl' Xs , "', Xn that
will yield an error in y which does not exceed a preassigned limit,
where y and the x's are related by the equality 1.4:2, equate each of the
terms of the right-hand member of 1.4: 10 to (I/n)th of the allowable
20 1. NUMBERS AND ERRORS

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

(1.5:3) 1dT 1 ~ 7r(I-tg-l + lig-i) 1dg 1~ 0.0001,


whence
d 1 ~ O.OOOll!gi
7r(1 + g) .
1
'g """"

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

lacking, it may be desirable at times to weight the errors sought according


to some arbitrary but reasonable plan rather than use blindly the principle
of equal effects.

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

The Approximating Polynomial; Approximation at a Point

2.1. Introduction. The scientific worker soon becomes aware that


some compromise with reality is necessary in almost every attempt to
develop and formulate the principles that describe the quantitative
aspects of natural phenomena. The world and its workings are so
complex that it is usually impossible to write down, exactly, the mathe-
matical laws they obey. It is almost always necessary to simplify by
idealization and neglect. Thus, in the attempt to describe the apparently
simple phenomenon of a body falling through air, it is necessary to
neglect or at least to idealize air resistance. The scientific worker realizes
his limitations and is ever faced with the problem of balancing the
advantages of simplicity with the disadvantages of inaccuracy.
Nor is pure mathematics entirely free from the necessity of similar
compromise. Indeed, it is frequently convenient and sometimes impera-
tive that a function
(2.1:1) y = f(x)
be replaced by a simpler function
(2.1 :2) y = a(x)

so that the properties and values of f(x) can be studied or obtained


from the corresponding properties or values of a(x). We give two
instances below. If we put
(2.1 :3) f(x) = a(x) + E(x),
then by analogy with equality 1.2:2, we may regard a(x) as an approxi-
mation to f(x) and E(x) as the error function. Again, it is necessary to
balance the advantage of simplicity gained with the disadvantage of
precision lost.
As soon as it has been decided what the type of the simple, approxi-
mating function a(x) shall be-for the most part, a(x) will be a poly-
nomial-our ability to weigh the advantages and the opposing dis-
advantages will depend on the ease with which a(x) can be obtained
22
2.1. INTRODUCTION 23

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

which arises in the study of a swinging pendulum. This equation is


difficult to solve as it stands, but if we replace the function sin 8 by
the function 8, the new equation is quite easy to solve (and as a matter
of fact, leads to the formula 1.4:1). It turns out that the replacement
causes a negligible error if 8 and consequently sin 8 are small in absolute
value.
Another instance in which one function is replaced by another-
this time the replacement is usually performed quite unconsciously-
is afforded by the process of interpolation. The reader is familiar with
the method of evaluating, say, log 2.956 (=0.4707) from a four-place
table of common logarithms which lists log 2.95 = 0.4698 and
log 2.96 = 0.4713. A superficial analysis of the process reveals that
log x has been replaced or approximated by a first degree polynomial;
the process is, indeed, frequently called linear interpolation.
We delve into this interpolation process somewhat further. Suppose
that ten-place common logarithm tables were used instead of four-place
tables. We have log 2.95 = 0.4698220160, log 2.96 = 0.47129 17111,
whence, by linear interpolation, we obtain log 2.956 = 0.4707038331.
However, the value of log 2.956 correct to ten decimal places is
0.4707044297, a result quite different from the preceding one. Why
the discrepancy? Why do we get an answer correct to four decimal
places when we use a four-place table but an answer correct to only
six decimal places when we use a ten-place table?
To understand this apparently unnatural situation, let us note first
that 0.4698 and 0.46982 20160 are rounded-off values; they are approxi-
mations to and are not the exact value of log 2.95. Therefore, since the
computations of log 2.956 involved the use of these rounded-off values,
We should expect some errors in the answers. Furthermore, log x was
replaced by a linear polynomial in each of the computations; since
log x is not a linear polynomial, we should expect some error in the
answers due to the replacement. Now, it happens that the replacement
error is small and negligible compared to the rounding-off error when
24 2. APPROXIMATING POLYNOMIAL; APPROXIMATION AT A POINT

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.

2.2. Representation of a Function by a Polynomial. Let


(2.2: I) y = f(x)
be a function of x. For the reasons indicated in the first section, it is
desirable at times to replace f(x) by a polynomial
(2.2:2)
whose degree does not exceed a preassigned n and which approximates
f(x) as well as possible. For the sake of brevity, a polynomial of degree
not greater than n will be called a polynomial of max-degree n. For the
present, we evade the question of what is meant by "as well as possible."
Since Pn(x) has n + I coefficients that are at our disposal, we can impose
an equivalent number of conditions for the determination of the poly-
nomial.
Let us suppose first that A : (xo , Yo) is a point on the graph of y = f(x).
The max-degree n being given, we obtain in this section a polynomial
whose graph approximates as well as possible in some intuitive sense
the graph of y = f(x) in the neighborhood of point A. It would seem
natural to require that the graph of the polynomial pass through A,
that its tangent coincide with the tangent to the graph of y = f(x) at A,
and that its radius of curvature coincide with the radius of curvature
of y = f(x) at A. These requirements will be satisfied if

We use primes to designate differentiation and drop the subscript n


from Pn if there is no danger of misunderstanding.
2.2. REPRESENTATION OF A FUNCTION BY A POLYNOMIAL 25

The generalization is clear. Let us choose the a's in 2.2:2 so that

We assume that f(x) possesses all the derivatives in question, but it


remains to show that the conditions just imposed uniquely determine
the a's.
It follows from 2.2:2 that to satisfy these conditions we must solve
the linear equations

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

ao = f(x o) - xof'(xo) + ;,2- f"(x o) =t= ... + (-1 )"~!" p")(xo),


1 2 n~
a1 = IT f'(x o) - ;0 f"(xo) + ... + (-1 )"-1 n~! j<n)(xo),
(2.2:4) ........................................................................................... .
pn-l)(xo) nxo "
~-1 = Tn--=-l)! - n!- j< )(xo),

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)

is the required polynomial.


How well or in what sense does this polynomial approximate f(x)?
The form of the approximating polynomial is strongly suggestive of a
26 2. APPROXIMATING POLYNOMIAL; APPROXIMATION AT A POINT

Taylor's Theorem expansion. Indeed, if f(x) possesses an (n + l)st


derivative, we have by Taylor's theorem
(x - x )11
(2.2:6) f(x) = f(x o) + (x - xo)f'(xo) + ... + nl 0 P1l)(xo)

+ (x(n- +XO)1I+l f(1I+U(x + 8(x _ x


I)! 0 0 ,

It follows that the error E(x) made in replacing f(x) by P1I(x) is

(2.2:7) E(x) = f(x) - P1I(x)

= (x - xo)1I+l f (1I+U(x + 8(x _ x 0<8<1.


(n + I)! 0 0 ,

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 '

where X is a number between x and xo'


It might have been anticipated that the polynomial of max-degree n
given by the first n + I terms of the Taylor expansion of a functionf(x)
would be an excellent approximating polynomial in some sense. We
elucidate a bit. Let p(x) be given by 2.2:5 and let q(x) be any other
polynomial of max-degree n. For the sake of simplicity, put
p1l+l)(X)
(n + I)! = g(X),
then
f(x) - p(x) (x - XO)1I+lg(X)
f(x) - q(x) = (x - XO)n+lg(X) + r(x) ,

where r(x) is of max-degree n but is not identically zero. Write r(x) in


the form r(x) = (x - xo)k t(x), where t(xo) =1= 0, and 0 ~ k ~ n. Then

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

(2.2:9) lim f(x) - p(x) = O.


f(x) - q(x)
"' ...."'0
2.2. REPRESENTATION OF A FUNCTION BY A POLYNOMIAL 27

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.

EXAMPLE 1. Approximate y = loge x = In x by polynomials of


respective max-degrees 1, 2, 3 in the neighborhood of the point (1,0).
Here, Xo = 1; and we have y' = X-I, y" = _x-2, y'" = 2x-3 Hence
/(1) = 0, /,(1) = 1,/"(1) = -1, /"'(1) = 2, and
y= x - I,
Y= (x - I) - l(x - 1)2,
Y= (x - I) - ! (x - 1)2 + -l (x - 1)3,

are the required approximating polynomials.

EXAMPLE 2. Approximate the same function as above in the neighbor-


hood of the point (5, In 5).
This time we have Xo = 5 and /(5) = In 5 = 1.61, /,(5) = 1/5,
/"(5) = -1/25, /,"(5) = 2/125. Hence the approximating polynomials
are
1
Y = 1.61 + S(.'t - 5),

1 1
Y = 1.61 + S (x - 5) - 50 (x - 5)2,

Y = 1.61 + ~ (x - 5) - 5~ (x - 5)2 + 3~5(x - 5)3.

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

Examination of the error term 2.2:8 explains why the goodness of


the approximation in the neighborhood of Xo increases with an increase
in the degree for a fixed Xo and with an increase in Xo for a fixed degree
in the case of the function y = In x. Indeed, we have for this function,
nl .
= __
j (n+U(x)
x n +1 '

whence
E x = (x - xo)n+l . _1_ = __1_ ( x - x'l)n+l
n( ) n+1 Xn+l n+1 X .

Suppose that x is restricted to the interval txo


< x < 2xo . Since X
is between x and Xo , the value of X which makes I En(x) I greatest is
either x or Xo according as x < Xo or x > Xo . In either case, the absolute
value of the fraction (x - xo)/X is less than unity; hence En(x) approaches
zero as n tends to infinity (x itself being fixed). Also, if the difference
x - Xo and n are fixed, En(x) again approaches zero as Xo increases
since X will likewise increase.

EXAMPLE 3. Approximate y = sin x in the neighborhood of the origin


by polynomials of max-degrees 1, "',6.
We leave the ca:lculations to the reader; the results are

y= x,
x3
Y = x - 3! '
x3 x5
y=x-3T+5f;

the polynomial of max-degree 2n turns out to be the polynomial of


degree 2n - 1. The reader should graph y = sin x and the three
polynomial curves on the same set of axes. The error in P6(X) is
(x 8 sin X)/6!, where X is between 0 and x.

EXAMPLE 4. If sin x is approximated by the fifth degree polynomial


just above, through what interval may x range if the value of sin x
determined by the polynomial is to be correct to five significant figures?
Suppose x is positive; we have (x8 sin X)/6! < 0.000005, whence
x8 < 6!(0.000005)/sin X. Since we desire an upper bound for x, the
right-hand member of the last inequality must be made as small as
possible; hence we replace sin X by unity. We then obtain x ~ 0.39+.
That is, if x deviates from 0 rad by not more than 0.39 rad, about 22.4,
EXERCISE 29

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)

is, in a certain sense, best approximated by a polynomial

of max-degree n at a point A : (xo , Yo) on the graph of the function,


provided that pn)(xo) exists. If pn+l)(x) exists in the neighborhood of A,
the inherent error of the polynomial approximation is given by

(2.3:3) E(x) = (x - .xO),,+lJ<,,+l)(X)


(n+ 1)1 '

where X is between x and Xo . It also developed that while the approxi-


mation was good for a particular x in the neighborhood of A, it rapidly
became bad as x left the vicinity of the point. A question then naturally
arises: Is it possible to find an n so that Pn(x) approximates f(x) to
within any preassigned margin of error in an interval of arbitrary
extent around the point A ?
The answer is: sometimes, yes; sometimes, no. A more definite and
complete answer is furnished in books that discuss power series, a
special case of the more general infinite series. We must refer the reader
to these books as we can give here only the briefest review of the subject.
An expression of the form

(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

The power series is said to converge to the number k or to have the


value k at x = x' if the sequence of numbers

(2.3:6) Po(x'), Pl(X'), P2(X'),, Pn(x'), ... ,

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

(2.3:7) 1 x - Xo 1 < 1 x' - Xo I.


We now define a number R called the radius of convergence of the
power series. It may happen that the power series converges for no
value of x other than x = Xo , for which value it must obviously converge
to ao . In this case we say that the power series is nowhere convergent
(this term is used although, as we have just said, the series does converge
for x = x o) and we put R = O. It may happen that the power series
converges for every value of x; in this case we say that the power series
is everywhere convergent and we put R = 00. Finally, it may happen that
there is a finite positive number r such that the power series converges
for every x satisfying the inequality 1 x - Xo I < r, and diverges for
every x satisfying the inequality 1 x - Xo 1 > r. The various possibilities
at I x - Xo I = r do not concern us here. In this case we put R = r.
In all cases, R is called the radius of convergence of the power series.
As illustrations, we exhibit the three power series (xo = 0 in each case):

1+ l!x + 2!x2 + ... + n!xn + ... ,


Xxn x2
1+-+-++-+
I! 2! n!'
X x2 xn
1 + T+"2 + ... + 11 + ... ,

which have the respective radii of convergence 0, 00, I; however, we


offer no proof.
If a power series is convergent at each point of an interval, the series
is said to be convergent in the interval. The interval from Xo - R to
Xo + R is called the interval of convergence of the power series. A
power series defines, within its interval of convergence, a function f(x)
if f(x') is defined as the value of the series at x = x'; we write

I X-Xo 1< R.
32 2. APPROXIMATING POLYNOMIAL; APPROXIMATION AT A POINT

The conditional inequality I x - X o I < R may be omitted in discussing


a function defined by a power series, but it must be clearly understood
that any statement concerning such a function may hold only for x's
within the interval of convergence. For example, we have (again without
proof)
X x2 xn
e:D= 1 +-+-+ ... +-+ ...
I! 2! n!'
x x2 xn
1 - In(1 - x) = 1 + -1 + -2 + ... + -n
+ ...' I x 1< 1.

The functionf(x) defined by 2.3:8 is, within its interval of convergence,


(a) continuous and single-valued, and
(b) differentiable, and its derivative can be obtained from the power
series by term by term differentiation, and
(c) integrable, and its integral (between limits within the interval of
convergence in the case of a definite integral) can be obtained
from the power series by term by term integration.
It can also be shown that
(d) f(x) possesses derivatives of every order and each can be obtained
by term wise successive differentiation of the power series.
The series obtained by termwise differentiation or integration have the
same radii of convergence as the original series. Also, if f(x) is given
by 2.3:8 and also by

f(x) = bo + b1(x - xo) + ... + bn(x - xo)n + ... ,


and if neither radius of convergence is zero, then ai = hi , i = 0, 1, 2, ... ,
that is, a function
(e) f(x) can be represented as a power series in x - Xo in one and
only one way.
Finally, if f(x) is given by 2.3:8, then
_ pn)(xo)
(2.3:9) ~-1i!' n = 0, 1,2, ... ,

where !'O)(xo) = f(x o) and O! = 1.


The reader will immediately recognize this last expression as the
coefficient of (x - xo)n in the approximating polynomial for f(x).
Indeed, the polynomials of 2.3:5 are exactly these approximating poly-
nomials. The successive coefficients of the right member of 2.3:8 are
calculated by use of formula 2.3:9 and the resulting power series is
2.3. POWER SERIES 33

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)

then within their common interval of convergence,

(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

(2.3:17) (U) = u(u - I) ... (u - r + I) ;


r r!
it is convenient to put
(2.3:18) (~) = 1.
We now have
(2.3:16.6) (I + x)" = I + (7) x + (;) x + ... + (:) xn + "', R = I;

It follows from the definition of the binomial coefficient that if u is


a non-negative integer, the last power series reduces to a polynomial
of finite degree. Putting u = -1, we obtain
(2.3:16.6') (I + X)-l = I - x + x =f ... + (-I)nxn + "', R=1.
We may replace x - Xo in 2.3:8 by a function tp(x) to obtain the
senes
(2.3:19)
2.3. POWER SERIES 3S

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,

sin x sin 2 x sin" x


e81nz = 1 + -11- + -2!- + ... + -n
- +!...'
Also, substituting Xl for x in 2.3:16.6', we obtain

(2.3.16.6") (1 + X2)-1 = 1 - x 2 + x4 ... + (-I)"x2" + ... , R=1.


The coefficients of the Maclaurin expansion of x/(eX - 1) are of
great importance and hence we pay some attention to this series. We
have, after some simplification,

x x"
1+-+"'+
2! (n + I)!
+ ...
If we put
X
- - = B +_X+~X2+
BI B B"
... +-x"+'"
eZ - 1 0 1! 2! n!

(the factorials are written as part of the coefficients for reasons of


future simplicity and the letter B is used in honor of James Bernoulli),
then, from the equalities 2.3: 15,

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

These equations may be written more elegantly. In particular, if we


mUltiply the last one through by (n 1)1, we obtain +
+I
(nn + 1) O
B + (n +
n
1) B 1 + ... + (n +2 1) B,,-I + (n +1 1) B" = 0,
36 2. APPROXIMATING POLYNOMIAL; APPROXIMATION AT A POINT

or

(nn++ 11) Bo + (n +n 1) Bl + ... + (n +1 1) Bn + (n +0 1) Bn+! = Bn+1'


The last identity can now be written in the more concise symbolic form
(2.3:20) n = 1.2 .....

where the left-hand side signifies the result obtained by expanding


(1 + B)n+1 by the binomial theorem and then dropping the exponents
on the B's to subscripts. Since each B is obtained recursively from the
preceding B's. the value of a B. once determined. is fixed once and for
all; we find

(2.3:21) Bo = 1. Bl =- 1/2. B2 = 1/6. Be = -1/30. Be = 1/42.


Be = - 1/30. B 10 = 5/66. B12 = -691/2730.... ;
Ba = B6 = B7 = ... = B 2n+! = ... = O.

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.

Bo = 1. Bl = 1/2. B2 = 1/6. Ba = 1/30. Be = 1/42.....


We shall use the Bernoulli numbers as originally defined.
Returning to the power series. we have

(2.3:16.7)
- -x - = 1i i 1
- -x + - x2 - --x8
Bn
+ ... + (2n)!
_Lx2n + ... R= 2.
e:D - 1 2 12 720

We turn next to the expansion of tan x. It would be difficult to


calculate more than a few terms of the expansion by direct use of
formula 2.3:9; the series could be determined somewhat more easily by
writing tan x = sin x/cos x. and using the expansions of sin x and
cos x. However. the form of the general term of the series can be best
obtained from 2.3:16.7; it can be shown that

(2.3:16.8) tan x = x + -1 x8 + ... + (-1 )n-l 22n(22n - 1) B


2n X 2n - 1 + .. ,
3 (2n)1
R = ,"/2.
2.3. POWER SERIES 37

It can also be shown that


1 1 22nB
(2.3:16.9) xcotx = 1- -x2 - -oX' - ... + (_I)n _ _2_n x2n + ...
3 45 (2n)I'
R = 71;
and that

(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:16.13) sinh x = !(e'" - r"')


xl Xi X2n+!
=X+ 3! + 5! + ... + (2n + 1)1 + ... , R=co;

(2.3:16.14) cosh x = ! (e'" + e-"')


x2 oX' x2n
= 1 + 2f + 4f + ... + (2n)1 + ... , R=co.
38 2. APPROXIMATING POLYNOMIAL; APPROXIMATION AT A POINT

Another series of importance for later developments is the Maclaurin


expansion of x/ln(l x). Let us write +
:---;.,-_x,............,.
In(1 + x)
= I
0
+ I 1x + 1_",2
z-
+ ... + 1" x" + ... .

The importance of the series lies in the properties of the coefficients


rather than in the series itself. Since
x
In(1 + x) 1--+-=f
X x2 '

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

We may regard In as being determined by the recursion formula

_.1 ... "+1_1_ .


(2.3:23) I" -
_1
"'11"-1 31"-2 + (_ 1) n + 10 ,
where 10 = 1. We find

(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.

The last series can be obtained in another fashion. We have

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

On comparison of the two expansions for x/ln(1 + x), we obtain the


set of identities important for the sequel,

(2.3:25) n = 0,1,2, ....


These identities may, of course, be used in place of Eq. 2.3:22 for the
evaluation of the I's.
We derive here for future use some properties of the integral 2.3:25.
By definition, (~) is a polynomial in t of degree n whose n distinct roots
are 0, 1, 2, ... , n - 1, hence (~) does not change sign in the interval
o < t < 1. Also, since
(n ~ 1 ) = ~ ~ ~ (~),
(~) and (n;l) are of opposite signs (or are both zero) for t < n,
n = 1,2,3, .... In particular, (_I)n-l(~) > 0 for 0 < t < I, 0 < n.
Hence
(2.3:26)
n- 1 n
n +
1 (-1 )..-1 I.. < (-1)" I"+l < n + 1 (-1 )..-1 I.. , n = 1,2.. ,
or
n = 1,2, ....
We derive from the last inequalities the pairs of inequalities
n-2 n-l
--11
n
.._11 < 11.. 1 <--11
n
.._11
n-3 n-2
- 1 11"_21 < I /..- 1 I <
-n- -
n-- 1 11..-21
n-4 n-3
- - 2 11..- 3 I < 11..- 2 I <
n- -
n-- 2 11..-31

< 1131 <


40 2. APPROXIMATING POLYNOMIAL; APPROXIMATION AT A POINT

whence we obtain by multiplication

n-2 n-3 n-4 1


- - . - - I . - - 2 ..... -3 11..- 11..- 2 ... 1311 121
n n- n- < I I .. 111..- 11..- 2 ... 131
n-I n-2 n-3 2
< -n - ' -n-
-1 '-
n-- 2 .... '-311..-11..-2 "'13 1112 1.
Hence
2 2
n(n - I) 112 I < 11.. 1 < -1121.
n

Since 12 = l2'
1
(2.3:27) 6n(n - I) < 11.. 1 < 6n' n = 3,4, ....

It follows from several of the previous statements that the sequence

(2.3:28)

is an alternating sequence and that

is a decreasing, null sequence.


Weare now in a position to provide a partial but far-reaching answer
to the question posed at the beginning of this section. If a function f(x)
possesses a Taylor series expansion in powers of x - Xo whose radius
of convergence is not zero, and if x is a value of x within the interval
of convergence, it is possible to find a sufficiently large n such that the
value of the approximating polynomial Pn(x) at x = x differs from f(x)
by less than any preassigned positive margin of error. The value of n
will depend on the preassigned values, x and the margin of error.

2.4. Computation with Power Series. We have just seen that if a


function f(x) possesses a Taylor series expansion

(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

error does not exceed a preassigned bound, we must have an estimate


of the error

(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:3) ao - al + a. - as ... + (-1 )"a,. + ... ,


where all the a's are positive. It can be shown that an alternating series
will converge if

(2.4:4) lim a"


"...
",
= 0,

and if from some term, say am, onward, the condition

(2.4:5)

holds. (A sequence of constants satisfying the last condition is called


a decreasing sequence; if the > signs are replaced by ~ signs, the
sequence is called a monotonically decreasing or nonincreasing sequence.
Increasing and monotonically increasing or nondecreasing sequences are
similarly defined. A monotonic sequence is anyone of the preceding
types.) Conditions 2.4:4 and 2.4:5 are sufficient to ensure convergence;
the first condition is necessary but the second is not; the first condition
alone is not sufficient.
It is proved in texts on infinite series that if an alternating series
converges to a number A, say, then

(2.4:6) I E" I = IA - ~ (-1 )ia; I ~ I a,.+l I,


\ <-0

provided that an+l is in the monotonically decreasing portion of the


series; that is, the absolute value of the error committed in deleting
42 2. APPROXIMATING POLYNOMIAL; APPROXIMATION AT A POINT

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.

EXAMPLE I. Compute sin 40 correct to five significant figures from


the series 2.3: 16.1.
We have 40 = 21T/9 = 0.6981317 rad. We deduce, if we use for-
mula 2.2:8 for the error, since x = 0.7 (approximately), Xo = 0,
pn+l)(X) = I (at most),

(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

. 400 """ 0 6981317 _ (0.6981317)3 + (0.6981317)5 _ (0.6981317)1


sm ""'. 31 5! 7!
= 0.6427875,

or, to five significant figures,

sin 40 = 0.64279.

The symbol ~ is read "is approximately equal to."


Methods for estimating the error 2.4:2 which yield better results
than formula 2.2:8 involve more intimate knowledge of power series.
We illustrate one of the possibilities in

EXAMPLE 2. Compute In 2 correct to five decimal places by putting


x = t in the power series
I x x x' 3 x"
In--
I-x
= x+-+
2
-+
3
-+
4
... +-+
n'
... R=l.
2.4. COMPUTATION WITH POWER SERIES 43

A simple calculation shows that pnHI(x) = n!/( 1 - x)nH. Hence, the


expression 2.2:8 for the error term becomes (xo is again 0),
x n +1 n! x n +1
(n + 1)1 (1 - X)n+1 - (n + 1)(1 - X)n+1

We have x = i; further, X must be chosen between 0 and so that the t


magnitude of the error is as large as possible, hence X is also t. The
error term consequently reduces to I/(n + I) and we must find the
first n for which I/(n + I) < 0.000005. The first n is n = 200,000.
On the other hand, we have

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.

EXAMPLE 3. Evaluate 1/2e0.26 correct to five decimal places by use of


the Maclaurin series for xe-Zl
The successive derivatives of this function soon become very un-
wieldy; hence it is desirable to compute the coefficients of the power
series and to estimate the magnitude of the error committed by stopping
at a certain term by other means. If in series 2.3:16.3 we replace x by
-x2 and then multiply through by x, we obtain
x3 x5 x7 x 2n +1
xe- Zl = x - - + - - - ... + (-I)n - - + ...
11 21 31 n!
2. APPROXIMATING POLYNOMIAL; APPROXIMATION AT A POINT

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

This time, however, about 200,000 terms are necessary to obtain an


answer with the same degree of precision as before. The first series is
thus far better suited for the calculation of In 2 than the second.
A computer is often faced with a similar situation. He may discover
that in attempting to evaluate a function J(x) for a particular argument
i, say, from the Taylor expansion ofJ(x), far too many terms are necessary
to obtain a value with a desired degr.ee of precision. The series converges
too slowly. The computer can do several things to lessen the labor of
computation. He may try to accelerate the rate of convergence by
transforming the series into another one. It is not necessary to define
here what is meant by the "rate of convergence" nor do we attempt to
give here formal methods for the accomplishment of such transforma-
tions; the reader is again referred to the standard texts on infinite series.
Another possibility that the computer may try is to replace the function
used by another which will yield the same result. If, say, J(i) is wanted
and the power series expansion of J(x) converges too slowly for x = i,
it may be possible to find another function F(x) and a corresponding!
such that J(i) = F(x) and such that the power series expansion of F(x)
converges rapidly for x = x. Thus, we have just seen that a great
saving in labor and in time will result if we replace In( I +
x) by
In[I/(1 - x)] for the calculation of In 2. In this case, an even greater
saving can be gained by adding the two series together to yield

In(1 + x) + In [1/(1 - x)] = In[(1 + x)/(I - x)]


;x:3 x5 x~" +1 )
=2 ( x+ 3 + S ++ 2n+1 + ... ;
R=l.
We can calculate In 2 from the last series by putting x = l. This time,
only five terms are necessary to obtain In 2 correct to five significant
figures.
EXERCISES 45

Another method for avoiding long and tedious calculations IS


illustrated in:

EXAMPLE 4. Compute e6 correct to five decimal places from the


series 2.3: 16.3.
If 5 is substituted for x in the series, it can be shown by the method
used in example 2 that 22 terms are necessary to compute e6 correct
to five decimal places. We can, however, compute e correct to eight
decimal places by substituting one for x in the series; we need only
twelve terms. Raising e to the fifth power will yield e6 correct to five
decimal places. But it should be remarked that unless a desk calculator
is available, it is doubtful whether a real saving is hereby effected. The
result is e6 = 148.41316.

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

each correct to seven significant figures.


7. We have seen that
I
In - -
+x =
(X3
+ - + ... + -X
2 x -I-' H
+ I...) , R=1.
I-x 3 2n+1
46 2. APPROXIMATING POLYNOMIAL: APPROXIMATION AT A POINT

Since

~
I-x
= ~ (! +
2x
I)/! (! - I) ,
2x
for x"# 0,

it follows that

In! (! + I) = In! (! - I) + 2 (x + ~ + ... + XI'H~ + ... ), x"# 0, R = I.


2x 2x 3 2n+1
Put x = i'i' t, ... ,
in this series to compute successively In 2, In 3, In 4, ... , In 10. Find
each value correct to seven significant figures.
8. Prove that
I I S E ln
sec x = - - = I + - Xl + - x' + ... + (_I)n - - xln + ...
cos x 2 24 (2n)I'
where the Euler numbers Eo , E, , EI , ... , are defined by the symbolic recursion formula
Eo = I; (E + I)k + (E - Ih = 0, k = 1,2,3, ....

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.

Provef(x) = f( -x) and then show that B ln +1 = 0, n = 1,2,3, ....


t2. Let f(x) = Qo + QIX + ... + QnXn be a polynomial of degree n and let Xo be any
constant. Divide f(x) by x - Xo to obtain the quotient qo(x) and the constant remainder
bo so that
2.S. ASYMPTOTIC SERIES; EULER'S SUMMATION FORMULA 47

Similarly, obtain
qo(X) = (x - xo) ql(X) +b l ,

ql(X) = (x - xo) q.(x) +b l ,

q"_I(X) = (x - xo) q"_I(X) + b"_l ,


q"_I(X) = b".
Use these equations to prove that
k = 0, 1, 2, ... , n,
and therefore
f(x) = bo + bl(x - xo) + b.(x - xo)S + ... + b,,(x - x o)".
Hence justify Horner's method for the determination of the real roots of a polynomial
equation.
tl. More generally, let f(x) be the polynomial of the previous example and let Xo,
Xl , ... , X,,_l be any set of n constants. Form the sequence of equations

f(x) = (x - xo) qo(x) + bo ,


qo(x) = (x - Xl) ql(X) + bl ,
ql(X) = (x - XI) qs(x) + bl ,

q"_I(x) = (x - X,,-l) q"_I(X) + b"_l ,


q"_I(X) = b".
Prove
f(x) = bo + bl(x - Xo) + b.(x - Xo)(X - Xl) + ... + b,,(x - Xo)(X - Xl) ... (X - X,,-l).
Furthermore if
f(x) = Co + CI(X - Xl) + CI(X - xo)(x - Xl) + ... + c,,(x - xo)(x - Xl) ... (X - X,,-l),
prove b, = Cj, i = 0, 1,2, ... , n.
Prove a similar result for the preceding example.

1.S. Asymptotic Series; Euler's Summation Formula. If y = f(x)


is a function of x with an (n + l)st derivative, thenf(x) can be expressed
in the form
f(x} = f(x o} + (x - xo)j'(xo) + ... + (x -:to)'1 pn)(xo) + E~(x},
where one form of the remainder En(x) is

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

f(a) = f(x o} + (a - xo)!'(xo} + ... + (a - ntx}n pn)(xo} + ....


2. APPROXIMATING POLYNOMIAL; APPROXIMATION AT A POINT

More generally, if we have a formula of the type

f(x) = fo(x) + fleX) + ... + f ..(:oc) + E..(x),


where the law governing the formation of the J/s and En(x) is known,
and if for a particular fixed x the limiting condition just above holds,
then J(x) can be determined to any degree of precision by taking enough
terms of the infinite series

f{:") = fo{x) + flex) + ... + f ..{x) + ....


For example,
111
el / z = 1 + - + -- + ... + -- + ...
l!x 2!x2 n!x"

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

Let us, however, consider the finite series with remainder

f(x) = 1 -.!.! + x2!2 =F ... + (-I)" x"n! + (-1)n+18.. (nx+ I)! ,


x ..+1

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

More generally, consider the infinite series

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

(2.5:2) S,,(x) = ao + atx + ... + a"


x"
, n = 0, 1,2, " ..

The series 2.5: I is called an asymptotic (or semiconvergent) series and is


said to be an asymptotic expansion (or representation) of a function f(x)
if there exists a sequence of constants

such that

(2.5:3) I/(x) - S,,(x) I< ~::: ' n = 0,1,2, ... ,

for every positive value of x, and we write

(2.5:4) I(x) ,...., a


o
a
+ ---.!
X
a
+ -.-!
x 2
+ ". + -a,.
x"
+ " ..
The inequality means that the absolute value of the error made in
approximating f(x) by 8,,(x) does not exceed K"+l/Xn+l. For a fixed x,
the error may be numerically large, but the numerical value of the
error will approach zero as x tends to infinity. Indeed, this stronger
statement holds: the numerical value of the error multiplied by x" will
approach zero as x tends to infinity.
When we use 8,,(x) to approximate f(x) for a given (positive) x,
we use the smallest n which will make the margin of error small enough
for our purposes (if it can be done). Asymptotic series frequently arise
in connection with the Euler summation formula which we discuss
later but before we do that, one or two examples may be helpful.
We consider first the so-called logarithmic integral (r'/t) dt, r
where we suppose that x is positive. Although this integ~al can be
expressed as a known function plus a power series in x which converges
everyw here - indeed,

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

where C is a constant whose value is given in 2.5:13 [see T. J. Bromwich,


"An Introduction to the Theory of Infinite Series" (rev. ed. by T. M.
MacRobert), Macmillan, New York (1931); or K. Knopp, "Theory
and Application of Infinite Series," 2nd ed., Hafner, New York, 1948]
the power series converges so slowly for large value of x that it is
practically worthless for the evaluation of the integral for such values of
x. It is far better for the purposes of computation to express the integral
in the form

f" -td t = e-" GIl


ooe- I
x
21 =f ... + (_I)n-1 ( n .-
- - - + ---.:
x3 xn
+l(-I)nE
2
)I]
n ,

where 0 < En < n!/xn+!. We have

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
.,

The inequality 2.5:3 holds and

1 11 2! (n - i)!
f(x)"'---+-=f"'+(-I),,-1
x x2 x3 xn
....

Take x = 5, say; then if n = 4,

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

with an error too small to affect the last decimal place.


Again, it can be shown that

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

where Bk(X) is of degree k; they are defined by the statements

(2.5:5a) Bo(x) = I,

(2.5:5b) Bk+l(X) = f Bk(x) dx, k = 0, 1,2, "',


(2.5:5c) k = 2,3,4, ....
If we make use of the defining relations for the Bernoulli numbers,
B o , Bl , B2 , "', it is readily shown that

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

The general polynomial can be written in the symbolic notation

(2.5:7) k = 0, 1,2, ....

These polynomials are named the Bernoulli polynomials (it should be


noted that the terminology varies in the literature as it does for Bernoulli
52 2. APPROXIMATING POLYNOMIAL; APPROXIMATION AT A POINT

numbers) and like the Bernoulli numbers, they occur frequently in


many investigations.
For some purposes it is convenient to replace the Bernoulli poly-
nomials by periodic functions of period I that coincide with the poly-
nomials in the interval 0 ~ x < I. A nonconstant function f(x) is
said to be periodic if there exists a number p different from zero such
that f(x) = f(x + p) for every x. If p is the smallest positive number
for which this relation holds, f(x) is said to be of period p. The reader
has already met periodic functions in trigonometry. Thus, sin nx is a
periodic function of period 21T/n. To obtain the periodic functions we
desire, let [xl be the largest integer which does not exceed x; the functions
are then defined by

(2.5:8) k = 0, 1,2, ....

In particular,

(2.5:9) Pt(X) = x - [x] - !.


The graphs of Bt(x), B 2(x) , Pt(x), and P 2(x) are shown in Figs. 2.5:1
and 2. The Bernoulli polynomials are, of course, everywhere continuous
and possess derivatives of all orders for all values of x; this is also true
of the P's except that Pt(x) is discontinuous and non differentiable for
integral values of x and P 2(x) is nondifferentiable for integral values of x.
The definite integral of anyone of the periodic functions like the definite
integral of anyone of the polynomials exists between any two finite
limits.
We are now ready to derive the Euler summation formula. If i is

yp,(x)

'3 ,~ /5 ,1; x

" " " " " / "

FIG. 2.5:1.
2.5. ASYMPTOTIC SERIES; EULER'S SUMMATION FORMULA 53

a non-negative integer, let y1 k) = J<k)(t); in particular, for k = 0, we


write Yi = f(i). We have

iIi f'(x) dx = i(yi - Yi-l), i = 1,2, ... , n,


i-1
whence

i
i-I
i r1-1
f'(x) dx = -(Yo + Y1 + ... + Yn) + (n + I)Yn

-I

FIG. 2.S: f2.

If i - I < x < i, then i = [x] + 1, and


f
i-1
i
i-1
f'(x) dx = r
i-1 ,-1
([xl + I)f'(x) dx = r0
([xl + I)f'(x) dx.
Therefore
n n
~Yi = (n + I)Yn - I ([xl + I)f'(x) dx.
i-O 0

By an integration by parts, we find that

nYn = r o
xf'(x) dx + r
0
f(x) dx,

whence we obtain by substitution into the last equation,

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,

which we write finally as

(2.5: 10) iYi


i-O
= r
0
f(x) dx + t (Yo + Yn) + r 0
PJ(x)f'(x) dx.

This is the so-called Euler summation formula in its simplest form.


Two examples will illustrate the usefulness of the summation formula,
even in its simple form.

EXAMPLE l. Let f(x) = 1/(1 x), then Yk = I/(k + I), k = 0, I, +


2, ... , n - I, and r-
1 f(x) dx = In n. (In this example it is convenient

to stop at the inde: n - I rather than at the index n.) Hence

(2.5:11) ~
t.{k"+T =
1
In n + 21 ( 1 + n
1)
- fn-
0
J PJ(x)
(x + 1)2 dx.

The last equality has some interesting consequences. Since


I P1(x) I ~ t for every x and

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

exists and is between 0 and - t. Therefore the number C defined by

.
(2.5.12) C -!~
_. [~1
f:to k + 1 - In n -
] _ 21- foo PJ(x)
0 (x + 1)2 dx

exists. The number C is called Euler's constant; it can be shown that


(2.5: 13) C = 0.577216-.
(See previously cited references.)
2.5. ASYMPTOTIC SERIES; EULER'S SUMMATION FORMULA 55

The statements 2.5:11-13 throw an interesting light on the growth


of the harmonic series. In words, the sum of the first n terms of the
harmonic series exceeds In n by an amount which, as n increases,
constantly increases but approaches 0.6- as a limit.

EXAMPLE 2. Take f(x) = In(1 + x); then Yk = In(1 + k) and


j"-l f(x) dx
o
= 1- n + n In n. Hence
n-l fn-1 p (x)
~ln(1
~
+ k) = 1- n + n In n + tIn n + 0
_1
x+
-1 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:15) A-I = lim f n


-
1
Pl(X) dx = P1(x) dxf'"
n-oao 0 X+ lox + 1
exists. Assume for the time being that the limit does exist, we rewrite
2.5:14 as

(2.5:16) In n! = (n + l)ln n - n + An ,
where
A = 1 + fn- 1
P 1(x) dx
.. 0 x+l '

and we endeavor to determine A.


The presence of n! in 2.5:16 suggests the use of Wallis' infinite product

which can be put into the form

where 0 is positive and limk-+'" Ok = I. Hence

.';;=~.~ .....
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

In.y; = (2k + !) In 2 + 21n k! - In(2k)! - ! In(2k + I) + In Ok'


We use 2.5:16 to obtain
.r I
In V1T
1
= "!fIn 2 + (Ilk) + 2Ak - A2k + In Ok,.
hence

We now let k -.. co, then

(2.5:18)

which is the desired result.


Before we proceed to the proof of the existence of A, we note that
An can now be written as

A = I + fco P1(X) dx _ fco P1(x) dx


" 0 x+I n-1 X +I
= In V21T - fco P 1(X)1 dx,
n-1 X +
and therefore 2.5: 16 can be rewritten as

In n! = (n + !) In n - n + In V21T - fco P1(x)1 dx


- n-1 X +
= In nn v2n1T - n - fco P 1(X)1 dx.
n-1 X +
By changing the last equality to the exponential form, we obtain

(2.5:19) n! = nn v2n1Te- n exp (-fCO P 1(x) dX).


n-1 X +I
This last important identity is one form of Stirling's formula, a formula
which gives us the value of n! in terms of functions of n that are more
readily computed. It can be shown that h-l P1(x)/(x + 1) dx is negative
2.5. ASYMPTOTIC SERIES; EULER'S SUMMATION FORMULA 57

[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

(2.5:21) P k+1(x) = fPk(X) dx, k = 0, 1,2, ....


An integration by parts yields

and therefore

(2.5:22) ( P1(x)f'(x) dx = ~t(/'(n) - 1'(0 - ( p.(x)f"(x) dx,

since, from 2.5:7, 8, P.(n) = p.(O) = B.(O) = B./2!. In particular

(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 n! = (n + !)1n n + 1 - 1 (1n- 1) + f"-1 (xp.(x)


n + 12 + I). dx.
0

From 2.5:15-18-23, we obtain

. /-
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

This is another form of Stirling's formula. It can be shown that


fn'-l P2(X)/(X + 1)2 dx is positive [example 7(b)]; the last factor in
2.5:24 is then less than one and

(2.5:25) n! < nn v2n1T exp (l~n - n).

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).

We are now ready to improve the simple Euler summation formula.


The equality 2.5:22 is easily extended to

(2.5:27) 5: Pk(X)J<k)(X) dx = (kB~+;)! (y~k) - y~k) - 5: Pk+l(X)J<k+l)(X) dx.

The simple Euler summation formula then yields

""
~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:29) R2k = : P2k(X)J<2k'(X) dx = - : P 2k+1(X)J<2k+1'(X) dx.

Before we illustrate the use of the formula, it would be well to get


some estimate of the magnitude of the remainder R2k . It can be shown
that
m,.., 0,1,2, ''';

for even subscripts we have the better bound

I P2m(x) I ~ 1(~:n)!I, m = 0, 1,2, " ..


Hence

(2.5:30) I R2k I ~ (2:)2k : I


J<2k'(X) I dx,
and also

(2.5:31)

An important special case in which we can get an estimate of the


magnitude of the remainder frequently arises in practice. Suppose that
the differences y~j-l) - y~j-l), j = 2,4,6, "', all have the same algebraic
sign (or, more generally, have the same algebraic sign after a certain
point, for j = 2t, 2t + 2, 2t + 4, "', say), then since the odd-indexed
B's after Bl are all equal to zero, and the even-indexed B's alternate
in sign, the terms that actually appear in the sum on the right-hand
side of Euler's formula 2.5:28 will themselves alternate in sign (at
least after a certain point). Hence if k is allowed to tend to infinity, we
obtain an alternating series. Now, the differences y~j-l) - y~j-l) will
60 2. APPROXIMATING POLYNOMIAL; APPROXIMATION AT A POINT

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,

(2.5:32) I R2k I < I(2kB2k+2


+ 2)1"
(yI2k+U - yI2k+l)
0
I

EXAMPLE 3 (Extension of example 2). Since f(x) = In (I + x), we


have pk+l)(x) = (-I)k k!/(l + x)k+l and pk+l)(O) = (-l)k k!,
jlk+U(n - I) = (-I)k k!/nk+l. Hence

, _
In n. - n In n - n + 1 + 1"2" In n + ~
i-I
B2i (2i - 2)1
~ (2 ')'
,. n
2i-! - (2i - 2)!
)

+ (2k)' f,,-1 P2k+l(X) dx.


0 (I + X)2k+l
From 2.5:27 we obtain

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.

If we allow n to become infinite, then

I . /2- 1 - f<Xl P 1(x) dx - ~ B2i (2' 2)' (2k)' f<Xl P 2k+l(X) dx


n v 'TT - - 0 x+I - - t{ (2i)! ,- . + . 0 (x + 1)2k+l '
and

(2k) ' f"-1 P 2k+ 1(X) d - 1 . /2- - 1 ~ B2i (2' - 2)'


.' 0 (I + X)2k+l X - n v 'TT + t{ (2i)!' .

-(2k)' f<Xl P2k+l~) dx


. "-1 (x + 1)2k+l
Consequently,

In n., -- In n" v /-2


n'TT - n -+- i~-I'
B2i
~ (2' _ I) 2'. 2i-l
, n
-
(2k)' f<Xl

,,-1 x
(
P 2k+l(X)
+ 1)2k+l
d
x,
or
(2.5:33) n., -- n".v /-2
n'TT e-" exp [~
~ (2i _
B2t2i . n2t- 1
I) + A k... ],
i-I

where, for a fixed k, Ak,n - 0 as n - <Xl. This is the general form of


Stirling's formula.
2.S. ASYMPTOTIC SERIES; EULER'S SUMMATION FORMULA 61

EXAMPLE 4. Let f(x) = x P , where p is a constant not equal to 0 or I.


Then, by Euler's summation formula 2.5:28,

( P ) P 2HI
n
~jP
i-I
nPH
= __ + -1 n P + t=1
P+ 1 2
k B
~ ~ (2i - I)!.
(2,). 2, - 1
n -

- (2k)! (~) : P2k(X) Xp - 2k dx,


or
B
n-I
~jP = _n_
pH 1
_ -nP + ~~ (. P ) nP- 2;H
k

;-1 P+ 1 2 ;-1 2, 2, - 1

- (2k)! (~) : P2k(X) Xp - 2k dx.

If, in particular, p is a positive integer, the series on the right can be


carried out as far as the term in n or n2 according as p is even or odd.
In either case, the final integral is equal to zero and we have

~jP = _1_ ~ (P ~ 1) Btn P- HI ,


;-1 P+ 1;_0 '
which can be written in symbolic notation as
n-I 1
~J.p -
~
- - [(n
-p+l + B)PH - B pH
]
,-I
EXAMPLE 5. Let f(x) = sin tx and take n = I. Then, by 2.5:28,

.
sm t = -1 - -
t
cost sint
- + --
t
+~ B
~(-I)t-1 ~ (t lt - I cos t -
2 t-I (2,).
tIt-I)

+ (-1 )kH t2i: ( P2k(X) sin tx dx,


or

! 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

which can be put into the form


k B
! cot! t = ~ (-I)t (2i)~ t 2t- 1 + T k

In virtue of 2.5:30, Tk - 0 as k - 00, hence the sum on the right can


be extended to an infinite series. If we multiply through by t and then
replace it by x, we obtain the series 2.3:16.9.
62 2. APPROXIMATING POLYNOMIAL; APPROXIMATION AT A POINT

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

to evaluate the integral as precisely as possible for x = 5 and x = 10.


3. Use the Euler summation formula 2.5:10 withf(x) = a + dx to derive the formula
for the sum of an arithmetic progression.
4. Derive the formula for the sum of an arithmetic progression by use of formula
2.5:28.
5. The table below gives the values of

- 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

6. Evaluate the entries of the table above.

[.
Hlflt: evaluate
It
t-l
Pl(X)
- - - . dx.
(x + I)
]

7. a. Prove J""" Pi (x)


- - dx
+I
.
19 negative.
.

r
n_1X

b P rove p.(x) dx' ..


--- 19 pOSitive.
n-l + I)
(x

2.6. Other Methods of Approximation. In Section 2 of this chapter


we developed a method for the representation of a function y = f(x) by
a polynomial Pn(x) = ao + a1x + ... + anxn of max-degree n. We
wished to find an approximating polynomial which, in some sense,
represented the function as well as possible in the neighborhood of a
point (xo ,Yo) on the graph of y = f(x). To this end we imposed the
n + 1 conditions

(2.6:1) i = 0, 1, "', n,

for the determination of the coefficients of Pn(x). It was then shown


that if Pn(x) was the polynomial so determined and qn(x) was any other
polynomial of max-degree n, then

(2.6:2) lim f(x) - Pn(x) = 0.


f(x) - q,,(x)
"' ...."'0

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

(2.6:3) lim f(x) - Pt(x) = 0,


f(x) - q.(x)
"' ...."'0

where qi(X) is any polynomial of max-degree i distinct from Pi(X). It


can be shown that the first n derivatives of f(x) exist and the conditions
2.6: 1 hold. In summary:
If the function y = f(x) possesses an nth order derivative at x = xo ,
then for each i in the range 0, 1, "', n there exists a polynomial Pi(X)
of max-degree i such that Pi(X) approximates f(x) at x = Xo better than
any other polynomial qi(X) of max-degree i in the sense of condition
2.6:3; and conversely, if for each i in the range 0, 1, "', n there exists
a polynomial Pi(x) of max-degree i such that Pi(X) approximates f(x)
64 2. APPROXIMATING POLYNOMIAL; APPROXIMATION AT A POINT

at x = Xo better than any other polynomial qi(X) of max-degree i in


the sense of condition 2.6:3, then f(x) possesses an nth order derivative
at x = Xo.
It is thus clear that if y = f(x) fails to possess an nth order derivative
at a particular point, we must look elsewhere for methods of determining
the "best" approximating polynomial of max-degree n and we must
seek other criteria for the goodness of the representation. In particular,
what polynomial of max-degree I approximates the function

(2.6:4) y = f(x) = i (x + I x I) = i (x + vXi)


well at the origin? The function is everywhere continuous and possesse
a first derivative everywhere except at the origin (at which point it is
continuous). It follows from the discussion above that there is no
polynomial of max-degree I which is the best representation at the
origin in the previous sense.
In casting about for other criteria for goodness of representation it
might be well to examine the geometric significance of condition 2.6:2.
Essentially, the condition states that for any x sufficiently close to xo ,
the segment of a vertical line intercepted between the graphs of f(x)
and P..(x) is shorter that the corresponding intercept between f(x) and
q..(x). When this criterion fails, it is then natural to ask if there exists
a P..(x) such that the average segment intercept is smaller than the
average segment intercept determined by a q..(x) in an interval about Xo
In whatever sense "average" is understood, it is tied up with some sort
of an integral; in particular, we may examine the integral

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

J"'0+1& 1 f(x) - P..(x) 1 dx


"'0-1&
(2.6:7) hm = 0,
1&-+0
f "'0-1&
"'0+1&
1f(x) - q..(x) 1 dx
or such that
f "'o+1& (f(x) - p..(X))2 dx
"'0-1&
(2.6:8) hm =0,
I&~O J"'0+1& (f(x) - q..(X))2 dx
"'0-1&

where qn(x) has the same meaning as before?


We do not propose to answer these general questions but we shall
examine the function 2.6:4 in the light of these criteria. Take n = I;
is it possible to find a Pl(X) = mx (the constant term is zero since the
line must go through the origin) 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

Hence for any m between 0 and 1 inclusive, the integral A is equal to


Ih 2 and this is the minimum value that the integral can have. In this
case, then, it is not possible to find a unique polynomial mx which
minimizes A, given by 2.6:5, nor is it possible to find a unique Pl(X)
to satisfy 2.6:7.
We then turn to a consideration of the integral

(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

It follows at once that for an arbitrary but fixed h (#0) B is a minimum


when m = t. In this case, we can minimize the integral 2.6:6 and
furthermore, our answer is independent of h; we cannot, however,
satisfy the limit condition 2.6:8.
We do not pursue these considerations any further.

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

The Approximating Polynomial;


Approximation in an Interval

3.1. Introduction. The main theme of the preceding chapter was


the construction of a polynomial, P(x), that approximated a given
function, f(x), well in the neighborhood of a point on the graph of the
function. However, even a superficial analysis indicates that as we
leave the immediate vicinity of the point, the error tends to grow larger
and larger. For this as well as other reasons, it is desirable to develop
methods of constructing polynomials which approximate a given function
well throughout an interval. If our concern is to replace f(x) by p(x)
in some process, we refer to p(x) as an approximating polynomial, but if
our only concern is to determine f(x) by evaluating p(x) for corresponding
values of the argument x, it is common to refer to p(x) as an interpolating
polynomial. In this respect, Weierstrass proved the fundamental theorem:
if a function f(x) is single-valued and continuous in the closed interval
[a, b] (a ~ x ~ b), and if E is any preassigned positive number, then there
exists at least one polynomial p(x) such that I f(x) - p(x) I < E for all x's
in the interval.
Although the existence of the polynomial is proved, its degree may
be enormous if E is small or the interval large. It is then perhaps simpler
to find a suitable polynomial whose degree does not exceed a preassigned
bound. We start with the method discussed at the end of the last
chapter.
Let
(3.1: 1) y = f(x)
be a real, single-valued and continuous function; we endeavor first to
approximate f(x) throughout an interval [a, b] by a polynomial
(3.1:2) P..(x) = ao + a1x + a2x2 + ... + a..x"
of preassigned max-degree n where P..(x) is determined by the condition
that
(3.1:3) lA = t
If(x) - P..(x) I dx
12

67
68 3. THE APPROXIMATING POLYNOMIAL; APPROXIMATION IN AN INTERVAL

be a minimum, or by the condition that

(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

which is a minimum when c = i.


The condition that the integral 1A given by 3.1:3 be a minimum
usually lead to an unwieldy problem because of the absolute value.
We illustrate the use of the second condition by two examples.

EXAMPLE 1. Hf(x) = t(x +


I x I), find the parabolay = ao alx al x 2 + +
which minimizes the integral Is given by 3.1:4 in the interval [-1, 1].
We have (the subscript S is omitted)

J o
= -I (ao + alx + a2x2)1 dx + f 0(ao + (al -
I
1) X + a2x2)1 dx

= i + 2ao2 - ao + t ana2 + iall - ial + fall - t a2


Now
IDO = 4ao - 1 + tal'
I al-"3
- 4 a1 - g3'

laB = tao + tal - t,


3.1. INTRODUCTION 69

where Ia = oIloai' and


j

laoao = 4,

I 40al -
-
Ial40 -.4:
- 3 '

I asa. -- 3"'
4

where I alZ, = o2IIoaioaj . Sufficient conditions for a minimum are

lao = I al = I al = 0,
14040 l40al l40aa

(3.1:5) lal ao lalal lalaa >0.


laaao lalal 1a1a

.
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.

EXAMPLE 2. If f(x) = sin x, find the parabola y = a o + alx + a2x2


which minimizes the integral Is given by 3.1:4 in the interval [0,11].
We have (again we omit the subscript S)

I = (Sin x - (a o + alx + ar 2))2 dx.


This time we calculate the partial derivatives before we integrate; we
obtain
lao = -2 r o
(sin x - (a o + alx + a2x2)) dx
= -2 (2 - ao'TT - ~1 'TT2 _ ;2 'TT 3 ),

lal = -2 r
0
x(sin x - (a o + a 1x + ar2)) dx
= -2 ('TT - ~0'TT2 - ;1'TT3 - ~ w4),

lal = -2 ( x 2 (sin x - (a o + a1x + a2x2)) dx


= -2 ('TT2 - 4 - ;0 wi - 7w4 - ~ 'TTO).
70 3. THE APPROXIMATING POLYNOMIAL; APPROXIMATION IN AN INTERVAL

We find on imposing the conditions 3.1:5 that

12
ao = w3 (172 - 10) = -0.050,

60
a 1 = -rr4 (12 - r) = 1.312,

60
a2 = -rr5 (172 - 12) = -0.418,

and therefore the equation of the required parabola is

Y 12 [r - 10 + :5; . (12 -
= w3 172 ) X + 1752 (172 - 12) x2]

= - 0.050 + 1.312x - 0.418x2


The reader should graph the parabola and sine curve on the same set
of axes.

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. Polynomial Thr.ough n + 1 Points; Determinant Form. In the


preceding section we saw that it is possible to approximate a function
throughout an interval by a polynomial by imposing the condition that
a certain integral be as small as possible. As a rule, the polynomial is a
good approximation, but unless its degree is small, it can be found
only by the expenditure of much time and labor. Another method of
determining a polynomial that approximates a function well throughout
an interval is based on the requirement that the graphs of the polynomial
and the function have a number of common points in the interval, or
what is the same thing, that the polynomial graph pass through a certain
number of points chosen on the function graph. The polynomial obtained
in this manner does not, as a rule, approximate the given function as
well as the polynomial obtained by the previous method but the loss is
more than made up for by the facility with which the new polynomial
can be obtained. Moreover, the polynomial derived from the new
requirements lends itself much better to many of our later developments
than does the old polynomial.
3.2. POLYNOMIAL THROUGH n + 1 POINTS; DETERMINANT FORM 71

Our immediate general problem is then to find a polynomial


(3.2:1) Y = P..(x) = a o + alx + ... + a,.x"
of max-degree n whose graph passes through each of the n +I points
(3.2:2) i = 0, 1, ... , n.

These points may be assumed to be quite arbitrary (although it will


develop in a moment that the abscisses must be distinct) or they may
be chosen on the graph of the function
(3.2:3) Y = f(x).
In the latter case, our requirement stated in algebraic terms is that
(3.2:4) Yi = P..(Xi) = f(Xi), i = 0, 1, ... , n.

Our second general problem is to determine how well the polynomial


approximates the function and to learn how to use it to interpolate for
values of the function.
To find the required polynomial we substitute in turn the coordinates
of the n + I points for x and y in the polynomial equation; we obtain
the n + I linear equations
ao + alxO+ ... + a,.xo" = Yo ,
a o + alx l + ... + a,.Xl" = Yl'
(3.2:5)

Solving for the a's we get

(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

However, a unique solution will exist only if D =1= O. To determine the


circumstances under which this holds, we note that the expansion of D
is a homogeneous polynomial in the x's of degree In(n + I). Moreover,
the determinant and hence the polynomial vanish when Xi = xi' i =1= j,
hence Xi - Xi is a factor of D. There are tn(n + I) such linear factors.
A simple calculation shows that D = IIi>i (Xi - Xi)' It follows that D
will be different from zero if the x's are distinct. Indeed, since a poly-
nomial is a single-valued function, this condition might have been
anticipated. (D is the famous Vandermonde-Cauchy determinant and
appears in a great many different places in mathematics.)
The coefficients of the polynomial y = p,,(x) are thus determined by
the a's of 3.2:6. The polynomial, however, can be written in a much
neater form. The determinant Di is equal to the determinant

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"

YI Xl ... X~-l Xli x~+l .. xt

Y" 1 x,,'" X~-l X"i x~+l .. x,,"

The latter determinants, for different values of i, differ only in their


first rows; hence summing them from i = 0 to i = n, we see that the
polynomial p,,(x) can be written as the quotient of two determinants,
y = p,,(x) = -E/D, where

o 1 X x2 .. x"

E =. Yo 1 Xo X02 ... xo"

y" 1 X" X,,2 ... x,,"


3.2. POLYNOMIAL THROUGH n + 1 POINTS; DETERMINANT FORM 73

The preceding polynomial equation can be written as Dy +E = 0


and hence can be put into the form
y 1 X x2 x"
Yo 1 Xo X02 ... xo"
(3.2:7) = O.
y.. 1 x.. X ..2 x....

This is the determinant form of the polynomial 3.2: I which we were


seeking.
REMARK. We repeat that the n + I points may be assumed to be
points within some interval on the graph of a function y = f(x), but
since the function f(x) does not enter into the determination of the
polynomial P..(x), the n + I points are quite arbitrary subject to the
condition that they have distinct abscissas; in particular, the x's and
the corresponding y's may be the observed or measured values of some
magnitudes in a laboratory experiment or some natural phenomenon.
We summarize this section in the

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.

EXAMPLE 1. Let y = f(x) = i(x + 1X I). The points of each of the


three sets (-1,0), (0,0),(1, I); (-I,O),(-l,O),(O,O),(i,i),(I, I);
(-I, 0), (- i, 0), (- 1, 0), (0, 0), (1, i), (i, i), (I, I), are equally spaced
on the graph of the function. The equation of the parabola determined
by the first set of three points is

y X x'l.
o -1 1
= 0,
o 0 0
1 1 1

or y = lx + lx2. The equations of the curves determined by the second


and third sets can be similarly found; they are y = x/2 + 7X2/6 - 2x4/3,
y = x/2 + 37x2 /20 - 27x4/8 + 8Ix8 /40, respectively. The reader should
draw the graphs of the three polynomials and compare them with the
previously drawn graph of the parabola obtained by the former method.

EXAMPLE 2. Find the equation of the parabola which coincides with


the sine curve y = sin X at x = 0,17/2,17.
74 3. THE APPROXIMATING POLYNOMIAL; APPROXIMATION IN AN INTERVAL

The values of y corresponding to the given values of x are y = 0,


1, 0; hence the equation of the parabola is
y X x2
0 0 0
'TT 'TT2 =0
2 4
0 'TT 'TTl
or y = 4x/'TT - 4X2/'TT2.

EXAMPLE 3. Find the equation of the cubic curve which intersects


the logarithmic curve y = loglo x at x = i; 1, 2, 4.
The equation of the cubic is

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

3.3. Polynomial through n + 1 Points; Lagrange Interpolation


Formula. We proved in the preceding section that there is one and
only one polynomial of max-degree n whose graph passes through n + 1
arbitrary points with distinct abscissas. The determinant form 3.2:7,
however, lends itself neither to arithmetic computation nor to most
theoretic developments, hence it is desirable to obtain the polynomial
Y = P..(x) in other more suitable forms.
It turns out that a polynomial of the form
(3.3:1)
n

= ~Li(X)Yt'
i~O

where the L's are polynomials of degree n in x is quite suitable for


computational and theoretical needs. Since Yk = P..(Xk), the forms of
the polynomial multipliers of the y's will be determined if we impose
the conditions that Lk(xj) be 0 or 1 according as j does not or does equal k.
Since Lk(x) is a polynomial of degree n, it must have the form
A(x - xo)(x - Xl) ... (X - xk_l)(X - xk+l) ... (X - X.. ), where A is a
constant. Since Lk(Xk) = 1,
1
A= (Xk - xo) ... (Xk - Xk-l)(Xk - Xk+1) ... (Xk - x,,)
.
Hence
.( ) _
L ,x (x - xo) ... (x - Xt_I)(X - Xi+1) ... (x - x..)
(3.3:2) - ,
(Xt - xo) ... (Xi - Xi-I)(Xt - Xi+1) ... (Xi - x,,)
i = 0, 1, "', n,
(3.3:3) Y = p,,(x)
(x - Xl) ... (x - x,,) (x - xo)(x - X2) ... (x - x,,)
= (xo - Xl) ... (xo - x,,) Yo + (Xl - XO)(XI - Xl) ... (Xl - X,,) YI
+ ... + (X - Xo) ... (X - X"-l) Y
(X" - Xo) ... (X" - X"-l) ".

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

Y= (x - O)(x - 1)(x - 5) 3 + (x + 2)(x - 1)(x - 5) 0


(-2 - 0)(-2 - 1)(-2 - 5) (0 + 2)(0 - 1)(0 - 5)
76 3. THE APPROXIMATING POLYNOMIAL; APPROXIMATION IN AN INTERVAL

(x -f 2)(x - O)(x - 5) (x + 2)(x - O)(x - I)


+ (I + 2)(1 - 0)(1 - 5) 4 + (5 + 2)(5 - 0)(5 - I) (-I),
or
1
y = 420 (1256x + 597x - I 73x3).

The Lagrange coefficients, 3.3:2, may be given other useful forms.


Let k be anyone of the integers 0, 1, .... n and let a, b "', g, h be the
remaining integers in any order whatsoever. It follows that

(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)

I+I x - Xk + ... + (x - Xk)(X - xc) ... (x - Xg) j.


Xk - Xc (Xk - Xc)(Xk - x,,) ... (Xk - x h) ,

(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. Polynomial through n + 1 Points; Divided Difference Form.


The polynomial through n + I points can be put into yet another form
which is frequently superior to the Lagrange form for computational
purposes. The means used in deriving the third form are so useful In
so many places that we give this method special attention.
As before, let

(3.4:1)

be a set of n + I points with distinct abscissas. The fraction

(3.4:2) i-::pj,
78 3. THE APPROXIMATING POLYNOMIAL; APPROXIMATION IN AN INTERVAL

will be designated by the symbol

(3.4:3)

and is called the first-order divided difference of the y's. In particular,

etc.

Also,

For the sake of convenience in writing some expressions later on, we


put
(3.4:4)

so that the fraction 3.4:2 can be written in the form

(3.4:2.1)

and we have
(3.4:5)

Similarly, we define a second-order divided difference of the y's by the


symbol
(3.4:6) i, j, k all distinct;

a third-order divided difference by the symbol


[XtX/Xk] - [x;x~m]
(3.4:7) [
XiXjXkXm
]
= Xi - Xm
, i,j, k, m all distinct.

In general, we define an rth-order divided difference of the y's, r ::::;; n,


by the symbol

(3.4:8)

where io , i1 , ... , ir are r +


I distinct integers in the range 0, I, ... , n. In
actual practice, the subscripts in 3.4:8 are almost always consecutive
integers.

* 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

It is convenient for many applications to exhibit the numbers 3.4: I


and the divided differences determined by them in the form of a triangular
array known as a divided difference table. The x's and their corresponding
y's are written in two vertical columns, the first-order divided differences
are written in a third column, the second-order divided differences in
a following column, and so on. The complete array for n + I number
pairs then contains n + 2 columns, the last one consists of but a single
entry, the only nth-order divided difference. The divided difference
table for (xo ,Yo), ... , (X4 ,Y4) will look as follows:

Xo Yo
[XoXl]
Xl Yl [XoXIXI]
[XIXJ [XoXIXIXS]
XI Y. [XIXsXS] [XoXIXsXsXC]
[XsXs] [XIXaXsXc]
Xs Ys [XsXsx,]
[XsxJ
X, y,

As a concrete illustration, the divided difference table for the values


(-2,234), (0, to), (5, 13135), (-1,31), (2, -86),
1S:

-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

We remark that a divided difference table need not be carried out to


completion; we may truncate it at any column. Note also that each
divided difference in the table is the vertex of a triangle whose opposite
side is in the y column. Thus, in the array above, [X I X 2X 3X4] is the
vertex of a triangle whose sides are the vertical column
YI' Y2' Ya, Y4'
the descending diagonal
[Xl]' [X IX2], [X IX2X3], [XIXraXJ,
and the ascending diagonal
[X4] , [xaxJ, [Xr3X4] , [X IXraX4]
It follows readily from the definition of the divided differences that

[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

As an immediate consequence of the preceding formula, we see that


a divided difference is a symmetric function of the x's and their cor-
responding y's; the value of a divided difference is therefore independent
of the order in which the x's are written within the brackets. It is for
this reason that we find the two 25's and the two ISO's in identical
places in the two arrays exhibited above.
The subscripts in formula 3.4:9 can be chosen more generally. Let
i j ,j = 0, 1, ... , r, be r +
1distinct integers and (Xi I ,Yi), j = 0,
1, ... , r, r + 1 pOints with distinct abscissas; then
I

(3.4:10)

Yt.
+ ... + -:----.,..,.....---:----;------:-
(x. - X )(x. - x, ) ... (x. - x ).
1, '0 I, .1 I, ',.-1
3.4. DIVIDED DIFFERENCE FORM 81

Let a difference table be constructed for the n + I points 3.4: I,


where X o , Xl , ... , Xn occur in that order in the first column. Each
divided difference in the table is adjacent to two divided differences
that precede it and, unless it is the last or first entry in its column,
to two that follow it. The sequence of divided differences

(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)

whose terms form the uppermost descending diagonal of the difference


table; second, the sequence chain

(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

(3.4:14) [x m], [xmxm+l]' [Xm-IXmXm+l]' [X m-IXmXm+lXm+21 ... , [XoXl ... xn],


(3.4:15) [x m], [Xm-IXm], [xm_IxmX",+l]' [xm-~m-IXmXm+l]' ... , [XoXl ... xn];

if n is odd and equal to 2m + I, we note the sequence chains


(3.4:14') [Xm], [xmXm+l]' [xm-IXmXm+l]' ... , [XoXl ... xn],
(3.4: 15') [xm+1]' [xmxm+l]' [xmxm+lxm+2]' ... , [XoXl ... xn]

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

sequence chains of central divided differences. More briefly, we shall


refer to chains as forward, backward, or central sequence chains.
The sequence chain 3.4: II is now used to build the polynomial
equation

The law of formation of the polynomial is rather 0 bvious and consequently


need not be explicitly stated. Since each divided difference is a constant,
the polynomial is of max-degree n. Since there are 2" sequence chains,
there are ostensibly 2" polynomials of the form 3.4:16. However, we
shall prove that all of these polynomials are identically equal to each
other and, indeed, each is the polynomial through the n + I points
(3.4: I). Before doing so, we call attention to the four special forms of
the polynomial corresponding to the four special sequence cnains
noted above; we write explicitly only the first of these polynomials,
to others are left to the reader.

(3.5:17) y = [xo] + [XoXI](X - xo) + [XoXIX2](X - xo)(x - Xl)


+ ... + [XoXI . x..](x - xo)(x - Xl) .. (X - x..- I ).

To prove the statement made above, we have, from 3.4:4 and 3.4: 10,

Now multiply the first of these identities by I, multiply the second of


these identities by x - Xi o ' the third by (x - Xio)(x - Xi), ... , and the
(n + I )st by (x - Xio)(x - Xi 1) ... (X - Xi n_l ); then add all the products.
3.4. DIVIDED DIFFERENCE FORM 83

The result is an identity whose left-hand side is the polynomial of


3.4: 16. The right-hand side can be written as

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).

But by formulas 3.3:4.0 - 4.n, the coefficient of Yi k is precisely Lik(X);


hence the right-hand side is the Lagrange interpolation polynomial
and our assertion is proved. That is, the polynomial equation 3.4: 16 is
the equation of the polynomial of max-degree n through the points 3.4: 1.

EXAMPLE. The equation of the polynomial through the five points


given at the beginning of this section is

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)

in that order, has one noteworthy feature. It determines the sequence


of polynomials
Y = [XiJ,

(3.4: 19) Y = [XiJ + [XioXil](X - Xi o)'


Y = [Xio] + [Xtox;J(x - Xi o) + [XioXiIXil](X - Xio)(x - Xii)'
84 3. THE APPROXIMATING POLYNOMIAL; APPROXIMATION IN AN INTERVAL

of max-degrees 0, 1,2, ... , respectively, determined by the first, the


two, the first three, ... , points, respectively, of 3.4: 18. This suggests
that to find by interpolation the value f(x') from a table of f(x), the
most precise result can be obtained by choosing the points 3.4: 18 so that

(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"

S. If y = f(x) = I/x, then [XoXl ... x,,] = (-I)"/xoxl .. X"

6. If y = f(x) = x", then [XoXl .. x,,] = 1.


7. If y = f(x) = x"+1, then [XoXl ...~,,] = Xo + Xl + ... + X".
8. The divided difference of the sum of two functions is the sum of the corresponding
divided differences.
9. A divided difference of cf(x) equals c times the corresponding divided difference of
f(x), where c is a constant.
to. Derive the equality 3.4:9 by mathematical induction.

3.5. Polynomial through n + 1 Points; Aitken-Neville Forms. The


polynomial through the n + 1 points
(3.5: 1)
3.S. POLYNOMIAL THROUGH n + 1 POINTS; AITKEN-NEVILLE FORMS 8S

can be obtained in yet another form. Let

(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)

is the polynomial through all r + 1 points of 3.5:2. Indeed, we have


for 0 ~ j ~ r,
(Xij - Xio) q(Xi,) - (Xi j - Xi.) P(Xi j )
Y(Xi j ) = X - X
i. io

Hence

(3.5:6)

In particular, if we put {Xk} = Yk' then

{Xio} = Yio '


(x - Xio){Xil } - (x - Xil){Xio}
{XioXil } = ----'---=-------'-_..:....
Xii - Xio

=. 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,}

In each table, the sequence of polynomials at the top of each column,


after the first, is precisely the sequence of polynomials 3.4: 19.
The process of interpolation based on the first table is due to Aitken,
the process based on the second is due to Neville. The particular
virtue of these forms of the (n + I)-point polynomial lies not in the
form of the polynomial itself which is, as a matter of fact, rather unwieldy,
but in the simple and repetitive nature of the process of interpolation
that ensues.
3.6. COMPUTATIONAL FORMS 87

3.6. Magnitude of the Error in the Polynomial through n + 1 Points.


Computational Forms. We found, in the last four sections, four
different ways of writing the polynomial

(3.6: 1)

of max-degree n whose graph passes through the n + 1 points


(3.6:2)

with distinct abscissas. If no further information is available concerning


the n + I points, nothing further can be said about Pn(x) as far as
approximation or interpolation is concerned. But if it is known that
the n + I points also lie on the graph of a function

(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)

Since f(x') = Pn+l(x'), we have f(x') - Pn(x') = Pn+l(x') - Pn(x').


Consequently,
(3.6:5)

The magnitude of the error in approximating f(x') by Pn(x') will then


be determined if a value for [XOXI ... xnx'] can be found. We proceed
to attack this problem.
The form of the identity 3.6:5 suggests an examination of the function

This function vanishes for the n + 2 distinct values xo , Xl , "', Xn , x'


(we may suppose that x' is distinct from the other x's, otherwise,
E(x') = 0); hence by Rolle's theorem, tp'(x) will vanish for at least
88 3. THE APPROXIMATING POLYNOMIAL; APPROXIMATION IN AN INTERVAL

n + 1 distinct values of x; tp"(X) will vanish for at least n distinct


values of x; and so on to tp(n+ll(x) which will vanish for at least one
value of x, say X. [We assume thatf(x), and consequently tp(x), possesses
all the necessary derivatives.] But from the definition of tp(x) it follows
that
tp(n+lI(X) = jn+ll(x) - [XoXl ... xnx'](n + 1)1,

since Pn(x) is a polynomial of max-degree n and the coefficient of the


divided difference is a polynomial of degree n + 1 whose leading coeffi-
cient is unity. Hence
, jn+lI(X)
(3.6:6) [XoXI'" xnx] = (n + I)! '

and substituting In 3.6:5, we obtain the desired expressIOn for the


error E(x'),
jn+lI(X)
(3.6:7) E(x') = f(x') - Pn(x') = (n + 1)1 (x' - xo)(x' - Xl) ... (X' - xn),

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.
.

This formula reduces for n = 1 to the Theorem of the Mean for


derivatives, hence the formula may be thought of as a generalization of
the theorem. Furthermore, if f(x) is a polynomial of max-degree n - 1,
then

and if f(x) is a polynomial of max-degree n, then

where an is the coefficient of xn in f(x).


3.6. COMPUTATIONAL FORMS 89

The last two results are restated and rounded out in the

THEOREM. If XO ' Xl , , X" are arbitrary but distinct numbers and


Yo, YI , ... , y" are the corresponding y's determined by the polynomial
y = ao + alx + ... + a"x", then

(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.

EXAMPLE 1. The following values are taken from a table of the


exponential function:

y: eZ \_0-2-.7-18-7-.3-28-9-54-.5-:-8

The divided difference table is:

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)

is an interpolating cubic for eZ through the four given points. For


X = 3, the cubic yields the value 22.27 which is not a particularly good
90 3. THE APPROXIMATING POLYNOMIAL; APPROXIMATION IN AN INTERVAL

approximation to e3 = 20.09. The maximum error as predicted by


formula 3.6:7 is I 55(3 - 0)(3 - 1)(3 - 2)(3 - 4)/4! I = 14-.

EXAMPLE 2. We obtain from the same table:

y =
x
eZ
I 0.6
1.822
0.7
2.014
0.8
2.226
~

2.718
1.0

The divided difference table is:

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

The interpolating cubic is

y = 1.822 + 1.92(x - 0.6) + 1.00(x - 0.6)(x - 0.7)


+ 0.33(x - 0.6)(x - 0.7)(x - 0.8);

at x = 0.9, Y = eO. 9 = 2.460. The estimated maximum error is

12.718(0.9 - 0.6)(0.9 - 0.7)(0.9 - 0.8)(0.9 - 1.0)/4! I= 0.0001-.

Actually, the answer, 2.460, is correct to four significant figures.


The error given by formula 3.6:7 in approximating f(x') by p,,(x') is
the error inherent in the method of polynomial approximation. There
are, however, still other sources of error. In the first place, the coordinates
of the n + 1 points 3.6:2 may not be exact. If the points arise as recorded
data of some experiment, then both the x's and the y's are likely to be
inexact; if the y's are values of a function taken from a table for the
corresponding x's, then the y's alone are inexact. Again, there are the
accumulative errors inherent in all computations. In all cases, if we
assume that the approximate numbers are written so that all their
significant figures are correct, the errors due to computation and inexact
data can be computed by the methods of Chapter I. Although these
errors, which for want of a better name we shall call the computational
errors, are usually negligible, they should be considered, particularly
when the number of points is large.
3.6. COMPUTATIONAL FORMS 91

It should be further remarked and carefully noted that the estimation


of the error committed in approximating f(x) by p,,(x) at x = x' as
given in formula 3.6:7 depends on the existence of p"+ll(X) in the
neighborhood of x = x'. If the (n + l)st derivative does not exist, the
formula, of course, can not be used. There is, however, an important
special case where we can say something definite about the magnitude
of the error even though p"+ll(x) does not exist, or if it exists, is not
known. Let us refer back to the equality 3.6:5; it is an expression for
the error which involves the unknown quantity [XOXI ... X"X']. If we
assume, as we did, that f(x) possesses an (n + l)st derivative, we are
led to the evaluation of [XoXl ... X"X'] given by 3.6:6. If the abscissas
Xo , Xl' "', x" ,X' all lie within an interval [a, b], say, then X also lies
in [a, b]. If these abscissas are replaced by n + 2 other (distinct) abscissas
lying in [a, b], then the corresponding X' will also be in [a, b]. If the
interval [a, b] is sufficiently small, f'n+ll(x) will not vary greatly for
different points within it; that is, P"+ll(X) and p"+ll(X') will be almost
equal. In other words, the right member of 3.6:6 determined by the
particular set of n + 2 abscissas XO, Xl , "', X" ,X' may be taken as a
good approximation to the (n + l)st order divided difference determined
by any set of n + 2 distinct points within the interval [a, b]. These
observations lead us to the following conclusion. Suppose that we can
prove, or have reason to believe, that for a given function f(x) and for
any set of n + 2 distinct numbers Xo , Xl , "', X" , X' within an interval
[a, b] there exists a positive constant K such that the inequality

(3.6:10) 1 [XoXl ... xnx'] 1 < (n : I)!


holds, then we have

(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

(3.6:12) f(x) = Pn(x) + pn+ll(X) (x - xo)(x(:- :l~;!" (x - xn )

is an identity provided that the (n + l)st derivative exists and X is


properly chosen. A consideration of the derivation of X reveals that
it is a function, usually multivalued, of X O , Xl , "', X" and x. Since
92 3. THE APPROXIMATING POLYNOMIAL; APPROXIMATION IN AN INTERVAL

Xo , Xl , ... , Xn are constants in a particular problem, X may be regarded


as a function of X only and hence jn+l)(X) is a function, usually multi-
valued, of x. Let tp(x) be one branch of this function, then we may write

f( ) = () ( ) (x - xo)(x - Xl) ... (X - Xn)


(3.6:13) X Pn X + cp X (n + 1)1

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.

EXAMPLE 3. Find e0,8, given:

__X_I 0.6 0.7 0.8 1.0 1.3 1.4


y = e~ I 1.82212 2.01375 2.22554 2.71828 3.66930 4.05520

The Lagrange form yields, for the interpolation,

(2)(1)(1)(4)(5) (3)(1)(1)(4)(5) (3)(2)(1)(4)(5)


(1)(2)(4)(7)(8) 1.82212 - (1)(1)(3)(6)(7) 2.01375 + (2)(1)(2)(5)(6) 2.22554
(3)(2)(1)(4)(5) (3)(2)(1)(1)(5) (3)(2)(1)(1)(4)
+ (4)(3)(2)(3)(4) 2.71828 - (7)(6)(5)(3)(1) 3.66930 + (8)(7)(6)(4)(1) 4.05520
= 2.45960.
3.6. COMPUTATIONAL FORMS 93

Some ISO steps are required (each addition, subtraction, multiplication,


and division is counted as one step; the tabulation or recording of a
number is not counted), but many of the steps here can be done mentally.
If this form were to be used for the evaluation of ez for several values
of x, the fractions -1.82212/(0.1)(0.2)(0.4)(0.7)(0.8), ... , which
remain constant, would be calculated first, and then the multipliers
(x - 0.6)(x - 0.7) ... (x - 1.4), ... , for each value of x. After the
fractions are evaluated, each y can be found with the expenditure of
about 65 steps, most of which can be done mentally.
To evaluate eo.B by means of divided differences, we first form the array:

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)

Here, for x = 0.9,

1 1 0. 3 1 0.21 0.1 I -0.1 -0.4


1 0:31 0.06 0.006 I -0.0006 0.00024

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

The tables for the Aitken and Neville processes are:

0.6 0.3 1.82212


0.7 0.2 2.01375 2.39701
0.8 0.1 2.22554 2.42725 2.45759
1.0 -0.1 2.71828 2.49424 2.46183 2.45966
1.3 -0.4 3.66930 2.61377 2.46926 2.45984 2.45960
1.4 -0.5 4.05520 2.65952 2.47201 2.45991 2.45960 2.45960

and

0.6 0.3 1.82212


2.39701
0.7 0.2 2.01375 2.45749
2.43733 2.45966
0.8 0.1 2.22554 2.46038 2.45960
2.47191 2.45951 2.45960
1.0 -0.1 2.71828 2.45778 2.45960
2.40127 2.45984
1.3 -0.4 3.66930 2.47016
2.12570
1.4 -0.5 4.05520

respectively. Each takes about 65 steps to reach the answer 2.45960,


and, because of the nature of the process, will take exactly the same
number for the calculation of additional values. Note that a column of
differences 0.9 - 0.6 = 0.3, 0.9 - 0.7 = 0.2, ,0.9 - 1.4 = -0.5,
has been inserted between the column for x and that for {x}.
In the Lagrange and divided difference processes, we obtain, so to
speak, the interpolating polynomials first and then we substitute the
value of the argument; in the Aitken-Neville processes, the answer is
obtained by immediate use of the value of the argument. All the methods
are repetitive in nature and hence are convenient for the computor
and lend themselves for automatic machine computation; the Aitken-
Neville processes are repetitive in "purest" form since, after the
evaluation of the differences, each stage is a calculation of the form
(ab - cd)/e. The error inherent in polynomial approximation can, of
course, be estimated by the methods of the first half of this section,
but the divided difference and Aitken-Neville processes have built-in
error indicators. The top entries in the columns of the Aitken-Neville
tableaux and the successive sums in the last stage of the divided difference
EXERCISE 9S

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

b. _ _ x_i_a 1.2 1.4 1.6 1.8 2.0


y = r/Z 11.0000 1.8221 2.0138 2.4596
96 3. THE APPROXIMATING POLYNOMIAL; APPROXIMATION IN AN INTERVAL

arcsin k 5 6 7 8
c.
r.'1
o
d~

VI - k' sin ' ~


1.5738 1.5767 1.5785

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

The positive square root of 930 is computed by linear interpoilltion to 2. 3..... 8


significant figures. respectively. by successive use of the entries in columns 2. 3... .8.
At what point does the error inherent in linear interpolation exceed the rounding-off
error? Obtain your answer by use of the appropriate formula and check it by evaluating
v930 from as many entries as are necessary in the last column.
b. Calculate V1010 from the entries in column 4.
c. Calculate V1258 from the entries in column 6.
d. Calculate V1034 from the entries in column 8.
e. The following pairs of square roots are evaluated from the entries in column 7:
vi0i2. V1013; ViOi2.T. VlOI2.2; v'i0i2.i4. V1o'i2.i"S; V1012.136. VI012.137;
VI012.1361. V1012.1362; V1012.13606. VI012.13607; VI012.136064.
V1012.136065.
At what point is it no longer possible to distinguish between the two values in a pair? How
many significant figures do the entries in a table of square roots need to distinguish
between the roots of the last pair?
... A table of natural sines to five decimal places is given with entries at one degree
intervals. What is the maximum error of linear interpolation. both direct and inverse?
b. Same as problem a. if entries are given for every minute.
c. Same as problem a. if entries are given for every second.
9. Same as problem 8. if entries are given to ten decimal places.
3.7. EQUALLY SPACED POINTS; FINITE DIFFERENCES 97

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. Equally Spaced Points; Finite Differences. It frequently


happens that the abscissas of the n + I points 3.6:2 are equally spaced,
particularly when the y's are tabulated values of a function for successive
values of the argument x. The points themselves will be called equally
spaced when the abscissas are equally spaced. In these cases, the formulas
of the preceding sections can be rewritten in more convenient forms.
Let the notation be chosen so that Xo < Xl < ... < x".' and let the
x's be equally spaced so that
(3.7:1) i = 0, 1, ... , n - 1,
say. Then
(3.7:2) Xi = Xo + ih, i = 0, 1, ... , n;
and

(3.7:3) i, j = 0, 1, ... , n.

Divided differences are usually replaced by the more convenient


finite differences when we work with equally spaced points. They are
defined as follows: a first-order finite difference is defined by
(3.7:4)
98 3. THE APPROXIMATING POLYNOMIAL; APPROXIMATION IN AN INTERVAL

a second-order finite difference is defined by

(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

x '\ 0.4 0.6 0.8 1.0


Y = e~ 1.492 1.822 2.226 2.718

IS:

x Y ..::Iy ..::I." ..::I 3y

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

A finite difference LlrYk in a finite difference table is a vertex of a


triangle whose other two vertices are Yk and Yr+k . Each of the formulas
3.7: 13-15 below can then be interpreted as an expression for a vertex
of this triangle in terms of the elements of the side opposite.
3.7. EQUALLY SPACED POINTS; FINITE DIFFERENCES 99

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

(3.7:7) -..., ... x ] _ .1'yo


[x 17'"1 , - rlh' .

Although finite differences for y's corresponding to nonconsecutive or


nonequally spaced x's can be defined, they are rarely used and it is
not necessary to express the more general divided difference 3.4:8 in
terms of finite differences. However, the subscripts in 3.7:7 can all be
raised (or lowered, if it is convenient to use negative subscripts) by an
arbitrary integer, hence we can rewrite it in the more general form

(3.7:8) [ X12x 12+1 ... x 12+'] _- .1'YI2


rlh' ,

where a is any integer.


It follows from 3.4:9 and 3.7:3 that

1 r .
(3.7:9) -..., ... x] -
[x 17'"1 ~(-I)'-i Y.
, - h' i-O
~ I( - I)1.
I r

Combining the last equation with 3.7:7, we obtain

(3.7:10) .1'Yo =
i-o
(-I)'-i (~) Yi ,
I
r = 1,2, ... , n,

an expression for the rth-order finite difference in terms of the y's.


This expression can be written in the symbolic form
(3.7:10') .1'Yo = (-1 + y)" r = 1,2, ,n,
where (-1 + y), means the expression obtained by expanding (-1 + y)'
by the binomial theorem and then changing the exponents on the y's
(including the exponent 0) to subscripts. Conversely, to express y, in
terms of the finite differences Yo , LJyo , ... , LJ'yo (we may regard Yo as a
Oth-order finite difference), we eliminate Yo, Yl , ... , y,-l from the
r + 1 equations obtained from 3.7:10 by putting r = 0, 1, ... , r in
turn; we obtain

(3.7:11) r = 0, 1, ... , n,
100 3. THE APPROXIMATING POLYNOMIAL; APPROXIMATION IN AN INTERVAL

which can be put into the symbolic form

(3.7:11') Yr = (1 + .dYYo , r = 0, 1, ... , n.

In a similar manner we can obtain the formula

(3.7:12) r = 0, 1, ... , n,

which in symbolic notation becomes

(3.7: 12') Yo = (-.d + yy, r = 0, 1, ... , n.

Formulas 3.7:10--12 can be slightly generalized by stepping up, or


down, each subscript by the same integer. We obtain

(3.7:13) r = 1,2, ... , 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:

THEOREM. If Xo , Xl , . , X"are equally spaced numbers 'With Xi+l - Xi = h,


and Yo, Yl' ... , y" are the corresponding y's determined by
y = a o alx + + ... + a"x", then

(3.7:16) .d"yo = n!h"a,.;

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.

3.. Polynomial through n + 1 Equally Spaced Points. In this


section we obtain the expressions for the polynomials through n + I
points when the latter are equally spaced. Although the preceding
formulas can be used, the new expressions will be simpler. When we
deal with equally spaced points, it is frequently advantageous to replace
the variable x by a variable u linearly related to x by the equation

1
(3.8:1) or u = h (x - xo)'
Hence

(3.8:2) x- Xt = (u - i) h, i = 0, 1, ... , n.

If we substitute the values given by 3.7:3 and 3.8:2 in the Lagrange


coefficient 3.3:2, we obtain, after simplification,

(3.8:3) .H u(u - 1) ... (u - i + 1)(u - i - I ) ... (u - n)


Li(X) = (-1) il(n _ i)1 '
i = 0, 1, "., n;
102 3. THE APPROXIMATING POLYNOMIAL; APPROXIMATION IN AN INTERVAL

or
(3.8:4) i = 0, I, ... , n.

The Lagrange interpolation formula then becomes

(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

Here, Xo = 0.4, h = 0.2, x = 0.7, U = I, n = 3. Formula 3.8:5


yields
1.5) 3 (_I)H (3
y=4 ( 4 ~1.5-i i)Yi=2.014,

which is correct to four significant figures.


Extensive tables have been prepared which list the values of Li(x)
for various ranges of U and n (see, for example, Natl. Bur. Standards,
"Tables of Lagrangean Interpolation Coefficients," Columbia Univ.
Press, New York, 1944). The use of these tables greatly facilitates the
process of interpolation.
We next obtain the equation of the polynomial through the n + 1
equally spaced points in terms of finite differences. It follows at once
from 3.8:2 that
(3.8:6) (x - xo)(x - Xl) ... (X - X,_l) = u(u - I) ... (u - r + I) hr
= rl (:) hr, r = 1,2, ... , n + 1.
Using this and 3.7:7 in 3.4: 17, we find that

(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

Using this and 3.7:8 in that form of the interpolating polynomial


generated by the sequence chain 3.4: 13, we obtain

(3.8:9) Y = n
k.1 iYn_i
(U - n +. i-I)
i-O '

In a similar manner we derive the formulas below from the formulas


3.8:8, 3.7:8, and 3.4:14, 15 for n = 2m:

(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

and from 3.4:14', 15', for n = 2m + 1,


(3.8:10')
mI' m+l 1 .
_
Y -
~ A2i
~ ~ Ym-i
(U - m 2i- + ') + ~~~ A2i-1
Ym+1-i
(U - m-
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

The variables Xo , Xl , ... , Xn appear in formulas 3.8:7, 9-11, 10'-11'


in the respective orders
xI , ... , Xn ;
XO '
Xn , Xn _ 1 , .. ', Xo;
Xm , Xm+ l , Xm_ l , X m +2 , ... , X n , Xo;
Xm , Xm_ l , Xm+l , X m - 2 , , X o , Xn;
Xm , Xm+l , Xm_ l , X m +2, ... , X o , Xn;

Xm+l, Xm , X m +2 , X m _ l , , X n ,
XO'

Formula 3.8:7 is known as Newton's Interpolation formula with forward


differences; formula 3.8:9 is known as Newton's Interpolation formula
with backward differences; the remaining formulas are known as the
Gauss' formulas or central difference formulas.
We wish to stress the fact that for a given n, Eq.3.8:7, 9-11 (or
10' and 11') are only different forms of the same polynomial through
104 3. THE APPROXIMATING POLYNOMIAL; APPROXIMATION IN AN INTERVAL

the n + 1 points 3.6:2. Why, then, do we bother with this multiplicity


of forms? We postpone the answer for a moment and turn first to the
equation for the magnitude of the error.
The magnitude of the error in the general case was given in formula
3.6:7. If in that formula we use 3.8: 1 and 3.8:6, we obtain the following
expression whose absolute value is an upper bound of the magnitude
of the error for equally spaced points,

(3.8:12)

where, as before, X is a value between the smallest and largest of the


numbers Xo , Xl , ... , Xn , X' and where u = (x' - xo)/h. Let us again
remark that consideration should be given not only to the error above
inherent in polynomial approximation but also to the computational
errors due to the use of inexact values of the coordinates of the n + 1
points and to those that accumulate in the process of computation.
Formula 3.8:12, like formula 3.6:7 from which it was derived, is
meaningless if the (n + l)st derivative does not exist. We recall that
the expression 3.6: 11, which may be rewritten as

(3.8:12')

can then take the place of 3.8:12.


We illustrate the use of the preceding formulas by an example. The
values of y = sinh x for x = 1.50, 1.60, "',2.60 are taken from a table
of hyperbolic sines. We wish to compute the values of sinh 1.52,
sinh 2.03, sinh 2.54.
We form first the finite difference table on the next page.
(In practice, it is usual to omit the decimal point and the zeros in front
of the first significant figure in writing the numbers in the difference
columns.) We use 3.8:7 for the computation of sinh 1.52; we have
x' = 1.52, Xo = 1.50, h = 0.1, u = 0.2, n = 5; (i) = 0.2, Gt) = -0.08,
(3) = 0.048, (4) = -0.0336, m= 0.025536; whence
sinh 1.52 = 2.12928 + 0.2(0.24629) - 0.08(0.02377) + 0.048(0.00271)
-0.0336(0.00026) + 0.025536(0.00003)
= 2.17676.
The answer is correct as far as it is written.
3.8. POLYNOMIAL THROUGH n + 1 EQUALLY SPACED POINTS 105

x sinh x Ay A2y A8y Aty Aiy


1.50 2.12928
0.24629
1.60 2.37557 0.02377
0.27006 0.00271
1.70 2.64563 0.02648 0.00026
0.29654 0.00297 0.00003
1.80 2.94217 0.02945 0.00029
0.32599 0.00326 0.00004
1.90 3.26816 0.03271 0.00033
0.35870 0.00359 0.00003
2.00 3.62686 0.03630 0.00036
0.39500 0.00395 0.00004
2.10 4.02186 0.04025 0.00040
0.43525 0.00435 0.00007
2.20 4.45711 0.04460 0.00047
0.47985 0.00482 -0.00001
2.30 4.93696 0.04942 0.00046
0.52927 0.00528 0.00012
2.40 5.46623 0.05470 0.00058
0.58397 0.00586
2.50 6.05020 0.06056
0.64453
2.60 6.69473

We use formula 3.8:9 for the evaluation of sinh 2.54. We have


x' = 2.54, xo = 2.10, h = 0.1, u = 4.4, n = 5;
sinh 2.54 = 6.69473 + 0.64453 (-~.6) + 0.06056 (24) + 0.00586 Cj4)
+ 0.00058 (244) + 0.00012 et)
= 6.30039.
The result is in error by one unit in the last decimal place. If we omit
the suspicious last term (just why it is suspicious will develop later),
we get the value 6.30040 which is correct to all five decimal places.
Finally, we compute sinh 2.03 by use of formula 3.8: 10' (formula
3.8:11' may also be used). We have x' = 2.03, xo = 1.80, h = 0.1,
u = 2.3, n = 2m + 1 = 5;
(2
sinh 2.03 = 3.62686 + 0.39500 (Oi 3) + 0.03630 3) + 0.00395 (l j3)

+ 0.00036 C43) + 0.00004 e53)


= 3.74138.
106 3. THE APPROXIMATING POLYNOMIAL; APPROXIMATION IN AN INTERVAL

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

sinh 1.8276 = 2.94217 + 0.32599 (;76) + 0.02945 (;76)


+ 0.00326 (;76) + 0.00029 (;76) + 0.00004 e~76)
= 3.02909.
The correct result to five decimal places is 3.02907.
The solutions of the preceding examples require some further explana- .
tions in answer to some questions which undoubtedly have arisen in
the minds of some readers. Why was the finite difference table truncated
at the column of fifth differences? Or, what is essentially the same
question: why was a polynomial of degree 5 used? Why should the
entry 0.00012 have been suspicious? Which entry should be called xo?
Which formula should be used?
We endeavor to answer these questions in turn. We recall the theorem
given at the end of Section 3.7 concerning the differences of a polynomial
and also the statement that in evaluating a function f(x) at x = x' by
computing Pn(x'), where Pn(x) is the approximating polynomial of
max-degree n, there are two principle sources of error, first, the inherent
error found in all polynomial approximation and, second, the computa-
tional error due to inaccurate data and the accumulation of errors of
computation. One expression for the inherent error was given in for-
mula 3.8: 12; an upper bound for the computational error is usually
readily found. Let us suppose, as in the data given for the examples
just worked out, that the entries for f(x) are all given to the same number
of decimal places and that each is correct as far as it is written. Then
the error in each y is at most one-half unit in the last decimal place,
the error in each Lly is at most one unit in the last decimal place, the
error in each Ll2y is at most two units in the last decimal place; in
general, the error in each Llry is at most 2r - 1 units in the last decimal
place.
Now, if we use formula 3.8: 12 for the data given above, taking n = 5
and various values for u, it develops that the absolute value of the
inherent error is less than one-half unit in the sixth decimal place.
On the other hand, the computational error may be as large as 16 units
in the column of fifth differences. Inspection of the preceding difference
3.8. POLYNOMIAL THROUGH n + 1 EQUALLY SPACED POINTS 107

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

x sinh x .:Iy .:Iay.:lay


1.50 2.129
247
1.60 2.376 23
270 3
1.70 2.646 26
296 4
1.80 2.942 30
326 3
1.90 3.268 33
359 3
2.00 3.627 36
395 4
2.10 4.022 40
435 5
2.20 4.457 45
480 4
2.30 4.937 49
529 6
2.40 5.466 55
584 6
2.50 6.050 61
645
2.60 6.695

x sinh x .:Iy .:lay .:lay .:I'y .:I 6y .:Ily .:I7y .:lay


1.50 2.129279455
246288498
1.60 2.375567953 23775483
270063981 2702890
1.70 2.645631934 26478373 265007
296542354 2967897 29698
1.80 2.942174288 29446270 294705 2961
325988624 3262602 32659 307
1.90 3.268162912 32708872 327364 3268 61
358697496 3589966 35927 368
2.00 3.626860408 36298838 363291 3636 35
394996334 3953257 39563 403
2.10 4.021856742 40252095 402854 4039 19
435248429 4356111 43602 422
2.20 4.457105171 44608206 446456 4461 70
479856635 4802567 48063 492
2.30 4.936961806 49410773 494519 4953
529267408 5297086 53016
2.40 5.466229214 54707859 547535
583975267 5844621
2.50 6.050204481 60552480
644527747
2.60 6.694732228
3.8. POLYNOMIAL THROUGH n + 1 EQUALLY SPACED POINTS 109

with a backward difference). The successive arguments of the table


are then named ... , X_a, X_B , X_I' X o , Xl , X B , . , respectively.
Formula 3.8:7 is rewritten as

(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

If in 3.8:9 we replace the binomial coefficients by their equivalents from


the preceding identity and reduce all subscripts by n, we obtain

(3.8:14)

where x' = X-I + th, or t = (X' - x_l)/h.


Formulas 3.8:10 and 3.8:10' can be coalesced. We put, in either
case, t = u - m and reduce the subscripts by m. We obtain

(3.8: 15) Y = ~
[nIB] .
.:jBY _ i
(t - 21 + i) + [("+1)/B].
~ .:jB.-IYI _ i
(t -21_+1i) '
i-O I i-I I

where X = Xo + th, or t = (x - xo)/h, and where [n/2] means the


largest integer not greater than n/2, etc. Formulas 3.8: 11 and 3.8: 11'
can also be coalesced. In the first case, put t = u - m + 1, and after
substitution reduce the subscripts by m; in the second case, put t = u - m,
and after substitution reduce the subscripts by m + 1; in either case
we get

(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 '

where X = X_I + th, or t = (X - x_l)/h.


It should be carefully noted that whereas formulas 3.8:7, 9-11, 10',
11' all represent the same polynomial, formulas 3.8:13-16 will yield
in general different polynomials since they represent polynomials
through different sets of points. It should also be noted for future use
that two polynomials given by the latter (or equivalent formulas) will
be identical if, whatever the notation, the highest order differences
110 3. THE APPROXIMATING POLYNOMIAL; APPROXIMATION IN AN INTERVAL

occuring in each are identical. This is important because it may be


convenient to raise or lower the subscripts for some purposes. Thus,
if the final term of one polynomial involves J6Y _ 2 and the final term
of another polynomial involves J5y8 , but if J5Y _2 and J6Y8 represent
the same entry in the difference table (implying, of course, that different
entries were named Xo in the two cases), then the two polynomials are
identical.
The notation of the last group of four formulas was chosen in such
manner that the variable t always equals the difference between the
argument for which we are interpolating and the preceding argument in
the table, divided by the tabular difference between two successive
arguments; hence 0 :::;;; t < 1.
We have thus answered our question concerning the argument to be
called Xo' It is the argument in the table that precedes x' when we
use a formula that starts with a forward difference, 3.8:13 or 3.8:15,
and the argument in the table that follows x' when we use a formula
that starts with a backward difference, 3.8:14 or 3.8:16.
We move on to the question of which formula to choose. We see
that we have no choice for the calculations of sinh 1.52 and sinh 2.54
in the examples worked out above provided that we use the formulas in
terms of t and only the information given in the table on page 105.
Formula 3.8:13 must be used for the computation of sinh 1.52 since we
do not have the necessary finite differences for the other formulas;
similarly, formula 3.8: 14 must be used for the computation of sinh 2.54.
However, either one of these two formulas or either one of the central
difference formulas 3.8: 15 and 3.8: 16 can be used for the computation
of sinh 2.03. Which one? Inspection and study of the error term-
3.6:7 is the most convenient form-indicates that since the factor
pn+1l(X)j(n + I)! is not apt as a rule to vary considerably with the
choice of x' within the interval from Xo to Xn , the magnitude of the
error will depend on the productg(x' ) = (x' - Xo)(x' - Xl) ... (X' - x n ).
The particular equations

y = (x + 3)(x + 2)(x + I) x(x - I)(x - 2)(x - 3)


= x(x2 - 1)(x2 - 4)(x 2 - 9),
Y = (x + 3)(x + 2)(x + I) x(x - I)(x - 2)(x - 3)(x - 4)
= x(x2 - 1)(x2 - 4)(x2 - 9)(x - 4),

indicate the behavior of the polynomial in the general case. Their


graphs, drawn in Fig. 3.8:fl, show that for a random choice of x'
3.8. POLYNOMIAL THROUGH n + 1 EQUALLY SPACED POINTS 111

within the interval from Xo to Xn the product g(X') will tend to be


smaller when x' is chosen in the middle rather than at an end of the
interval. It is not necessary to state the facts more precisely; these
considerations indicate that the product (x' - xo) ... (x' - xn) will be
numerically least when for a given x' ::f=. Xi , the argument Xo is so chosen
that x' lies in the middle interval or in one of the two middle intervals.

y y

700

300 600

500

200 400

300

200

200

-300

-200 -400

-500

-300 -600

y = x(x 2 -IJ(x 2 - 4)(x 2 -9J(x-4)

FIG. 3.8:f1.

As a consequence, one of the central difference formulas will usually


give the best results and should therefore be used. We now see too
why it was necessary to develop the multiplicity of forms for the inter-
polating polynomial.
Before we close this section we derive some new expressions for the
polynomial through n + 1 equally spaced points that are advantageous
112 3. THE APPROXIMATING POLYNOMIAL; APPROXIMATION IN AN INTERVAL

for some special applications. If n is even, say n = 2m, formula 3.8: 15


may be written as

_
y - Yo +~ 1.12
~ I y-.
(t - 2i1 + i) + .12.-1Yl-. (t 2i- -1 +1 i) I\'
.-1
or

(3.8:17)

The last expression is known as the Newton-Stirling formula; it involves


even order differences and the averages of odd order differences.
Similarly, if n = 2m + 1, formula 3.8:15 may be rewritten as

(3.8:18) _ ~ (t - 2i1 + i) fl"1~(.12Y-. + .12')


y - ~
t -I .12
Yl-. + 2i + 1
i+l I
Y- . '

This expression is known as the Newton-Bessel formula; it involves odd


order differences and averages of even order differences. Formula 3.8:15,
n = 2m + 1, may also be rewritten as

(3.8:19)

This expression is one form of the so-called Laplace-Everett formula;


its virtue is that it involves only differences of even order.

REMARKS. We conclude this section with some remarks and observations


on interpolating or approximating polynomials. Let y = f(x) be a
(single-valued) function defined throughout the interval I [a, b]. =
Let

(3.8:20)

be the sequence of polynomials whose general term Pn(x) is the poly-


nomial of max-degree n determined by the n + 1 points

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

sequence of polynomials given in 2.3:5, but there is one important


difference. In the earlier case, the polynomial Pn(x) was precisely the
polynomial Pn-l (x) plus the term an (x - xo)n; no such simple relation
exists between Pn(x) and Pn-l(X) in the present case and hence there is
no simple transition from the infinite sequence to an infinite series.
Let x' be in the interval 1. The polynomial interpolation sequence
is said to converge to f(x) at x = x' if the sequence of constants

Pl(X'), P2(X'), ... , P..(x'), ... ,

converges to f(x'). The polynomial interpolation sequence is said to


converge to f(x) throughout the interval I if it converges to f(x) at each
point of the interval. The general theory of the convergence of poly-
nomial interpolation sequences is beyond the scope of this text; we
content ourselves with the remark that the convergence of the poly-
nomial inte~polation sequence implies that the error term, 3.8:12 or
3.8:12', approaches zero as n tends to infinity. Or, in other words,
the convergence of the polynomial interpolation sequence implies that
if n is sufficiently large, the corresponding difference table will certainly
contain a difference column whose entries are mote or less constant
(assuming that computational errors are negligible).
In the preceding observations, it was supposed that the points were
all contained within a given interval I, hence as the number of points
increased, the distance h between two successive points necessarily
decreased. There is a corresponding theory for the case where h is
kept fixed and I is made to increase with increasing n; but again, this
study is beyond the scope of this text.
It may be of interest to know some of the reasons the polynomial
interpolation sequence fails to converge either at a point or uniformly
throughout an interval. Since the graph of a polynomial is of a very
special type, it cannot accomodate itself to certain peculiarities of the
graphs of some functions. Thus, if f(x) or its graph is periodic or almost
periodic, if it has a discontinuity, an asymptote, or a vertical tangent,
or if its slope increases very rapidly with increasing x, to mention only
some of the possibilities, it is not reasonable to expect a polynomial
to be a good approximation to the function except over a very small
range. We give several examples to illustrate the phenomenon of non-
convergence; note that the difference tables do not and will not contain
columns of more or less equal numbers. The reader will find it instructive
to calculate approximating polynomials for the various examples,
interpolate for certain values of the functions, and then compare his
answers with the results obtained directly from the functions.
114 3. THE APPROXIMATING POLYNOMIAL; APPROXIMATION IN AN INTERVAL

EXAMPLE 1. Periodic function, y = sin(x + i)1T.

x y ..::Iy ..::I." ..::I 3y ..::ICy

0
-2
-I 4
2 -8
2 -4 16
-2 8
3 -I 4 -16
2 -8
4 -4
-2
5 -I

EXAMPLE 2. Discontinuous function, y = 1/(2x + 1).

x y ..::Iy ..::Ily ..::I 3y ..::I 4y

-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

EXAMPLE 3. Asymptotic function, y = 1/( I + x 2 ). This function has


received consideral attention in the literature.

x y .dy .d1y .day .d'y .diy

-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

EXAMPLE 4. Function with vertical tangent, y = {ix.

x y .dy .dly .day .d'y .d'y

-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

EXAMPLE 5. Function with rapidly increasing slope, y = rl.

x y ..:Iy ..:I1y ..:I1y ..:I'y ..:Ily ..:Ily ..:I 7y

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

x lOOe-z x y=tanx x y = (I +x)-ZO x I x fo{x) ].(x)

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.

3.9. Extrapolation. In all of the examples of the previous section,


a functionf(x) was calculated for an argument x' which was between the
smallest and largest arguments in the table used. The process of calcu-
lating f(x' ) where x' is smaller than the first argument or larger than
the last argument of the table is called extrapolation. When x' is smaller
than the first argument of the table, we name the first argument Xo
and use the forward difference formula 3.8:7; when x' is larger than the
last argument of the table, we name the last argument Xn and use the
backward formula 3.8:9. In either case, the factor (x - xo)(x - Xl) ... (x - x n )
in the error term and consequently the error term itself grows rapidly
in magnitude as the interval between x' and the nearest entry of the
table increases.
118 3. THE APPROXIMATING POLYNOMIAL; APPROXIMATION IN AN INTERVAL

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

sinh 1.32 = 2.12928 - 1.8(.24629) + 2.52(.02377) - 3.192(.00271)


+ 3.8304(.00026) - 4.443(.00003)
= 1.73807.
The result correct to five decimal places is 1.73814.

EXAMPLE 2. Compute sinh 2.70 from the same table.


This time we use formula 3.8:9; we have x' = 2.70, xo = 2.10,
h = 0.1, u = 6, n = 5; (11") = (U-~+l) = (U-~+2) = (U-~+3) = (U-~+4)
= I, whence

sinh 2.70 = 6.69473 + 0.64453 + 0.06056 + 0.00586 + 0.00058 + 0.00012


= 7.40638.
The result correct to five decimal places is 7.40626. Had we used the
larger table on page 108, we would have obtained 7.406263142. The
two italicized figures are incorrect; they should be 06.

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. v'395, v'399, v'412, v'415.


2. Tan 15, tan 1830', tan 6110', tan 7015'.
3a. lOOe-', lOOe-I.8, lOOe-I.I, lOOe-I.711.
b. Tan 1.35, tan 1.367, tan 1.475, tan 1.5.
c. (I + x)-ao for x = 0.009,0.04,0.05.
d. I for x = 1.1, 1.3, 1.5, 2.
e. 10(1),10<1.5),10<1.9),10(3.1),10(3.5),10<4.0); U1.95), U1.98), U3.02), 1.(3.15).

3.10. Subtabulation. It is frequently desirable and sometimes


necessary to extend a table of values of a function to include values
intermediate to those already tabulated. For example, it may be desirable
to extend a table giving sin x at intervals of one degree to a table giving
sin x at intervals of one second. The process of this inserting new entries
in a table is called subtabulation.
3.10. SUBTABULATION 119

To be definite, suppose it is desired to extend a table giving values of


(3.10:1) y = f(x)
for successive x's that differ by the amount h to a table giving values
of the function for successive x's that differ by the amount H, where

(3.10:2) H h q a positive integer.


= q'
In one sense the problem has already been solved. Indeed, if Xo and Xl
are two particular arguments, the values of f(x) to be interpolated can
be found from several of the formulas of the preceding section, for
example, formula 3.8:13, by taking t = l/q,2/q, ... , (q - I)/q, in turn.
In this connection, we draw particular attention to formula 3.8: 18,
which becomes if t = -t,
". . 1
(3.10:3) Y = ~ ti (' -2i "!) "2"l( A2'Y + A'Yl-t
LI
2)
-i .
LI

The successiye differences that appear in this formula fall in every


other column of the difference table and are in the same horizontal
rows as the entries Yo = f(x o), Yl = f(x 1 ). The formula is then especially
effective for interpolating to half intervals and should be used whenever
possible. To lessen the labor of computation even further, we give in
the table below the values of the binomial coefficients occurring in the
formula for i = I, ,6:

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

(3.10:6) Y; = !(Xi ), i = 0, 1,2, ... ,


(3.10:7) k = 0, 1,2, ....

The first method of subtabulation was a process in which Yo, Y I ,


Y 2 , , were calculated directly from Yo , YI , Y2' ... , and their differences;
in the present method, the differences of Yo, Y I , Y 2 , , will first be
calculated and then Yo, Y 1 , Y 2 , , will be computed from them.
The advantage of the second method lies in the great saving it affords
in computational labor when new entries are to be added in a wholesale
fashion.
We form first, from the original entries, a difference table beginning
3.10. SUBTABULATION 121

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,

(3.10:8) i = 0, 1,2, ....

We now use formula 3.7:10 in the form


r
.1ryo = ~ (-I)'-i (~) Yi , r = 1,2, ... , n,
i=O I

to obtain

or

r = 1,2, ... , n.

It can be shown, however, that

(3.10:9) for j < r;

consequently the preceding double sum may be abbreviated to

(3.10:10) r = 1,2, ... , n.

We calculate LlYo , Ll2YO ' , from the preceding identity by taking


r = 1,2, ... , in turn, and then find Y 1 , Y 2 , . , by additions using the
relations
Y1 = Yo + .1 Yo ,
.1Y1 = .1 Yo + .1 2 Y O '
Y2 = Y 1 + .1 Y 1 ,
122 3. THE APPROXIMATING POLYNOMIAL; APPROXIMATION IN AN INTERVAL

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

revealing that the third-order differences are more or less constant;


hence we take n = 3. The value of q is 5 so that Q = 1. We need the
the following values for use in formula 3.10: 10:

(~) =
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;

note that these values are exact. Formula 3.10: 10 yields

JYo = G)(~) Jyo + (~)(~) J2yo + (~)(~) Jayo


(3. 10: lla)

= 0.2 Jyo - 0.08 J% + 0.048 Jayo ;

J2YO = - ![(i)(~) - (;)ef)] J2yo + [(i)(~) - (;)ef)] Jayo!


(3.1O:11b)

Jayo = [(i)(;) - (;)(2f) + (;)ef)] Jayo


(3.10:11c)

We remark again that the coefficients of the differences in these equations


are exact. We stop at Jayo because if a third degree polynomial is a
good approximation to vi
(in the neighborhood of x = 300) if we
use the interval h = 1, the degree will certainly not increase if we use
the smaller interval H = 1. Actually, we find (Yo = Yo = 17.3205081)
AYo = 0.0057725, A2Yo = -0.0000019, Aayo = 0.0000000, so that a
second degree polynomial is adequate. These numbers are not exact
since rounded-off numbers were used in their calculations.
124 3. THE APPROXIMATING POLYNOMIAL; APPROXIMATION IN AN INTERVAL

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

which is formed as follows. We write the entries in the topmost diagonal


in their proper places, then compute 17.3262806 by adding 17.3205081
and 0.0057725, then 0.0057706 by adding 0.0057725 and -0.0000019,
etc. Short cuts, abbreviations, and convenient forms for performing
and rearranging the tabulations will naturally suggest themselves to the
computer whether he carries out the computations longhand or on a
calculating machine_._
The value of v'301 from this table agrees with the value given in
the original brief table but the value of v'302 differs from its original
value by four units in the last place. Since we are going to use only
five decimal places, the values given in the extended table will be correct
when the decimals are rounded off. However, to compute v'302j~,
v'302.4, ... , it would be better to start afresh; we use 3.1O:IIabc with
Yo = Yo = I 7.3781472 and find LI Yo = 0.0057534, Ll2Yo = -0.0000019,
Llsyo = 0.0000000. Using these values and proceeding as above, we
determine v'302.2, v'f02A, etc.
Finally, we calculate v'300J, v'300~j, ... , from the enlarged table
by use of formula 3.8:13 which becomes in this case, since n = 2,
EXERCISE 125

t = t, y = Yo + iJYo/2 - iJ2Yo /8.


We find V300J = 17.3233946,
v300.3 = 17.3291661, etc. These numbers too are rounded off to five
decimal places for inclusion in the final table.

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. Nonpolynomial Approximation. For the reasons indicated at


the close of Section 3.8 as well as for other reasons-for example, elec-
trically controlled and operated machines lend themselves most readily to
sinusoidal curves-it is frequently desirable to approximate a function

(3.11:1) y = f(x)

by a function

(3.11:2) y = a(x)

which is not a polynomial. We illustrate some methods in this section


but we do not propose to give a detailed discussion of either the methods
or the errors involved.
The function

(3.11:3) C(x) = ao + at sin 21T (x - xo) + ... + an sin n 21T (x - xo)


p p
21T
+b t cos p (x - xo) + ... + bn cos m 21T
p (x - xo),

where ao , "', an, bo , "', bm and Xo are constants, is everywhere


continuous and periodic with period p and hence is suitable for approxi-
mating the function y = f(x) at a point (xo, Yo) if the function f(x)
is itself continuous and periodic with period p. As a rule, m is chosen
to be n, n - 1, or n + l. The function C(x) has n + m + 1 arbitrary
constants and hence can be determined by the imposition of an equivalent
number of conditions.

EXAMPLE 1. Approximate

(3.11:4) y = e slll '"

at x = 0 by a function of type 3.11:3 for n = m = 1 and for n = m = 3.


For n = m = I, we take Xo = 0 and put

(3.11:5)

(The function to be approximated has the periodp = 21T.) We determine


the three constants ao , at , and bt by equating the values of es1nz and
Ct(x) and the values of their first and second derivatives at x = Xu
We obtain

Ct(x) = 2 + sin x - cos x.


3.11. NON POLYNOMIAL APPROXIMATION 127

The graphs of y = C 1(x) and the given function should be drawn by


the reader; they show the periodicity of the two curves and indicate
that C 1(x) is a good approximation to e s1nx from about -21T/9 to about
71T/18 (roughly from -40 to 70) in the period interval from -1T to 1T.
For n = m = 3, we start with

(3.11:6) Ca(x) = ao + a l sin x + a2 sin 2x + aa sin 3x


+ hI cos X + h2 cos 2x + ha cos 3x.
Since we need six derivatives, it is convenient to write es1nx as a power
series in x, namely,

+ x2! 3X4 8x 5 3x6 56x7


2
Y = esln", = 1+ x - "4! - Sf - 6f + 7! + ....

We obtain on substituting 0 for x, equating the values of corresponding


derivatives, and solving,

Ca(x) = 1!0 (200 + 210 sin x - 6 sin 2x - 6 sin 3x + 45 cos x


- 72 cos 2x + 7 cos 3x).
The graphs of y = Ca(x) and the given function show that this time
the approximation is good from about -41T/9 to about 111T/18 (-80
to 110) in the period interval from -1T to 1T.

EXAMPLE 2. Approximate 3.11:4 by a function of type 3.11:3 at


x = 0 for n = 3 if all the b's are O.
We put

(3.11 :7)

Since A~'(O) and A~4)(0) are identically equal to 0, we impose the


conditions

We find

Aa(x) = 3~ (30 + 35 sin x - sin 2x - sin 3x).

Aa(x) approximates es1nx well only in a short interval about x = 0 and


about x = 1T.
128 3. THE APPROXIMATING POLYNOMIAL; APPROXIMATION IN AN INTERVAL

EXAMPLE 3. Approximate

(3.11:8) P2(X) = !(x - [X])2 - !(x - [x]) + l2


by a function of type 3.11:3 at x = i if n = m = 2.
This function was discussed in Section 2.5. Since the function IS
periodic with period 1, we take

(3.11:9) C2(x) = a o + a1 sin 217(X - !) + a2 sin 2 . 217(X - !)


+ b1 cos 217(X - !) + b2 cos 2 . 217(X - i)
as the approximating function. Since P2(X) coincides with
B2(x) = tx2 - tx
+ l2 in the interval from 0 to 1, the latter may be
used for the calculation of the derivatives at x = l- By differentiating,
putting x = i, and equating the results to the corresponding derivatives
of P 2(x), we obtain

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.

EXAMPLE 4. Approximate 3.11:4 by a function of type 3.11:3 which


coincides with y = es1nz at x = 0, 17/3, 17/2.
Since we are given three points (0, 1), (17/3, elv'a), (17/2, e), ony = es1nz
whose coordinates are to satisfy the equation of the approximating
curve, the a priori form of the equation of this curve must contain
three arbitrary constants. We start with

(3.11:9a)
3.11. NONPOL YNOMIAL APPROXIMATION 129

If we impose the conditions that this equation be satisfied by the


coordinates of the three points, we find

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

EXAMPLE 5. Approximate 3.11:4 by a function of type 3.11:3 which


coincides with y = es1nz at x = 0, 7r/3, 7r/2, 7r, 37r/2.
We wish to determine the constants in

(3.11:10)
so that the graph of this equation passes through the five points

(0,1), (7r/3, elvs), (7r/2, e), (7r,I), (37r/2, e-I ).


Substituting the coordinates of the points into C 2(x) , equating corre-
sponding values, and solving, we obtain

C 2(x) = 1.272 + 1.175 sin x - 0.057 sin 2x - 0.272 cos 2x.

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

the form A3(X) = ao + al sin x + a2 sin 2x + a3 sin 3x can coincide with


y = eBlnx at x = 0, 17/2, and 317/2. Indeed, these points impose the
conditions
ao = 1,
+
ao al - as = e,
ao - a l+as = e- l
Adding the last two of these equations and dividing the sum by 2, we
get ao = !(e + e-l ), a result inconsistent with the first equation.
It is desirable for some purposes to approximate either at a point or
throughout an interval a non periodic function by a finite trigonometric
series. We illustrate some of the possible procedures in the two following
examples.

EXAMPLE 6. Find the function of type


(3.11:11) As(x) = a l sin x + a2 sin 2x + as sin 3x
which approximates

(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 7. Find the function of type 3.11:11 which coincides with


3.11:12 at x = 17/4, 17/3, 17/2.
Substituting the coordinates of the points (17/4,17/8), (17/3,17/6),
(17/2,17/4) into Eq. 3.11:11, and solving, we find that
y = 17(0.2639 sin x - 0.0715 sin 2x + 0.0139 sin 3x)
is the required equation; it is a good approximation to y = lx from
3.11. NONPOL YNOMIAL APPROXIMATION 131

-1T/2 to X = 1T/2. Of course, no part of this graph or the graph of the


preceding answer is a straight line segment, but these graphs deviate
very little from the line y = tx
in the neighborhood of the origin.

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:

x f(x) a(x) f(x) - a(x) Error (%)

1.8 3181 4103 -922 29


1.9 146710 155710 -900 6
2.0 590510 590510 0 0
2.1 2126.101 2240.101 -114.101 5
2.2 6971.101 8498.101 -1527.101 22

EXAMPLE 9. Determine a function of exponential type which coincides


with 3.11:l3 at x = 1.5, 1.8, 2.0.
The desired function is of the form y = ao + a1fiZ + a2e2:i;. It is
readily seen that the function is given by

_ (e'" - e1.8)(e'" - e2 ) 1 2510 + (e'" - e1 .5 )(e'" - e2 ) 2.2410


y - (e1.5 _ e1.8 )(e1. 5 _ e2 ) (e 1.8 - e1.5 )(e1.8 - e2 )
+ (6'" - e1.5)(e'" - e1.8) 310
(e 2 - e1.5)(e2 - e1.8)
Simplification will reduce this equation to the required form.
132 3. THE APPROXIMATING POLYNOMIAL; APPROXIMATION IN AN INTERVAL

EXERCISE 3.11

1a. Approximate Y = x - xl at x = 0 by a function of type 3.11:3 of period 2 for


m = O. n = I. 2. 3.
b. Estimate the maximum value of the error in the interval [ - I. I] for each of your
answers.
la. The function Y = eC08b is periodic of period 'fT. Approximate it at x = 0 by a
function of type 3.11:3 for each of the 15 combinations of nand m in the range O. 1.2.3.
omitting n = m = O.
b. Same as a. but at x = 'fT12.
c. Graph the given function and each of the answers.
3a. Approximate y = I Ix at x = I by a function of type 3.11: 14.
b. Determine the errors at x = 0.8. 0.9. 1.1. 1.2.
4&. Approximate y = x + x + lOx' at x = 0 by a function of type ae"'" + c.
b. Through what interval about x = 0 may x range if the error is not to exceed 0.1 ?
Sa. The function

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

b. Put aj = a(xj), i = 0, I, ... , n; let io , ;1 , ... , i" be a permutation of 0, I, ... n; and


define

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).

3.12. Additional Methods of Interpolation. We discussed in the


previous sections methods of interpolating in which values of a function
were obtained by substituting for the function an approximating or
interpolating function. These methods can frequently be replaced by
other less laborious methods when auxiliary tables are available. We
know, for example, that in using an ordinary five-place table for the
logarithms of the trigonometric functions tabulated at minute intervals
of the argument, linear interpolation is not accurate for certain ranges.
In particular, linear interpolation is not accurate for log sin 8 when 8 is
between 0 and 3. Auxiliary tables, the so-called S, T, CS, and CT
tables are then constructed for more accurate interpolation. We have
log sin 8 = log 8" + S,
134 3. THE APPROXIMATING POLYNOMIAL; APPROXIMATION IN AN INTERVAL

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

sinh(x + h) = sinh x cosh h + cosh x sinh h,


. h3 h5 h2n - 1
smh h = h + 3f + Sf + ... + (2n - I)! + "',
h2 h4 h 2n - 2
cosh h = I + 2f + 4f + ... + (2n - 2)1 + "',
where the two infinite series are everywhere absolutely convergent. Hence
h2 h4 h3 h5
sinh(x + h) = sinh x (I + 2f + 4f + ...) + cosh x (h + 3f + Sf + .. -) .
Suppose that the tabulated values of the functions are given correct
to five decimal places and that the argument interval is 0.1. If x' is
between the arguments Xo and Xl of the table and we put x' = Xo + h,
then 0 < h < 0.1. Consequently, hlj2! < 0.005, haj3! < 0.00017,
h4j4! < 0.000004. It follows that if we put
h h4
2 h 3
sinh(x + h) = sinh x (I + 2! + 41) + cosh x (h + 3\)'
the error will not affect the fifth decimal place in the evaluation of
sinh X for 0 ~ X ~ 5. The number of terms necessary in the factors
multiplying sinh x and cosh x will depend on the argument interval,
that is, on h, the number of decimal places used, and on the size of x;
the number of necessary terms increases with increasing h, x, and the
number of decimal places.

EXAMPLE 1. Given sinh 1.5 = 2.12928, cosh 1.5 = 2.35241, find


sinh 1.52.
We have h = 0.02, hlj2! = 0.0002, haj3! = 0.000001, h4j4! = 0.000000.
Hence
sinh 1.52 = 2.12928(1.0002) + 2.35241(0.020001)
= 2.17676.
EXAMPLE 2. Given sinh 2.5 = 6.05020, cosh 2.5 = 6.13229; find
sinh 2.54.
3.13. INVERSE INTERPOLATION 135

This time h = 0.04, h2/2! = 0.0008, h3 /3! =0.000011, h4/4! = 0.000001;


and
sinh 2.54 = 6.05020(1.000801) + 6.l3229(0.040011)
= 6.30041.

EXAMPLE 3. Given sinh 1.8 = 2.98217, cosh 1.8 = 3.10747, find


sinh 1.8276.
We have h = 0.0276, h2/2! = 0.000381, h3 /3! = 0.000004,
h4/4! = 0.000000; and

sinh 1.8276 = 2.94217(1.000381) + 3.10747(0.027604)


= 3.02907.

Compare these values with the ones previously obtained as well as


the amount of labor necessary in finding them. It is suggested that if
nonlinear interpolations are to be performed, the computer might do
well to investigate these other methods before he uses the methods
furnished by the interpolating polynomials. The precise form in which
interpolation is to be carried out in these other methods will depend,
of course, on the nature of the function and the availability of the
necessary auxiliary tables. These methods cannot be used if the function
f(x) is unknown as in the case of recorded data of an experiment.

3.13. Inverse Interpolation. In the preceding pages we considered


the problem of evaluating y = f(x) for an assigned argument x' not
found in the data or in a table. The process of determining an argument
x' which will yield an assigned value f(x') not found in the data or in
the table is called inverse interpolation.
When linear interpolation is inadequate, the most obvious and natural
method of performing an inverse interpolation is the process of merely
interchanging the roles of x and y. This method, however, has a serious
drawback. Since the successive changes in y will rarely be uniform,
the formulas for equally spaced points cannot be used and we must
resort to the Lagrange interpolation formula or an equivalent one.
In any case, the calculations will involve divisions by numbers very
close to zero and will, as a rule, lead to inaccurate results.
Of the remaining methods of inverse interpolation, other than the
ones that use auxiliary tables and apply only to particular functions,
the most common and the most efficient is the method that leads to the
solution of a polynomial equation. An example will illustrate the process.
Let us use the difference table on page 105 to find sinh- 1 4.00000.
136 3. THE APPROXIMATING POLYNOMIAL; APPROXIMATION IN AN INTERVAL

We use formula 3.8:16; we havey = 4.00000,yo = 4.02186, X_I = 2.00,


h = 0.1. Hence (we put n = 4),

4.()()()()() = 4.02186 + 0.39500 e~ 1) + 0.04025 G) + 0.00395 G)

+ 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

The Numerical Solution of


Algebraic and Transcendental Equations in One Unknown;
Geometric Methods

4.1. Introduction. In this and succeeding chapters we discuss


various methods of calculating one or more of the roots of an equation
or of a system of equations. The methods fall roughly into two classifica-
tions.
The first class consists of the geometric methods in which solutions
are found by means of diagrams. These methods are subdivided into
the ordinary graphical methods and the nomographic methods. A
graph is a diagram used to solve a particular equation. A nomogram
is a diagram or a set of diagrams used to solve many equations all of
the same type; for example, a literal equation for any set of numerical
values of the coefficients within assigned limits. The graphical method
is usually quick but inaccurate.
The second method consists of the arithmetic methods in which
solutions are obtained by definite computational processes. These
methods are subdivided into the literal methods, the iterative methods,
and the algorithmic methods. The literal methods are methods in which
formulas are found for the roots in terms of literal coefficients and in
which solutions are obtained by substituting for the letters given
numerical values. For example, we have the well-known formula,
x = (-b vb s - 4ac)/2a, for the roots of the quadratic equation
axs + + bx c = O. This method is the algebraic counterpart of the
geometric nomographic method; it is very efficient but can be used only
in a very limited number of cases. The method of iteration, in its
simplest form, is a repetitive process in which a root of f(x) = 0 is
found by use of a related function <p(x); the root is determined as a
term or as the limit of the sequence <p( ao), <p( a1), <p( as), ... , where ao is
an approximation to the root sought and <p(ai+l) = <p(<p(al. The
algorithmic methods are methods in which the solutions are found by
repetitive processes not of the preceding type. The arithmetic method is
137
138 4. GEOMETRIC METHODS

the more useful, particularly when a very precise or accurate result is


desired.
Needless to say, the two methods are often used in conjunction in a
problem. A graph is frequently used to determine the number of (real)
roots, to locate them, and to indicate any potential source of trouble
such as two or more almost equal roots; an arithmetic method is then
used to determine the required root or roots to the desired degree of
precision.

4.2. Graphical Methods. Let


(4.2:1) f(x) =0
be an equation whose (real) roots are sought and put
(4.2:2) y = f(x).
If the graph of this equation is drawn in a rectangular coordinate
system in the usual manner, the roots are the abscissas of the points
of intersection of the graph and the x-axis.

EXAMPLE 1. Find the real roots of the equation


x2 - 3.61ogl oX - 2.7 = 0,
where the coefficients 3.6 and 2.7 are exact.
y
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.

determine the roots of f(x) = 0 as the abscissas of the points of inter-


section ofthe graphs of y = fl(X) and y = f2(X), wheref(x) = fl(X) - f2(X).
Thus, in the preceding example, the roots can be determined as the
abscissas of the points of intersection of the graphs of y = X2 and
y = 3.61og1o X + 2.7. The work is shown in Fig. 4.2:f4-f6.

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).

8. e- j sin (i + 2t) = 0.1, (as in preceding example).

9. cosh x = Xl + -xI , (2 dp). '

10. loglo(1 + x) = arcsin v' I - Xl, (2 dp. Find all positive roots and the three
largest negative roots).

4.3. Construction of Scales and Rules. The reader is undoubtedly


quite familiar with the Cartesian coordinate systems used in the pre-
ceding section. In such a system, the coordinates of a point in the
plane are determined by coordinate systems set up on the axes. In this
and the following sections we propose to study in greater detail some
of the basic concepts involved in constructing and using coordinate
systems on lines and curves. We start with some formal definitions.
142 4. GEOMETRIC METHODS

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),

where f(x) is a real, single-valued function of x. The point 0 from


which distance is measured is called the origin of the scale; the point,
if any, whose coordinate is zero is called the zero point. A scale is called
uniform if the distance between points PI and P 2 is equal to the distance
between the points Ql and Q2 (all distances are measured, of course,
on or along the curve) if and only if the difference between the coordinates
of PI and P 2 is equal to the difference between the coordinates of
Ql and Q2'
The simplest of all scales is the linear scale; it is a uniform scale
determined by the function

(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.

A scale is nonuniform if its defining function 4.3: I is not a first degree


polynomial. We give four examples of nonuniform scales on a straight
line.
0.5
:0.8 1.4 1.8
0i j 11.2! 16: 2 2.5 3 3.5
(a) A.. I . ; i I. I. . I I
...........
u

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

Consider the function

(4.3:3)

where x is non-negative. A unit distance represented by a line segment


u is chosen, see Fig. 4.3:f2a, and a point on the scale line is arbitrarily
selected as the origin. The origin is indicated on the scale by the inverted
vee, A.. The coordinate system of the scale is then determined. Note
that only points to the right of the origin have coordinates; points to
the left are not part of the scale.
The scale determined by the function

(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

the x-axis. If Xo is the coordinate of A on the x-scale and Yo the coordinate


of B on the y-scale, we call Xo and Yo the planar coordinates of P and
write them in the usual manner as (xo , Yo).
These notions are, of course, obvious generalizations of the familiar
Cartesian coordinate systems. It may happen, however, that due to the
choice of the x- or y-scales, a point P of the plane lacks one or both of
its coordinates. Furthermore, if Xo and Yo are given numbers, there
need not exist a point whose coordinates are (xo , Yo).
Another method of constructing a scale is now open to us. Let a
coordinate system be established for the plane and let

(4.3:7)
x = /(t),
y = g(t),

be a pair of parametric equations, where /(t) and g(t) are single-valued


functions of the parameter t. For a given value to of t, we have Xo = /(to),
Yo = g(to); that is, to determines the pair of coordinates (xo , Yo). Hence,
as t runs through a given range of values, the points determined by the
corresponding pairs of coordinates will fall on a curve C (but note the
possible misbehaviors outlined in the preceding paragraph). We can
now establish a coordinate system on C by assigning to each point as
its scale coordinate the value of the parameter t which gave rise to
that point.
As an illustration, consider a usual Cartesian coordinate system;
that is, a system in which the x- and y-axes are perpendicular lines
scaled by the same linear polynomial function with zero points at the
ongm.

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

It is to be emphasized that the resulting scale depends as much on


the coordinate systems used for scaling the axes as on the parametric
equations. Thus, if we scale the y-axis by means of the function y,
but the x-axis by means of the function 10 loglo x, the scale C determined
by the last pair of parametric equations will look as in Fig. 4.3:f5.
Note also that different sets of parametric equations may yield the
same carrier curves but different scales.

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

16 .../2; lx, y8; U = v. x = 4t, Y = 2t; -1 <t< 1.


17 .../2; x,loglo y; 2u = v. x = t, Y = e'; 0<t<6.
18 .../2; x, 2y; u = v. x = sin t, y = cos t; 0< t < 2.. .
19 .../6; x,2y; u = v. x = sin t, y = cos t; 0< t < 2.. .
20 .../3; x,3y; u = v. x = 2t, Y = sin t; 0< t < 2...
21. The equation s = kf(t) (k > 0) will determine on a carrier curve identically the
same scale as the equation s = f(t) if the unit of distance used in the first case is (1Ik)th
the unit used in the second. What happens if k < O?

4.4. Stationary Scales. Scales can be used in conjunction in a


variety of ways to exhibit a functional relation between variables or to
help in the solution of numerical problems. One of the most obvious
methods is to place two (or more) scales side by side, or to graduate
the "upper half" of a horizontal line with one scale and the "lower
half" with another scale, or the right- and left-halves of a vertical line.
If the two scales are determined by s = f(x), s' = F(y), respectively,
and if the origins coincide and the units of distance are equal, then the
coordinate x of a point is related to the coordinate y of the same point
by the equality

(4.4:1) f(x) = F(y).


Solving this equation for x and y in turn, we obtain

(4.4:2) x = cp(y),

(4.4:3) y = t/J(x).

The last two equations as well as 4.4: I expression the relationship


between the x- and y-coordinates of a point.
We give several examples to illustrate these principles. If the log
scale, Fig. 4.3:f2d, is placed against its own distance scale as in Fig. 4.4:f1,
we have y = loglo x, X = 1011. Again, take two uniform linear scales,
s = F, s' = Ie + 32; we have F = Ie + 32, e = 32). See t(F -
Fig. 4.4:f2.

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

-40 -30 -20 -10 0 10 20 30 40 50 60 70 eo 90 100


1..'ii"
,.1",.1, 1"'1"1"'1"1,,,,,,,"''''1''''''''''1'''''''''1''''"I'"
'" '" "( ifll , f i l l " 'r (,'" orll
-40 0 50 100 150 200

FIG. 4.4:f2.

As an example of three scales used in conjunction, we take s = t,


s' = 981t, s" = 5275 tanh 0.1 86t. Label the three scales the t-, the
v-, and the v'-scales, respectively. The v-scale gives the velocity in
centimeters per second of a body falling in a vacuum, the v' -scale
o I 2 3 4 5 6 7 8 9 10
I: " , , , , , , , ' , , , , , , , " , , , , ' " ' , , , , , , , , I, ,, ,,' , ,' ,, , , ' ,
o 1000 2000 3000 4000 5000 6000 7000 BOOO 9000 10,000
:.~ 1 ' \ " " ' " " '" ,,' , ',' , , , , " '
o 1000 2000 3000 4000 5000

FIG. 4.4:f3.

gives the velocity in centimeters per second of a body falling in such a


manner that the air resistance is proportional to the square of the velocity
in each case the body falls from rest and the time is given by the t-scale.
See 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

It should be pointed out that scales used in conjunction in this fashion


are merely an abridgment of the usual graph. Stationary scales take
little space and are easy to read, but graphs usually portray quite vividly
relations, tendencies or properties not immediately evident on a set of
numerical scales. Compare the preceding stationary scale with the
equivalent graph, Fig. 4.4:f4.

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. $ = loglo X, $' = In y; 0.1 < x < 100.


d. $ = Xl + I, $' = !(e' + r') 0< y< 4.
e.$= -~, $'= -~; -10 < y < O.
2. Construct a double scale on a line to exhibit each of the relations below for the
indicated ranges. If necessary, use several lines to show the complete range.
a. C = 0.213T!, -50 < T < 250.
b. y = 1.32 + 4.59x - 0.007x, 0< x < 100.
c. y = x + loglo x, 0.1 < x < 10.
d. PVI.Oi = 30, 5 < V < 150, at intervals of 0.5 for V.
e. y = eO. 3lz sin x, - 5 < x < 5, at intervals of 0.1 for x.
3. Construct, on parallel lines, single and double scales to exhibit each set of relations
for the indicated ranges.
a. 3 - 2t + 2t l + t 3 ,
$ =
v = -2 + 4t + 3t l ; 0< t < 5.
b. S = 2r + !",I,
1 <r < 2.

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

4.5. Sliding Scales. The stationary scales described in the preceding


section enable us to solve equations of the form y = f(x) but are not
suited for the solutions of equations of the form y = f(x i , X2 , ... , x n ).
Some limited equations of this type can be solved by means of sliding
scales or rules of which familiar examples are the ordinary logarithmic
slide rule and the vernier scale.
Let two scales A and B be determined by the equations
(4.5:1) s = f(x),
(4.5:2) s' = F(y),
respectively, where the same unit of distance is used for the two cases,
and construct a rule so that one scale slides against the other. A typical
setting is illustrated in Fig. 4.5:fl, where 0 and 0' are the respective

0 P, p.
A:
, Po
, , ,
B: I I I
0' 0, O.

FIG. 4.5:1.

origins. If the points PI and P 2 with coordinates Xl and X 2 , respectively,


on the A scale coincide with the points QI and Q2 with coordinates
YI and Y2 , respectively, on the B scale, we have
P I P2 = QIQ2'
OP2 - OPI = O'Q2 - O'QI ,
and therefore,
(4.5:3)
All of the results of the present section are derived from the last
equation. We note several particular cases. If f(x) = F(x), that is, if
scales A and B are constructed by means of the same function, the
preceding equation becomes
(4.5:4)
If on scale B the point QI is the origin 0', which mayor may not have
a coordinate, and if the point Po on A which is coincident with 0' has
the coordinate xo , then 4.5:3 and 4.5:4 become
(4.5:5) f(X2) - f(x o) = F(Y2)'
(4.5:6) f(X2) - f(x o) = f(Y2)'
respecti vel y.
152 4. GEOMETRIC METHODS

In Eq. 4.5:3 and 4.5:4 any three of the numbers Xl' X 2 , YI , Y2 ,


will determine the fourth; in Eq. 4.5:5 and 4.5:6, any two of the numbers
Xo , X 2 , Y2, will determine the third. We apply these conclusions to
several examples.
Suppose that log scales are constructed on A and B so that
s = f(x) = logloX,
s' = f(y) = IOgloY
Equation 4.5:4 yields
log X2 - log Xl = logY2 - logYI.
Hence
log X2 = logY2 ,
Xl YI
and, since all numbers are real,

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.

(some ratios will be only approximately equal to others because of errors


in reading; we can expect at best only approximations whose closeness
will depend on the precision of the rule); also,

~:~ =
6
T.6 = 3.75, 5.94, etc.,
and
1.6 X 3 = 4.8, 1.6 X 5.1 = 8.16, etc.

As another example, construct scales on A and B determined by

, 1
s =-.
y

Equation 4.5:6 then yields

or

The last equation is soon recognized as the fundamental equation of the


famous work problems, the lens problems, and the resistance in series
problems amongst others. A typical setting is shown in Fig. 4.5:f3;
the setting yields

etc.

100 10 5 4 3 2 I 0.9 O.B 0.7


I I I I... , I"I I"I I I ! !
" ! I I ! I
! ! II'!""!" " ! ' " ' ' I i !
100 10 654 3 2 0.9

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. Nomography. Scales can be used in conjunction in yet another


way to solve numerical problems. A method which is particularly
effective when it is necessary to solve a number of problems all of the
same type and where great precision is not demanded is furnished by
the nomogram. A nomogram is a set of three or more fixed scales placed
in definite positions relative to each other; the scales are so constructed
that a coordinate on one scale is a preassigned function of the coordinates
collinear with it on two other scales.
We explain the construction and principle behind a simple type of
nomogram. Let a, b, and c be three vertical lines (vertical scales are
somewhat more convenient than horizontal scales in nomographic work)
spaced so that the distance between a and b is to the distance between
band c as r1 : r2 , where r 1 and r2 are positive numbers. Let a line of
origins and an arbitrary line meet a, b, and c in 0, 0', 0" and A, B, C,
respectively; Fig. 4.6:fl. It is readily shown that

(4.6:1) O'B = r20A + r1o"e .


r1 + r2
If distances on the vertical lines are directed so that the positive distances
are those oriented upwards, say, then formula 4.6: I will hold no matter
what the respective positions of the transversals ABC and 00' 0" are.
Construct scales on a, b, and c by use of the equations
(4.6:2) s = fey), s' = cp(x), s" = F(z),
respectively; take 0, 0', and 0" as the three origins and use the same
unit of distance in all three cases. It follows that

(4.6:3)
4.6. NOMOGRAPHY 155

This equality is fundamental for the construction of certain nomograms;


we illustrate its application by several examples.

EXAMPLE 1. Take 71 = 72 and put <p(x) = x, f(y) = y, F(z) = z.


Equation 4.6:3 yields x = l(y + z). The corresponding nomogram is
exhibited in Fig. 4.6:f2. This nomogram enables us to compute simple
arithmetic averages quickly. Obviously, this example is included for
illustrative and not for practical purposes. To find the arithmetic
average of y and z, draw the line connecting the point with coordinate
y on the first scale to the point with coordinate z an the third scale;
this line will intersect the center scale at a point whose coordinate x
is the arithmetic average of y and z. In practice, it is not advisable to
actually draw a line but rather to place a straightedge on y and z;
better yet, one should use a transparent flat surface on which a straight
line has been carefully drawn.
4 4 4 10
C 8
A 8 3 3 3 7
6
2 2 2 5
4
3
0
0' 0 0 0
0" 2
-I -I -I

D b c -2 -2 -2
Y If r y If r

FIG. 4.6:fl. FIG. 4.6:f2. FIG. 4.6:f3.

EXAMPLE 2. Put 71 = 72 and take <p(x) = ! log x, f(y) = log y,


F(z) = log z. Then ! log x = !(log y + log z), and x = yz. The
corresponding nomogram, fig. 4.6:f3, enables us to compute products;
indeed, the line joining y on the first scale and z on the third scale
will meet the center scale at a point whose coordinate is equal to the
product yz.
In the preceding two examples, we put 71 = 72 quite arbitrarily and
assigned values to <p(x), f(y), and F(z); then we found the functional
relationship between x, y, and z. In actual practice, the procedure is
just the reverse. We start with a functional relationship between three
variables, say x, y, and z, and we must determine the form of the func-
tions <p(x), f(y), and F(z). Examination of Eq. 4.6:3 shows that a nomo-
gram of the type described above can be constructed if a function of
one variable is equal to a function of the second variable plus a function
156 4. GEOMETRIC METHODS

of the third variable. Since the logarithm of a product is equal to the


sum of the logarithms of the factors, a nomogram of the above type
can also be constructed if a function of one variable is equal to a function
of another variable multiplied by a function of the third variable.

EXAMPLE 3. Construct a nomogram for the solution of the equation


V = 7Tr2h, which expresses the volume of a circular cylinder in terms
of the radius of the base and the altitude.
The volume for a given radius and altitude can be obtained readily
enough by use of a slide rule, but if a great many volumes were required
for varying radii and altitudes, a nomogram will prove to be a time-
saving device. The given equation yields
(4.6:4) log V = log r2 + log 7Th.
Again putting r 1 = r 2 and comparing Eqs. 4.6:3 and 4.6:4, we see that
cp(V) = i log V,
/(r) = log r2 = 2 log r,
F(h) = log 7Th = log 7T + log h = 0.497 + log h.
The nomogram is exhibited in Fig. 4.6:f4.

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

The length of the usable portion of the r-scale is

2 0.954
/(15) - /(5) = -r (log 15 - log 5) = -r - ;
2 2

the length of the usable portion of the h-scale is

F(500) _ F(3) = 0.497 + log 500 _ 0.497 + log 3 = 2.222;


r1 r1 r1

hence the lengths of the two scales will be equal if

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.

EXAMPLE 4. Construct a nomogram for K = P/V0-98 for the ranges


5 ~ P ~ 75, 200 ~ V ~ 1000.
We have log K = log P = 0.96 log V; comparing this equation with
4.6:3 (in which we replace x by K, y by P, z by V), we see that

cp(K) = log K,
f(P) =--
Tl + Ta Iogp,
T2

F(V) = -0.96 Tl + Ta log V.


T1

The length of the desired portion of the P-scale is

/(75) - /(5) = Tl + Ta (log 75 -log 5) = 1.18 T1 + T2;


T2 T2
4.6. NOMOGRAPHY 159

that of the V-scale is

F(200) - F(IOOO) = -0.96 r1 + r 2 (log 200 - log 10(0)


r1

= 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

Construct monograms for the following relations and indicated ranges.


t. y= 3.2x1 + 0.54 log w; 0", x '" 2, I '" w '" 1000.
2. s = 3 + 2t - sin A; -5'" t '" 50, -1.5 '" A", 1.5.
1. v = 2zp; -I'" x '" I, I '" P '" 10.
4. V = 1TTlh; 3 '" T ' " 10, I '" h '" 25.
5. w = O.OIIDIP; 0.1'" D '" 2.0, 50", P '" 300.
6. T = Vp/v; 3", P '" 10, I '" v '" 50.
100R
7. S = 10", R '" 30, 70", G '" 90.
130.6 + 0.0794G '
sin ex
8. ,..1 = 10 '" ex '" 90, 0 '" fJ '" 90.
1.026 + sin fJ
9. z = x"; 10", x '" 20, 0.5'" Y '" 2.5.
I
10. t l = ".gl + -I; 100", g '" 300, 2 '" f '" 10.
Vf + 0.6fl

4.7. Nomography. General Theory. We discussed in the preceding


section a method for constructing a three scale nomogram which exhibited
a functional relation of the form

(4.7:1) B(x) = A(y) + C(z).


It is possible to construct nomograms with more than three scales, with
scales on intersecting lines, with scales on curves other than straight
lines, and so on. These various nomograms can be used to exhibit
various types of functional relations of more complicated forms or
involving more variables than the relation above. We do not propose,
however, to discuss these concrete nomograms any further-the interested
reader should consult texts on nomography-but we do wish to devote
this section to an introduction to the general theory of three scale
nomograms based on the use of parametric equations.
Let the three sets of parametric equations

(4.7:2)
x = ft(u), x = f2(V), x = f3(W),
y = gl(U), y = g2(V), y = g3(W),

define three scales, say A, B, C, in the same Cartesian plane. We


assume throughout this section that the x- and y-axes are scaled in the
usual manner by the same linear distance function. Let P:(x 1 , Yl)'
Q: (X2 'Y2)' R: (xa ,Ya) be three points on the respective scales A, B, C,
and let their x, Y coordinates be determined by the respective scale
4.7. NOMOGRAPHY. GENERAL THEORY 161

coordinates u' , v', w'. It is well known that P, Q, and R will be collinear
if and only if

(4.7:3)

hence, if and only if

(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.

Equation 4.7:4 becomes (we drop the primes on u, v, and 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

Multiply through by u1vw, then

(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),

where r1 and r2 are constants. Equation 4.7:4 becomes

l
- r1 F(u)
r2 G(v)
II
I = 0,

or
H(w) I

(4.7:6) H(w) = _r_2-F(u) + _r_l- G(v).


r1 + r2 r1 + r2

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

Fl(U) G1(u) H 1(u) I


(4.7:7) IF (v)
2 G2(v) H 2(v)
F3(W) G3(w) G3(w)

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

is U 2 + uw + v. If we divide the first row of the determinant by -u 2 ,


the second by v, and the third by w, we obtain after an interchange of
columns the determinant in example 2. On the other hand, if we add
the second column of 4.7:8 to the third, and then divide the elements
in the first row by I + u, we obtain the determinant
u2 u
-1+u l+u
(4.7:9) v 0
w 1
The first two columns of this determinant yield the parametric equations
u2
X=--- x = v, X= w,
1 + u'
u
y= y = 0, y=l.
1 + u'
These equations, in turn, yield the three scaled nomogram shown in
Fig. 4.7:f2 which can also be used for the solution of the quadratic
equation 4.7:5.

-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

In changing a determinant from the form 4.7:7 to the form 4.7:9 we


must be careful not to mix the variables; we must, therefore, not add
multiples of one row to another, etc.
H we equate the expansion of the determinant 4.7:7 to zero, we
obtain

(4.7:10) F1(u)[G 2(v) H a(w)-H 2(v)GS(w)] + G (u)[H (v}Fa(w) -F (v)Ha(w)]


1 2 2

+ H (u)[F (v) Ga(w) -


1 2 G2(v)Fa(w)] = O.
If now

(4.7:11) 9'(u, v, w) = 0

is the functional equation for which we wish to construct a nomogram,


the problem of determining appropriate scales becomes the problem of
choosing suitable expressions for the functions in 4.7: 10.
We illustrate a general method by constructing a nomogram for the
functional relation

(4.7:12) f(u) = g(v) h(w) + k(w),


where f(u), g(v), h(w), and k(w) are given expressions. We first rewrite
the given equality in the form

(4.7:13) f(u) - g(v) h(w) - k(w) = 0;

and then ask if it is possible to find a nomogram where the u and v


scales are on parallel lines, say on vertical lines. This requires that
we put

(4.7:14)
F 2(v) = a;

the equality 4.7: 10 then becomes

(4.7:15)

A comparison of this equality with 4.7: 13 suggests that we put either


Gt(u) or Ht(u) equal to f(u) and the other equal to a constant. Since
in the determinant 4.7:7 Ht(u) is in the position of the element which
ultimately becomes a constant, we put

G1(u) = f(u),
(4.7:16)
H 1(u) = b =F o.
166 4. GEOMETRIC METHODS

The equality 4.7: 15 can then be written as

For further guidance, we compare the last equality with 4.7:13. We


will proceed yet another step toward the desired form if we put Hs(v)
equal to a constant, say

(4.7:18)

The equality 4.7:17 can then be rewritten as

(4.7:19)

The road is now clear; we put

(4.7:20)

whence
bF3(w) _ h(w)
CF3(W) - aH3(w) -
(4.7:21)
abG3(w) _ k(w)
CF3(W) - aH3(W) - .

Put H3(W) equal to a nonzero constant,

(4.7:22)

then
adh(w)
F3(W) = ch(w) - b '
(4.7:23)
dk(w)
G3(w) = - ch(w) - b .

The equalities 4.7:14, 16, 18,20,22,23 determine the nine functions of


4.7:7 or 4.7:10. The determinant equation becomes

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

If c =1= 0, the equality can be written as

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

The equality 4.7:25 leads to the parametric equations

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)

with j(u) to be placed in the first row. A few moments of experiment


will yield the determinant

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

The Numerical Solution of


Algebraic and Transcendental Equations in One Unknown;
Arithmetic Methods

5.1. Horner's Method. All of the arithmetic methods of evaluating


the real roots of f(x) = 0 depend directly or indirectly upon the funda-
mental theorem:
If f(x) is single-valued and continuous in the interval a ~ x ~ b,
and if f(a) and f(b) are of unlike signs, then f(x) = 0 has at least one
real root between a and b.
The first algorithmic method to be considered is the well-known
Horner's method. It is very efficient but can only be used to find the
real roots of a polynomial equated to zero. Since the method is described
in detail in all advanced algebra texts, we give it here only in outline
and illustrate with an example. The roots are first located between
successive integers by means of the fundamental theorem; the use of
the graph of the function is highly recommended. If two or more roots
are close together, it may be necessary to locate them between successive
tenths, or hundredths, or thousandths, and so on. If the positive root
r is sought and r is between the integers t and t + I, the given equation
is transformed into a second equation whose roots are those of the
original equation diminished by t; this second equation is transformed
into a third equation whose roots are those of the second equation
multiplied by to. The last equation will have a root r' between 0 and
to such that [r'] (the largest integer not exceeding r') is the tenth's
digit of the original root. The process is continued in the same manner
until as many decimal places as desired are obtained.
It will be noted in forming the successive equations that the coeffi-
cient of x and the constant term soon differ in sign and become numer-
ically large in comparison with the other coefficients. One can then
find the next few decimal places by dividing the constant term by the
negative of the preceding coefficient. Just how many places one can
find correctly in this manner will depend on the number of places
already obtained and the particular equation.
169
170 5. ALGEBRAIC AND TRANSCENDENTAL EQUATIONS IN ONE UNKNOWN

To find the negative root of an equation, find the corresponding


positive root of the associated "negative" equation, f( -x) = O.

EXAMPLE. Find the root between 2 and 3 of the equation

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

1 + 510 + 86700 - 87000 L~

1 + 5100 + 8670000 - 87000000 L~_.


+ 9 + 45981 + 78443829
I + 5109 + 8715981 - 8556171
9 + 46062
1 + 5118 + 8762043
9.765
8762043 I 85561710.000
78858387
67033230
61334301
56989290
52572258
44170320
5.2. THE ROOT-SQUARING METHOD 171

The root is thus found to be 2.7099765-; correct to seven decimal places


it is 2.7099759. The actual value of the root is I + {13.

EXERCISE 5.1

1. Find, correct to three decimal places, the roots of


a. lx 3 - 14x" + 28x - 15 = O.
b. x 3 + 3x" - 4x - 10 = O.
C. x 3 - 6x + Ilx - 5.75 = O.
d. x' - 2x 3 - 4x" + 4x + 4 = O.
e. 3x' - 8x 3 - 18x" + 72x - 80 = O.
2. Find, correct to four decimal places, the real roots of
a. x' - 6x 3 + lx" - 6x + I = O.
b. lx 3 - 6x" - 7x + 23 = O.

5.2. The Root-Squaring Method. Another method for finding the


roots of a polynomial equation is the so-called root squaring method,
a procedure due to Dandelin, Lobachevsky, and Graeffe, each of whom
apparently worked independently of the other two, but the last name
is the one usually associated with the process. The method is not as
efficient as Horner's method for finding the real roots of a polynomial
equation, but can be used to find the imaginary roots or the roots of
an equation with imaginary coefficients. In this method, the given
equation, f(x) = 0, is transformed into another, F(x) = 0, whose roots
are powers of the roots of the given equation; if the roots of F(x) = 0
are sufficiently spread apart, they are readily found from the coefficients
and then the roots of f(x) = 0 are obtained.
Let

(5.2:1)

be the n roots of the equation

(5.2:2)

that is to be solved. We assume that the coefficients bl , b2 , " ' , bn are


real numbers; some modifications are otherwise necessary but these
will be left to the reader. We also assume, without any real loss of
generality, that bn *- O. The fundamental feature and underlying
concept of the method is the derivation of a new equation

(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:6) f(x) = (x - '1)(X - '2) ... (x - Tn),

so that f( -x) = (-x - '1)( -x - '2) ... (-x - Tn), or


(5.2:7) (-I)n f( -x) = (x + '1)(X + '2) ... (x + Tn).
We obtain by multiplying 5.2:6 and 5.2:7 together the equation

(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).

The coefficients in the polynomial g(u) can be obtained directly


from the coefficients of f(x) by noting that f( -x) is also equal to
(-I )n(xn + b1x n- 1 + ... + bn), or that

(5.2:11) (-I)nf(-x) = xn + b1xn- 1 + ... + b...


We obtain by multiplying 5.2:2 and 5.2: II together,

(5.2:12) (-I)n j (x)f( -x) = x2n - (b 12 - 2b2) x2(n-l)


+ (b 22 - 2b1b3 + 2b4) x2(n-2)
=F ... + (-l) n bn2.
We find by comparing this result with 5.2:10 that '1 2, '22, "', 'n 2 are
the roots of the equation

(5.2:13) (-I)n f(x)f( -x) = g(u) = un - ,.un- 1


+ '2Un-2 =F ... + (-I)n'n = 0,
5.2. THE ROOT-SQUARING METHOD 173

where
(5.2:14) i = 1,2, ... , n,

and where bo = 1 and bi = 0 if j < 0 or j > n.


In a similar way we can transform Eq. 5.2:13 into an equation whose
roots are the fourth powers of the original roots, and so on. The mth
transform can then be written in the form 5.2:3. The work is conveniently
arranged as in the table below (illustrated for n = 6):

bo bl b. ba b, b, ba

bo l bsl ba l btl b,s bll


bl
-2bob. -2b l ba -2bab, -2b ab, -2b,b,
2bob, 2b l b, 2b.b,
-2boba

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.

Let the notation for the roots 5.2: 1 be chosen so that


(5.2: 15)

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

(4) 21 98.5 42 0.0625

441 9702.25 1764 0.00390625


-197 -1764 -12.3125
0.125

(8) 244 7938.375 1751.6875 0.00390625

Then, froin 5.2:5,


(S.2:17)

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

It follows from 5.2: 18 that

(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

2[RIR2 ... Rrr-t{l + PL)][R1R2 ... Rk+t(l + P:+i)]


R12R22 ... Rk2(1 + Pk *)2
or

(5.2:23)

where f3* * is a product of f3's.

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

is small compared to Bk 2 This means that in the root squaring process,


all the double cross product terms (in this case) will ultimately become
negligible. We illustrate the process in:

EXAMPLE 2. Find the roots of 2x' + 2x3 - 6x 2 - 4x + 1 = 0 correct


to four decimal places.
A table of values of the polynomial or a rough graph shows that the
roots are approximately r l = -1.9, r2 = 1.5, ra = -0.8, r, = 0.2.
The order of the roots is that of decreasing numerical value; we have
r2/r l = 0: 1 = -0.79, ra/r2 = 0:2 = -0.53, r,/ra = O:a = -0.25, whence
f3l = (0.79)2"', f32 = (0.53)2m, f3a = (0.25)2m.
It is readily shown from 5.2:5 that if ri is calculated from an assumed
value for Ri , the accuracy of ri is as least as great as the accuracy of Ri .
This implies, first, that the work should be carried out using one or
two significant figures more that required in the final answers; and
second, the minimum value of m, in this example, is 6. In actual practice,
one or two significant figures more than required in the final answer are
used and the value of m is not determined beforehand but the calculations
are continued until all double cross products become so small that they
cannot affect the last significant figure desired. The work is shown in the
table on page 177. In the table, a small number in the position usually
reserved for exponents indicates that the base number is to be multi-
plied by the corresponding power of 10; thus, the entry 7.93838 a means
7.93838 X lOa = 7938.38. Also, within a box, the indicator of the
power of 10 is written adjacent to the top number only and is to be
understood for the other co-columnar numbers in the box. An asterisk (*)
indicates a number too small to affect the last significant figure desired.
The beginning of the table is taken from the table prepared for example 1.
We have, from the row marked (64) in the table,
1 rl 164 = Bl = 3.1671 X 1018 ;
hence logl r l 1 = 0.28907 and 1 r l 1 = 1.9457. (We now round off the
numbers to five significant figures and replace the approximation signs
in 5.2:24 by equality signs since presumably the values will be correct
as far as they are written.)
S.2. THE ROOT-SQUARING METHOD 177

(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

(4) 21 98.5 42 0.0625

441 9702.25 1764 0.00390625


-197 -1764 -12.3125
0.125

(8) 2.44 1 7.93838 3 1.75169 3 3.90625 -3

5.95360 ' 6.30179 7 3.06848 8 1.52588 -II

-1.58768 -0.08548 -0.00006


*
(16) 4.36592 ' 6.21631 7 3.068428 1.52588 -II

1.90613 3.86425 111 9.41520 11 2.32831 -10

-0.12433 - 0.00027 *
*
(32) 1.78180 3.86398 111 9.41520 11 2.32831 -10

3.17481 18 1.49303 31 8.86460811 5.42103 -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

(1) -I -27 21 254


I 729 441 64516
54 42 13716 5376
508 256 51192
1896 360
2160
(2) 55 1279 16309 123604

3.02500 00000 1.63584 10000 8 2.6598348100 8 1.52779 48816 10

- 2.55800 00000 -1.7939900000 -3.1617903200 -1.8391594064


0.2472080000 0.62023 28000 0.38201 78592
-0.0298684800 -0.0228808800
0.00023 32800
(4) 4.67000 0000 8.90590 0000 ' 8.84088 1000 8 4.80057 3440 8

2.18089 0000 7.931505481 7.81611 768613 2.30455 0535 17

-1.781180000 -8.257382854 -8.550685400 - 2.40518 0268


0.96011 4688 1.27048 3321 0.30807 4245
-0.034592152 -0.00787 2427
0.000027210
(8) 3.99710 000' 6.34237 315 5.01323455 U 1.99599295 18

1.59768 084 4.02256972 17 2.51325207 26 3.98398 786


- 1.26847463 -4.00767 996 -2.53186642 -3.37188564
0.39919859 0.26884368 0.10517090
-0.00165823 -0.00019 171
0.00000004
(16) 3.2920621 8 4.1408835 18 2.48571 10 ., 7.1708145 31

1.0837673 17 1.7146916 6.1787592 " 5.1420581 83

-0.8281767 -1.6366230 -5.9387015 -3.98900 70


0.14341 63 0.5283019 0.0043634
-0.0001054 OF

*
(32) 2.55590618 2.214849" 7.682542 u 1.15741 5 83
6.532655" 4.905556 8' 5.902145 &6 1.33960 9 U8

-4.429698 -3.92717 I -5.126999 -0.977634


0.231483 0.325249 0.00000 I
* *
*
(64) 2.102957" 1.209868 "' 1.100395 3.61966 u,
a b c d e
j ** k
** ** *
* *
*
5.2. THE ROOT-SQUARING METHOD 179

-128 -948 180 1080


16384 898704 32400 1166400
481584 46080 2047680
7560 548640
58320

563848 1493424 2080080 1166400


3.1792456710 11 2.23031 52438 11 4.32673 28064 11 1.36048 89600 11
-3.6918636019 - 2.34569 78957 -3.4838595072
0.67848 04944 0.2883434112
-0.0298365120

1.360260515 10 1. 72960 7593 11 8.42872 2992 11 1.36048 8960 1.


1.85030 8669 10 2.991542426 7.104337128 1.85093 0210 H

-1.660621655 -2.29305 1816 -4.706224071


0.149034674 0.13062 2543
-0.00242 3276

3.36298412 11 8.29113 153 11 2.39811 306 1.85093 021 II

1.13096 622 al 6.87428 620 la 5.75094 625 18 3.42594 264 18


-0.33098080 -1.61296 323 -3.06926116
0.00240446 0.00738889
-0.00000 235

8.02387 53 a8 5.26871 19 18 2.6816851 18 3.42594 26 18


6.43825 75 77 2.77593 25 87 7.1914350 II 1.17370 83 17

-0.0755619 -0.0430350 -3.6100609


0.00000 13 0.0000005
*

6.362697 77 2.732898 87 3.58137411 1.173708 17

4.048391156 7.46873 1 171 1.28262 4 186 1.377590 1"

-0.000063 -0.000456 -0.641525


* *
*

4.048328156 7.468275 171 6.41099 181 1.377590 I"

f g h
* * m
* *
*
180 5. ALGEBRAIC AND TRANSCENDENTAL EQUATIONS IN ONE UNKNOWN

Since we approximated the roots at the very start, we know the


proper distribution of algebraic signs; we have Tl = -1.9457, T2 = 1.5777,
T3 = -0.8286, T" = 0.1966. Because of rounding off errors and the
predilection toward mistakes, it is advisable to check answers obtained
by the root squaring process. The given answers are correct to all four
decimal places.
Case 2. There are some equalities in 5.2: 15 and hence in 5.2: 17
and 5.2: 19; but we assume that the roots (and coefficients) of the
Eq. 5.2:2 are all real. There are then multiple roots or roots whose
negatives are also roots.
Let us suppose, for example, that

(5.2:25) 1T,_1 1> 1T, 1= 1T,+11 = ... = 1T,+I_ll > 1Tn. I


It can be shown that the approximations 5.2:24 for Bg , Bg+1 , ... , Bg+s- 1
are replaced by the approximations

(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:

EXAMPLE 3. Find the roots of x 8 + x 7 - 27x6 - 21x5 + 254x" +


128x3 - 948x 2 - 180x + 1080 = 0, given that all roots are real.
We rewrite the equation as x 8 - (-I)x7 + (-27)x 6 - 21x5 +
254x" - (-128)x3 + (-948)x 2 - 180x + 1080 = 0 and then evaluate
as in example 2 the entries in the table on pages 178 and 179. The
work was carried out to the 64th power equation although it should
have been carried out further for greater precision. The letters under-
neath the coefficients of the 64th power equation indicate entries that
would appear in all further tabulations; the single asterisks (*) indicate
entries that have already become negligible or will become negligible
at the next step; the double asterisks (**) indicate entries that will
ultimately become negligible. In view of the discussion just above, it
5.2. THE ROOT-SQUARING METHOD 181

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

R12 = B2 = 1.2099 X 1084 ,


3R12R2 = B3 = 1.1004 X 1095 ,
3R12R22 = B4 = 3.6197 X 10125 ,
R 12R23 = B5 = 4.0483 X 10155 ,
R 12R23R3 = Be = 7.4683 X 10174 ,
2R12R23R3R4 = B7 = 6.4110 X 10184 ,
R12R23R3R42 = B8 = 1.3776 X 10194
Hence

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

can be obtained first. We may then suppose that the equation to be


solved has no multiple roots. Let us assume further that no imaginary
root has the same absolute value as any other root except, of course,
as its conjugate which must also be a root. Let rf/ be an imaginary root
and rf/+l its conjugate, and let rand 0 be the modulus and amplitude,
respectively, of rf/' so that I rf/ I = I rf/+l I = rand rf/rf/+l = r2. It
follows that
R, + RHI = 2r2m cos 2mB,
(5.2:27)
R,R'+1 = r2m+!;

and it can be shown that in place of the approximation for Bf/ given
by 5.2:24, we have

(5.2:28)

Hence, again using equalities in place of approximations,

(5.2:29) R, + R'+1 = B,/B'_l'


R,R'+1 = B,+1/B,-l'

so that Rf/ and Rf/+l are the roots of the equation

(5.2:30)

The existence of imaginary roots is readily determined from the


root squaring tabulations. As in the case of real roots with equal absolute
values, the cross product term 2Bf/- 1Bf/+l does not become negligible
in comparison with Bf/2 since by a line of reasoning similar to the
previous one it can be shown that its absolute value is approximately
equal to Bf/2/2 cos 2 2mO. Hence, as before, the nonvanishing double cross
product points to the presence of two roots with equal absolute values.
To distinguish the present case from the one in which the two roots
are equal, we note that if all the roots of f(x) = 0 are real, the roots
of the very first transformed equation as well as the roots of all the
later equations are positive. Hence, by Descartes' Rule of Signs, the
actual coefficients of all the transformed equations must alternate in
sign and therefore, in view of our notation, all the coefficients of the
transformed equations that appear in the tabulations must be positive.
The appearance then of one or more negative coefficients in the equations
in the table whose roots are the second, fourth, eighth, ... , powers of
the original roots would immediately indicate the presence of imaginary
roots.
5.2. THE ROOT-SQUARING METHOD 183

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.

EXAMPLE 4. Find the roots of X4 - 5xa + 8x 2 - 3x - 3 = O.


The root squaring tabulations are shown on page 184. We stop at the
64th power equation because after that point all coefficients with the
exception of the coefficients of x 2 will be merely the squares of the
previous corresponding coefficients. The appearance of negative signs
in the coefficients of x 2 indicates the presence of imaginary conjugate
roots.
We have R t = I Tl 164 = 3.1451 X 1024 ; whence 10g1 Tl I = 0.38278
and I Tl I = 2.4142. Next, since T2 and Ta are apparently imaginary roots,
we put I T2 I = I Ta I = T and we have, using 5.2:29,

R2R3 = I T2Ta l84 = (T2)84 = 1.0800 x 1055/3.1451 X 1024 ;


log T2 = 0.47712 and T2 = 3.0000.
Finally,
RIR2R3R4 = I TIT2Tal 84 I T, 18' = 3.4337 x 1()30;
log I T41 = 9.61722 - 10, I T41 = 0.4142.
A graph or substitution into the original equation shows that the
two real roots are Tl = 2.4142, T4 = -0.4142. If we put T2 = u + iv,
Ta = u - iv, then

Tl + T2 + T3 + T4 = 5 = 2.4142 + (u + iv) + (u - if) - 0.4142,

so that u = 1.5000. Then v = V;! - u2 = Y3-~ 2.25 = 0.8660 and


T2 = 1.5000 + 0.8660i, Ta = 1.5000 - 0.8660i. The roots are correct
as far as they are written; the roots are actually 1 y2, (3 Y3t)/2.
The present method can be extended to cover the cases where the
given equation has several sets of roots, real or imaginary, with repeated
absolute values. The details of recognition and computation are left to
the reader.
Real or imaginary roots can also be found by the methods to be
discussed in the succeeding sections.
184 5. ALGEBRAIC AND TRANSCENDENTAL EQUATIONS IN ONE UNKNOWN

(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

4.48 -13.7250 0.03629


0.0162
(8) 1.073 3 -8.6912 ' 7.57132 8 6.561 3

1.15133 8 7.55370 5.7324913 4.30467 7

0.17382 -16.24805 0.00011


0.00001
(16) 1.32515 I -8.69434 5.73260 13 4.30467 7

1.75602 11 7.55915 11 3.28627 17 1.85302 16

0.01739 -15.19311 *
*
(32) 1. 77341 11 -7.63396 11 3.28627 17 1.85302 16

3.14498 II 5.82773 31 1.07996 I i 3.43368 30

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

5.3. The Method of Iteration. The method of iteration for finding


the roots of an equation, unlike Horner's and the root-squaring methods,
applies not only to polynomial equations but to equations of all types.
In its pure form, an approximation to a root of an equation f(x) = 0
is substituted into a suitably chosen function 9'(x) to yield a better
approximation, the latter is substituted into 9'(x) to yield a still better
approximation, and so on until a result is obtained of satisfactory
precision. Modifications of the pure form of the method will also be
discussed. The process when properly used is usually very efficient
and is well suited for computation on high speed machines.
The method owes its validity to the following two theorems.

THEOREM 1. Let 9'(x) be a single-valued function and ro an arbitrary


constant. Let the sequence of constants
(5.3:1)
be defined by the recursion formula
(5.3:2) n = 0, 1,2, ....

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) ,

that is, r is a root of the equation


(5.3:4) x = 9'(x).

The proof follows readily enough. Since 9'(x) is continuous at x = r,


it is true that for any sequence such as 5.3: I which approaches r, the
associated sequence 9'(ro), 9'(r1), 9'(r 2 ), " ' , will approach 9'(r). Since the
latter sequence is identical with the sequence 5.3: I minus its first term
in virtue of the definition 5.3:2, the two limits are equal or r = 9'(r).
Theorem I is of consequence only if criteria or conditions are given
which will assure the convergence of the sequence 5.3: I. A sufficient
condition for convergence is furnished by the next theorem.

THEOREM 2. A sufficient condition for the convergence of the sequence


5.3:1 is that the derivative 9"(x) and a constant m exist such that the
double inequality
(5.3:5) I 9"(x) I < m < 1
holds for all x's.
186 S. ALGEBRAIC AND TRANSCENDENTAL EQUATIONS IN ONE UNKNOWN

The proof of this theorem is also immediate. Definition 5.3:2 yields


for any positive integers nand k, Tn - Tn+k = 91(Tn - 1 ) - 91(Tn +k-l).
Since 91'(x) exists, it follows from the Law of the Mean that
91(Tn - 1) - 91(Tn+k-l) = (T n - 1 - Tn +k-l)91'(S), where s is between Tn - 1 and
Tn +k-l. Furthermore, from 5.3:5,

I Tn-l - Tn+k-l I <p'(s) ~ I Tn-l - Tn+k-l I m,


where the equality holds only if Tn - 1 = Tn+k-l . Consequently,

(5.3:6)

Similarly, I Tn - 1 - I ::::;; I Tn - 2 - Tn+k-2 1m, hence I Tn - Tn+k I ::::;;


Tn+k-l
I Tn - 2 - If we continue the reduction of the subscripts on
Tn +k_2Im 2 .
the right, we find after n steps that

(5.3:7) n = 1,2,3, ....


Since To - Tk is a constant and 0 < m < 1, the right-hand member
of the last inequality can be made arbitrarily small by taking n large
enough; hence the left member can be made arbitrarily small. It follows
from a well-known theorem on sequences that the sequence 5.3: 1 will
then converge which is what we wanted to prove.

REMARK. If T = 91(T) and TO is any (real) number, the condition that


5.3:5 hold for all x's can be replaced by the weaker condition

(5.3:8) I <p'(x) I < m < 1 for Ix - T I ~ I To - T I,


to assure convergence of the sequence To, Tl , T2 , . , to T.
In 5.3:7, let k tend infinity, then

(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: 12) x = x - gf(x),

where g is an arbitrary nonzero constant, and

(5.3:13) x = x - g(x)/(x),

where g(x) is an arbitrary function of x which exists but is not equal


to zero in N r Then not only is r a root of either equation, but is, in
N r , the only root of either equation. If 9'(x) = x - gf(x), then
9"(x) = I - gf'(x) [we assume that f(x) is differentiable]. Since r is
known approximatelY,f'(r) will be known approximately, and hence if
g is chosen approximately equal to I/f'(r), 9'(x) will satisfy 5.3:8.
Similarly, if 9'(x) = x - g(x) f(x) , then 9"(x) = I - g(x) f'(x) - g'(x)f(x).
Since for x close to r, f(x) is close to zero, 5.3:8 will hold if g(x) = I/f'(x).
Summing up, the right-hand members of

(5.3:14) x = x _ I(x)
f'
and
I(x)
(5.3:15) x = x - f'(x)

will be suitable forms for iteration if I' is a constant close to f'(r).

EXAMPLE I. Find the real root of x3 - 3x2 + 12x - 24 = 0 correct


to four decimal places.

Solution I. It is readily ascertained that the only real root is between


2 and 3. The "average" slope of f(x) = x3 - 3x2 + 12x - 24 in this
interval is (/(3) - f(2/(3 - 2) = 16, or we can take the value of
1U'(2) + 1'(3 = 16.5. If we take I' = 16 in 5.3:14, then 9'(x) =
x - la(x3 - 3x2 + 12x - 24). Start with ro = 2; then r 1 = 9'(2) = 2.25,
r2 = 9'(2.25) = 2.30, r3 = 9'(2.30) = 2.306, r, = 9'(2.306) = 2.3071,
r6 = 9'(2.3071) = 2.3073. Further substitution produces no change in
the fourth decimal place; hence 2.3073 is the required root correct to
four decimal places.
188 5. ALGEBRAIC AND TRANSCENDENTAL EQUATIONS IN ONE UNKNOWN

Solution 2. Use 5.3: 15, then


x3 - 3x2 + 12x - 24 ixS - x 2 + 4x - 8
9'(x) = x- 3X2 _ 6x + 12 = x- x2 - 2x + 4

Again start with ro = 2; then r 1 = 9'(2) = 2.33, r 2 = 9'(2.33) = 2.307,


ra = 9'(2.307) = 2.3073, with no further change, as before.

EXAMPLE 2. Find the larger root of the equation f(x) = x 2 - 3.6


logloX - 2.7 = 0, correct to four decimal places (assume 3.6 and 2.7
are exact numbers).
Solution 1. It can be ascertained from a graph, or otherwise, that
the equation has two real roots, one between 0.1 and 0.2 and the other,
the desired root, between 1.9 and 2. From

f'(x) = 2x _ 3.61og e ,
x

we obtainf'(2) = 3.2. We use 5.3:14 to get

( )_ x2 - 3.61og x - 2.7 .
9' x - x - 3.2 '

whence, if we start with ro = 2, we find r 1 = 1.93, r2 = 1.9310. Further


substitution produces no change in the fourth decimal place of the root.
Solution 2. Forms other than those derived from 5.3:14 or 5.3:15 can
be used for iteration. For example, the given equation can be solved for
x 2 and then both sides divided by x to yield x = (3.6 log x + 2.7)/x,
whence 9'(x) = (3.61ogx + 2.7)/x and 9"(2) = -0.6. Hence 9'(x) is
suitable for iteration; again beginning with ro = 2, we find r 1 = 1.9,
r 2 = 1.95, ra = 1.92, r, = 1.94, rs = 1.93, r6 = 1.932, r7 = 1.931,
r8 = 1.9310.
Reference to 5.3:8, 9 explains why the rate of convergence is much
more rapid in solution 1 than in solution 2. In the first case, I 9"(x) I ~ 0.05
in the neighborhood of the root; in the second, I 9" (x) I ~ 0.6.

REMARK 1. It should be borne in mind that the most suitable form


for 9'(x) depends not only on the rate of convergence to the root but
also on the ease with which the computations can be made. In turn,
some computational forms may be most efficient when all calculations
are made long-hand, other forms may be more suitable when slide
rules or desk calculators are used. Still other forms may be advisable
for high speed electronic calculators.
5.3. THE METHOD OF ITERATION 189

REMARK 2. The method of iteration has one very pleasing aspect. If


in the calculation of Tk , say, an arithmetic mistake is made and Tk' is
obtained instead, no great harm is done provided that Tk' is close enough
to the root so that the condition 5.3:8 holds. Since a large mistake would
be immediately obvious and corrected, mistakes in general merely
change the rate of convergence to the root.

REMARK 3. The method of iteration based on formula 5.3: 15 is known


as the Newton-Raphson method. The formula itself can be otherwise
derived and interpreted. Consider, for example, the graph of y = f(x)
in the neighborhood of a root T of f(x) = 0, Fig. 5.3:1. Suppose, as in

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

the same as the problem of finding the abscissa of an intersection point


of y = x and y = cp(x). See Fig. 5.3:f3. If R is an intersection point
of the graphs of y = x and y = cp(x) and Ro , RI , R2 , "', SI' S2' "',
are on the graphs of y = cp(x) and y = x, respectively, and if
RoSI , R I S2 , "', SIRI , S2RS , "', are parallel and perpendicular, re-

y=x

--~~-----------------x

FIG. S.3:f3.

spectively, to the x-axis, then if 5.3:8 holds, the abscissas of R o, R I , R s, ...


will approach T, the abscissa of R.
If the equationf(x) = 0 has more than one real root, or, in particular,
if it has several real roots that are close together, these geometric
considerations will indicate a suitable choice for TO so that the iteration
will yield the desired root.

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)

11. logloX = 1 + -x1 . (2 dp)

12. Xl - 2x - logloX = O. (3 dp)


5.3. THE METHOD OF ITERATION 191

13. Xl(lOglOX - = 1. I) (3 dp)


14. Xl + logloX -
4 = O. (4 dp)
15. 10.311oglo T + O.OOIT = 34.31. (3 dp)
16. x" + 2x = 6. (3 dp)
17. I + loglox = sin x. (3 dp)
18. 11 sin x = lOx. (3 dp)

19. x + -xI =
.
3 sm x. (3 dp)

20. lOuin! = 1. (3 dp)


x
21. x + tan x - 2 = O. (3 dp)

n. x sinh 10 - 15 = O.
x
(3 dp)

23. tan x + tanh x = O. (3 dp)


980.56
24. x tanh - - - = a, for a = 401.75 and 970.23. (4 sf)
x
Xl + I
25. e llnz - - - - = O. (5 sf)
x+2
26. eZ cos 2x + e-Z sin 2x = x. (4 dp)
27. Find the roots of the equations in problems 10 and 15 to as many significant figures
as are warranted if the three decimal numbers in each equation are correct only as far as
written.
21. Find the minimum value of V2x + 3 + e-Z correct to three decimal places.
29. Find the turning points with positive abscissas less than 2,. of sin x el/z and sin l x el/z
correct to three decimal places.
30. If,o is an approximation to a root, of x = F(x), andF'(,o) *"
I, then
F(x) - xF'(,o)
'I'(x) = I - F'(,o)
is suitable for iteration to the root,.
31. If,o is an approximation to a root' of x = F(x), and F'(x) *"
I in a neighborhood
of, (which includes '0), then
F(x) - xF'(x)
'I'(x) = I - F'(x)
is suitable for iteration to the root,.
32. Derive 5.3:15 from the finite Taylor expansionf(x + h) = f(x) + hf'(x) + hIR(x).
33. If,o is an approximation to a root, of f(x) = 0, prove that
f(x)
'I'(x) = x - - -
f'(x)
is suitable for iteration if [J'(x)I > f(x) f"(x) > 0 for all x's between, and '0 .
34. If a > 0, prove that
'I'(x) = !n (n - I) x + _a_)
X"-l

is suitable for iteration to yield a l/ft ; in particular


a. tp(x) = x(2 - ax) is suitable for I/a;
b. cp(x) = 1[x + (a/x)] is suitable for Va.
c. Find by iteration, correct to four decimal places, (i) t (ii) v'1Q.3 (iii) {/4.2-:-
192 5. ALGEBRAIC AND TRANSCENDENTAL EQUATIONS IN ONE UNKNOWN

5.4. The Method of False Position (Regula Falsi); The Method of


Chords. Another method of wide application for finding an isolated
root r of an equation f(x) = 0 is the method of false position or regula
falsi. The method which is essentially nothing but inverse linear inter-
polation and is related to the method of iteration, as we shall see, does
not involve directly the concept of slope and hence can be used if f(x)
fails to have a derivative at r or in some neighborhood of r.
Let a < r < b, and suppose that r is the only root in the closed
interval [a, b]; then f(c) has the same sign as f(a) if c is in the "left
interval" or "left neighborhood" [a, r) and the same sign as f(b) if c
is in the "right interval" or "right neighborhood" (r, b]. Suppose now
that f(a) and f(b) have opposite signs so that the graph of y = f(x)
actually crosses the x-axis at a point R whose abscissa is r. The root r
is approximated by the abscissa ro of the intersection point Ro of the
x-axis and the chord joining the points A: (a,f(a)) and B: (b,j(b)).
See Fig. 5.4:fl. It is readily found that

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

An example will illustrate the method and the manner in which it


can be judiciously modified.

EXAMPLE I. Find the positive root of {IX--=-l - cos x = 0 correct to


five significant figures.

Solution 1. It is readily determined that there is only one positive


root and that it is slightly greater than unity. We have f(l) = -0.54,
f(1.2) = 0.22; hence the root is between a = I and b = 1.2. We use
5.4: 1 or 5.4:2 and find '0= 1.1. Since f(l.l) = 0.01, we regard 1.1 as
a new b; using the new b and the old a = I, we find '1= 1.098. Since
f(1.098) = 0.00566, 1.098 is also a new b. We continue in this fashion-
it will take quite a number of additional steps-to get the answer 1.0957
correct to five significant figures. Note that as the work proceeds, we will
need more and more significant figures in the values of f(x).

Solution 2. The preceding method of solution is poor on two counts,


the rate of convergence to the root is quite slow and the length of the
interval within which the root is known to lie does not become arbitrarily
small so that we do not have a good measure of the precision of the
approximation at any step. To overcome these defects, we proceed as
follows. Take, as before, a = I, b = 1.2 to find '0
= 1.1. Since
f( 1.1) = 0.0 I, the root is between 1.00 and 1.10 and probably closer
to 1.1. As a conservative guess, take the new a = 1.06 and the new
b = 1.10. Using these values, we obtain the approximation '1 = 1.096.
Since f( 1.096) = 0.00073, 1.096 is a new b and we choose 1.095 as a
new a. Since f(1.095) = -0.00176, 1.095 is indeed a new a. If it had
turned out that f( 1.095) were positive, 1.095 would have been a new
and better b than 1.096. Another step yields f(1.0957) = -0.00001,
f(1.0958) = 0.00023. Hence, not only is the root between 1.0957 and
1.0958, but the former is certainly correct to five significant figures.
If in the right-hand member of 5.4: I or 5.4:2 we replace a by x to
obtain

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

REMARK. To pave the way for a later generalization, rewrite 5.4: I as


f(b) f(a)
(5.4:4) '0 = a f(b) _ f(a) + b f(b) - f(a) .
Put
f(b) f(a)
(5.4:5) =
ml f(b) - f(a) , m2 = f(a) - f(b)'
so that
(5.4:6)
and
(5.4:7)

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

(5.4:9) h = b_ a G(a) - g(a)


( ) G(a) - g(a) + g(b) - G(b)

EXAMPLE 2. Find the real root of (x + 1) 10gIO x = 1, correct to four


decimal places.
The given equation is put into the form log x = Ij(x 1), and we +
set G(x) = 1j(x +
1), g(x) = log x. The root T is clearly greater than
unity (since otherwise the left-hand member of the given equation will
be negative or imaginary); since G(I) = 0.5, g(l) = 0, G(x) > g(x)
for x < T. The computations below are self-explanatory.

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

2.1 0.3226 0.3222


2.2 0.3125 0.3424

0.3226 - 0.3222 000 3


h = (2.2 - 2.1) = . I
0.3226 - 0.3222 + 0.3424 - 0.3125

2.1013 0.32244 0.32249


2.1012 0.32245 0.32247
2.1011 0.32247 0.32245
2.10115 0.322461 0.322457

Hence, the root is 2.1012 correct to four decimal places.

EXERCISE 5.4

1. Do the indicated examples by the method of false position or by the method of


chords; the numbers refer to the examples of Exercise 5.3.
a. 1 b. 2 c. 5 d. 6 e. 7 f. 8 I. 9 h. 10
I. II j. 13 k. 17 I. 18 m. 19 n. 21 o. 25.
196 5. ALGEBRAIC AND TRANSCENDENTAL EQUATIONS IN ONE UNKNOWN

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)

5.5. Imaginary Roots. Some of the methods described in Sec-


tions 5.3 and 5.4 for the determination of real roots are applicable with
little or no modification to the determination of imaginary roots. For
example, the method of iteration, of which the Newton-Raphson
method is a special case, is particularly suited for the computational
process. We illustrate the method by working:

EXAMPLE 1. Find the imaginary roots of


f(x) = x4 - 5x3 + 8x2 - 3x - 3 = O.
It is readily ascertained by Descartes' Rule of Signs and by substitution
that the equation has two real and two imaginary roots. Since /(2) = -1,
/(3) = 6; /( -I) = 14, /(0) = - 3; it appears that the real roots are
approximately 2.2 and -0.2. The sum and product of the real roots
are approximately 2 and -0.44, respectively; since the sum and product
of all four roots are 5 and -3, respectively, the sum and product of
the imaginary conjugate roots are approximately 3 and 6.8, respectively.
It follows that the imaginary roots are approximately 1.5 2i.
Since f'(x) = 4x3 - 15x2 + 16x - 3, the Newton-Raphson formula
for iteration becomes
44 - 5x3 + 8x2 - 3x - 3
x = x - _:--=---:-::---=--::--::-----::--
4x3 - 15x2 + 16x - 3
We start with To = 1.5 + 2i and find by successive substitutions in
the right-hand member of the preceding equation, Tl = 1.5 + 1.5i,
T2 = 1.5 + I.li, T3 = 1.5 + 0.9i, T4 = 1.50 + 0.86i, etc. The root
was previously found to be i(3 + V3i).
Another method that can be used is an adaptation of the method of
chords; it is the generalization referred to in the Remark of the preceding
section. Let T be an isolated imaginary root of the equation
(5.5:1) f(x) = o.
Suppose that by trial or otherwise we locate three numbers
(5.5:2)
5.5. IMAGINARY ROOTS 197

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.

Now, if the points f(r 1)'/(r2)'/(ra), are given numerical weights or


masses, positive, negative, or zero, m 1 , m 2 , ma , respectively, then the
center of gravity of the triangle is a + f3i, where

f3 + m2f32 + m3f33 .
= m1f31
m1 +m2 +m3
198 s. ALGEBRAIC AND TRANSCENDENTAL EQUATIONS IN ONE UNKNOWN

If, on the other hand, we put ex = fJ = 0, and ml + m + ma


2 = 1, then

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

we have /(1.45 + 0.77i) = -0.33 + 0.27i. We evaluate next


(1.48+ 0.80i) = -0.25 + 0.16i,/( 1.50 + 0.90i) = 0.15 - 0.07i. Again
we compute the m's:

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

1. Do examples 2, 3, 4 of Exercise 5.2 by the methods of Sections 5.3-5.


Chapter 6

The Numerical Solution of


Simultaneous Algebraic and Transcendental Equations

6.1. Introduction. In the present chapter we consider various


methods of finding the real solutions of a system of n equations in n
unknowns. The discussion will be limited, except for the linear case,
to the value n = 2 but generalizations for greater values of n will be
outlined.
The first and most obvious method of solving n simultaneous equations
in n unknowns is the method in which the problem is reduced to the
solution of one equation in one unknown, that is, to the type of problem
investigated. in the preceding two chapters. As an illustration of the
method, we do:

EXAMPLE 1. Find the real solutions of the pair of simultaneous equa-


tions
f(x,y) = x3 + 2y2 - 50 = 0,
g(x,y) = x - y + IOglO(XY + 1) = O.
Whatever method we employ for the solution, we will find it convenient
to graph the two functions on the same coordinate axes; the graphs
are shown in Fig. 6.1 :fl. The real solutions are, of course, the coordinates
of the points of intersection of the two curves. It appears that there are
three real solutions, approximately x = 0.3, Y = -4.9; x = 2.7,
Y = 3.6; x = 3.6, Y = -0.2.
We obtain, on solving the first equation for y in terms of x,

whence, by substitution into the second equation,

x ~ ~50 ~ x3 + log ( x~50 ~ x3 + 1) = O.


200
6.1. INTRODUCTION 201

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

,,, - - I09'O(IIY + I) + (11- y) =0

,I
I
-15

I
I
I -20

FIG. 6.1 :fl.

The solution with positive y is found from the equation obtained by


taking the upper signs; the two solutions with negative y's are found
by taking the lower signs.
We obtain the solution with positive y first. We rewrite the corre-
sponding equation in the form

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)

2.7 19.683 15.159 3.89 11.503 1.06 2.83


2.8 21.952 14.048 3.75 11.500 1.06 2.69
202 6. SIMULTANEOUS ALGEBRAIC AND TRANSCENDENTAL EQUATIONS

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

By the method of iteration, we find the root to four decimal places to


be x = 2.7541, whence y = 3.8151. The work is shown partially in
the tabulations below.

II III IV V VI VII

50 - Xl (IV) -(VI)+ 1.4x


x
2
x(IV) + I log (V)
2.4

2.75 20.796875 14.601563 3.82120 11.5083 1.06101 2.7542


2.754 20.887757 14.556122 3.81525 11.50719 1.06097 2.7541
2.7541 20.890033 14.554983 3.81510 11.50716 1.06097 2.75411
2.75411 20.890260 14.554870 3.81508 11.50716 1.06097 2.75411

We determine next the two solutions with negative y. This time


it is necessary to solve the equation

X= - ' \ /
Iso -2 x3 (
-log l-x,\/
/ SO -2 x3 ) .

We examine first the logarithmic argument

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

abruptly at the point x = {ISO = 3.684, z = 1. The logarithm of a


negative argument is imaginary, hence one of the desired roots is
between 0 and 0.20005 and the other is between 3.6803 and 3.6840.
By methods similar to the ones used above, we find that the solutions
are x = 0.2000147,y = -4.9995999; x = 3.6804025,y= -0.2716742.
This method can be extended in an obvious fashion for the solution
of three or more simultaneous equations in the corresponding number
of unknowns.

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.

6.2. The Method of Iteration. This method lends itself to the


solution of n simultaneous equations in n unknowns; we explain it for
the case of two equations. Let

(6.2:1) f(x,y) = 0, g(x,y) = 0,

be a pair of equations for which a common solution IS sought.


204 6. SIMULTANEOUS ALGEBRAIC AND TRANSCENDENTAL EQUATIONS

We rewrite them in the forms

(6.2:2) x = F(x,y), y = G(x,y),

respectively. Now if

(6.2:3) x = xo , y =Yo,

is an approximation to a solution, we determine a second approximation

(6.2:4) Y =Y1,

from the equations

(6.2:5)

and then a third approximation

Y =Y2'

by means of the equations

In general, an (n + l)st approximation


(6.2:6) x = x.. , Y=Y.. ,

is obtained from the nth approximation by means of the equations

(6.2:7) x.. = F(X.._1 , Yn-1)' Yn = G(Xn_1 , Yn-1)'

Our first problem is to determine the circumstances under which


these approximations converge to the solution

(6.2:8) x = T, Y = s,
that we are trying to find of Eqs. 6.2: 1. We have

(6.2:9) T = F(T, s), s = G(T, s),

and therefore

(6.2:10) T - Xl = F(T, s) - F(xo ,Yo), s - Y1 = G(T, s) - G(xo , Yo).


6.2. THE METHOD OF ITERATION 205

Now, by the Law of the Mean for functions of two variables,

F(r, s) - F(xo ,Yo) = (r - xo)F.,(t, u)+ (s - Yo)F (t, u),


lI

G(r, s) - G(xo ,Yo) = (r - xo) G.,(v, w) + (s - Yo) Giv, w),

where

t = Xo + 8(r - xo), u = Yo + 8(s - Yo); 0< 8 < 1;


v = Xo + 8'(r - xo), w = Yo + 8'(s - Yo); 0<8'<1.

It follows that

I r-xil + I s-Yll = I (r-xo)F., + (s-YO)F II I + I (r-xO) G., + (S-YO) Gil I


::;;; I (r-xo)F., I + I (S-Yo)FIII + I (r-xO) G.,I + I(s-Yo) Gil I
(6.2:11) ::;;; Ir - Xo I {IF., I + I G., I} + Is - Yo I {I FII I + I Gil I}.

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,

(6.2:14) Ir - Xi+l I + I s - Yi+l I ::;;; {I r - Xi I + I s - Yi I} M,


provided that we remain within the region R. Multiply the inequality
6.2: 13 by the inequalities 6.2: 14 for i = I, 2, ... , n - I; and then
divide out the factor common to the two sides; we get

(6.2:15) I r - X" I + Is - y" I ::;;; {I r - Xo I + Is - Yo I} M".


The left-hand side is the sum of the errors of the (n + I)st approxima-
tion to the solution 6.2:8; the first factor on the right-hand side is a
constant and the second factor approaches zero with increasing n;
hence if condition 6.2: 12 is satisfied, the successive approximations
will converge to the solution 6.2:8. (Compare this derivation with the
one in Section 5.3 for one equation in one unknown.)
If Eqs. 6.2: I are written haphazardly in the forms 6.2:2, the condi-
tions 6.2: 12 will ordinarily not be satisfied. To learn how to rewrite
206 6. SIMULTANEOUS ALGEBRAIC AND TRANSCENDENTAL EQUATIONS

the original equations in forms suitable for iteration, we follow the


lines indicated in Section 5.3 that stem from the equalities 5.3:12 and
5.3: 13. Consider the equations

x = x - a(x, y)/(x, y) - b(x,y)g(x,y) = F(x,y),


(6.2:16)
y = y - e(x,y)f(x,y) - d(x,y)g(x,y) = G(x,y),

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

Frz = 1 - alrz - bgrz - arzl - brzK,


F" = - al" - bg" - alii - b"g,
(6.2:17)
Grz = - elrz - dgrz - erzl - drzK,
G" = 1 - elll - dg" - e,,1 - d"g,
where the arguments x and y where dropped for the sake of simplicity.
Delete the last two terms of the right-hand members of each of the
preceding equations (note that these terms automatically drop out
if a(x, y), h(x, y), c(x, y), and d(x, y) are constants), set the truncated
equations equal to zero, and solve for a, h, c, and d. We find

a(x y) = gix,y) b(x y) = -I,,(x,y)


, .:1(x,y) , , .:1(x,y) ,
(6.2:18)
e(x y) = -gix , y) d(x y) = Irz(x, y)
, .:1(x,y) ' , .:1(x,y) '
where

(6.2:19) .:1(x y) = I/ix,y) grz(x,y)


' I,,(x, y) g,,(x, y) ,
I
whence we obtain by substitution into 6.2: 17,

Frz = Ad(x,y) + BtK(x,y),


F" = Ad(x, y) + Bzg(x, y),
(6.2:20)
Grz = Cd(x,y) + D1g(x,y),
G" = C2/(x,y) + D2K(x,y),
where the capital letters represent functions of x and y involving the
first and second partial derivatives of f and g. The precise forms of
these functions can be easily obtained but are not given here. If, however,
6.2. THE METHOD OF ITERATION 207

these functions exist and are bounded in the neighborhood of the


solution x = r, y = s of Eqs. 6.2: I, then it follows at once from
the equalities 6.2:20 that the partial derivatives Px , P'II' Ox, and 0'11
will surely satisfy the inequalities 6.2: 12.
To sum up: if Eqs. 6.2: I are written as

x = x - .1(:,y) [gll(x,y)f(x,y) -/II(x,y)g(x,y)],


(6.2:21)
1
y = Y + .1(x,y) [g..(x,y)/(x,y) - I..(x,y)g(x,y)],

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)].

Theoretically, the forms 6.2:21 will lead to a more rapid convergence


than the forms 6.2:22, but the far greater simplicity of the latter usually
make them preferable for computational purposes. We illustrate the
use of Eqs. 6.2:22 by doing:

EXAMPLE I. Find the real solutions of

I(x, y) = 4x2 - 5xy + 3y2 + 7x - 4y - 55 = 0,


g(x, y) = e"'l/ - x - y = O.
The graphs of these equations are shown in Fig. 6.2:fl; from them
we see that the solutions are approximately x = - 2.6, y = 2.6;
x = 0.3, y = 5.2; x = 1.7, y = -1.6; x = 3.2, y = 0.4. We have

I", = 8x - 5y + 7, II/ = -5x + 6y - 4,


g",=ye"'I/-1, gl/ = xe"'U - 1.
Put
208 6. SIMULTANEOUS ALGEBRAIC AND TRANSCENDENTAL EQUATIONS

then 6.2:21 can be put into the form

(6.2:23)
.12
Y=Y+Lf

We find the fourth solution, correct to five decimal places. We sub-


stitute the values Xo = 3.2, Yo = 0.4 into the right-hand members of
6.2:23 and obtain Xl = 3.163, Yl = 0.401. After two more substitutions,
we find X = 3.17328, Y = 0.40144.

10

,.--....,
~ , 1
I
I
I
-10 5 10 I
----L-----~/~----~~7=~===-~-----x
I
I
I
I
I
: ",/ -5
" .... _-",.,.

-10

----- 4x 2 -5xy + 3y2 + 7x-4y -55: 0


- - - eXY: x +y

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

1. Do example I of Exercise 6.1 by the method of iteration.


2. Complete the illustrative example of this section.
6.3. THE METHOD OF CHORDS 209

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. The Method of Chords. The next method IS an adaptation


of the method of chords of Section 5.4. Let

(6.3: I) f(X,y) = 0, g(X,y) = 0,

be the equations to be solved; we suppose that in the neighborhood of


a solution (r, s) the functions f(x, y) and g(x, y) are continuous and if
solved for y, say, are single-valued functions of x. From a graph or
otherwise we determine a pair of numbers Xl and x 2 close to r such that

(6.3:2)

We substitute Xl and X 2 into the first of the equations to be solved and


determine the corresponding y's, YI and Y2 . Similarly, by substituting
Xl and x 2 into the second equation we determine the pair YI and Y 2
The chord joining the points (Xl' YI) and (X 2 , Y2) will intersect the
chord joining the points (Xl' Y I) and (X 2 , Y 2 ) in a point whose coordi-
nates are fairly close to the desired solution. If greater accuracy is
desired, the process can be repeated; the abscissa of the point just
found is chosen as the new Xl or X 2 depending in whether it is smaller
or larger than the abscissa of the solution. Which it is can be determined
by a comparison of ordinates. It follows that the abscissa of the point
of intersection is given by

(6.3:3) x' = Xl + h,
where

(6.3:4)

Compare formulas 5.4:8 and 5.4:9.


We illustrate the use of the method by finding one solution of the
illustrative example of Section 6.1. We begin by taking Xl = 2.7. We then
find YI = 3.89 by solving the equationf(2.7, y) = (2.7)3 + 2y2 - 50 = 0
for Y, and YI = 3.75 by solving the equation g(2.7, y) = 2.7 - Y +
log(2.7y + 1) = 0 for y. Similarly, we take X 2 = 2.8 and findY2 = 3.75
210 6. SIMULTANEOUS ALGEBRAIC AND TRANSCENDENTAL EQUATIONS

and Y 2 = 3.87. Since Yl > Y 1 and Y2 < Y 2 , the abscissa r of the


solution satisfies the inequality 2.7 < r < 2.8.
For greater precision we calculate h and find

h = (2.8 - 2.7) 3.89 _ ;:~~ ~ ;:~; _ 3.75 = 0.054.


We then calculate the values

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.]

1. Do the examples of Exercises 6.1 and 6.2 by the method of chords.

6.4. Simultaneous Linear Equations. Theoretical discussions of the


system of n linear equations in n unknowns,

allxl + a12x 2 + ... + alnXn = b l ,

a 21 x I + a 2r2 + ... + a 2nXn = b2 ,


(6.4:1)

can be found in texts on college algebra, linear algebra, and elsewhere.


6.4. SIMULTANEOUS LINEAR EQUATIONS 211

It is shown that if the determinant of the coefficients

all aI2 aln


a 21 a22 a2n
(6.4:2) .::1=

is different from zero, then the system has one and only one simultaneous
solution

(6.4:3) i = 1,2, ... , n,


where
all a I2 al.i-l hi at.i+! aln
a 21 a22 a2 .i-1 h2 a 2 .HI a2n
(6.4:4)

(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

the second equation (of the transformed system) by suitable constants


and subtract the multiples, in turn, from the third, fourth, ... , nth
equations to obtain a new system in which every coefficient of x i2 '
after the second, is equal to zero. The zero coefficients of xii' of course,
remain zero. If we continue to work downward in this fashion, we will
end up with a system of equations S, equivalent to 6.4: 1, such that
just one unknown, say xi n ' of the nth equation of S has a nonzero
coefficient; just one unknown, say xin_t' where jn-l =1= jn, of the
(n - l)st equation has a nonzero coefficient; just one unknown, say
xin_I' where jn-2 =1= jn or jn-l , of the (n - 2)nd equation has a nonzero
coefficient; and so on. The last equation of S can now be solved for
xin ' the next to last equation for xi n_t ' the third from last for xin_2 '
and so on.
The process can be modified slightly if, when we select a nonzero
coefficient in the kth equation to be used to obtain zero coefficients in
the (k + l)st, (k + 2)nd, ... , nth equations, we first divide the kth
equation through by this nonzero coefficient. The process can be further
modified if, when we operate with the kth equation, we obtain zero
coefficients not only in the (k +l)st, (k +
2)nd, ... , nth equations,
but also in the 1st, 2nd, ... , (k - l)st equations. Roughly twice as
many steps will be necessary to derive the final system of equations,
but then it will not be necessary to solve the system "backward"; the
value for each variable will be immediately obtainable.
We illustrate the various procedures by:

EXAMPLE 1. Solve the system of equations

3x + 2y - z + w = 8
x + 4y - 3z - 2w =
(I)
6x- y- z+4w=20
Sx - 3y + 2z + 2w = 7.

(It is more convenient to use x, y, z, w than Xl' X 2 , Xa , X" .)


Multiply the first equation by - 3, -1, 2, in turn, and add to the
second, third, and fourth equations to obtain

3x + 2y - z + w= 8
-8x - 2y - Sw = -23
(II)
3x - 3y + 3w = 12
llx+ y + 4w = 23.
6.4. SIMULTANEOUS LINEAR EQUATIONS 213

Next, multiply the second equation by -I and t, in turn, and add to


the third and fourth equations. We obtain

3x+2y-z+ W= 8

-8x - 2y Sw = -23
(III)
21 93
ISx +T w = T
3 23
7x + 2w = T

Multiply the third equation by -t and add to the fourth equation;


we obtain

3x + 2y - z + w = 8

-8x - 2y Sw = -23
(IV)
21 93
ISx +T w = T
34 34
'fx 7

The last equation yields x = 1; substituting into the third equation,


we find w = 3; substituting into the second, we findy = 0; and finally,
from the first equation, z = - 2.
After the first stage, the second equation (of II) could have been
divided by -2 before eliminatingy from the third and fourth equations;
we would have obtained

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

We then solve backward as before.


There is little to choose between the two methods in this example;
but if the coefficients are given or written as decimals, the second
procedure is somewhat preferable.
After obtaining the system V, we could have eliminated the y term
in the first equation by multiplying the second equation by 2 and sub-
tracting the result from the first equation; we get
-5x - z - 4w = -15
5 23
4x+y + 2w = 2
(VII)
21 93
15x +2 w = "2
3 23
7x + 2w = 2
As before, we divide the third equation by 21/2 and then multiply the
result by 3/2 and subtract from the fourth equation; but in addition,
to eliminate the w terms from the first two equations, we multiply
the resulting third equation by 4 and add to the first equation, and
by 5/2 and subtract from the second equation. We get

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

Numerical Differentiation and Integration

7.1. Introduction. The derivative f'(x) of a given function f(x) can


almost always be found by the well-known rules of differentiation and
hence the values of f'(x) for arbitrary values of the argument x can
usually be obtained. Trouble may arise if f(x) is not an elementary
function, for example, if f(x) = I x 2 sin(l/x) I or if f(x) is the function
which equals 0 for x irrational, I for x = 0, and l/q for x equal to the
nonzero rational number p/q in lowest terms. The ordinary rules cannot
be used if the function possesses a derivative but is known only by
means of a set of points or tabulated values, (Xi' Yi). The same remarks
apply with even greater force to the evaluation of a definite integral
since the indefinite integral of an elementary function is not necessarily
an elementary function. For example, f x-leX dx is not an elementary
function. Hence it becomes expedient to devise methods for the
numerical approximation of derivatives and integrals.
One method of approach consists in drawing the graph of Y = f(x)
on cross-section paper. The value of the derivative f'(a) can be approxi-
mated by drawing a line, as best one can, tangent to the curve at the
point (a,f(a and then evaluating, in anyone of a variety of ways, the
slope of the tangent. Since a definite integral can be interpreted as an
area, the value of f!f(x) dx can be approximated by counting the number
of squares within the region bounded by the curve, the x-axis, and the
vertical lines x = a, x = h. In the count, consideration must be given,
of course, to the position of a square, squares above the x-axis must be
counted positively, those below, negatively; also, judgment must be
used in estimating what fractional part of a square is represented by an
irregular area contiguous to the curve. In spite of the obvious crudeness
of this method, a little practice will yield rather good estimates from a
carefully drawn graph for either the derivative or definite integral.
Another simple method for those who desire an arithmetic rather
than a geometric approach is available. Let h be a small positive number,
then (f(a + h) - f(a - h/2h, the slope of the line joining the points
(a - h,f(a - h, (a + h,f(a + h [or, what is the same thing, the
average of the slopes of the chords joining (a - h,J(a - h, (a,f(a
217
218 7. NUMERICAL DIFFERENTIATION AND INTEGRATION

and (a,/(a, (a + h,/(a + h, respectively], is an approximation to


/,(a). The area 2h/(a) of the rectangle of altitude /(a) and base 2h and
the area h(f(a - h) + /(a + h of the trapezoid of altitude 2h and
bases /(a - h) and /(a + h) are approximations to the integral
f:~:/(x) dx. Since one of the simple geometric areas usually over-
estimates and the other underestimates the integral, their average
h(f(a - h) + 2/(a) + /(a + h/2 is apt to be a better estimate than
either. Note the similarity of the last formula to the still better Simpson's
rule, h(f(a - h) + 4/(a) + /(a + h/3, discussed later in this chapter.
It is clear, however, that if great precision is desired for an approxima-
tion to the value of a derivative or definite integral, and if some estimate
is wanted for the magnitude of the error, the two crude methods just
discussed are inadequate and other numerical approximation methods
must be sought.
From one point of view, the problem may seem trivial. If a set of
tabulated values, say (Xi' Yi)' is known for a function, then n + I of
these pairs will determine, as we saw in Chapter 3, a polynomial of
max-degree n which approximates the function. The polynomial can
then be used to approximate the value of a derivative or definite integral
of the function. We could thus dismiss the entire subject; however as a
matter of practicability, it is better to construct special formulas for
these purposes, particularly when the points are equally spaced. Further-
more, some of the desired formulas are not derivable from the approxi-
mating polynomial. Also, we shall want several of the formulas for use
in the numerical solution of differential equations.
We first introduce some notations and prove some identities that we
shall need for the sequel. As before, let
(7.1: I)

be n +I points with distinct abscissas, and let P(x) be the polynomial

(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

The last equality is, of course, an identity; it should be noted, however,


that whereas the right-hand member of 7.1:3 is defined for x = Xi ,
the right-hand member of 7.1:4 is not. Since it will be convenient to use
the form 7.1 :4, we define its right-hand member to be the right-hand
member of 7.1:3 for x = Xi. Corresponding definitions will be understood
for the subsequent polynomials about to be given.
Similarly, we define the polynomial

(7 1 5) P ..(x) = P(x) i=j::.j; i,j = 0, 1, ... , n;


. : " (x - Xi)(X - xi) ,

it is the polynomial P(x) with the two distinct factors x - Xi and x - Xj


deleted. In general, we put
(7.1 :6)
P(X) i, j, ... , m all distinct,
P;;m(x) = (x - Xi )( X - xi) ... (x - xm) , i,j, ... , m = 0, 1, ... , n;

it is the polynomial P(x) with the distinct factors x - Xi' X - Xj , .:.,


X - Xm deleted. It follows at once from the definitions of the P's that

(7.1 :7) for g =j::. i,j, ... , m,


and that
(7.1:8) for k = anyone of the subscripts i, j, ... m.
The Lagrangian coefficient Lk(X) of Yk given by 3.3:2 (with k In
place of i) can now be written as

(7.1 :9)

Differentiating both sides with respect to x, we find that

Lk'(x) = P)Xk) [POk(x) + ... + Pk-U(x) + Pk+1.k(X) + ... + Pnk(x)],


or,

(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

It follows from 3.3:3 and 7.1: 10 that

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:13) [~, = x(x - 1) ... (x - n + 1) = n! (:),

(7.1:14) [~. = x(x - 1) .. ' (x - i + 1)(x - i-I) ." (x - n + 1)



1 n![X]
=x-in=x-in'
(X) i = 0, 1, ''', n - 1.

The polynomial [j is frequently called the factorial polynomial; if x


is a positive integer equal to or greater than n, [:] is the number of
permutations of X distinct things taken n at a time. It follows from the
preceding definitions that if m is a non-negative integer, then

(7.1: 15)

[:] = 0, for ~m < n;

(7.1:16)
ml
= nl (:), for m ~ n;
[:J (m - n)!

(7.1:17)

[:J; = 0, for ~m < n but m =1= i;


7.1. INTRODUCTION 221

(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.

We state and prove several theorems necessary for the sequel.

THEOREM I.
(7.1 :20) Q(x; n) =
i-O
(-I)i (~)[
' n
x ].
+1 I
= (-I)nn!

Let m be one of the integers 0, I, '.', n. Then

Q(m' n) = (-I)m (n)[ m ] = (_I)m(n)(_I)n-m~ = (-I)nn!


, m n+1m m (;)

Since.Q(x; n) is equal to the constant (-I)"n! (which is independent


of m) for the n + I distinct values x = 0, I, ' .. , n, and since Q(x; n)
is a polynomial in x of max-degree n, Q(x; n) is identically equal to
(-l)" n! The proof of the theorem is thus completed.

COROLLARY. Let [,,:l]i be written in the form

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 '

(7.1:22) (-1)~ (~) Ci.n = (-I)nn!


i-O '

The proof of the corollary follows immediately from the theorem


since the first sum, 7.1:21, is the coefficient of xi in Q(x; n) and the
second sum, 7.1:22, is the constant term of Q(x; n).
222 7. NUMERICAL DIFFERENTIATION AND INTEGRATION

We will also need:

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

= (-1)"-1 i (-I)~ ('~)


;-0 n -) }

= (_1)"-1 ~ (-I); [ n ] ("!)


[ n]f='o m+I;)
m+1
= (_1)"-1 (-I)"'m!

[m ~ I]
_ (-I)"+m-lm!(n - m - I)!
- n!

The right-hand member of the equality in the statement of the


theorem is

1 ,,-1 X
=,~[],
n. i-O n i
7.2. NUMERICAL DIFFERENTIATION IN TERMS OF FINITE DIFFERENCES 223

and is therefore a polynomial B(x) of max-degree n - 1. It follows that

B(m) = ~! %[~L
(_l)n-m-1m!(n - m - I)!
n!

Since (-I )n+m-l = (_l)n-m-l, B( m) = A( m). The left- and right-


hand members of 7.1:23 are then polynomials of max-degree n - 1
equal to each other for n distinct values of x. They are therefore iden-
tically equal and the theorem is proved.

EXERCISE 7.1

1. Draw, carefully, the graph of y = Xl - 2x - 3 on cross-section paper from


x =-2 to x = 5. With the aid of a straightedge, draw the tangents to the parabola at
x = -2, 0, 3, 4. Estimate from your drawing the values of dy/dx at the four points.
Estimate, by square counting, the area bounded by the parabola and the chord joining
(-2,5) and (5, 12). Check your answers by straightforward differentiation and integration.
2. Draw a smooth curve through the points
(-3, -2.5), (-2, -2.0), (-I, -0.9), (0,0.5),
(I, 1.9), (2,3.0), (3,3.5), (4,3.2), (5,2.3).
Determine, as in the preceding example, the values of the derivative at x = - 2, 0, 2, 4.
Estimate the value of f~3f(x) dx. Check your answers by using y = ! + sin (x/2).

7.2. Numerical Differentiation in Terms of Finite Differences.


In this section we develop a number of formulas for the derivative of
the polynomial which passes through the n + 1 points 7.1: I when these
points are equally spaced. The formulas will be expressed in terms of
the differences of the y's and they will yield, if the polynomial is an
approximating polynomial to a function f(x), approximations to f'(x).
The magnitudes of the errors will be discussed later.
The present set of formulas is derived from the forms 3.8: 13-16.
We begin with the first of these, namely,

n . t
(7.2:1) Y = ~Ll'yo (.),
i=O t

where t = (x - xo)/h, h = Xi - Xi-l


224 7. NUMERICAL DIFFERENTIATION AND INTEGRATION

Differentiating with respect to x, we find

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

by 7.1 :23, it follows that

(7.2:3) dy
dx
= y ' = !h ~ [~
~ ~
(-1 )H ( t )] Ai
. . _. '" Yo .
,=1 ;=1 J I J

By rearranging the terms, this formula can be written as

(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)

which may be written, if we recall 2.3:16.4, in the symbolic notation

(7.2:5') Yo' = ~ In(1 + .1) Yo

(.1 nH = .1n+2 = '" = 0).


To facilitate the computation of the coefficients of .1Yo, .1 2yo, ... ,
in the expressions for Y/, Y2', Ya', ... , rewrite 7.2:3 in the form

(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

y, , = -h1 ~ d'i .d'Yo


,-1

, 1 ~ (-I)-d,.,
Y-t=;; , 1 .d'Y-i
,-1

Divide all entries by 2520.

: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

o -{).16666 66667 0.1428571429 -{).12500 00000 0.11111 11111 -{).IOOOO 00000


I 0.03333 33333 -{).0238095238 0.0178571429 -{).0138888889 0.0111111111
2 -{).0166666667 0.00952 38095 -{).0059523810 0.0039682540 -{).00277 77778
3 0.01666 66667 -0.0071428571 0.00357 14286 -{).0019841270 0.0011904762
4 -{).03333 33333 0.00952 38095 -{).00357 14286 0.0015873016 -{).0007936508
5 0.16666 66667 -{).0238095238 0.0059523810 -{).0019841270 0.0007936508
6 2.45000 00000 0.1428571429 -{).01785 71429 0.00396 82540 -{).001l904762
7 11.1 5000 00000 2.5928571429 0.1250000000 -{).0138888889 0.00277 77778
8 34.10000 00000 13.7428571429 2.7178571429 O.lllll11lll -().Ollli lllli
9 83.63333 33333 47.8428571429 16.46071 42857 2.8289682540 0.10000 00000
10 177.5833333333 131.4761904762 64.30357 14286 19.2896825397 2.9289682540

Hence

Yl' = /,(1) = 1(-7) + ~ (6) - i (6) = -5,

Ys' = /,(6) = 1(-7) +!! (6) + 373 (6) = 100.


2

These values can be checked by ordinary differentiation.


228 7. NUMERICAL DIFFERENTIATION AND INTEGRATION

Note that the value of the derivative at a particular point, say /,(6),
can be found in several ways. Indeed, we have

if Xo = 2, YII: = /,(6) = 1(11) + ~ (18) + 1: (6) = 100,

if Xo = 3, Y3' = /,(6) = 1(29) + ~ (24) + Ii (6) = 100,

if Xo = 6, Yo' = /,(6) = 1(119) - ~ (42) + ~ (6) = 100,


etc.
H f(x) is a polynomial of max-degree 10, Tables 7.2:tlab will yield
exact values for the derivatives; if f(x) is not a polynomial of max-degree
10, the results will be approximate. The magnitudes of the errors will
be discussed in Section 7.5.
Incidentally, Table 7.2:tl can be extended backward to enable us
to compute Y-l , Y-2 , .... (See Table 7.2:t2.) In all cases, however, we
TABLE 7.2:t2
VAI.UD OF de1 FOR NUMERICAL DIFFERENTIATION

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

are computing a derivative in terms of differences that form a descending


diagonal in the difference table.
We derive next the table based on formula 3.8:14 which we write
again:

(7.2:7)

where t = (x - x_1)/h. We have

= 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

The resulting table of coefficients is the same as Table 7.2:t1.


To illustrate the use of the table, we take Y = J(x) = x3 - 8x 5, +
xo = 0, h = 1; whence LlY_1 = -7, Ll2Y_2 = -6, Ll3Y_3 = 6. We have

Y'-2 = /,(-2) = 1(-7) - ~ (-6) + i (6) 4,

Y'-a = /'( -6) = 1(-7) - Ii (-6) + 337 (6) = 100.

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+1)/2] 2i-l [2f-l (_I)H ( i-I )]1


+ :t
i-I
LI Yl-i:t
;=1 J
. 2i - I - '
J
I

-_ IiI [LI I Ll2


Yo - 2 )'-1 - 6"I Lla)'-1 + 12I Lifo)'-2 + 30I LI&)'-2
I I I I
- 60 Ll8Y_a - 140 Ll7Y_a + 280 Ll8y _ + 630 Ll9Y fo -40

_ _1_LlI011 =!= ...]


1260 J-6
7.2. NUMERICAL DIFFERENTIATION IN TERMS OF FINITE DIFFERENCES 231

Finally, starting with formula 3.8:16 or

[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

[(n+l1/2] 2i-l [2i-l (-I );-1 ( i - I )] 1


+ ~ .1 Y-i ~ . 2i _ 1 _ .
i-I ;-1 J J

-_ h1 !.1Y-l + 21 .12Y-l - 61 .13Y-2 - 1 .140


12 Y-2 + 301 .15Y-3
1 1 1 1
+ 60 .1 8Y_3 - 140 .1 7Y_40 - 280 .1 8Y_40 + 630.1'y-s

+ 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

(7.2:17) , _ ! [.1Y - 1 + .1yo _ ! .1 3Y_2 + .1 3Y_l + .! .1 5Y_3 + .1 5Y_2


Yo -- h 2 6 2 30 2

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

3 I 1 -1.5 1.75 -1.875 1.93333 33333 0


z
4 I 1 -2 2.83333 33333 -3.5
1 -2.5 4.16666 66667 Z
5 I -I
1 -3
~I
m
""
:I
II>

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

can be found by repeated differentiation of Eqs. 7.2:3 or 7.2:4, 7.2:8


or 7.2:9, 7.2:12, 7.2:15. If we substitute 0 for t in these results, we
Yo" , Yo,,, , Yo(4) , ... ; 1'f we su bstltute
ob tam ' 1 f or t, we 0 b
tam' Yl
' ' ,'Yl
' ' , Yl(4) , ... ;
and so on. Some of these results are given in Tables 7 .2:t3ab; the
entries are self-explanatory and need no further comment.

EXERCISE 7.2

1. By use of formula 7.2:3 or 7.2:4, find dyldx at x = 0.5,0.9, I, 1.3,5,5.3,6,6.1, if


y = In x. Take n = 3, h = I,
and appropriate values for Xo. Use a five-place table.
Determine the error in each case by using dYldx = Ilx.
2. By use of formula 7.2:3 or 7.2:4 and a five-place table for sin x (x in degrees), find
d(sinx)/dx at x = 0, 1, 120',2,50,5115',5240',88,89,90,91,92. Take
n = 4, h = 2, and appropriate values for Xo Determine the error in each case by means of
ordinary differentiation.
3. Use formula 7.2:6 and Tables 7.2:tl, 2 to find the derivatives at the indicated
points from the tabulated values of the functions .
. x = 28, 32, 34, 38, 46, 50.
b, x = 3.70,4.75,5.10,6.50,7.20,7.90.
C, x = I, 3, 6, 8, 12, 13.
d, x = 25, 28, 32, 36, 40, 45.

b C d

x f(x) x f(x) x f(x) x f(x)

34 0.31270 5.10 1.62924 5.5 38.02952 30 0.23137745


36 34549 5.45 69562 6.0 39.14868 31 22035947
38 37904 5.80 75786 6.5 40.20726 32 20986617
40 41318 6.15 81645 7.0 41.21285 33 19987254
42 44774 6.50 87180 7.5 42.17163 34 19035480
44 48255 6.85 92425 8.0 43.08869 35 18129029
46 51745 7.20 97408 8.5 43.96830 36 17265741
9.0 44.81405 37 1644 3563
38 15660536

4. Do example 3 using Table 7.2:tl.


5. Use Table 7.2:t3 to find, where possible, the first five derivatives of the functions of
example 3.
6. Derive tables similar to 7.2:t3 for the derivatives at Xl , X2 , Xa , x, .
7. Derive the identity 7.2:6.2.
I. Prove the following about the entries in Table 7.2:t3 .
. If hiy~iI = a i i .:jiyo - a i i +1 .:jHlyo + ai.H2.:ji+2yo =F then

ai+1,i+l = al,'+'_l + lai,'+'-2 + !ai,i+l-a + ... , j = 1,2,3, ....


7.3. NUMERICAL DIFFERENTIATION IN TERMS OF ORDINATES 235

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. Numerical Differentiation in Terms of Ordinates. In this


section we shall present formulas for the numerical evaluation of deri-
vatives of a function Y = f(x) in terms of the ordinates Yo , YI , Y2 , ....
The most obvious way of obtaining such formulas merely involves the
substitution for the finite differences in the formulas of the last section
their values in terms of the ordinates.
We recall the equalities 3.7:13 which we repeat here with a slight
change of notation:

(7.3:1) i = 1,2,3, ....

If we substitute these values in 7.2:3 and 7.2:4, we obtain

(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

(7.3:4) Xk - xi = (k - i) h, j,k = 0, I, ,n;


236 7. NUMERICAL DIFFERENTIATION AND INTEGRATION

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

6 0 1 -147 360 -450 400 -225 72 -10


60
I -10 -77 150 -100 50 -15 2
2 2 -24 -35 80 -30 8 -I
3 -I 9 -45 0 45 -9 I
7 o 4~0 -1089 2940 -4410 4900 -3675
700
1764 -490 60
1 -60 -609 1260 -1050 -315 84 -10
2 10 -140 -329 700 -350 140 -35 4
3 -4 42 -252 -105 420 -126 28 3

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

we use these identities in 7.1:5 to obtain

(7.3:5)

Hence, from 7.1: 11 we find

(7.3:6) L '(x) = (-I )k-J-I _1_.


k J k- J
(~) !h'
(j) j =1= k,

and

the last identity can be rewritten as

if n < 2j,
(7.3:7) if n = 2j,
if n > 2j.

As an illustration of the use of these formulas in deriving the entries of


Table 7.3:tl directly, we compute the value ofYl' in terms ofthe ordinates
Yo, Yl , Y2 , Ya , Y4 . We have from 7.1:12, Yl' = p'(x1 ) = ~;_OL/(Xl) Yi ,
and from 7.3:6,

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

and from 7.3:7,


,
Ll (Xl) = - (I2 + 3I) Ii1= - 6h
5.
Hence

It follows from 7.3:6 that

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)

Also, if n < 2j, then n > 2(n - j) and

L~_;(xn_;) = - ~ ( n - ; + 1 + ... + n - 1
(n - j)
)

= -~(n-;+ 1 + ... + j) = -L;'(x;).

If n = 2j, then n = 2(n - j) and

If n > 2j, then n < 2(n - j), and

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

Hence in all cases,

(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

Y/ = ~h (coYo + C1Yl + ... + c..y1l),

then we can write at once the complementary formula

Thus, from the result of the illustrative example, we get

Ys' = l~h (-Yo + 6yl - 18Y2 + IOys + 3y,).

Because of the observations just made, it is sufficient to give explicitly


in Table 7.3:tl the values of Y/ for i = 0, I, ... , [nI2], only. The
remaining values can be obtained as explained above.
Several properties of these formulas should be noted for present and
future use. First, anyone of the formulas for a particular n is exact
for all polynomials of max-degree n. If we use a formula with a particular
nand Y = f(x) is not a polynomial of max-degree n, there will be an
error whose magnitude will be discussed in Section 7.S.
Second, the subscripts on a derivative y' and the corresponding
ordinates Yi in any formula can all be raised or lowered by the same
integer to yield a valid and, of course, a similar formula. Thus, from
the illustrative example we derive the equally valid formulas

Ys' = 1~ (-3Y2 - IOys + 18Y4 - 6Y6 + Y8)'

Y~2 = 1~ (-3Y-3 - IOy-2 + 18Y-l - 6yo + Yl)

Third, the superscripts on Y/ denoting differentiation can be raised


if appropriate superscripts are put on the y's. Thus, if yl) is inter-
preted as the ordinate Yi and y1 m ) as the mth derivative of Y with respect
to x evaluated at Xi , then each of the tabulated formulas yields a series
240 7. NUMERICAL DIFFERENTIATION AND INTEGRATION

of formulas which are obtained by raising all superscripts by the same


integer. For example, the foregoing illustration yields

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):

Y~' = I~ (-3yo' - IOy1' + 18Y2' - 6Y3' + Y;)


I
= 144h2 [- 3(-25yo + 48Y1 - 36Y2 + 16Y3 - 3Y4)
- IO( -3yo - IOyl + 18Y2 - 6Y3 + Y4)
+ 18(yo - 8Y1 + 8Y3 - Y4)
- 6(-yo + 6Y1 - 18Y2 + IOya + 3Y4)
+ (3yo - 16Y1 + 36Y2 - 48Ya + 25Y4)]
I
= 144h2 (132yo - 24Oy1 + 72Y2 + 48Y3 - 12Y4),
or

The preceding result can be restated and summarized in a compact


and instructive manner. Suppose that

(7.3:10) i = 0, I, ... , n;

then

(7.3:11) Ylml _ I ~ clmly i = 0, I, ... , n;


i - (Kh)'" f=i iJ J'

where, if

(7.3: 12) e lml = II cJf' II , m = 1,2,3, ... ,


7.3. NUMERICAL DIFFERENTIATION IN TERMS OF ORDINATES 241

we have

(7.3:13) m = 1,2,3, ....

In words, the matrix of coefficients of the mth derivatives in terms of


the ordinates is the mth power of the matrix of coefficients of the first
derivatives in terms of the ordinates.
Since the equations 7.3: II are exact if y = f(x) is a polynomial of
max-degree n, the (n + l)st and higher derivatives are identically equal
to zero. Hence

(7.3:14) C(fl+t) == 0, i = 1,2,3, ....

This implies that the matrix em is singular or that the determinant

(7.3:15) I C(l) 1= O.

As an illustration of the use of Table 7.3:tl, consider the following


set of values:

XI 6.0 6.1 6.2 6.3 6.4 6.5


Y 1.7918 1.8083 1.8245 1.8405 1.8563 1.8718

We calculate/,(6.1) wheref(x) is a function determined by these points.


If we put Xo = 6.1 and use the very first formula of the table, we
obtain /,(6.1) = (-3(1.8083) + 4(1.8245) - 1.8405))/2(0.1) = 0.1630.
If we put Xl = 6.1 and use the second formula, we obtain
/,(6.1) = (-1.7918 + 1.8245)/2(0.1) = 0.1635. Again putting Xl = 6.1
and using the second formula for n = 5, we find

/'(6.1) = (-12(1.7918) - 65(1.8083) + 120(1.8245) - 60(1.8405)

+ 20(1.8563) - 3(1.8718))/60(0.1) = 0.1634.

The answers in this case are in fairly close agreement. It should be


remembered that we have said nothing as yet concerning the margin
of error. Actually, we used the function y = In X in this example, so
that /,(6.1) = 1/6.1 = 0.1639.
The table for the derivatives in terms of the ordinates arising from
the formulas stemming from 7.2:12 and 7.2:15 would be identical with
Table 7.3:tl and therefore need not be given.
242 7. NUMERICAL DIFFERENTIATION AND INTEGRATION

It is also well to remark that Table 7.3:t I can be extended by the


same methods used in its derivation to include the expressions

Ya' = 2~ (3yo - 8Yl + 5Y2),


Y4' = 2~ (5yo - 12Yl + 7Y2),

which are exact for polynomials of max-degree 2;

Y4' = 6~ (-llyo + 42Yl - 57Y2 + 26ys) ,


Yr; = ;h (- 26yo + 93Yl - 114Y2 + 47ys),

which are exact for polynomials of max-degree 3, etc.

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 ...

I~ ..b. . ~. ~.. '.':


4. Prove ~~-o c:7' = 0 for any i and m, where c:~" is given by 7.3: II.

7.4. Method of Undetermined Coefficients. Another fruitful


method of determining the formulas of the preceding sections is the
method of undetermined coefficients. The method can be and is employed
in many diverse investigations; we use it here to indicate an alternate
method of procuring the formulas for the derivatives in terms of the
ordinates.
Some preliminaries are necessary. Since the derivative of a constant
times a function equals the constant times the derivative of the function
and the derivative of a (finite) sum equals the sum of the derivatives,
it follows that if
(7.4:1 )
7.4. METHOD OF UNDETERMINED COEFFICIENTS 243

is an exact formula for each of the functions

(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:6) Cdl(X + g) + C2f2(X + g) + ... + Cmfm(x + g)


== Cdl(X) + c2Ux) + ... + c".f".(x).
It follows that the formula 7.4: I which is exact for the points 7.4:3
will be exact for any linear combination of the functions 7.4:2 at any
set of points such as 7.4:5 spaced h units apart.
Finally, if we assume that each fi(X) of7.4:2 has the property that for an
arbitrary nonzero constant G,fi(GX) is expressible as a linear combination
of the functions 7.4:2, it follows, since df(Gx)Jdx = G df(Gx)Jd(Gx),
that if 7.4: I is exact for a function at n + I points spaced h units apart,
then

(7.4:7)

is an exact formula for the same function at any n +I points spaced


h* units apart.
244 7. NUMERICAL DIFFERENTIATION AND INTEGRATION

With these preliminaries understood, we take for the actual determina-


tion of the required formulas the polynomials

(7.4:8) y = 1, Y = x, Y = x 2 , "',y = x",

as the functions 7.4:2 (so that m = n +


1). Any (not identically zero)
polynomial of max-degree n is a linear combination of these polynomials
and possesses the two properties stated above, hence if 7.4:1 is exact
for the polynomials 7.4:8 at the points whose abscissas are the integers
0, I, "', n, then

(7.4:9)

is an exact formula for any polynomial of max-degree n at any set of


n +I points spaced h units apart.
The problem of determining formula 7.4:9 is thus reduced to the
problem of determining the coefficients ao , a1 , " ' , an; the reason for
the name of this method is now apparent. The corresponding derivatives
of the polynomials 7.4:8 are

(9.4:10) y' = 0, y' = 1, y' = lx, "',y' = nx,,-I.

Using the values x = 0, 1, "', n in Eq. 7.4:8 and 7.4:10, we obtain


from 7.4: 1 for an arbitrary integer k the system of linear equations

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 ,

o 1 2" ... n"

is not equal to zero (this determinant is equivalent to a Cauchy-Vander-


monde determinant; see page 72), the preceding system of equations
has a unique solution for a given nand k.
7.4. METHOD OF UNDETERMINED COEFFICIENTS 245

Thus, for the particular values n = 3, k = 1, Eq. 7.4:10 become


ao + al + a2 + aa = 0,
a1 + 2a2 + 3aa = 1,
+ 4a2 + 9aa = 2,
a1
a 1 + 8a2 + 27aa = 3;

whence ao = - 1, a 1 = - 1, a2 = 1, as = -1. These results yield


the formula

which is exact for polynomials of max-degree 3 for any four ordinates


spaced one unit apart. Consequently, the formula

is exact for all polynomials of max-degree 3 for any four ordinates


spaced h units apart.
The other formulas of Table 7.3:tl can be likewise obtained by giving
nand k appropriate values. We remark that, conceivably, a formula
derived to be exact for polynomials of max degree n may turn out to be
exact for polynomials of higher degree. This is not true in the example
worked out above since a simple computation shows that the formula
is not exact for y = X4.

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.

d. Yl' = ~ (coYo + CaYa + c,y, + 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. Magnitude of the Error in Numerical Differentiation. In the


preceding three sections of this chapter, certain formulas were derived
for the numerical evaluation of the derivative of a function y = f(x).
It was stated on several occasions that these formulas were ordinarily
not exact unless f(x) was a polynomial of a particular max-degree. In
the present section we propose to discuss the magnitude of the. error
involved. We consider here only the error inherent in the formula
and not the errors due to rounding-off, truncation, or use of inexact
values.
It is important to repeat, for this information cannot be emphasized
too strongly, that if all that is known about the function

(7.5:1) y =/(x)

is that its graph passes through the points

(7.5:2)

then nothing, absolutely nothing, can be said about the magnitude of


the error. As a matter of fact, we are not even sure that the very derivative
we are trying to evaluate actually exists. It is then necessary to make
certain assumptions regarding the nature of the function f(x).
In Chapter 3 we saw that, for a given n, f(x) could be expressed in
the form

(7.5:3)
7.S. MAGNITUDE OF THE ERROR IN NUMERICAL DIFFERENTIATION 247

or in the form

(7.5:4)

for points equally spaced h units apart where h = Xi+1 - X, ,


t = (x - xo)/h, and where, in either case, X is a value between the lar-
gest and smallest of Xo , Xl , "', Xn , x. It is necessary to assume if either
of the two expressions is to have meaning that pn+1'(X) exists in the
neighborhood of the values involved. This is a definite assumption
about the nature of the function f(x) and must be recognized as such.
We also recall formulas 3.6:6 and 3.7:7 which we rewrite as

and

respectively; whence

(7.5:5)

The identity 7.5:4 may then be written as

(7.5:6)

from which we obtain upon differentiation with respect to x,

(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) .

The error committed in approximating f'(x) by Pn'(x) is then given by

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) .

Unfortunately, this expression for the error is not very helpful or


useful. To obtain a happier and more fruitful evaluation we assume that
f' 7I +l'(x) is constant within the interval under consideration. In view
248 7. NUMERICAL DIFFERENTIATION AND INTEGRATION

of 7.5:5, this assumption is warranted if and only if the (n + l)st order


finite differences of the function are constant in the interval. If we
accept this condition, the expression for the error becomes

(7.5:9) E(x) = Ll1l+lj(xo) -I -d ( t )


h dt n + I
or

(7.5:9') E(x) = h".f(1I+l'(X)!:.- ( t ).


dt n + I

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

I(x) = Pn(x) + n!1 f"'-"'o


0 w'f(n+1l(x - w) dw,

where P1I(x) is a polynomial of max-degree n in X-Xo and hence, of course,


a polynomial of max-degree n in x. For the present purposes, it is con-
venient to make the substitution s = x - wand rewrite the function
f(x) as
(7.5:10) I(x) = Pn(X) + ,1 f'" (x - s)n/,n+1I(s) ds.
n. "'0

It is proved in texts in advanced calculus that if

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

J'(x) = Pn'(x) + (n _1 I)! f'"'" (x - s)n-y(n+1l(s) ds,


o

I"(x) = p"(x) + (n - 1 2)1 f'" (x - s)n-~(n+1l(s) ds


n
"'0

(7.5:11 n) pnl(x) = p';:'(x) + r"'0


/,n+1l(s) ds.
250 7. NUMERICAL DIFFERENTIATION AND INTEGRATION

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)

Since the formula we are testing is exact for polynomials of max-degree


2, we put n = 2 in 7.5:10 and 7.5:11 1 and substitute into 7.5:12. We
obtain
E(xo) = pz'(xo) + I"'o

"'0
(xo - S)/,31(s) ds

= IPz'(x o) - ~ [-3Pz(xo) + 4P2(X1) - pz(xz)] I


- ~ 14 I"'l (Xl - s)Z /,31(s) ds - I"'a (xz - s)Z /,31(S) ds l .
4h "'0 "'0 I
Since P2(X) is a polynomial of max-degree 2 and the formula we are
testing is exact for such polynomials, the first brace is identically equal
to zero and E(xo) reduces to

(7.5:13)

In order to evaluate the preceding expression, we introduce a function


U(s I a, b) of the variable s and the constants a and b, a ~ b, defined by
the statement
if s < a,
(7.5:14) U(, I _, b) ~ I~
if a ~ s ~ h,
if s > h.

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

- f"" (XI - S)11'31(s) U(s I Xo , XI) dS)


"0
or

Since the range of integration is from Xo to XI , the factor U(s I x o , XI) is


really unnec~ssary; we put it in for the sake of symmetry.
We consider that part of the integrand within the brackets, namely,

R(s) = 4(XI - S)I U(s I Xo , xl) - (XI - S)I U(s I XO, XI).

R(s) = 0 if s < XO , since then U(s I XO , Xl) = U(s I XO , XI) = 0;

R(xo) = 4(XI - XO)I - (XI - xo)1 = 4hl - (2h)1 = 0;

if Xo < s < Xl'


R(s) = 4(XI - S)I - (XI - S)I = (2XI - 2s + XI - S)(2x1 - 2s - XI +
s)
+
= (3(XI - s) h)(xi - S - h) < 0;
R(xl ) = -(XI - XI)1 = -hI;
if Xl <s< XI'
R(s) = -(XI - S)I < 0;
R(xl ) = 0;
and R(s) = 0 if s > XI. The shape of the graph of R(s) is shown in

* One "explicit" definition for U(sl a, b) is


U(sl a, b) = ~.~.~a I] [e.~:: I] ,
where [x] is the greatest integer which does not exceed x. The constant e can be replaced by
any other constant greater than unity and there are other "explicit" methods of defining
the function.
252 7. NUMERICAL DIFFERENTIATION AND INTEGRATION

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.

The integral S;: R( s) ds can be evaluated directly or by use of 7.5: 12 and


7.5: 16 where a particular function is chosen for f(x). Indeed, we have by
direct integration

f O' R(s) ds = 4 f"'l (Xl - S)I ds - f"" (XI - S)I ds


~o %0 Zo

= - 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

(7.5:18) Yk' = ~h (coYo + C1Yl + ... + cV',,)

be a representative formula. Hence the error committed in approximating


the derivative of a function f(x) at x = Xk is

(7.5:19) E(Xk) =j'(Xk) - ~ (coJ(xo) + cJ(x1) + ... + cnf(x,,.


We use 7.5:10 and 7.5:11 1 and express the error in the form

+ ....................... .
: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

- _1_ [eo f"'" (Xo - s)"p"+1I(s) ds


nImh "0

+ ................. .
+ e" r"
"0
(x" - s)"p"+1I(S) dS] ;

or, since 7.5:18 is exact for polynomials of max-degree nand p..(x) is


such a polynomial,

+ ....................... .
+ 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)

+ CO(XO - S)" U(S I Xo , XO)


+ Cl(Xl - S)" U(S I Xo , Xl)
+ ....................... .
+ C"(X,, - S)" U(S I XO, X,,)]!I,,+1'(S) tis.
Put
R(s) = - nmh(Xk - S),,-l U(S I Xo , Xk)

+ CO(XO - S)" U(S I Xo , XO)


+ Cl(Xl - S)" U(S I Xo , Xl)
+ ................. .
+ C"(X,, - S)" U(S I Xo , X,,),
then

(7.5:20) E(xk) If"''' R(S)P,,+l,(S) ds.


= Imh
n "'0

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

To evaluate the integral, take !(x) = (x - xo)(x - Xl) (X - Xn)


so that
!(Xt) = 0, i = 0, I, ... , n,
!'(Xk) = (-I)n-kkl(n - k)lhn,
pn+1'(x) = (n + 1)1
Hence, from 7.5:19 and 7.5:21,

(-l)n-kkl(n - k)lhn = (n + 1)1 f"''' R(s) ds.


nImh "'0

Solving for the integral and substituting in 7.5:21, we obtain

(7.5:22) E(x ) = (_I)n-khn kl(n - k)1 P,,+1'(X)


k (n+ 1)1
256 7. NUMERICAL DIFFERENTIATION AND INTEGRATION

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)

is an exact formula if y = f(x) is a polynomial of max-degree 2. If


y = f(x) is not such a polynomial [that is, if f(x) is a polynomial of
higher degree or is some other kind of function], the error in computing
f"(x o) by means of this formula is

To estimate the error, we substitute into this expression the values of


f,!'andf" given by 7.5:10, 7.5:11 1 , and 7.5:11 2 where n = 2, and find

E(xo) = - 4hI 2 f"'s R(S)f'31(s) ds,


"'0
where

Since R(s) is obviously never negative, we have

E(xo) = -
f'31(X)
~
f"'s R(s) ds.
"'0

We find by a direct evaluation of the integral that

f"'s R(s) ds = 2h3 ,


"'0
whence
7.6. NUMERICAL INTEGRATION; INTRODUCTION 257

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. Numerical Integration; Introduction. The reader is quite aware


that problems in applied mathematics-the determination of areas,
volumes, and moments, to mention just a few-frequently lead to and
can be solved by the evaluation of a definite integral f(x) dx. In
contrast to the differentiation of f(x) which is a routine pro~ess that can
r
be carried out by anyone acquainted with the rules, the integration of
f(x) may be a far from routine process even when the indefinite integral
J/(x) dx is known to exist. Moreover, the indefinite integral of many
simple functions, as was pointed out in the first section, cannot be
expressed in finite form in terms of the elementary functions.
It is therefore important that methods be devised for approximating
a definite integral. These methods will occupy our attention in the
present and remaining sections of this chapter.
We have already mentioned the crude evaluation of a definite integral
by the method of counting squares. This graphical method has the
advantage of speed-althoug even this is doubtful- and the disadvantage
of inaccuracy. Where great precision is required, it is best to use one
of the computational methods described hereafter.
A method of wide application and great importance is based on one
of the properties of power series (see page 32) j if f(x) is expressible
as a power series, say,

(7.6:1)

and if J is the interval of convergence of the power series, then for


any a and b within J,
(7.6:2)
f f(x) dx = ao f dx + a f (x -
b

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

Although, as we have just said, this method is of wide application,


it should not be used if a power series expansion off(x) or an appropriate
affiliated function cannot be readily obtained or if the rate of convergence
of the right-hand member of 7.6:2 is too slow.
A method allied to the preceding one but not as efficacious is based
on the Euler summation formula 2.5:28. The final term, - R 2k , is
dropped and the resulting equality is solved for t
f(x) dx. Since the
remaining terms are known, the integral is deter~ined. The integral
r a
f(x) dx, where a and h are integers, can be found from the identity

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. Numerical Integration in Terms of Finite Differences. In this


section we seek formulas for the numerical evaluation of the definite
integral

(7.7:1) ta
f(x) dx

in terms of the finite differences determined by the ordinates Yo , Yl , ... ,


y" , where (xo , Yo), (Xl' Yl)' ... , (X" , y,,) are n +
I points on the graph
of Y = f(x) spaced h units apart.
We observe for immediate use that fF(t) dx = f(dx/dt)F(t) dt, and
therefore if t = (x - xo)/h or t = (x - x_l)/h,

(7.7:2) f F(t) dx = h f F(t) dt.


As in the case of numerical differentiation, we start with Newton's
formula, 7.2: I, whence

(7.7:3) f'" Y dx = h ~.:1iyo


"'0
. f (.)t dt.
i=O
t

0 ,

This formula gives us the integral of Y in terms of the integrals of the


binomial coefficients and the finite differences. It is more convenient
7.7. NUMERICAL INTEGRATION IN TERMS OF FINITE DIFFERENCES 259

to have the integral of y in terms of the binomial coefficients and the


finite differences. Hence we must express the integrals of the binomial
coefficients in terms of the binomial coefficients themselves. To do this,
we observe that the equality 7.2:2, namely,

~ (~) =
dt,

;-1
(-IY-l (. t .),
} , -}

yields

(7.7:4) ~ (-1);-1
~ -=----,'.'--
;=1}
I'o'-}
( t) dt = (t),..

For the sake of brevity, we write Hk for t


UJ dt; then putting
i =I, 2, ... , n, in turn in the preceding equality w~ obtain the following
system of simultaneous equations:

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 .

Now, substituting the values of the integrals given by 7.7:6 into


Eq. 7.7:3 and using the coefficients just obtained, we derive the formula

( / 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

+ [(~) + ~ (;) - /2 (~) + 2~ (D] .13yo

+ [G) + ~ (~) - I~ (;) + 2~ (~) - 71:0 G)] .14yo

+ [(~) + ~ (;) - /2 (~) + 2~ (;) - 71;0 (~) + I~O (D] .15yo


+ ......................................... ~.

Rearranging terms, we get

J'"'0" y dX h lI
- - (t) [Yo + 2~ .1Yo - ~ .1 2Yo
12 ~ .1 3Yo - 12.
+ 24 720 .1 Yo + ... J
4

+ (2t) [.1Yo + 21 .12Yo - 1 .13


12 Yo + 241 .14Yo - 19 .15
720 Yo + .. .J

+ (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

304 800 27688 6432 2353328 611744 111071276 184021888 1940263936 Q


-8 I -8 32 -- --- ---- -- "T1
"T1
3 3 45 5 945 135 14175 14175 93555 m

81891 10752669 8361225 109871559 2701401201 100312094331


'"mz
81 567 3267 369603
-9 I -9 - -- - --- --- n
m
2 4 8 80 160 2240 396 6400 89600 1971200 II>

575 29225 70805 6602825 3414400 159817025 3661425 34808875345


-101 -10 50 -- 600 --- ----
3 18 18 756 189 4536 56 299376

...,
0-
w
TABLE 7.7:tlb

VALUES OF Ck,i FOR NUMERICAL INTEGRATION ........


0-

{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

9 40.5 101.25 165.375 -I


9 183.2625 139.21875 ;;
10 10 50 141.6666666667 266.6666666667 348.61111 11111 322.5 -I
0
-1 -1 0.5 -0.4166666667 0.375 -0.34861 11111 0.32986 11111 z
-2 ~2 2 -2.3333333333 2.6666666667 -2.9888888889 3.3 -
-3 -3 4.5 -6.75 9.375 -12.3375 15.61875
z
0
-4 -4 8 -14.6666666667 24 -36.3111111111 51.9111111111
-5 -5 12.5 - 27.08333 33333
z
51.0416666667 -87.3263888889 139.21875 -I
m
-6 -6 18 -45 96 -183.3 322.5 Cl
-7
-8
-7
-8
24.5
32
-69.4166666667
-101.33333 33333
165.375
266.66666 66667
-348.6486111111
-615.2888888889
671.12986 11111
1286.4
""-I
-
-9 I
-9 -141.75
0
40.5 408.375 -1023.6375 2310.01875 z
-10 -\0 50 -191.6666666667 600 -1623.61111 11111 3933.61111 11111
......
~
TABLE 7.7:lb (continued)
Z
C
:I
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)

2 I -0.00978 83598 0.00846 56085 -0.00734 56790 0.0064285714 -0.0056791460 '">-t


3 -0.0129464289 0.01004 46429 -0.00823 66071 0.00697 54464 -0.0060364245 (5
4 -0.0084656085 0.00846 56085 -0.0075485009 0.00663 13933 -0.0058468281 Z
5 -0.02273 47884 0.0113673942 -0.00843 94290 0.00697 54464 -0.00600 12848
0 -0.0064285714 0.0064285714
z
6 0.2928571429 -0.00581 16883 -t
7 3.57858 79630 0.3042245370 -0.0157851080 0.00789 25540 -0.0061689669 m
8 19.18306 87831 3.8941798942 0.27908 28924 0 -0.0050622628 '":I
VI
9 71.0799107143 23.08861 60715 4.16390625 0.28697 54464 -0.0118481128
0
10 210.28439 15344 94.1798941799 27.2431657848 4.45877 42504 0.26834 14836 .."
.."
Z
::::j
m
-1 -0.3155919312 0.3042245370 -0.29486 80004 0.28697 54464 -0.2801895964 Q
-2 -3.6013227513 3.8941798942 -4.1796913580 4.45877 42504 -4.7321779969 .."
.."
m
-3 -19.2058035714 23.08861 60715 -27.2589508929 31.70983 25893 -36.4352247362
-4 - 71.10264 55026 94.1798941799 -121.42948 85362 153.1314285714 -189.5598674576 '"
m
Z
()
-5 -210.3071263228 304.47565 31085 -425.8957851080 579.01932 11254 -768.5724027331 m
VI
-6 -532.7928571429 837.2571428572 -1263.14357 14286 1842.155 -2610.7206168831
-7 -1203.90844 90741 2041.1542245370 -3304.2884394290 5146.435546875 -7757.1493779081
-8 -2490.2941798942 4531.4370370370 -7835.71611 99295 12982.14377 42504 - 20739.28636 63086
-9 ' -4800.2986607143 9331.7243303571 -17167.43109 375 30149.5669754464 -50888.8465559050
-10 i -8733.8955026455 18065.6084656085 -35233.0302028219 65382.5892857143 -116271.42905 57693
...,
a-
U!
266 7. NUMERICAL DIFFERENTIATION AND INTEGRATION

of 7.7:8 and the right-hand member of 7.7:9 will have corresponding


gaps.
If we put t = I, 2, 3, "', in turn in 7.7:8 (or 7.7:9), we obtain the
formulas of Table 7.7:tl for the evaluation of the integral 7.7:11. The
first of these is known as Gregory's formula.
The preceding formulas are in terms of forward differences; to obtain
formulas in terms of backward differences we start with formula 7.2:7
and proceed along the same lines as above. The details are left to the
reader to show that

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)

be a particular forward difference formula. Then

(7.7:14) to
"-k
Y dx = h[coYo - C1 ~Y-l + C2 ~2Y_2 - Ca ~aY_a ...]

is a correct formula in terms of backward differences. Raise all sub-


scripts on the y's and their differences by k in the last expression, then

(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)

+ Cs LISYo - 2LIsYk-S + ...] .

This is a formula for the definite integral in terms of averages of differen-


ces that center about the midpoint between Xo and Xk
Another set of formulas is based on the Euler summation formula
2.5:28. Let Y = fl(Z) and put

~Ik) = ftlk)(i).

Formula 2.5:28 may then be written as

(7.7:17) (fl(Z) dz = (tYo + YI + ... + Yn-l + lYn)

_ ~ Bli (yil/-U _ ylli-U) + R Ik


~ (2j)1 n 0

Make the substitution Z = (x - xo)/h, where Xo a,nd h are arbitrary


constants, h positive, and let Xl' X 2 , , be the values of X corresponding
to the values I, 2, ... , respectively, of z. We have fl(Z) = f(x), say, and
for arbitrary positive integers k and T,

The summation formula can then be written as

(7.7:18) Ii1 f"''' f(x) dx = (tYo + YI + ... + Yn-l + lYn)


"'0
k B
_ ~ ~ (yI2i-U _ yll/-U) hl/-l
~ (2j)1 n 0
268 7. NUMERICAL DIFFERENTIATION AND INTEGRATION

or

(7.7:19) r"f(x} dx = h(!yo + Yl + ... + Y"-1 + ty,,}


"'0

_ ~ B 2J (y(2;-U _ y(2;-U) h2; + R*


~ (2j}!" 0 2k '

where yft) now means

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

is a formula of'Table 7.2:t3,

is a corresponding formula of Table 7.2:t3. If in the last equality we


raise all subscripts on y(r) and the differences by the same integer n,
we obtain the formula

Hence
00

(7.7:20) (y"(r) _ y(r)}


0
hr = ~ a
~ r.r+a
.(Llr+i1J
J,,-(r+a)
. _ (-I); Llr+iy )
0
i=O

Hence, by substitution into 7.7:19,

(7.7:21) r"f(x}dx = h [(iYo + Yl + ... + Y"-1 + iy,,)


"'0
7.8. NUMERICAL INTEGRATION IN TERMS OF ORDINATES 269

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

- 112 (..1Yn-1 - ..1Yo) - ;4 (..12Yn_2 + ..1%)


_. 7~ (..13Yn _3 - ..13yo) - 1~ (..1'yn-4 + ..1'10)
- ~:~o (..15yn_& - ..15yo) - 2!~~2 (..16Yn _6 + ..16yo)
33953 (..17 ..17) 8183 (..18
- 3628800 Yn-7 - Yo - 1036800 Yn-8 + ..18Yo )
- ... - ...J.
EXERCISE 7.7
1. Copy the values of cos x for x = 200 22 0 24 0... 300 from a five-place table.
Compute. by use of 7.7:8 or 7.7:9. and Table 7.7:tl. g,
cos x dx for u = 18 0 190 200
210. .31 0.320.
2. Use a five-place table and appropriate formulas to evaluate f: InS x dx for u = I.
I.S. 2. 2.S. 4. S. 10.
3. Let functions be defined as in Exercise 7.2. example 3. Find
a. f:.!(x) dx for u = 33. 36. 40. 43. 48.
b. f:.as!(x) dx for u = S.IO. S.SS. 6.00. 6.4S. 6.90.
c. f:. 5 !(x) dx for u = 6.0. 6.4. 6.8. 7.8. 9.0.
d. J;,!(x) dx for u = 30. 32. 36. 37. 38.
4. If (2.3:2S) In = f! (!) dt and Hn = f: (!> dt. prove Hn = ~i-o II(n-:+1).
S. Prove that the c's of Table 7.7:t1 satisfy the relationship Ct.1 = Ck-l.i-l + Ck-l.i + Cl.l.
Starting with the formula for k = I. CO.I = 0 for every i. Ck.-l = 0 for every k. derive the
other formulas of Table 7.7:tl.

7.8. Numerical Integration in Terms of Ordinates. In this section


we seek formulas for the numerical evaluation of the definite integral

(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

The most primitive evaluation is found in any calculus text and


depends on the very definition of the definite integral. If the x-axis
from x = a to x = b is divided into n equal intervals by n 1 points +
whose abscissas are Xo = a. Xl' X 2 X n - l Xn = b. then h r.~:oIYi
and h r.~=IYi' where h = xHI - Xi. are crude approximations to the
definite integral 7.8:1. The relation of these sums interpreted as sums
of areas of rectangles to the definite integral interpreted as an area is
well known and need not be elaborated here. The arithmetic average
of the sums. namely. h[i(Yo + Yn) + r.~.:;.lYi]' usually gives a better
approximation to the definite integral; the last expression is recognized
as the sum of the areas of trapezoids and is also too well known for
further mention here.
More refined formulas can be obtained in several ways. The method
of undetermined coefficients explained in Section 7.4 is also applicable
here. As in the case of numerical differentiation. we use the basic set
of polynomials
(7.8:2) Y = I. Y = x. Y = xS, ... ,y = x",

and the ordinates evaluated at the abscissas X = O. 1. . .. n. to obtain


a formula of the type

(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

(7.8:4) (Y dx = boYo + blYI + ... + bnY"


so that this equation is exact for the polynomials of 7.8:2. Using the
values O. I ... n for x. we are led to the system of simultaneous linear
equations
bo + bl + bs + ... + b" = I,
bl + 2b s + ... + nb" = 1,
bl + 22b s + ... + n2b" = t,
(7.8:5)

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,

whence bo = 9/24, b1 = 19/24, b2 = -5/24, b3 = 1/24. Consequently,


we obtain the formula

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 .

The answer, of course, can be verified by direct computation. The for-


mula is not exact for polynomials of degree 4.
Another method of obtaining formulas of type 7.8:3 is by direct use
of the formulas of Table 7.3:tl. For example, we have for n = 4,

12hyo' = -25yo + 48Yl - 36yz + 16Ya - 3Y4 ,


12hYl' = -3yo - 10YI + 18yz - 6Y3 + Y4'
12hyz' = Yo - 8Yl + 8Ya - Y4'
12hYa' = -Yo + 6Yl - 18yz + 1OY3 + 3Y4 .
We eliminate y, from these equations to obtain

12h(yo' + Ya') = -26yo + 54Yl - 54Y2 + 26Ya,


12h(Yl' + Y2') = -2yo - 18Yl + 18yz + 2Ya,
12h(yo' + 3Yl') = -34yo + 18Yl + 18yz - 2Ya'
We next eliminate Y3:

12h(yo' - 13Yl' - 13yz' + Ya') = 288Yl - 288yz ,


12h(yo' + 4Yl' + yz') = -36yo . + 36Y2'
272 7. NUMERICAL DIFFERENTIATION AND INTEGRATION

Finally, we eliminate Y2:

Hence

But J:~y' dx = Yl - YO' and therefore,

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,

(7.8:6) .:1 rYk = (-ly-i nYi+k'


i=O '

to replace the finite differences in 7.7:8. We obtain

(7.8:7) J.., Y dx = h \/Ho (t)I Yo


"0

+ [Ho G) + HI G)] (-Yo + Yl)

+ [Ho G) + HI G) + H2 G)] (Yo - 2Yl + Y2)


+ ........................... I,

hHi ( _!+ 1)(-ly-i(~)Yi'


i=O ' J i=O '

where the H's are given by 7.7:7.


7.8. NUMERICAL INTEGRATION IN TERMS OF ORDINATES 273

If we replace the finite differences in the formulas of Table 7.7:tl


by their values in terms of the ordinates, we obtain the formulas of
Table 7.8:tl. We have tabulated there the range of integration and
the max-degrees of the polynomials for which the formulas are exact as
well as the multipliers of h and the coefficients of the ordinates. Thus,
if y = f(x), the tenth formula states

f "'B

"0
3h
Y dx = 80 (9yo + 34Yl + 24Y2 + 14Ya - Y4)

The right-hand member is, of course, only an approximation to the


integral unless y is a polynomial of max-degree 4. Formulas 5, 14, 23,
30, 36, and 13,22,29, 35 of Table 7.8:tl are known as the Newton-Cotes
formulas; the first group consists of the closed-type formulas, so-called
because the range of integration coincides with the range of the ordinates
involved; the second group consists of the open-type formulas, so-called
because the range of integration is greater than the range of the ordinates
involved. Several of these formulas have special names; formula 0 is
known as the trapezoidal rule, formula 5 is Simpsons's one-third rule,
formula 9 is Simpsons's three-eights rule.
Some of these formulas can be simplified with little sacrifice in the
margin of error or in the number of ordinates involved. Thus, if y = f(x)
is a polynomial of max-degree 5,
.1 6yo = Yo - 6Yl + 15Y2 - 20ya + 15Y4 - 6y5 + Y6 = o.
Multiply this expression by 3/10 and add to the right-hand member of
formula 22 of Table 7.8:tl ; we obtain a simpler formula exact for poly-
nomials of max-degree 5,

(7.8:8)

known as Weddle's formula.


A formula of Table 7.8:tl can be combined with itself or with other
formulas of the table to yield formulas for integration over longer
intervals. For example, since

f "'2m Y dx = f"'2 Y dx + f"" Y dx + ... + f"'m Y dx,


:1'0 %0 %2 a"2m-1

and since, by formula 5 (Simpson's rule),


h
f
"'~/

%: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

I'"O f(x) dx = Kh ~ Ct.iY-i


z_k 1-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
.....
~

TABLE 7.8:tl (continued)


VALUES OF COEFFICIENTS FOR NUMERICAL INTEGRATION

IZkj(X) dx = Kh ~ Ck Y.
2'0 i-o-

I'"" j(x) dx = Kh ~ Ck .Y_i


X_.t 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

we obtain, by adding up the m integrals for i = I, 2, ... , m,


(7.8:9)
f"1lm

"0
Y dx
h
= "3 (Yo + 4Yl + 2Y2 + 4Y3 + ... + 2Y2m-2 + 4Y2m-l + Y2"')

Also, since

we have

which, if it is desirable to have small coefficients, can be rewritten as

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

b. I: VI + 2xa dx, for u = 1,2,3,4; 2 dp

c. I HU

1-u
sin -
Xl

4
dx, for u = 0, i, i, t, 1; 2 dp

d. I: cos Xl dx, for u = i, I, !, 2; 3 dp

e. I: riel dt, for x = J-, 2, f' 3, 4; 3 dp

f. I: e lill dt, for x = t, I, 2, 3, 4; 3 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

3. Derive by the method of undetermined coefficients or otherwise a formula of the


indicated type, exact for polynomials of the stated max-degrees.

n = 3.

n = 3.

n = 2.

n = 6.

7.9. Magnitude of the Error in Numerical Integration. In this


section we consider the magnitude of the error when a definite integral
is approximated by a formula of the preceding sections. The discussion
will parallel the discussion given in Section 5 of this chapter. As there,
let

(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

(7.9:2) f ba f(x) dx = fba Pn(x) dx + hn+1 fba pn+1I(X) (n+1


t ) dx,

and the error committed in approximating t f(x) dx by t Pn(x) dx is


a a

(7.9:3) E(x) = fb f(x) dx - fb Pn(x) dx = hn+1 fb pn+1I(X) ( t ) dx.


a a a n+1
If we again assume as in Section 5 that pn+lI(X) is constant within
the interval of integration, and if we substitute h dt for its equal dx,
then

(7.9:4) E(x) = hn+~Cn+1I(X) f Cb-ZO' III

Ca-zol/ll
(
n
t
+1
)
dt.

In particular, if we put a = Xo and b = Xk, the error becomes

(7.9:5)
280 7. NUMERICAL DIFFERENTIATION AND INTEGRATION

which in view of 7.5:5 can be rewritten as

(7.9:6)

The integral on the right has been discussed on several previous


occasions. Its value is the coefficient of LlnHyo in the row for Xo - Xk
in Table 7.7:tl.
The arbitrary condition that pn+l)(x) be constant within the interval
of integration can be removed by the following artifice. Let

(7.9:7)

be a typical formula for which we wish to estimate the error. If


f f(x) dx = F(x) so that F'(x), then

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

F(X2) - F(xo) = i (F'(x o) + 4F'(x1 ) + F'(x2

Since Simpson's formula is exact if f(x) is a polynomial of max-degree 3,


the last statement is exact if F(x) is a polynomial of max-degree 4. If
7.10. GAUSS' FORMULAS; ORTHOGONAL POLYNOMIALS 281

we then put n = 4 in 7.5:10 and proceed as in that section, we find the


error in the last expression to be

E(x) = f" R(s)F(5)(s) ds,


"0

where

(X2 - S)4 2 3
R(s) = 24 U(s I Xo , x2) - 9 h(Xl - s) U(s I Xo , Xl)

- ;8 (X2 - S)3 U(s I Xo , x 2)

It is not difficult to prove that R(s) :::;;; 0 for all values of s, hence

E(x) = F(SI(X) f" R(s) ds.


"0

We find by direct integration

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

1. Determine the errors in the formulas of Table 7.8:tl.


2. Determine the errors in the formulas of Exercise 7.8. example 3.

7.10. Gauss' Formulas; Orthogonal Polynomials. In Section 8 of


this chapter we developed a number of formulas of the type

for the approximation of the definite integral, where h = Xi+l - Xi .


In general, these formulas yielded exact values whenever f(x) was a
polynomial of max-degree n. It is reasonable to expect that if the restric-
282 7. NUMERICAL DIFFERENTIATION AND INTEGRATION

tion that the x's be equally spaced be removed, it might be possible to


obtain a formula of the type

(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

(7.10:2) (f(X) dx = Aof(xo) + Ad(xl ) + ... + AJ(xn),


where we have dropped the primes on the x's for the sake of simplicity
and where Ai = ai/(b - a). A formula of this type is known as a Gauss
formula for numerical integration. We use the method of undetermined
coefficients and endeavor to determine the 2n + 2 constants so that
7.10:2 is exact for each of the polynomials

(7.10:3) y = I, y = x, y = X2, "',y = x2n+1.

If we succeed in finding a formula which is exact for these polynomials,


it will follow at once from the linearity properties of the integral that
it will be exact for any polynomial of max-degree 2n 1. +
If we use Eqs. 7.10:3 in turn in 7.10:2, we obtain the following system
of equations to be solved for the A's and the x's:

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

First of all, we solve the system of linear equations

!+ 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)

[k + n] + U1 [k + n] + ... + Un [k + n] = M(k _ I)(k _ 2) ... (k - n),


n + 1n n + 1 n-l n + 10

where M is a constant. Put k = 0; every term on the left-hand side


drops out except the first which becomes n!; the right-hand side becomes
(--I)nn!M. Hence M = (-I)n. Now put k = -i, i = I, 2, ... , n.
The equality 7.10:6 reduces to

Ui [n - i] = (-I)n(-i _ I)(-i - 2)'" (-i - n)


n+l n- i
284 7. NUMERICAL DIFFERENTIATION AND INTEGRATION

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.

Secondly, we consider the polynomial of degree n defined by

or

(7.10:8)

This polynomial is known as the Legendre polynomial of order n (but


see the remark a little further on) and has some important properties
which we state and prove below. We also list in Table 7.1O:tl the first
ten Legendre polynomials for ready reference.

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

Property a. If p(x) is any polynomial of max-degree n - I, then

(7.10:9) ( p(x) Pn(x) dx = O.

In particular, we have;

Property b.

(7.10:10) ro
Pn(x) P",(x) =0 if n =F m.

Property c.

(7.10:11)

Property d. The roots of

(7.'10:12)

are all real, distinct, and between 0 and I.


If two functions f(x) and g(x) have the property indicated in 7.10:9,
or more generally, if the two functions are so related that

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.

Property a follows at once since f[Cjl(X) + C2.Mx)] dx = C1fjl(X) dx +


C2fj2(X) dx, where C 1 and C 2 are arbitrary constants. Property b is an
immediate corollary of the first property.
To prove property c, we note that fl P,.2(X) dx reduces to
o

which equals

( -I)" (2n) ~ ( -I )i . (~) (n ~


n ~n+I+" ,
i) .
Put k = n + I in the identity immediately following the set of equations
7.10:5 and use 7.10:6, 7.10:7, and 7.1:19; we obtain

~ (-I)i (n) (n + i) = (-I)"(n!)2


~n + I +iii (2n+ I)! .

Hence

I P"x2( ) dx = (-I)" (2n)n (-I)"(n!)2


l
o (2n + I)!
= _1_
2n + I '

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

positive in some portion of the interval from 0 to 1. On the other hand,


if we put p(X) = 1 in 7.10:9, we get

s: P,,(x) dx = 0,

and if we recall that the definite integral can be interpreted as an area


above the x-axis minus an area below the x-axis, we learn that P",(x)
must be negative in some portion of the interval. It follows that the
equation P",(x) = 0 must have at least one root between 0 and 1 of odd
multiplicity. Let r1 , r2 , ... , rg be the distinct (real) roots of P",(x) = 0
that are between 0 and 1 and are of odd multiplicity. Then rex) =
(x - r1 )(x - r2 ) ... (x - rg) is a polynomial of degree g ~ n. Hence,
by property a,

f: rex) P,,(x) dx = 0,

unless g = n. But the polynomial r(x)p",(x) is not identically zero and


does not change sign between 0 and 1 so that fl r(x)p",(x) dx cannot be
equal to zero. It follows that g = n, which rri'eans that the roots of
P",(x) = 0 are distinct and between 0 and 1 as we wished to prove.
Incidentally, we have already seen that P ",(0) = 1 and it can be shown
that P"'( 1) = (-1)"', hence neither 0 nor 1 are roots.
We are now ready to solve Eqs. 7.10:4. Multiply the first equation by
("'~1)("'~1), the second by _("'11)("'12), the third by ("'~1)("'~3), and so on
to the (n + 2)nd equation which is multiplied by (-1 )"'+l(:me::12 );
then add the n + 2 results. We obtain

= ~ (-I)i _.1_ (n ~ I) (n + ~ + i)
i=O ' +I, ,

where P"+l(x) is the Legendre polynomial of order n +


1. Now multiply
the second equation by ("'~1)("'~1), the third by -("'11)("'12), the fourth
+
by ("'~1)("'~3), ... , the (n 3)rd by (-I)"'+l(:m(~:{) and add the
results. We obtain

AoXoP,,+1(xo) + A1x1Pn+l(X1) + ... + A"x"P"+1(x,,) = s: XP"+1(x) dx.


288 7. NUMERICAL DIFFERENTIATION AND INTEGRATION

We repeat this process for each set of n +


2 consecutive equations of the
system 7.10:4. We thus obtain the system of n +
1 homogeneous
equations:

A"p"+1(xo) + A 1P"+1(Xl) + ... + A"P"+1(x,,) = 0


AoX"p"+1(xo) + A 1x1P,,+1(Xl) + ... + A"x"P"+1(x,,) = 0
(7.10:14) AoXo2P"+1(xo) + A 1x 12P"+1(X1 ) + ... + A"X,,2P"+1(X,,) = 0

The right-hand members of these equations all vanish in view of the


orthogonal property of the Legendre polynomials.
Equations 7.10:14 will clearly be satisfied no matter what the A's are
if we choose the roots of Pn+l(x) = 0 for X O ' Xl , . , X" If we so choose
the x's and then substitute their values in the first n + 1 equations of
7.10:4, we obtain a set of n + 1 equations linear in the A's. The deter-
minant of the coefficients (of the A's) is the Cauchy-Vandermonde
determinant previously discussed (page 72) which does not vanish
since the x's are distinct. Consequently, the A's can be uniquely
determined.
It remains to prove that the A's and x's so determined will satisfy
the remaining equations of 7.10:4. But this prooffollows readily enough.
We have already seen that the first equation of 7.10:14 was obtained by
multiplying each of the first n + 2 equations of 7.10:4 by certain con-
stants and adding the results. We note, first, that the constant multi-
plying the last equation is (-1 )n+l(~+'i2) which is not zero and, second,
that since the x/s were chosen as the roots of Pn+l(x) = 0, the coefficient
of each Ai in 7.10:14 is identically equal to zero. These remarks imply
that the (n + 2)nd equation of 7.10:4 is linearly dependent on the first
n + 1 equations and hence any solution of the first n +I equations is
necessarily a solution of the (n + 2)nd. Precisely the same line of
reasoning applies to the remaining equations of 7.10:4. That is, the A's
and x's that were found to satisfy the first n +
1 equations of 7.10:4
will satisfy all the equations of the system.
Table 7 .1O:t2 gives the values of the roots of the Legendre polynomials
and the corresponding A's (the Gaussian coefficients) up to n = 10,
and two illustrative examples are worked out below. Note that since
most of the x's are irrational, the greater precision afforded by the use
of Gauss's formulas may be more than offset by the greater difficulty
in computing the corresponding f(x),s, unless a computing machine
is used.
7.10. GAUSS' FORMULAS; ORTHOGONAL POLYNOMIALS 289

TABLE 7.10:t2

Degree of polynomial for Roots of Gaussian


n which Eq. 7.10:2 is exact Legendre polynomials coefficients

x. = 0;5 A. = I

2 3 x. = 0.2113248654 A. = 0.5 (1/2)


Xl = 0.78867 51346 Al = 0.5 (1/2)

3 5 x. = 0.1127016654 A. = 0.2777777778 (5/18)


Xl = 0.5 Al = 0.44444 44444 (4/9)
X. = 0.8872983346 AI = 0.27777 77778 (5/18)

4 7 X. = 0.0694318442 A. = 0.17392 74226


Xl = 0.33000 94782 Al = 0.3260725774
XI = 0.6699905218 AI = 0.3260725774
Xa = 0.9305681558 Aa = 0.1739274226

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

6 II X. = 0.0337652429 A. = 0.08566 22462


Xl = 0.1693953068 Al = 0.1803807865
X. = 0.3806904070 AI = 0.23395 69673
Xa = 0.6193095930 Aa = 0.23395 69673
x, = 0.8306046932 A, = 0.1803807865
Xi = 0.96623 47571 Ai = 0.08566 22462

7 13 X. = 0.02544 60438 A. = 0.0647424831


Xl = 0.1292344072 Al = 0.1398526957
XI = 0.29707 74243 A. = 0.19091 50253
Xa = 0.5 Aa = 0.2089795918
x, = 0.70292 25757 A, = 0.1909150253
X. = 0.8707655928 A. = 0.13985 26957
x, = 0.97455 39562 A, = 0.0647424831

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

TABLE 7.IO:t2 (continued)

Degree of polynomial for Roots of Gaussian


n which Eq. 7.10:2 is exact Legendre polynomials coefficients

9 17 Xo = 0.01591 98802 Ao = 0.0406371942


Xl = 0.0819844463 A1 = 0.09032 40803
X8 = 0.19331 42836 As = 0.1303053482
X. = 0.33787 32883 A. = 0.15617 35385
X. = 0.5 A. = 0.16511 96775
Xi = 0.6621267117 Ai = 0.1561735385
x, = 0.8066857164 A, = 0.1303053482
X7 = 0.91801 55537 A7 = 0.0903240803
X. = 0.9840801198 A. = 0.0406371942

10 19 Xo = 0.01304 67357 Ao = 0.03333 56722


Xl = 0.0674683167 A1 = 0.07472 56746
X. = 0.1602952159 As = 0.1095431813
X. = 0.28330 23029 A. = 0.1346333597
X. = 0.42556 28305 A. = 0.1477621124
Xi = 0.57443 71695 AI = 0.1477621124
x, = 0.7166976971 A, = 0.1346333597
X7 = 0.8397047841 A7 = 0.1095431813
X. = 0.93253 16833 A. = 0.07472 56746
x. = 0.9869532643 A, = 0.03333 56722

The Legendre polynomials can be used to extend some of the results


of Section 3.1. We were then looking for a polynomial Pn(x) = ao + a1x
+ a2x 2 + ... + anxn which would minimize the integral
Is = t
II
[f(x) - Pn(x)]2 dx,

where f(x) was a given function of x. It is more convenient to express


Pn(x) not as a polynomial in x but as a polynomial of the form
(7.10:15)

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

Our problem is then to determine the coefficients bo , bl , bn in


7.10: 15 so that
(7.10:16)
IS a minimum.
1=
o
r
[f(x) - Pn(x)]2 dx

Necessary conditions for a minimum to exist are that

(7.10:17) i = 0, 1, ... , n,

assuming that the partial derivatives are continuous. We have

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] .

The last reduction follows from properties band c of the Legendre


polynomials. Hence the condition 7.10: 17 will hold if

(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.

It follows from theorems of advanced calculus that the values of the


b/s given by 7.10:18 will make I given by 7.10.16 a minimum and not a
maximum. The desired polynomial 7.10: 15 is thus given by

(7.10:19) Pn(x) = i
i-O
(2i + 1) Pi(x) t 0
Pi(x)f(x) dx.

We illustrate an application of the preceding discussion by reworking


example 2 of Section 3.1, page 69. We make the transformation
X = X/TT. The function f(x) then becomes sin TT X and we have
292 7. NUMERICAL DIFFERENTIATION AND INTEGRATION

We evaluate these integrals and find ho = 2/TT, hi = 0, h2 = IO/TT -120/TT3


The required polynomial is then

~+
TT
(10 _ 120) (1 _
1T 1TS
6X + 6X2)

which becomes after simplification and a return to the original variable x,

the same result as the one previously found.


We do two additional examples as illustrations of the direct use of
formula 7.10:2 and Table 7.IO:t2.

EXAMPLE 2. Find the value of flo sin x dx by use of the Gaussian


formula 7.10:2 for three points.
We find (Table 7.IO:t2)

X o = 0.11270, Xl = 0.5 (exactly), X2 = 0.88730,


A o = 5/18, Al = 4/9, A2 = 5/18.
Hence the integral is approximately equal to

158 sin 0.11270 + ; sin 0.5 + 158 sin 0.88730 = 0.45970.


The answer is correct to five significant figures and can be readily
checked by direct integration.

EXAMPLE 3. Find the value of f~l eX dx by use of the Gaussian formula


for four points.
In order to use Table 7.IO:t2, we first make the transformation
Z = (x + 1)/3 so that the required integral becomes 3fl e3Z - 1 dz. From
o
the table,
Zo = 0.06943, A o = 0.17393,
Zl = 0.33001, Al = 0.32607,
Z2 = 0.66999, A2 = 0.32607,
Zs = 0.93057, As = 0.17393.
Consequently, the required integral is approximately equal to
3(0.17393e"06943 + 0.32607eo.33001 + 0.32607e"66999 + 0.17393e"93067) = 7.0212.
7.10. GAUSS' FORMULAS; ORTHOGONAL POLYNOMIALS 293

The answer is correct as far as it is written and it too can be readily


checked by direct integration.

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

.. I: [Vx - p,(X)]8 dx. b. (1 [e" - p,(x)]' dx. c. I: [cos x - P.(x)]' dx.

4. If u, is given by 7.10:7. prove

~_u_/_ = (-I)" (n: I) .


-t:k+i k (k+n)
n+1
5. If F(x) = (x - x o) (x - Xl) . (x - x ..). where the x/s are the zeros of the Legendre
polynomial Pn+1(x). prove that the A's satisfying 7.10:4 are given by
I
A, = - - -
F'(Xi)
II
0
F(x)
----dx
x - x,
i = O. I ..... n.

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

The Numerical Solution


of Ordinary Differential Equations

8.1. Statement of the Problem. It is well known that the mathemat-


ical formulation of a natural phenomenon frequently leads to an ordinary
differential equation, that is, to an equation whose general form is
(8.1:1) F(x,y;y',y", "',y(n) = 0,
where x and y are the variables and y', y", ... , y(n) are, respectively,
the first, second, ... , nth derivatives of y with respect to x. The formula-
tion of a natural law involving three or more causally related entities
frequently leads to a partial differential equation, that is, to an equation
involving the dependent variable y, two or more independent variables
Xl , X z , . , and one or more of the partial derivatives of y with respect
to one or several of the independent variables. We discuss only ordinary
differential equations in this text.
It is often more convenient and sometimes highly desirable to write
the law expressed by 8.1: 1 in the form

(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:3) f(x,y; Cl , Cz, , cn) = O.


294
8.1. STATEMENT OF THE PROBLEM 295

It is customary to call a solution in this form a general solution; a general


solution of a differential equation thus represents not a single curve
but an n-fold infinity of curves. If particular values are assigned to the
parameters c1 , C2 , , Cn , the resulting solution is called a particular
solution. Thus, if C1 and C 2 are arbitrary constants,

(8.1:4)
is a general solution of

(8.1:5) (x + l)y" + xy' - y = 0,


and
(8.1:6) y = x, y = 2x - 3e-"',
are particular solutions. If the general solution 8.1:3 of a differential
equation involves n arbitrary constants and particular values are assigned
to m of them, where 0 < m < n, or if m parameters are replaced by
combinations of the others, the resulting equation represents a particular
(n - m)-fold family of solutions of the general solution. Thus,

(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,

a solution of the latter would not differ materially from a solution of


the first. This equation has a general solution

(8.1: 10) 8 = C1 sin ~f t + Cz cos ~f t


which is readily obtained by standard procedures. (Incidentally, it fol-
Cows at once from this solution that the time of the complete swing
of the pendulum is given by the familiar formula T = 2TTvl/g. This
formula, of course, is subject to the error due to the replacement of
8.1:8 by 8.1:9.)
This method of obtaining a solution is frequently employed but it is
open to a most obvious objection. Even though we replace a factor or term
in the given differential equation by another almost numerically equal,
how can we be assured that the error in the solution will be small?
Undoubtedly, one ought to know the magnitude of the error in the solu-
tion due to the modification of the differential equation. But this is, as a
rule, not an easy matter to determine. Ordinarily, if a solution is obtained
in this manner and if the results agree with experimental data, the
solution is kept, right or wrong. It is, indeed, a useful and powerful
method, but we shall not discuss it further for the subject properly
belongs in the study of differential equations.
The second general method of obtaining an approximate solution
employs the given differential equation without modification. This time,
we do not attempt to approximate a general solution (although some
procedures do yield it), but we are content with approximating a parti-
cular solution. Ordinarily, the general solution is particularized in
advance by specifying certain initial or boundary conditions. The exam-
ples will illustrate various methods of doing this.
The second general method is itself subdivided into two submethods.
In the first of these we seek a function
(8.1:11) a(x,y) =0
which is an approximation to the particular solution; in the second, we
desire not a function at all but merely the numerical values of
(8.1:12) Yl' Y2' Y3''
8.1. STATEMENT OF THE PROBLEM 297

corresponding to given numerical values

(8.1:13)

such that the pairs

(8.1:14)

satisfy (approximately) a preassigned particular solution. A solution of


this type will be called a pointwise solution and will be referred to as
such henceforth.
The remainder of this chapter is devoted to the development and
discussion of these approximation methods as they apply to a limited
number of simple cases. Before we plunge into these arithmetic approx-
imation methods, it might be well to consider briefly a graphic method
which, although rough, is sometimes quite helpful and informative for
differential equations of the form

dy
(8.1:15) dx = F(x,y).

If very good approximations are not necessary, the graph is frequently


adequate and has the advantage of speed; if great precision is necessary,
the graph can be used advantageously in conjunction with the later
methods to throw light on the nature or behavior of the solution.
The graphic methods utilizes the so-called lineal-element diagram.
Let h be a small positive quantity; the points

(8.1:16) (ih,jh), i,j = 0, 1, 2, 3, "',


form a square lattice that covers the plane. The differential equation
8.1: 15 determines a slope at each lattice point for which F( ih, jh) exists.
At each lattice point a small line segment, called a lineal element, of
length approximately h and centered on the lattice point, is drawn with
the determined slope. The totality of lineal elements is the lineal-element
diagram. A curve whose equation is a solution of 8.1: 15 is tangent to
the lineal elements of the lattice points whose coordinates satisfy the
equation. Hence, if we start at any point and follow the slope lines, we
can sketch a curve whose equation is a particular solution of the differen-
tial equation 8.1: 15.
Figure 8.1:fl shows that portion of a lineal-element diagram within
a 4 by 4 square centered on the origin with h = 0.2 determined by the
298 8. NUMERICAL SOLUTION OF ORDINARY DIFFERENTIAL EQUATIONS

differential equation y' = x + y2. The particular curves passing through


(0, I), (0, 0), (0, -I) are shown.
The method is rough; but with care and experience, the graph of a
solution can be drawn which, although inadequate by itself, does
throw much light on the behavior of the required solution.

""//~//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

FIG. 8.1 :fl.

The number of lineal elements that need be drawn can be greatly


reduced if we want one or just a few particular solutions. For example,
suppose we wanted only that particular solution of y' = x + y2 which
passes through the origin. We calculate y" from the differential equation
and find y" = I + 2xy + 2y 3. At the origin, y' = 0, y" = I. Hence
the curve representing the sought solution is tangent to the x-axis at
the origin and is there concave upward. We draw the lineal elements
for x = 0.2 andy = 0, 0.1, 0.2; then for x = 0.4 andy = 0.1, 0.2, 0.3;
and then sketch the portion of the curve from x = 0 to x = 0.4. With
an eye on the part of the curve already drawn, and with an occasional
assist from the second derivative, we draw lineal elements for x = 0.6,
0.8 and appropriate values of y. We continue to sketch the curve and
draw additional lineal elements until we have as much of the curve as
we want.
8.2. PICARD'S METHOD OF SUCCESSIVE APPROXIMATIONS 299

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).

c. y' = Xl - y, (0, 0). d. y' = _x_ , (0, 1).


y -1
e-Z
e. y' = --, (0,0).
yl - 1
2. Draw only as many lineal elements as needed to sketch the particular solutions
determined by the given points. Where helpful, make use of the second derivative .
. y' = x + e- z ; (0,0), (5,0), (-5,0).
b. y' = xy; (-1,0), (0,0), (1,0).
c. y' = (sin x)/y; (0, I), (0,0.5), (0,0.1).
3. Superimpose on each of the five lineal-element diagrams of example 1 new lineal-
element diagrams such that the old and new lineal elements of a lattice point are perpen-
dicular. Sketch, for each of the five parts, several curves determined by the new lineal-
element diagrams.

8.2. Picard's Method of Successive Approximations. The first


method of getting an approximation to a particular solution of a differen-
tial equation that we consider is due to Emile Picard. We give it mainly
for historic reasons since it is usually cumbersome and difficult of appli-
cation in practice and is therefore infrequently used for computational
purposes. However, its basic feature is the underlying concept in several
of the methods to be discussed later. As the name implies, the method is
an iterative one and is similar in spirit and application to the procedure
described in Section 5.3 for the numerical solution of ordinary equations.
Let
(8.2: 1) 7x = F(x,y)
be the differential equation to be solved. If F(x, y) is independent of
y, the solution is y = fF(x) dx and the problem is trivial, at least from
the point of view of differential equations. If the integral is not easy to
compute, we always have recourse to the methods of the preceding
chapter on numerical integration.
We assume henceforth that y is present in F(x, y). Let the desired
solution of the differential equation 8.2: 1 be of the form
(8.2:2) y =f(x).
The differential equation can then be rewritten as

(8.2:3) d~~) = F(x,J(x,


300 8. NUMERICAL SOLUTION OF ORDINARY DIFFERENTIAL EQUATIONS

whence

(8.2:4) y = f(x) = I F(x,J(x dx.


This equation, of course, does not solve the problem since the unknown
f(x) appears in the integrand j it is merely another form of 8.2: I, a form
which is more vulnerable to our present line of attack. (As an aside,
we remark that Eq. 8.2:4 is a particular example of what is known as
an integral equation j the study of integral equations is a separate and
distinct branch of mathematics.)
Rather than solve Eq. 8.2:4 in its generality, we will attempt to find
a particular solution. Since the general solution will contain one arbitrary
parameter, we are free to impose one condition if we wish to particularize
the solution. A usual method of imposing a condition is to require that
the curve representing the particular solution pass through a given
point (xo , Yo). The condition implies that Yo = f(x o). Now, one simple
way of writing this condition into the general equation 8.2:4 is to rewrite
the latter as

(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)

which, under conditions to be stated later, will converge to the desired


solution 8.2:6.
We start with the approximation

and substitute this value for y in the right-hand member of 8.2:6 to


obtain
Yl = ft(x) = Yo + r... F(x, Yo) dx .
8.2. PICARD'S METHOD OF SUCCESSIVE APPROXIMATIONS 301

Since the integrand is now a function of x only, the integration can be


carried out, at least theoretically. We substitute Yl for Y in the right-
hand member of 8.2:6 to obtain

Y2 = !2(X) = Yo + r
"'0
F(x, Yl) dx.

We substitute Y2 for Y in the right-hand member of 8.2:6 to obtain

Ya = !a(x) = Yo + r
"'0
F(x, Y2) dx,

and so on. In general, the (n + I )st approximating function is obtained


from the nth by the recursive formula

(8.2:8) Yn = !n(x) = Yo + r
"'0
F(x, Yn-l) dx.

The iterative process yields in this manner a sequence of functions


8.2:7. It can be proved that if, the function F(x, y) is bounded in some
suitable region about the point (xo , Yo), that is, if there exists a positive
number L such that

(8.2:9) IF(.'t,y) I <L


for all x's and y's in the region, and if there exists a positive constant K
such that for any pair of points with the same abscissas (x, y), (x, ji),
in this region the Lipschitz condition

(8.2:10) IF(x,y) -F(x,y) 1< K(y - y)

holds, then the sequence of functions 8.2:7 approaches a limit function


y = f(x) which is a particular solution of 8.2: I that passes through
(xo ,Yo), It is well to note that the Lipschitz condition 8.2: 10 must
necessarily hold if F lI (x, y) exists in a neighborhood of (xo ,Yo),
We illustrate Picard's method by several examples.

EXAMPLE 1. Find the particular solution of y' = x + y2 which passes


through the point (0, 1).
It is readily verified that the conditions for a solution to exist hold.
The first approximation is the ordinate of the given point, Yo = I,
whence, from 8.2:8,

Yl = 1+ (x + I) dx, or
302 8. NUMERICAL SOLUTION OF ORDINARY DIFFERENTIAL EQUATIONS

We substitute this second approximation into 8.2:8 and obtain

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 .

It is becoming clear that the sequence Yo , Yl , Y2, ... , is approaching


a function whose Maclaurin expansion starts

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

Yl = 1 + I: (sin x + 1) dx = 2 +x- cos x;

Y2 = 1+ I: [sin x + (2 + x - cos X)2] dx = 4 + ! x + 2x2 + i x3

-4 sin x - 3 cos x + i sin 2x - 2x sin x.

We decide to stop at this point because further approximations can be


obtained only with great labor. The method does not seem advisable
for this equation.

EXAMPLE 3. Find the solution of Y' = x + Y - y2 if, when y' = -1,


y" = -2.
We find from the differential equation that y" = I + (1 - 2y)y';
and hence from the given initial conditions, x + y - y2 = -1, 2y = -2.
We obtain by solving the last two equations, x = 1, y = -I. The desired
particular solution must pass through the point (1, -1) and it is readily
8.l. POWER SERIES APPROXIMATIONS lOl

ascertained that F(x, y) satisfies the conditions for a umque solution


at this point.
Starting this time with Yo = -I, we find

by repeated use of 8.2:8. We stop at this third approximation to the


particular solution.
Estimates of the error are not easy to obtain and we do not propose
to make such determinations here, but the following considerations will
throw some light on the material to follow. In the last example just
above, let us take x = 1.1. By substituting this value for x in the third
approximation we find the corresponding value of y to be -1.1098.
The differential equation then yields the value -1.24 for the derivative
at the new point. Using the value x = 1.1 in the derivative of the third
approximation, we obtain the value -1.19, just a fair approximation.

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. Power Series Approximations. In this section we find a solution


of

(8.3: 1) ~ = y' = F(x,y)


of the form

(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)

Our problem is to evaluate the coefficients so that 8.3:3 satisfies 8.3: 1.


We illustrate the method by reworking the examples of the preceding
section.

EXAMPLE 1. Find the solution of y' = x + y2 which passes through


the point (0, 1).
We assume the solution can be expressed as a power series

(8.3:4)

which converges in some interval about Xo = O. We have


(8.3:5)

and

(8.3:6) y2 = ao2 + (aual + alaO) x + (aua2 + alal + a2aO) x 2


+ ... + (aua.. + altln-l + .. , + tlnao) x" + ....
Therefore,

al + 2a2x + ... + (n + I) tln+1x" + ... = ao2 + (aual+ alaO+ I) x


+ (aOa2 + alal + a~o) x2
+ ... + (aua.. + ... + a..ao) x"
+ ... .
We equate the coefficients of like powers of x and obtain the following
system of simultaneous equations:

2a2 = 2aual +1
3a3 = 2aua2 + a l2
8.3. POWER SERIES APPROXIMATIONS 305

Consequently,

If we substitute these values for a l , a 2 , a3 , , into the power series


for y, we obtain a general solution of the differential equation. This
might have been anticipated because we have made no use as yet of the


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)

where, to repeat, dnf(xo)/dxn is the nth derivative of f(x) evaluated at


Xo. By successive differentiation (with respect to x) of the given differen-
tial equation, y' = x + y2, we find

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.

EXAMPLE 2. Find the solution of y' = sin x + y2 which passes through


the point (0, 1).
As before, we assume the solution can be written as the power series
8.3:4 so that 8.3:5 and 8.3:6 again hold. Since

sin x = x- -
x3
3!
+ -xli5! + ... + (_I)n+1 (2nX2n- - 1I)! + ... '
we now have

al + 2a~ + ... + (n + 1) xn + ... = ao2 + (aoal + alaO+ 1) x


+ (aoa2 + alaI + a2aO) x 2

+ (aoaa+ ala2 + a2al + aaao - x3 id


+ ............................. .
+ (aoa2n-1 + ala2n- 2 + ... + a2n- laO+ (~~ ~n~;!) X2n-1
+ (aoazn + ala271- 1 + ... + a 271all) x2n
+ ....
Therefore

2az = aoal + alaO+ 1


3aa = aoaz + alaI + azao
1
4a, = aoaa + ala2 + a2al + aaao - 3!
(_I)R+I
2na211 = aOa2n-1 + ala2n-2 + ... + a2n-lao + (2n _ I)!
(2n + 1) a2n+1 = aoa2n + a l a 2n- 1 + ... + a2..aO

Again ao = 1 so that a l = 1, a 2 = 3/2, a3 = 4/3, a4 = 11/8, ali = 23/15,


... , and
3 2 4 11 23 6
Y= 1 +x+-x
2 +-x3+-x'+-x
3 8 15 + ... .
8.l. POWER SERIES APPROXIMATIONS l07

Alternately, we have from y' = sin x + y2,


y" = cos x + 2yy'
yea) = _ sin x + 2(yy" + y'2)
y(') = -cos X + 2(yy(a) + 3y'y")
y(l) = sin x + 2(yy(') + 4y'y'a) + 3y"2)

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.

EXAMPLE 3. Find the solution of y' = x +y - y2, if y" = -2 when


y' = -1.
As before, we find that the given boundary conditions are equivalent
to imposing the condition that the solution pass through the point
(1, -1). This time we start with the power series 8.3:3 where Xo = 1,
whence

y2 = ao2 + (aoal + alaO)(x - 1) + (aoa2 + alaI + a2aO)(x - 1)2


+ ... + (aoa" + ala..-l + ... + a..ao)(x - I)" + ...,
and
y' = al + 2a2(X - 1) + ... + (n + 1) a..+1(x - I)" + ....
Substituting these values into the differential equation, we obtain

al + 2a2(x - + ... + (n + 1) a"+1(x - I)" + ...


1)
= (1 + ao - ao2) + (1 + al - aoal - alaO)(x - 1)
+ (a 2 - aOa2 - alaI - a2aO)(x - 1)2
+ (aa - aoaa - ala2 - a~l - aaao)(x - l)a + ....
Hence
al = 1 + ao - ao2
2a2 = 1 + al - aoal - alaO
3aa = a2 - aoa2 - alaI - a2aO
4a, = aa - aoaa - al a2 - a~l - aaao
Sal = a, - aoa, - alaa - a~2 - aaal - a,ao
308 8. NUMERICAL SOLUTION OF ORDINARY DIFFERENTIAL EQUATIONS

Since a o = -1, we have al = -1, a2 = -1, a3 = -4/3, a4 = -3/2,


a5 = -49/30, ... ; whence

Y = - [ 1 + (x-I) + (x-I)2 +"34 (x-I)3 +"23 (x-I)4 + 49 ]


30 (x-I)5 + ....

Or, since y' = x +y - y2,

y" = I + y' - 2yy'


y(3) = y" _ 2(yy" + y'2)
y(4) = y(3) _ 2(yy(3) + 3y'y")
y(5) = y(4) _ 2(yy(4) + 4y'y(3) + 3y"2)
............................ , '

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,

It is again of interest to compare the values of y' of the last example


computed directly from the differential equation and from the fifth
degree approximating polynomial for x = 1.1. We find from the poly-
nomial that the corresponding value of y is -1.11150; from the
differential equation we find y' = -1.2469; from the polynomial,
y' = -1.2468. There is much better agreement this time.
The method of power series lends itself to the solution of differential
equations involving second or higher derivatives. We illustrate by doing

EXAMPLE 4. Find the solution of Bessel's equation of order zero,

tPy dy
X dx 2 + dx + xy = 0,

whose graph has the slope 2 at the point (1, 1).


We assume the solution can be written in the form

y = a o + al(x - 1) + a2(x - 1)2 + '" + fln(x - I)" + ....


We find

y' = al + + ... + (n + I) fln+l(x - I)" + '" ,


2a2(x - I)
y" = I . 2a2 + 2 . 3a3(x - I) + ... + (n + 1)(n + 2) fln+2(x - I)" + .. , .
8.3. POWER SERIES APPROXIMATIONS 309

Write the differential equation in the form


(x - l)y" + y" + y' + (x - l)y + y = 0,
and substitute the power series expressions for y, y', and y". We obtain
(a o + Pal+ 1 . 2a2) + (ao + a l + 22a2 + 2 . 3a3)(x - 1)
+ (al + a2 + 32a3 + 3 . 4a4)(x - 1)2
+ (a 2 + a3 + 42a4 + 4 Sa6)(x - 1)3
+ ............................... .
+ (tln-l + tln + (n + 1)2tln+l + (n + 1)(n + 2) tln+2)(x - I)"
+ ......................................... .
= o.
[We assume further that all the algebraic operations performed on the
power series are permissible, at least in some region about the point
(I, 1).] The preceding equality yields

ao + 12a l + 1 . 2a2 = 0
ao + a l + 22a2 + 2 . 3a3 = 0
al + a2 + 32a3 + 3 . 4a4 = 0

We obtain from these equations, since Yo =/(1) = ao = l,yo' =/,(1) =


al= 2, the values a 2 = -3/2, a3 = 1/2, a4 = -5/12, a6 = 23/60, ....
Hence
3 1 5 23
y = 1 +2(x-l)--(x-l)2+-(x-l)3--(x-l)4+-(x-l)6+ ...
2 2 12 60 '

is the desired solution.


The alternate solution is also applicable. Write the differential equa-
tion in the form xy" + y' + xy = O. We obtain by successive differen-
tiation
xy(3) + 2y" + xy' + y =0
xy(4) + 3y(3) + xy" + 2y' = 0
xy(6) + 4y(4) + xy(3) + 3y" = 0

Since x = y = I, y' = 2, we find y" = -3, y(S) = 3, y(4) = -10,


yeo) = 46, .... These values yield the same values for ao , al , a 2 , as ,
'" , as before.
310 8. NUMERICAL SOLUTION OF ORDINARY DIFFERENTIAL EQUATIONS

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. Pointwise Methods; Introduction. The methods of the pre-


ceding two sections furnish us with powerful tools for the approximate
solution of differential equations but in practice it is frequently sufficient
to find a pointwise solution. To repeat our previous definition, a point-
wise solution is a series of points

(8.4:1)

where the abscissas

(8.4:2)

are ordinarily given so that they satisfy the inequalities

and where the corresponding ordinates

(8.4:3) Yl' Y2' ...

are to be found such that each pair of coordinates satisfies a certain


prescribed but not found particular solution of the differential equation.
Of course, the ordinates Y1 , Y2' ... , could be calculated by substituting
8.4. POINTWISE METHODS; INTRODUCTION 311

in turn in a particular solution found by one of the preceding


Xl , X 2 , ,
methods, but as a rule, the approximating function approximates the
solution closely only in the immediate neighborhood of Xo . For greater
precision it is better to find Yl , then to use it and the given Yo to find Y2 ,
then to use Y2 and one or both of the previous y's to find Ys , and so on.
Since, in general, the ordinate Yn will be found by use of some or all
of the previously found ordinates Yn-l , Yn-2, ... , the methods to be
discussed in the remainder of this chapter are in a sense step-by-step
processes in which a step is taken only after all previous steps have been
carried out. For this reason these methods of solution are frequently
referred to as step-by-step methods; we will, however, usually call
them pointwise methods.

8.5. Pointwise Methods; Power Series. The first of the pointwise


or step-by-step methods that we consider is merely a slight modification
of the power series approximations of Section 3 of this chapter. As there,
let

(8.5:1)

be a solution of the differential equation

(8.5:2) ~ = Y' = F(x,y)

which is satisfied by the coordinates of the point (xo , Yo) so that ao = Yo .


If all the nth order partial derivatives of F(x, y) exist and are continuous,
the solution Y = f(x) possesses an (n + l)st derivative and can then be
certainly written in finite form as

(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)

was used as the approximating function to the solution of the differential


equation; the error term is

f(n+l'(X) n+l
(8.5:5) (n + 1)1 (x - xo) .
312 8. NUMERICAL SOLUTION OF ORDINARY DIFFERENTIAL EQUATIONS

As a rule, this error term grows rapidly in magnitude as x departs from


Xo; the present modification is designed to overcome this objectionable
behavior by constantly shifting the abscissa (here xo) which is the center
of expansion.
Let the ordinates
(8.5:6) Yl' Y2' Y3''
be desired for the corresponding abscissas
(8.5:7,
where Xl < XI < X3 < ... , and where the pairs (Xl' Yl)' (XI' YI)'
(X3 ,Ya), ... satisfy, within prescribed limits of error, the solution of the
differential equation through the point (xo , Yo). We first put
(8.5:8)
and then rewrite 8.5:4 as
' " (n)
(8.5:9) 11 1 +l!Lh2++~h"
Y1 =Y0 +l!Lh 21 1 nIl

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

We continue in this fashion and find, in the general case,

(8.5:11)

In practice, the intervals Xl - XO ' XI - Xl , Xa - X 2 , , are frequently


equal to each other; it is then usual to designate anyone of them by the
letter h without a subscript and we rewrite the preceding equation as

(8.5:12)

We illustrate this method by

EXAMPLE 1. Find, correct to five decimal places, the ordinates Yl ,


YI' ... , Y6 corresponding to the abscissas 0.1, 0.2, ... , 0.5 such that
each point is on the curve which passes through (0, 1) and whose equa-
tion is a solution of the differential equation Y' = X + y l
8.5. POINTWISE METHODS; POWER SERIES 313

If we let y = f(x) be the equation of the required curve, we have


y' = x + y2
y" = 1+ 2yy'
y(3) = 2(yy" + y'2)
y(4) = 2(yy(3) + 3y'y")
yeo) = 2(yy(4) + 4y'y(3) + 3y"2)
y(6) = 2(yy(0) + 5y'y(4) + IOy"y(3

(8.5:13) ym = 2(yy(6) + 6y'y(o) + 15y"y(4) + lOy(3)")


y(8) + 7y'y(6) + 2Iy"y(0) + 35y(3)y'4
= 2(yym
y(9) = 2(yy(8) + 8y'ym + 28y"y(6) + 56y(3)y(0) + 35y(4)")
y(10) = 2(yy(9) + 9y'y(8) + 36y"ym + 84y(3)y(6) + 126y(4) yeo~
yell) = 2(yy(10) + IOy'y(9) + 45y"y(8) + l20y(3) y(7)

+ 21Oy(4) y(6) + 126y(0)")


y(12) = 2(yy(11) + lIy'y(1O) + 55y"y(9) + 165y(3) y(8)
+ 33Oy(4) ym + 462y(0) y(6.
Since Xo = 0, Yo = 1, it follows that at this point, y'" = 3, y(3) = 8,
y(4) = 34, yeo) = 186, y(8) = 1192, y(7) = 8956, y'8) = 77076; there-
fore, from 8.5: 12 (h = 0.1 and k = 0),

Yl = I + 1(0.1) + ~ (0.1)2 + ; (0.1)3 + g


(0.1)4 + ;~ (0.1)0

+ 19~ (0.1)6 + ~~!~ (0.1)1 + ~!~~ (0.1)8


= 1.11649236,

with an error (which can be approximated by use of 8.5:5) of at most one


or two units in the last decimal place. We now use the value of Yl just
obtained and Xl = 0.1 to derive by use of 8.5:13 the values of Y1', y;', ....
These values are given in the second row of the table below. The
value of Y2 corresponding to X = 0.2 is then calculated from 8.5:12
where now k = 1; and so on. The necessary entries are shown in the
following table.
314 8. NUMERICAL SOLUTION OF ORDINARY DIFFERENTIAL EQUATIONS

x y y' yO yl3J y"J

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

x yl'J yf8J yl7J ylBJ yl8J y"OJ

0 186 1192 8956 77076


0.1 366.751 2640.54 22250.7 214 x 103
0.2 790.457 6481.68 62107.4 680 x loa 84 x lOS
0.3 1910.111 18163.93 201647.7 2558 x 103 365 X 10'
0.4 5380.677 60836 802649 1212 x 10' 205 x 10 386 X lOB

We consider the magnitude of the errors in Yl Y2 .... Since Xo = O.


Yo = I were exact values. the only error in Yl (aside from rounding off
errors) is caused by the use of a polynomial of finite degree rather than
an infinite power series for its determination. The error is given by
8.5:5 where. in this example. n = 8. The maximum value of J<9)(X)
(between x = 0 and x = 0.1) is 1'9)(0.1) which is about 3 X 106 The
error is then approximately (3 X 106 )(0.1)9/9! which is less than 9 X 10-9
and is therefore certainly less than one unit in the eight decimal place.
The error in Y2 (again aside from rounding off errors) has a twofold
cause: as in the preceding step. Y2 may be in error because a finite series
was used instead of an infinite series but unlike the preceding step.
Y2 may be in error because the initial value Yl = 1.11649236 is approx-
imate (the initial value Xl = 0.1 is. of course. exact). Now. we have
previously seen that the differentials dy. dy'. dy" .... are equal to the
errors in Y. y'. y" .... respectively. if we neglect infinitesimals of higher
order. But from 8.5:13.

(8.5:14)
dy' = 1 + 2ydy
dy" = 2(y dy + y' dy)
dy (3) = 2(y dy" + 2y' dy' + y" dy)

dyCk) = 2 [(k -0 1) Y dyCk-U + (k -1 1) y' dy Ck-2) + ... + (okk -_ 1)


1 yCk-U dy]
8.6. POINTWISE METHODS; THE RUNGE-KUTTA FORMULAS 315

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. Pointwise Methods; The Runge-Kutta Formulas. It is soon


evident to anyone who attempts to carry out, either long hand or with
the aid of a desk calculator, the necessary computations to find a numer-
ical solution of a differential equation by the method of the preceding
section that the labor is long and tedious. Various methods have been
devised to lighten the labor but, usually, the advantage of lesser labor
is offset by the concomitant disadvantage of lesser precision. One such
method due to Runge is discussed in this section.
As before, we seek a set of y's

(8.6:1 )

corresponding to the set of x's

(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

(8.6:3) ~ = Y' = F(x, y)


passing through a given point (xo' Yo). The method of Runge has its
genesis in the integration formulas of Gauss and involves the following
ideas. Suppose YIII is known; we calculate four constants kl , k2 , k3 , k4
by use of formulas of the form
kl = hF(xm ,Ym)
k2 = hF(xm + PI ,Ym + ql)
ks = hF(xm + P2 ,Ym + q2)
k4 = hF(xm + Pa ,Ym + qa),
where, as usual, h = XH1 - Xi; PI , P2' and P3 are constants to be
determined, and qi is a certain linear combination of hI' ... , hi' i = I,
2, 3. A linear combination h of hI' h2 , h3 , and h4 is then calculated. The
point of the method is to choose the various constants in such fashion
that Ym + h is a good approximation to Ym+l .
We do not propose to develop here the underlying theory; we merely
cite two of the infinitely many possible sets of formulas:
kl = hF(xm ,Ym)
k2 = hF(xm + th,Ym + tkl)
(8.6:4) (Runge's formulas) ka = hF(xm + th,Ym + tk2)
k4 = hF(xm + h, Ym + ka),
k = i(k l + 2k2 + 2ka + k4);
kl = hF(xm ,Ym)
k2 = hF(xm + 1- h, Ym + -l kl )
(8.6:5) (Kutta's formulas) ka = hF(xm + -ih,Ym - ikl + k 2)
k4 = hF(xm + h,Ym + kl - k2 + ka),
k = i(kl + 3k2 + 3ka + k4).
We use a set of formulas by starting with the given point (xo ,Yo) so that
m = 0, calculate YI , then use the formulas for m = I to calculate Y2 , and
so on.
To illustrate the use of these formulas, we do again the
EXAMPLE. Find the values of Y corresponding to the values 0.1,
0.2, ... , 0.5 of X which form a pointwise solution of Y' = X + y2 with
the initial condition Y = I when x = o.
The work, using Runge's formulas, is conveniently arranged as in
the table below.
8.6. POINTWISE METHODS; THE RUNGE-KUTTA FORMULAS 317

x y F(x,y) hF(x,y)

Xo Yo F(xo, Yo) hi ~(hl + h,)


Xo +!h Yo + !hl F(xo + !h, Yo + !hl) h2 h2 + ha
Xo + !h Yo + !h2 F(xo + !h, Yo + !h2) ha 3h = sum
Xo +h Yo + ha F(xo + h, Yo + ha) h, h = Jsum

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 x +yl 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.11649185 1.3465541 0.13465541 0.15849050
0.15 1.18381 956 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 1.8219616 0.18219616 0.21692072
0.25 1.36466063 2.1122986 0.21122986 0.42644 291
0.25 1.37917748 2.1521305 0.21521305 0.64336363
0.3 1.48877560 2.5164528 0.25164 528 0.21445454
0.3 1.48801 709 2.5141949 0.25141949 0.30601787
0.35 1.61372 684 2.9541143 0.29541 143 0.59797034
0.35 1.63572 281 3.0255891 0.30255891 0.90398821
0.4 1.79057600 3.6061624 0.36061624 0.30132940
0.4 1.78934649 3.6017609 0.36017609 0.45522086
0.45 1.96943453 4.3286724 0.43286724 0.88018262
0.45 2.00578011 4.4731538 0.44731538 1.33540348
0.5 2.23666187 5.5026563 0.55026563 0.44513449
0.5 2.23448098
318 8. NUMERICAL SOLUTION OF ORDINARY DIFFERENTIAL EQUATIONS

The table for the solution by use of Kutta's formulas is similar:

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)

Xo + ih Yo -lhl + h. F(xo + ih, Yo - lhl + h.) ha sum


Xo + h yo+hl-hl+ha F(xo+h, yo+h l - h.+h a) h, h = I (sum)

In detail:

x y x + y' h(x + yl)

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

0.46666667 2.07720465 4.7814458 0.47814458 3.56108884


0.5 2.21975151 5.4272968 0.54272 968 0.44513 611
0.5 2.23448314
8.7. POINTWISE METHODS; FINITE DIFFERENCES 319

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)

One-half of this quantity can be added to Ym+l to improve its value.


We illustrate the use of the correcting term by doing the previous
example over again. The entries in the first eight rows of the main table
below are copied from the table previously obtained (Runge's method).
We then compute the first four rows of the auxiliary table using the
double interval 2h = 0.2. The value of Y2 = 1.27356 255 which was
previously found is then improved by adding to it the correcting term

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.

8.7. Pointwise Methods; Finite Differences. Finite differences can


be used in a variety of ways to calculate the ordinates Yl , Y2' "', of a
pointwise solution with initial values x = Xo , Y = Yo of the differential
equation

(8.7:1 ) 1x = Y' = F(x, y).


We discuss several such methods in this section.
320 8. NUMERICAL SOLUTION OF ORDINARY DIFFERENTIAL EQUATIONS

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

0 I I 0.2 0.28277 478


0.1 1.1 1.31 0.262 0.53783220
0.1 1.131 1.37916 10 0.27583220 0.82060 698
0.2 1.2758322 1.8277478 0.36554956 0.27353566
0.2 1.27353566
0.2 1.27356434 1.8219661 0.36439322 0.54364 756
0.3 1.45576095 2.4192399 0.48384798 1.00318896
0.3 1.51548833 2.5967049 0.51934098 1.54683652
0.4 1.79290532 3.6145095 0.72290190 0.51561 217
0.4 1.78917651
8.7. POINTWISE METHODS; FINITE DIFFERENCES 321

If we substitute X1l for Xo and Y1I for Yo in formula 8.2:6, we obtain


the equality valid formula

(8.7:2) Y = Y1I + r"'" F(x,y) dx,

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

whence, by 7.7:13, 7.7:14 and an interchange of limits,

If we add n to all subscripts and replace Y by F, we obtain

(8.7:5)

Equation 8.7:3 can now be rewritten as (note that k = 1)

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

This method of obtaining a point-wise solution by means of formula


8.7:6 is due to J. C. Adams.
We illustrate the method by finding a pointwise solution of the
previously solved equation y' = x + y2, given the initial point (0, 1)
and h = 0.01. We prepare a number of columns in which we will write
the entries x, y, hF, .c1(hF), .c1 2(hF), .... See the table on below. We

x y hF iJ(hF) iJ2(hF) iJ8(hF) iJ'(hF) iJ6(hF)

0 1.00000 0000 0.01000 00000


3040575
0.01 1.01015 1348 0.0103040575 83511
3124086 3695
0.02 1.02061 0898 0.01061 64661 87206 212
32 11292 3907 13
0.03 1.031387186 0.01093 75953 91113 225
3302405 4132 19
0.04 1.042489125 0.0112678358 95245 244
3397650 4376 _-----13
0.05 1.05392 6032 0.01160 76008 99621 __ ----- 257
3497271 __ ----- 4633
0.06 1.065707647 0.0119573279 _ - - - 104254
---.:...----------------1601525 18
0.07 1.077844163 0.01231 74804 296
3710690 5207 25
0.08 1.090346247 0.0126885494 114372 321
3825062 5528 17
0.09 1.103225074 0.01307 10556 119900 338
3944962 5866 32
0.10 1.116492354 0.0134655518 125766 370
4070728 6236 24
0.11 1.130160369 0.0138726246 132002 394
4202730 6630 30
0.12 1.144242003 0.0142928976 138632 424
4341362 7054 35
0.13 1.15875 0785 0.01472 70338 145686 459
44 87048 7513 33
0.14 1.17370 0926 0.0151757386 153199 492
4640247 8005 40
0.15 1.18910 7368 0.01563 97633 161204 532
4801451 8537 46
0.16 1.20498 5826 0.01611 99084 169741 578
4971192 9115 39
0.17 1.221352842 0.01661 70276 178856 617
5150048 9732
0.18 1.23822 5842 0.0171320324 188588
5338636
0.19 1.255623193 0.01766 58960
0.20 1.273564266
8.7. POINTWISE METHODS; FINITE DIFFERENCES 323

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 ... )

is a typical formula of one of the tables, then by 7.7:15,

is also a true formula.


324 8. NUMERICAL SOLUTION OF ORDINARY DIFFERENTIAL EQUATIONS

Hence

Now, if we raise all subscripts by n + k, replace Y by F, and write


tJi(hF) for htJiF, we obtain

(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

Y20 = YIO + 1O(hFlo) + 50 tJ(hFe) + 5~5 tJ2(hFs) + 600 tJ3(hF7)


+ 2922~
18
tJ4(hF ) 70805 tJ5(hF )
8 + 18 5

= 1.116492354 + [10(134655518) + 50(3944962) + 5~5 (119900)

+ 600(5528) + 29225 (321) + 70805 (25)] 10-10


18 18
= 1.27356 4397.
This value is close to the value 1.27356 4266 previously obtained. The
discrepancy is caused mainly by the piling up of rounding-off errors.
Various formulas of Tables 7.7:tl,2 can be combined to yield addi-
tional formulas of type 8.7:7 for the evaluation of the integral in 8.7:3.
For example, we have from the Table 7.7:tl
8.7. POINTWISE METHODS; FINITE DIFFERENCES 325

whence

f"l

"0
Y dx = h(
Yl -I:2 Llyo - 12
1 Ll2Y_l - 24
1 LlaY_2 - )
,

or, adding n to all subscripts and replacing Y by F,

f.....
n+1
F dx = hFn+1 -
1 1
"2 LI(hFn) - nLl2(hFn_l) -
1
24 Ll3(hFn_2) - ....

Rewrite 8.7:5 and add unity to the subscripts:

r. t2Fdx = hFn+1
:1:,,+1
+ ~LI(hF7I) + I;Ll2(hFn_1) + ~Lla(hFn_2) + ....

Now add the last two equalities to obtain

r. t2
....
F dx = 2hFn+1 + iLl2(hFn_1) + j Lla(hFn_2) + ~~ Ll4(hFn_a)

+ !~ LlS(hFn_4) + ~~~~ Ll8(hFn_ + ... ,


li )

which can be rewritten as

(8.7:8)

rnt'.... F dx = 2hFn+1 + j [Ll2(hFn_1) + Ll3(hFn_2) + Ll4(hFn_a) + LlS(hl',._4)]

- ~ [Ll4(hFn_a) + 2 LlS(hF7I -4)]


1139 8
- 3780 LI (hFn_li ) + ....
If the sixth and higher order differences are negligible, the preceding
formula is particularly convenient for the evaluation of F dx f;:+2
because of the simplicity of the coefficients. The formula was employed
in this form by Nystrom.
The methods of obtaining a pointwise solution of 8.7:1 discussed so
far in this section do not permit a simple estimation of the error at each
step. We then modify these methods to overcome this deficiency.
As before, suppose that by some means or other the values of a point-
wise solution (xo, Yo), (Xl' YI), ... , (x n , Yn) and the corresponding
326 8. NUMERICAL SOLUTION OF ORDINARY DIFFERENTIAL EQUATIONS

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

By substituting these values in 8.7:10, we obtain Y11 = 1.13016 0369.


If we substitute this value and X11 = 0.11 into the differential equation,
we obtain F11 = 1.38726 246. Further substitution does not change
the value of Y11 , hence the above value is taken for Y11 .
We do another example by this method by finding to four decimal
places the values of Y corresponding to the values x = 0.1, 0.2, 0.3, "',
which are determined by the integral curve of y' = Y - x + 1 which
passes through (0, I).
We find the values of Yl ,Y2 , ... by anyone of the previous methods.
As each new Y is found, the corresponding F is found and the difference
table of the F's is extended. When we reach Y5' the column of third
differences begins to oscillate; we therefore stop at this point. See the
table below. To determine Ye , we assume the tentative value tJ3(hF3} =
12 X 10-5 , a value suggested by the entries in the third difference
column. We find tJ2(hF4 } = 162x 10-5, tJ(hF5} = 1731 X 10-5 , hFe =
28218 X 10-5 From 8.7:10,

Y8 = 2.1487 + 0.28218 - 2"1 (0.01731) -121 (0.00162) - 241 (0.00012) = 2.4221.

Substituting this value and Xe = 0.6 into the differential equation, we


find Fe = 2.8221, whence hFe = 0.28221, tJ(hF5} = 0.01734, tJ2(hF4 } =
0.00165, tJ3(hF3} = 0.00015. Using these new values in 8.7:10, we find
again Ye = 2.4221. We accept this value for Ye, use the last Fe found
and its differences and go on to calculate Y7 'Y8 , ... in the same manner.

x y hF iJ(hF) iJ2(hF) iJ3(hF)

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

Suppose we had made a start with the obviously bad choice of


tJ3(hF3} = 0; then tJ2(hF4 } = 150 X 10-5 , tJ(hF5} = 1719 X 10-5 ,
hFe = 28206 X 10-5 From 8.7:10, Ye = 2.4220. Substitution into the
differential equation yields Fe = 2.8220. This new value of F produces
the Y obtained before.
328 8. NUMERICAL SOLUTION OF ORDINARY DIFFERENTIAL EQUATIONS

It remains to discuss the convergence of this process. We do this now,


using the equation Y' = x + y2 as an illustration. Suppose that all
the entries in the table for the first example have been found except
Y20 j we wish to use formula 8.7: 10 to compute this last entry. Recall
that we estimate F 20 and then from it and the lowermost diagonal of the
table determine the values of hF20 , LJ(hF19 ), LJ2(hF1S )' LJ3(hFu), LJ4(hF16 )
and LJS(hF1S ). We substitute these values into 8.7:10 to determine an
approximate value for Y20. This value and X 20 = 0.20 are substituted
into the differential equation to obtain a new estimate for F 20 . This new
estimate is used as the first F 20 was to obtain a new Y20 . The process is
repeated until there is no change in Y20 and the last value is kept. We
want to know if such a happy ending will actually happen.
Since we are interested here only in the convergence of this process,
we assume for the purposes of this discussion that the entries in the last
row and diagonal are exact and that the differences of orders higher than
five are all zero (or, what is essentially the same thing, that they are
so small that they cannot affect the last decimal place retained in Y20).
Furthermore, we pay no attention to computational or rounding-off
errors. Let us now suppose that e is the error in the estimate for F 20 ,
that is, e is the difference between the true value and the assumed value.
Then he is not only the error in hF20 but because of the method of for-
mation of the difference table it is also the error in LJ(hF19) and in each
of the subsequent differences. It follows from 8.7:10 that the error in
Y20 is
( 1 1 1 19
he 1 - "2 - 12 - 24 - 720 - 160
3) = 288
95
he,

or approximately,
(8.7:11) e' = i-he.

Now if Y20 is in error by this amount, we find by substitution into the


differential equation (remember that X 20 is exact) that Y' or the new F 20
is in error by the amount
(Y20 + e')2 - Y:o = i hey + i- h2e2 .
Assume e is positive (and note that Y20 is approximately 1.3) j then in
order for the error in the new F 20 to be smaller than the error in the
originally estimated F 20 we must have

(8.7:12)

whence, using h = 0.01 and the overestimate Y = 1.3, e < 89220. If


e is negative, it turns out that if e > -90780, then the absolute value of
8.7. POINTWISE METHODS; FINITE DIFFERENCES 329

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

(8.7:13) -90780 < e < 89220,


then the new F 20 will be a better approximation than the original F20!
Since an inspection of the table assures us that the value of F 20 is most
certainly within one-tenth of 1.8, we have here a most unusual latitude
for the error. Just a minor word of caution. We have shown that if e
satisfies the inequalities 8.7: 13, then the succeeding approximations for
F 20 and hence (by 8.7: II) those for Y2U will be better and better. It does
not follow that the error can be made to approach zero. But this desi-
deratum can be attained if we replace the right-hand member of 8.7:12
by ke, where k is a proper fraction. For k = t, we have -45780 < e <
44220, still plenty of latitude.
What we have seen to hold for the particular value Y20 for the parti-
cular differential equation above holds true in general. When we seek
to determine the value of Yn+1 corresponding to a value x n+1 to satisfy
a differential equation of the type 8.7:1 by use of formula 8.7:10, we
find that it is sufficient to estimate the first Fn+1 to within an amount
e which satisfies a pair of inequalities of the form
(8.7:14) -u < e < fJ (u, fJ > 0).
The values of u and fJ depend on the differential equation, the values of
Y and h, and the number of differences in the right-hand member of
8.7:10. Although the values of u and fJ can be calculated for different
examples by methods similar to those used above, it is rarely necessary
to do so to ensure convergence because of the usual extreme latitudes.
Of course, the better the estimate the more rapid the convergence and
in any case it would soon be evident if the successive approximations
for a Y did not converge.
We repeat that the entire preceding discussion of convergence was
based on the assumption that the only error influencing the value of
Yn+1 was the error in the estimate of Fn+1 . It must be remembered that
other errors due to rounding-off, neglect of higher order differences,
and so on, will creep in. It is therefore advisable to use several decimal
places more in the computations than are wanted in the final results.
The reader should also note the discussion in the next section.
The preceding methods can be combined to yield a rapidly convergent
and self-checking pointwise solution. After Yo, ... , Yn' Fo , ... , Fn
and their differences have been computed, the value of Yn+1 is computed
330 8. NUMERICAL SOLUTION OF ORDINARY DIFFERENTIAL EQUATIONS

from 8.7:6 or a similar formula. Instead of accepting this value of Y


immediately as we did before, we now substitute it and x n+1 into the
differential equation to determine F n+1' The differences LJ(hFn)'
LJ2(hFn_l ), ... , are then computed and substituted into 8.7: 10 to recom-
pute Yn+1 . This process is continued until there is no further change in
the value of Yn+l .

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' "

15. y' = -y - e"-2y2; (I, e); x = I (0.3) 4; 4 dp.

8.8. Pointwise Methods; Iteration Using Ordinates. All of the


formulas of the preceding section involving finite differences have their
counterparts in formulas involving ordinates. It is only necessary to
replace the finite differences by their values in terms of ordinates; these
values are given by the identities 3.7: 13. Instead of doing this, however,
we develop in this section a method based on the suggestion contained
in the last paragraph of the preceding section. We describe a method of
finding a pointwise solution of the differential equation

(8.8:1) ~ = y' = F(x,y)


with initial conditions Y = Yo when x = Xo whose underlying feature is
the use of a pair of formulas, one to "predict" a value for Yn+1 , the other
to "correct" that value. We plunge immediately into the details.
The values Yl , Y2' ... , Yn corresponding to the values Xl , X 2 , ... ,
Xn are found by anyone of the previous methods; the value of n itself
will soon appear. We then obtain from Table 7.8:tl a formula which
gives Yn+1 in terms of Yn , Yn-l , Yn-2 , ... , and y,,', Y~-l , Y~-2 , .... This
formula will be known as a predicting or an advancing formula. We
substitute this tentative value of Yn+1 into the differential equation 8.8: 1
to find the value of the corresponding Y~+1 . From Table 7.8:t 1 we obtain
another formula known as the correcting formula which gives Yn+1 in
terms of Y~+1 and the preceding ordinates and derivatives. We substitute
the value of Y~+1 just found together with the necessary earlier found
8.8. POINTWISE METHODS; ITERATION USING ORDINATES 331

ordinates and derivatives to find a corrected value of Yn+l . This value is


substituted into the differential equation to obtain a new value for
Y~+l . The correcting formula is again used and the process is repeated
over and over until there is no further change in Yn+l . We proceed in
the same manner to find Yn+2 , Yn+3' ...
We list three advancing formulas and their associated correctors:

(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')

c: Yn+1 = Yn-3 + 4~ h(7Y~-3 + 32Y~_2 + 12Y~_1 + 32Yn' + 7Y~+1);


(8.8:4)
A: Yn+1 = Yn-7 + 9!5 h(460Y~_6 - 954Y~_5 + 2196Y~_4 - 2459Y~_3
+ 2196Y~_2 + 954Y~_1 + 460Yn')

c: Yn+1 = Yn-5 + l!o h(41Y~_5 + 216Y~_4 + 27Y~_3 + 272Y~_2


These formulas are obtained in this manner. Formula 13 of Table
7.8:tl is

Write Y' (= dyJdx) for Y; then

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

If we now add Yo to both sides and increase the subscripts by n - 3,


we obtain formula 8.8:2A. The remaining formulas are similarly derived
from formulas 5, 22, 14, 29, and 23, respectively, of Table 7.8:tl.
For future needs we list three forms of the errors inherent in each
of the formulas 8.8:2, 3, 4, respectively:

A: !~ h"JCS1(X), !~ J"J(xo), !~h J4F(xo)


(8.8:5)
1
c: - 9~ h"JCS1(X), - 9~ J"J(xo), - 90h J4F(xo);

A: I~ h7fC71(X), I~J7j(Xo), :1oh J6F(x o)


(8.8:6)
~ h7jC71(X) 8 8
c: -
945 ' - 945 J7j (x O), - 945h J6F(xo);

A: 3956 h'f(9I(X) 3956 9 3956 8


14175 ' 14175 J1(xo), 14175 h J F(xo)
(8.8:7)
c: __9_ h'f(9I(X) - I:OOJ'f(xo), - l:OOh J8F(xo)
1400 '

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

EXAMPLE I. Find the values of y corresponding to the values x = 0.1,


0.2, ... , 0.10 that satisfy the solution of

dy
(8.8:8) -=2+y-2x
dx

with initial conditions y = I when x = O.


We decide to use formula 8.8:2A for advancing and its associated
formula 8.8:2C for correcting. From the first formula it is clear that
we need four "starting" values. These are obtained from the Maclaurin
8.8. POINTWISE METHODS; ITERATION USING ORDINATES 333

expansion of the desired solution. From y' = 2 +Y - 2x we obtain


y" = y' - 2
y(3) = y"

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! .

We use the notation Xo = O. Xl = 0.1. X 2 = 0.2. etc . then Yl = 1.3052.


Y2 = 1.6214. Y3 = 1.9499. (We could. of course. use the Maclaurin
series to find the values of Y4 Y5 ... but that is not the purpose here.)
We enter these starting values and the corresponding values of y' In
a table:

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.

We substitute this tentative value of Y4 into the differential equation


and obtain Y4' = 3.4918. We now use 8.8:2C and find

1
y, = 1.6214 + 30 [3.2214 + 4(3.3499) + 3.4918] = 2.2918.
334 8. NUMERICAL SOLUTION OF ORDINARY DIFFERENTIAL EQUATIONS

the same value as before as we anticipated. We enter this value in an


extension of the table above (row 5 of the table below):

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

(8.8:9) Ys' = 0.4 + Ys ,


(8.8:10) Ys = 3.68469 + 3~Y8'.
Instead of taking the value Ys = 3.8255 as predicted by the advancing
formula, let us choose the value Ys = 40, for no good reason. Substitu-
tion into the first of the above equations, 8.8:9, yields Ys' = 40.4;
substituting this value into the second equation yields the better value
Ys = 5.0. Substitution into the first equation gives Ys' = 5.4, and then
this value into the second equation yields Ys = 3.86. Repetition of this
circular iteration results in the successive values 3.827, 3.8256, 3.8255
for Ys . Further substitution causes no change in the last value and this
is indeed the value previously obtained.
The precision that can be obtained by this process depends, of course,
on the precision of the preceding y's and the error inherent in the
correcting formula.
Let pursue this matter of iteration a bit further. We can reduce
the double iteration process to an ordinary single iteration of the type
discussed in Section 5.3 by substituting for Ys' in 8.8: 10 its value given
by 8.8:9. We obtain

(8.8:11) Ys = 3.69802 + 301 Ys .


This equation can be used for iteration to determine Ys. Since the
derivative of the right-hand member (with respect to Ys) is 1/30, the
process must converge to the desired value. Also, since the right-hand
member is linear, there is but one root so that the initial value chosen
for Ys may be any real (or imaginary!) number whatsoever.
Again: what we are looking for here is a value of Ys which will satisfy
8.8: 11 ; but obviously this is a linear equation in Ys which can be solved
directly, without the use of any iteration, for Ys to yield, as before,
Ys = 3.8255.
We can extend these concepts to yield another method of obtaining
a pointwise solution of a differential equation. In example 1, we have,
let us say, the values of Y..- I ' Y .. , Y~-l , y,/ . We want the value of
Yn+l corresponding to the value x n +1 of x. In algebraic terms, what we
ll6 8. NUMERICAL SOLUTION OF ORDINARY DIFFERENTIAL EQUATIONS

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

(8.8:12) Yn+1 = 2~ (2 - 2xn+1 + 3Oyn-l + Y~-l + 4Yn'),


a formula which can be used for the derivation of the successive values
of y.
The formula has two advantages; it requires only two starting values
and it does away with prediction and correction since it yields the cor-
rected value in one step. Its disadvantage is its somewhat greater
cum bersomeness.
However unimportant the advancing formula may now appear, it
does have its use as a predictor to help us minimize the number of
iterations and it has yet another use as we shall see in the discussion
following the next example.

EXAMPLE 2. Find the values of Y corresponding to the values x = 0.1,


0.2, 0.3, ... , 0.9, I, that satisfy the solution of Y' = x + y2 with the
initial condition Y = 1 when x = O.
We must first decide which of the formulas 8.8:2-4 we wish to use
in this problem. If we turn back to page 313, we see that if Y = f(x) is
the desired solution, yIn) = pn)(x) grows rapidly with n. As a matter
of fact, P5)(0.4), P7)(0.4), P9)(0.4) are approximately 5 X lOs, 8 X 105 ,
2 X 108 , respectively. Hence the magnitude of the errors in the correcting
formulas for values in the neighborhood of x = 0.4 are roughly (remem-
ber that h = 0.1) 0.0006, 0.0007, and 0.00 I, respectively. It is then best
to use the first formula, 8.8:2A, and its associated corrector, but to get
reasonable precision, it is necessary to take a smaller value for h. We
take h = 0.02 and find the values of Y corresponding to x = 0.02, 0.04,
0.06, ....
We need for starting values, the values of Y corresponding to the
values Xo = 0, Xl = 0.02, X 2 = 0.04, Xs = 0.06. These are found by
Taylor's series or some other previous method and are listed, together
with the corresponding values of Yo', Yl', Y2', and Y3' in the table below.
The value Y4 = 1.09035 is then calculated from 8.8:2A; the corre-
sponding derivative is determined from the differential equation and
substituted into 8.8:2C to obtain the corrected value which turns out
to be the same as the predicted value. We enter the value Y4 = 1.09035
8.8. POINTWISE METHODS; ITERATION USING ORDINATES ll7

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

We have already remarked that the precision of the results obtained


in the advancing and correcting process depends on the accumulation
of rounding-off errors and on the errors inherent in the advancing and
correcting formulas, more particularly the correcting formula. Nothing
much can be done about the rounding-off errors except to hope that
they more or less iron out or, what is more positive, to use a larger
number of decimal places than is required in the final answers. On the
other hand, we can estimate the magnitude of the error due to the
formulas and it is here that the advancing formula plays an important
role. Assume that Yn-3, Y~-2' Y~-l' and Yn' are correct, then the
true value of Yn+1 is given by
(8.8:13)

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)

where y is the value obtained from 8.8:2C, e2 is the error given in


8.8:5C, and e. is an error caused by using in 8.8:5C not the correct value
(which we do not know) but an approximate value of Y~+l . (The value
of y is the final value in the iteration process, that is, the value which
remains unaltered when 8.8:5C is used.) We obtain from 8.8:13, 14,
(8.8:15)
338 8. NUMERICAL SOLUTION OF ORDINARY DIFFERENTIAL EQUATIONS

To get an estimate of the magnitude of the errors in 8.8:2A, C given


by 8.8:5A, C, we assume first that e is negligible compared to el or e2
and that the X of 8.8:5A is the same as the X of 8.8:5C. This is equi-
valent to saying that e = 0, el = -28e 2 We substitute these values in
8.8.15 and obtain
(8.8:16)

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

if we substitute xn+l and Yn+l for X and y, respectively.


8.9. FIRST-ORDER SYSTEMS; HIGHER ORDER AND SPECIAL EQUATIONS 339

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

Do the examples of Exercise 8.7 by the methods of this section.

8.9. First-Order Systems; Equations of Higher Order; Special


Equations. The methods of the preceding sections are applicable with
little or no modification to the pointwise solutions of systems of first-order
equations; that is, to systems that are or can be put into the form

dYI
dx -_ F 1(x , Y 1, Y 2, ... , Y '" )

~: = F2(x,Yl ,Y2, ... ,y",)


(8.9: 1)
l.ofO 8. NUMERICAL SOLUTION OF ORDINARY DIFFERENTIAL EQUATIONS

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.

EXAMPLE 1. Find the values of x and y corresponding to the values


t = 1.1, 1.2, ... , 1.5 that are a point-wise solution of
dx 1
dt = 2(Y - 1)
(8.9:2)
dy 2t
dt = 3x

with the initial condition x = 2/3, y = 3 when t = 1.


Solution by infinite series.
We assume that a solution exists of the form

x = ao + a1(t - 1) + a2(t - 1)2+ .. .


(8.9:3)
y = bo + b1(t - 1) + b2(t - 1)2 + ... .

As before,
yln)(I)
(8.9:4) bn = ---.
n!

We get from the first of the given differential equations


xln) = ! yln-U
for values of n greater than unity; we get from the second equation

y' = itx-1
y" = i - tx-2x' + X-I
y(3) = i- tx- 2x" + 2tx- (x')2 -
3 2x- 2x'.

We find on making use of the initial conditions that at t = 1,


X' = 1 y' = 1
X" = i- y" =-!
X (3 ) = - i y(3) =!
X (4 ) = j-.
8.9. FIRST-ORDER SYSTEMS; HIGHER ORDER AND SPECIAL EQUATIONS 341

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

1.0 0.667 3.000


1.1 0.769 3.098
1.2 0.874 3.190
1.3 0.988 3.277
1.4 1.104 3.362
1.5 1.225 3.441

Solution by Picard's method. We put the differential equations into


the forms

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

Substituting the first approximation for x into the integrand of the


second equation of 8.9:5 and integrating, we obtain a second approxima-
tion for y
Y = 3 + 3"2 ( t - I + 3"1 In 3t - 1 )
2 .

The second approximations yield the following values for x and y:

x y

1.0 0.667 3.000


1.1 0.769 3.098
1.2 0.877 3.192
1.3 0.991 3.283
1.4 1.112 3.371
1.5 1.240 3.458

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

ki., = hFi(t + h, Xo + k1.3 , Yo + ku),


O

k i = i- (k i 1 + 2k i 2 + 2ki a + k i .,)

Here, i takes on the values 1 and 2,

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

I 0.6667 3.0000 0.10000 0.10000 0.10244 0.09768


1.05 0.7167 3.0500 0.10250 0.09768 0.20494 0.19518
1.05 0.7179 3.0488 0.10244 0.09750 0.30738 0.29286
1.1 0.7691 3.0975 0.10488 0.09535 0.10246 0.09762
1.1 0.7691 3.0976 0.10488 0.09535 0.10721 0.09329
1.15 0.8215 3.1453 0.10727 0.09333 0.21449 0.18652
1.15 0.8227 3.1443 0.10722 0.09319 0.32170 0.27981
1.2 0.8763 3.1908 0.10954 0.09123 0.10723 0.09327
1.2 0.8763 3.1909 0.10955 0.09123 0.11179 0.08947
1.25 0.9311 3.2365 0.11183 0.08950 0.22361 0.17889
1.25 0.9322 3.2357 0.11178 0.08939 0.33540 0.26836
1.3 0.9881 3.2803 0.11402 0.08771 0.11180 0.08945
1.3 0.9881 3.2804 0.11402 0.08771 0.11617 0.08612
1.35 1.0451 3.3243 0.11622 0.08612 0.23239 0.17215
1.35 1.0462 3.3235 0.11617 0.08603 0.34856 0.25827
1.4 1.1040 3.3664 0.11832 0.08452 0.11619 0.08609
1.4 1.1043 3.3665 0.11832 0.08452 0.12040 0.08309
1.45 1.1635 3.4088 0.12044 0.08308 0.24084 0.16609
1.45 1.1645 3.4080 0.12040 0.08301 0.36124 0.24918
I.S 1.2247 3.4495 0.12248 0.08165 0.12041 0.08306
I.S 1.2247 3.4496

Solution by Adams' method. We replace formula 8.7:6 by the pair


of formulas

X"+l = X.. + hF1 , .. + 2"1 .d(hF1..._ 1) + 125 .d 2(hF1..._ 2 ) + ...


(8.9:7)
1 5
Y"+l = Y .. + hF2... + "2.d(hF2 ...- 1) + 12 .d 2(hF 2 7I _ 2) + ... ,
for the solution of the given equations. Again, the generalization to m
dependent variables is immediate. As before, Fl and F2 refer to the right-
hand members of the two equations in 8.9:2. It turns out that we need
four starting values for t, x, and y; we copy these from the results of the
last solution and enter them in a table. These entries are shown in the
344 8. NUMERICAL SOLUTION OF ORDINARY DIFFERENTIAL EQUATIONS

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.

x y hFl A (hF1) AO(hF1) hFo A(hFo) AO(hFo)

0.6667 3 0.10000 0.10000


488 -465
1.1 0.7691 3.0976 0.10488 -21 0.09535 53
467 -412
1.2 0.8763 3.1909 0.10955 -20 0.09123 60
447 -352
1.3 0.9881 3.2804 0.11402 -16 0.08771 33
431 -319
1.4 1.1043 3.3666 0.11833 0.08452

1.5 1.2247 3.4497

We next calculate

X4 = 0.9881 + 0.11402 + "2I (0.00447) + 125 (-0.00020) = 1.1043

Y4 = 3.2804 + 0.08771 + 2:I (-0.00352) + 125 (0.00060) = 3.3666.

We find hF1.4 and hF2.4 and then extend the difference table. Finally,

Xs = 1.l043 + 0.11833 + 2:I (0.00431) + 125 (-0.00016) = 1.2247

Y5 = 3.3666 + 0.08452 + 2I (-0.00319) + 125 (0.00033) = 3.4497.

Solution using advancing and correcting formulas.


We modify formulas 8.8:2A, C to read

(8.9:8)
8.9. FIRST-ORDER SYSTEMS; HIGHER ORDER AND SPECIAL EQUATIONS 345

TheF's are defined as above and the generalization to m equations is again


immediate. Once more we need four starting values which we copy from
the Runge solution and enter in a table. (See the first four rows of the
table below.) We use 8.9:8A1 , A2 to predict X 4 and Y4 and find

X4 = 0.6667 + 304 [2(1.0488) - 1.0955 + 2(1.1402)] = 1.1043,

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

Substitution into the differential equations yields F 1 4 = 1.1832,


F2,4 = 0.8452. Next, we correct the preceding values of X 4 and Y4 by
use of 8.9:8C1 , C 2 and find

X4 = 0.8763 + 30I [1.0955 + 4(1.1402) + 1.1832] = 1.1043,

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

then the differential equation 8.9:9 is equivalent to the system of n


first-order differential equations
dy
dx = VI

dv]
dx = VB

(8.9:10)
8.9. FIRST-ORDER SYSTEMS; HIGHER ORDER AND SPECIAL EQUATIONS 347

in the independent variable x and the n dependent variables Y, VI'


, V n - l

EXAMPLE 2. Find a pointwise solution of the differential equation


in example 4, Section 8.3, for x = 1.1, 1.2, ... , 1.5, with the initial
conditions y = 1, dy/dx = 2 when x = 1 by reducing the given equa-
tion to a system of first order differential equations.
If we put V = dy/dx, the given second-order equation is immediately
reduced to the first order system in the independent variable x and the
dependent variables y and v:

dy
-=V
dx

We solve the first-order system by use of the advancing and correcting


formulas 8.9:8 (the reader will make the necessary change of notation).
The four starting values needed are found from the infinite series expan-
sion of the solution given in Section 8.3. To get four decimal place
precision, the series must be evaluated to the term in (x - 1F; v is
obtained by termwise differentiation of the series for y. The four starting
values and the two computed values are shown in the table below.

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

The computer should avoid the common oversight of failing to use


completely the correcting formulas. That is, suppose Ys and Vs have been
estimated by the advancing formulas in the preceding example. The value
of Y5 is then corrected by iteration in the correcting formula. The value
of v is next corrected. If there is a change in the value of v, the value
348 8. NUMERICAL SOLUTION OF ORDINARY DIFFERENTIAL EQUATIONS

of y must be recorrected since it depends on v. It is necessary to go


back and forth in this manner until there is no further change in either
variable.
Some types of differential equations occur so frequently in the
natural and applied sciences that they have received special study and
special methods of attack have been devised for their solutions. In
particular, we consider the differential equation

dBy
(8.9:11) dx 2 = G(x, y),

an equation of the second order with the first derivative missing.


Although the substitution v = dy/dx reduces this equation immediately
to the first-order system
dy
dx = V

dv
dx = G(x,y),

so that a solution can be obtained by solving the pair of first-order


equations, it is more efficient to use some other means. By the method
of undetermined coefficients or otherwise it can be shown that

A: Yn+l = Yn + Yn-2 - Yn-3 + ~2 (5Y~:'2 + 2Y~:'1 + 5y~/)


(8.9:12)

These equations are exact if y is a polynomial of max-degree 5. As


before, the first equation is used for estimating the new value of y and the
second equation is used for correcting; they need four starting values that
must be found by other means. These equations are adapted for the
direct solution of the Eq. 8.9: 11 if we replace y;' by G" = G(Xi 'Yi).
An example will illustrate the method of solution.

EXAMPLE 3. Find a pointwise solution of the differential equation


d 2y/dx2 = xy for x = 0.2, 0.4, ... , 1.0, given the initial conditions
y = I, dy/dx = 2 when x = o.
Four starting values were found by use of infinite series (that is,
three values in addition to the given value) and the two further values
8.9. FIRST-ORDER SYSTEMS; HIGHER ORDER AND SPECIAL EQUATIONS 349

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

Do the following examples by the methods of this section.


dx 1 dy t
1. dt = -2(Y - 5), -dt -- -
6x''
x = 9, y = 8 when t = 9; t = 9(0.5)15; 2 dp.

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.

6. (x - 1)1 y" + x(x - I) y' - xy = x - 6;


y = 7, y' = -2 at x = 2; x = 2(0.2)4; 3 dp.

7. xy" - 2y' + xy= 2e~-1(x - I) - 2 sin (x - I);


y=I, y'=2 at x=l; x=I(0.1)2; 4dp.

8. xay", - XI(X - I) y" + xy' + 5y = 3~;


y = e, y' = 0, y" = e at x = I; x = 1(0.1)2; 4 dp.
350 8. NUMERICAL SOLUTION OF ORDINARY DIFFERENTIAL EQUATIONS

9. 4xi y" + 2yy' + x-ly = 3x + I;


y = 6, y' = 11/4 at x = 4; x = 4(0.2)6; 3 dp.
10. y" = 2(y + I) sec x;
y=y'=O at x=O; x =0(0.1)1; 3dp.

11. y" = y (I + ~ - 4:.);


y=e, y'=ie at x=l; x=I(0.1)2; 3dp.
12. y'" = 2(y' - 2x)a;
y = 3, y' = 3, y" = 1 at x = I; x = 1(0.1)2; 3 dp.
Chapter 9

Curve Fitting

9,1, Introduction, The preceding eight chapters were mainly devoted


to a consideration of two questions: how does one obtain numerical
answers to a variety of numerical problems? how reliable are these ans-
wers? This chapter is concerned with a different, but related, problem:
given a mass of data, usually the results of observation, measurement,
or experiment and usually presented as a set of numbers or a set of
number pairs, how can we obtain the significant mathematical law
underlying the data? In particular, if

(9.1:1)

is a set of numbers, what single number will "best" represent this set? If

(9.1:2)

is a set of number pairs interpreted as points in the Cartesian plane, what


is the equation of the curve whose graph "best" fits these points?
The reader undoubtedly knows that the number chosen to answer
the first of the preceding questions is almost always one of the means or
averages: the simple or weighted arithmetic mean, the simple or weighted
geometric mean, the simple or weighted harmonic mean, the median,
the mode. Also, he has undoubtedly gathered from the use of the quota-
tion marks and the multiplicity of the available averages that more must
be known about the numbers before a particular average is chosen or
before one average can be called better than another. For example, there
is no such thing as the best representative of the numbers 70, 80, 78 if
nothing more is known about these numbers; but if these are a student's
grades in three equally weighted tests, various considerations may lead
one to choose the simple arithmetic average. We do not attempt to justify
this choice, but if the median and mode are ruled out as unfit in this
situation, the arithmetic average has the advantage of being the easiest
to calculate and it is the most altruistic since (for positive numbers)
the harmonic mean never exceeds the geometric mean and the geometric
mean never exceeds the arithmetic mean. But suppose that a piece of
351
352 9. CURVE FITTING

meat weighs 5 lb when placed in one pan of an off-center beam balance


and 8 lb when placed in the other pan. It is easily proved from the
momentum laws of physics that the true weight of the meat is the geo-
metric mean of 5 and 8.
We do not pursue the topic of averages any further but devote the
remainder of this chapter to a discussion of the problem raised by the
second question above.

9.2. The Straight Line. In the natural sciences, a physical law


is frequently determined by first measuring a quantity y for given values

(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.

If x is chosen as the arithmetic average of Xl' XI' "', X n , that is,


if x = ~:-l Xi/n, the vertical line 9.2:5 is as good, by almost any natural
criterion, as any other vertical line.
Suppose next that the required line is not vertical; its equation for
which we are looking can be written in the form
(9.2:6) Y = mx+b.
35-4 9. CURVE FITTING

Since two parameters, m and b, have to be determined, the equivalent


of two conditions is at our disposal. We consider the errors to help us
determine the parameters. As far as the X's and Y's are concerned,
there are four possibilities:
(i) the X's are exact, the Y's are in error,
(ii) the Y's are exact, the X's are in error,
(iii) the X's and the Y's are in error,
(iv) the X's and the Y's are exact.
For example: in a moving body experiment, one could measure distances
Y i at stated times Xi' We then assume that the X's are exact and the
Y's are in error. If a particular distance Y i is not measured exactly at
time Xi , the error is thrown into the distance Y i . This is case (,).
One could measure the times Xi for stated distances Y i ; case (ii). Or
three people could work in conjunction in this manner, one gives a
signal and at his command the second measures time Xi and the third
measures the distance Y i ; case (iii). The fourth case does not occur in
actual practice.
Refer to Fig. 9.2:fl. Suppose point Pi with coordinates (Xi' Y i ) is
one of the points to be fitted by a line ST (some of the other points
are indicated in the diagram). If ST were the "true" line whose equation
is being sought, then, had there been no error, Pi would have been at A:
(Xi' Yi) in case (i); in case (ii), Pi would have been at C: (Xl' Y i ).
There is no clear indication where on the line Pi would have been in case
y

T
P,' (X,', 'r/ ) .
"C(xi,Y;)

~~~--------~o~------------------X
s

FIG. 9.2:1.
9.2. THE STRAIGHT LINE 355

(iii). A not unnatural supposition (but definitely a supposition) is to


assume that Pi. would have been at B, the foot of the perpendicular from
Pi. to ST.
We consider the first case. Since Pi. should have been at A, the error
or deviation is APi or

(9.2:7)

Since A is on line ST whose equation is given by 9.2:6, Yi = mXi. +b


or

(9.2:8)

Hence the sum of all the errors for all points is

(9.2:9)

To determine m and b, we impose the condition that

(9.2:10) ~ei = OJ
then

(9.2:11)

(the limits of summation, when not expressed, will be understood to be 1


and n). This one linear equation in m and b is not sufficient to determine
m and b. We can get two conditions by the following device. Separate
the points 9.2:4 into two groups. This can be done by putting the points
whose coordinates have even subscripts into one group and the others
in the second; or by putting the first half of the points (using the numer-
ical values of the abscissas to order the points) into one group and the
others into the second, and so on. After the points have been separated,
rename the points in one group

(9.2:12)

and the points in the other group

(9.2:13) (X~', Y~'), (X;', Y;'), ... , (X~~., Y~:.).


356 9. CURVE FITTING

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

It is quite clear that anyone of the three equations 9.2:11, 14, 15 is a


linear combination of and is therefore dependent on the other two
equations.
If Eqs. 9.2: 14 and 9.2: 15 are consistent and independent, they can be
solved for m and b. If they are inconsistent or dependent, it is necessary
to regroup the points to obtain a uniquely solvable pair of equations.
It is to be expected that different groupings will result in different
sets of values for m and b and therefore in different "best" straight lines.

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;

whence m = 17/18, b = -409/90 and the equation of the required


straight line is
17 409
Y = IS x -9(f'
If we group the first, third, and fifth points together, and the second,
fourth, and sixth points together, we are led to the equations

+ 3b =
ISm 3.5
24m + 3b = S.9;

whence m = 9/10, b = -127/30 and


9 127
Y= lO x- 30 .
9.2. THE STRAIGHT LINE 357

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

which cannot be solved for m and b.


The graphs of the two lines fit the points rather well. This, however,
is not always the case. Consider

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.

Hence, m = -I, b = 4, and y = -x + 4. Its graph, which the reader


should draw, is not a good fit for the points.
If we group the first three and the last three points, we obtain
y = -5x/9 + 26/9 or 5x + 9y - 26 = O. Its graph is a much better
fit than the first.
It has been pointed out that a solution of Eqs. 9.2: 14 and 9.2: 15 will
satisfy Eq. 9.2: II. If Eq. 9.2: II is divided through by n to yield

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

is said to be determined by the method of averages; in general, the equa-


tion of any line or curve determined by condition 9.2:10 is said to be
determined by the method of averages.
We have just seen that if the errors are determined as in case (i)
and the condition 9.2: 10 is placed on the errors, the required straight
line will be determined by two centroids of the points. Since the X's
and Y's play symmetric roles in this result, the same result is obtained
if the errors are determined as in case (ii). If both the X's and the Y's
are inexact, case (iii), and the error is assumed to be the perpendicular
distance from the point to the line, or

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

value is not a simple function to manipulate. Another condition, one


which is widely used, is that

(9.2:17) be a minimum.

A result obtained by imposing this condition is said to be obtained by


the method of least squares.
We interrupt the train of discussion for a moment to recall a necessary
theorem from the calculus. Let z = f(x, y) be a function with continuous
second partial derivatives. The value of z will be a minimum at a point
(a, b) if at this point
of of = 0,
(9.2:18) Zz = ox = 0, Zll = -oy
if
(9.2:19)

and if
(9.2:20)

We now return to the discussion at hand. We seek the parameters m


and b in Eq. 9.2:6 if the condition 9.2: 17 is imposed on the errors ei
given by 9.2:8; this is case (i). We then have et 2 = (mXi b - Yi)2, +
hence
(9.2:21)

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

and Eqs. 9.2:23 are consistent. Now

= -4D>0

and 2n > OJ hence the unique solution of 9.2:23 yields a mlmmum


value for S.
We note, first that the imposition of the condition that S given by
9.2:21 be a minimum is equivalent to two conditions, enough to deter-
mine the parameters m and h of Eq.9.2:6. Second, since the first
equation of 9.2:23 is the same as Eq.9.2:11, the line determined by
the method of least squares also goes through the centroid of the
points 9.2:4, at least for case (i). Equations 9.2:23 are often referred
to as the normal equations for the determination of the straight line.
We do example 2 over again, this time by the method of least squares.
We form the following table:

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

The normal equations are

15m + 6b = 9
55m + 15b = 13;
9.2. THE STRAIGHT LINE 361

whence m = -19/35, b = 20/7, and the required line is y = -19x/35


+ 20/7 or 19x + 35y - I()() = O. This line differs but little from the
second solution obtained by the method of averages.
If we make the transformation

x'=x-Jl
(9.2:25)
y' =y- Y,

where g = ~ Xi/n, Y = ~ Y{./n, that is, we translate the axes


so that the new origin is at the centroid of the points 9.2:4, then

(9.2:26)

Referred to the new axes, the normal equations become

nb' = 0
(9.2:27)
m~X? = ~X/Y/,

whence

(9.2:28)
b' =0
~X/Y/
m= ~X'2 '
j

and the equation of the required line becomes

(9.2:29) Y'~X;2 = x'~X/Y/.

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'

0 3 -5/2 312 2514 -1514


1 2 -312 1/2 9/4 -3/4
2 2 -1/2 112 1/4 -1/4
3 1 1/2 -1/2 1/4 -1/4
4 1 312 -1/2 914 -3/4
5 0 5/2 -3/2 2514 -1514

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

which can be solved for a and p. Also, as before, the transformation


9.2:25 leads to the solution

(9.2:31)

The solution for the points of example 2 is 22x' + 38)" = 0 or, in


the original variables, llx + 19)' - 56 = O. Note carefully that this
equation is not the same as the one found for case (i); the two lines are,
however, close together and each goes through the centroid (t, !) of
the six points.
Let us suppose, finally, that both the X's and the Y's are in error,
case (iii), and that the error in Pi is the length of the perpendicular
from Pi to the required line whose equation is given by 9.2:6; the error
is then

(9.2:32)

In order to simplify some of the ensuing calculations, we assume that the


centroid of the points 9.2:4 is at the origin. In the contrary case, we
would first translate the axes so that the origin is at the centroid, obtain
the results below, and then go back to the original variables. We may
suppose, then, that

(9.2:33)

The sum T of the squares of the errors is given by


(9.2:34)
9.2. THE STRAIGHT LINE 363

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)

Tm = (m 2 ! 1)2 !m 2 kXiYi + m [k Xi 2 - k Yi2] - k XiYi - mnb 2 !.


If we set Tb = 0, then

(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:3'7) ex.m 2 + 213m - ex. = 0

for the determination of m, where

(9.2:38)

We find

(9.2:39) m=
-13 vex. 2 + 132
ex.

(We assume for the time being that ex =F- 0.)


To test for a minimum, we find

2n
Tbb = m2 + 1
4mnb
Tmb = T bm = - (m2 + 1)2

Tmm = (m 2 ! 1)2 {2ex.m + 213 - nb2 }

(m 28: 1)3 {ex.m 2 + 213m - ex. - mnb 2}.


364 9. CURVE FITTING

At the required values, 9.2:36 and 9.2:37 hold, hence

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)

where y = f3/a and the plus or minus sign is taken according as a is


positive or negative. Since Tbb = 2n/(m 2 +
I) > 0, the values of band
m given by 9.2:36 and 9.2:40 minimize T of 9.2:34 and hence yield
the required line.
If ex = 0 but f3 =F 0, Eq. 9.2:37 yields

(9.2:41) m =0.

Also,

Tbb T bm I = 1
2n 0 I = 8nfJ
I
Tmb Tmm 0 4fJ

If f3 > 0, the line

(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

Hence, referred to the new axes, the required equation is y = -O.55x;


referred to the original axes, the equation is y = -O.55x + 2.88. This
equation is different from but close to the ones previously obtained.
If an initial or boundary condition is placed on the required straight
line, for example, the nature of the physical phenomenon may dictate
that the line go through the origin, then only one further condition is at
our disposal. Since the line determined by the method of averages or
by the method of least squares passes through the centroid of the points
in all cases, it is natural to make this the second determining condition
if it does not conflict with the boundary condition.

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

-I -I -I 5 4.1 4.4 -4.2 1.0


0 I 0 2 6.1 6.3 -0.3 -1.2
2 4 2 0 9.8 11.4 5.7 -3.5
5 12 5 -7 15.0 16.6 11.2 -7.3
----
366 9. CURVE FITTING

e I h
x y x y x y x Y

-1.1 -1.8 0.8 0.82 -2.0 9.2 -20 -4.0


0.2 -1.7 2.1 1.70 -0.9 7.3 -12 -3.7
1.8 4.9 5.2 4.25 0.1 4.6 -5 -3.0
3.7 11.1 9.7 8.47 1.3 3.1 0 -2.8
8.1 23.8 19.6 16.90 3.4 -1.0 5 -2.7
15.4 46.5 50.1 42.38 7.8 -11.3 10 -2.5
10.1 -15.1 20 -1.9
14.5 -24.0 30 -1.6
SO -0.5
80 1.0

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. Polynomial Graphs. In this section we discuss methods of deter-


mining the coefficients (parameters) of a polynomial of max-degree m,

(9.3:1)

so that the graph of the polynomial is a good fit for the points

(9.3:2)

whose coordinates are obtained by measurements or other means.


The problem makes sense only if n exceeds m; in actual practice, n will
usually be considerably larger than m. We suppose further throughout
this entire section that the X's are exact and the Y's inexact. The other
two cases are more difficult to handle and the slight differences in the
results do not warrant the extra labor.
9.3. POLYNOMIAL GRAPHS 367

The first method, the method of centroids, is an adaptation of a method


discussed in the previous section. Suppose the n points 9.3:2 arranged
so that the abscissas are in increasing order; separate the points into m+ 1
groups with more or less equal numbers of points. Find the centroid of
each group and then the polynomial of max-degree m through the m + 1
centroids. The graph of this polynomial will usually be a good fit for
all the points of 9.3:2.

EXAMPLE 1. Fit a parabola y = a o + a1x + a 2x 2 to the points ( - 2, 9),


(-1,6), (0,3), (1, -1), (2, -2), (3, -3), (5, -1), (7,3).
We group the first three, the second three, and the last two points;
the centroids of the three groups are, respectively, (-1, 6), (2, - 2),
(6, 1). The equation of the parabola through these three points, by the
methods of Chapter 3, is y = (198 - 265x + 41x2 )/84.
The "true" values of y, corresponding to the given values of x, are
computed from the equation to be 446/42, 252/42, 99/42, -13/42,
-84/42, -114/42, -51/42, 176/42. Hence, the respective errors are
68/42,0, -27/42, 29/42,0, 12/42, -9/42, 50/42. The sum of the errors
is 123/42.
A method of averages can be developed as follows. By substituting
Xi for x in 9.3: 1, we obtain the corresponding "true" value of y, namely,
Yi = ao + alXi + a2 Xi + ... + amXr The error at this point is
(9.3:3)

the sum of the errors for all the points is

(9.3:4)

where, as before, 1 and n are to be understood as the limits of summation.


If we set Ui = 0, we obtain only one condition for the determination
of the m + 1 parameters ao , aI' ... , am; we therefore do what we did
before, we divide the points 9.3:2 into m + 1 groups

(Xu, Y n ). (X I2 Y 12 ). ... (XI a Y I a );


(X21 Y 21 ). (X22 Y 22 ). . .. (Xu. Yu);
(9.3:5)

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

We redo example 1 by the method of averages. If we group the points


as above. we obtain the three equations

3ao - 3a1 + 5al = 18


3ao + 6a1 + 14a2 = -6
2ao + 12a1 + 74a2 = 2,

whence ao = 522/255. a 1 = -803/255. a2 = 123/255. The required


equation is y = (522 - 803x + 123x2 )/255. which is in close agreement
with the previously found solution.
A method of least squares can be developed by procedures similar to
those followed for the straight line. If the errors are given by 9.3:3.
then put
(9.3:6)

We obtain by partial differentiation.

Sao = ~ 2(ao + a1Xi


+ ... + amXr - Yi)

Sal = ~ 2(ao + a1Xi + ... + amXr - Y i ) Xi

Sal = ~ 2(ao + a1Xi + ... + amXr - Y i ) XiI

Sam = ~ 2(ao + a1X j + ... + amXr - Y j ) Xr

Setting these partial derivatives equal to zero. we obtain

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

The data of example I yield the table:

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

The normal equations for this example are therefore


8ao + ISa 1 + 93a2 = 14
ISao + 93a1 + 49Sa2 = -22
93ao + 49Sa1 + 3141a2 = 128.
These equations yield the solution y = 2.133 - 2.864x + 0.429x2
which, as we could have anticipated, is close to each of the two previous
solutions.
As in the case of the straight line, the preceding procedures must be
slightly modified to accomodate given initial or boundary conditions.

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

-3 11 2 0 -6 -13 -4.0 2.0 -9 70 0 0


--2 4 3 3 -4 -6 -1.5 3.8 -7 48 0.5 -2.2
-1 -1 4 9 -1 -1 -1.0 2.8 -5 30 1.0 -5.0
0 -2 5 20 3 3 -0.5 1.4 -2 10 1.5 -8.3
I -I 6 28 4 2 0.0 2.0 -1 6 2.0 -12.0
2 0 7 40 8 -6 5.0 -9.2 0 3 3.0 -20.8
I 0 3.5 -26.1
3 -2 4.0 -32.1
4 -I 4.5 -38.2
6 2 5.0 -44.8
9 16 6.0 -60.0
12 39 8.0 -96.3
370 9. CURVE FITTING

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).

9.4. Other Graphs. It is often desirable to fit a curve to a set of


points
(9.4:1)
where the equation of the curve is not of the form y = p(x), p(x) a
polynomial in x. For example, the graph of the points plus some knowl-
edge of the underlying physical law may indicate the suitability of an
equation of the type y = aebz . The parameters involved may usually be
determined in at least one of three ways: the problem can be reduced to a
previous case by an appropriate change of variables; one or more special
devices can be used, some of which are illustrated below; either freehand
or with the aid of a French curve a good fitting curve is drawn and
estimates are made, directly or indirectly, of the parameters from the
graph. We do a number of examples to illustrate the methods.

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

of centroids, whence a = 0.498. The final answer, using two significant


figures, is y = 0.50eO. 30z
It is to be carefully noted that if the equation of the straight line
y* = a* + bx is found by the method of least squares, it is generally
not true the values of the parameters so determined will minimize the
sum of the squares of the errors in the equation whose graph fits the
original data.
Solution by special device. We differentiate y = aeb z to obtain
y' = abeb z so that y' /y = b. The values of yare approximately the res-
pective Y's, we need the corresponding values of y'. We note that if
Pu: (xo, Yo), Pl : (Xl' Yl)' P2: (X2' Y2) are three points on or near a
curve with X o < Xl < X2 , the slope of the curve at or near Pl should be
some sort of weighted average of the slopes of the chords POPl and
Pl P2 . If we take as the weights the distances X2 - Xl and Xl - Xo,
respectively, the slope at or near P l is approximately

(9.4:2)

If we use this formula to estimate the derivative at each of the three


interior points of the given data, and then evaluate b, we obtain the three
values 0.30, 0.30, 0.36. Their arithmetic average, 0.32, gives us rea-
sonable estimate for b. Using this value for b, and substituting the given
values of X and Y for X and y in a = y/ebZ , we obtain five values for a,
0.49, 0.49, 0.47, 0.46, 0.42. These average out to 0.47. Hence, the final
equation is y = 0.47eO. 32z , a result fairly close to the previous one.
Note that if Xl - X o = X2 - Xl , then 9.4:2 becomes (Y2 - yo)/(x2- xo),
the slope of the line POP2.
Solution by graphing. Plot the given points carefully on graph paper
and draw a smooth curve that seems to be a good fit. Extend the curve
until it meets the y-axis. The y-intercept gives the value of a in the
equation, but this value should be averaged in with the value obtained
as now described to even out drawing inaccuracy. Select five points,
more or less equally spaced, on the graph and draw tangents to the curve
at these points, by inspection, but with the aid of a straightedge. The
slopes of the tangents yield the values of y'; as above, calculate the values
of a and b. Average this a with the y-intercept. Essentially the same result
as before should be obtained.

EXAMPLE 2. Determine the parameters in y = a(2 + X)h so that the


graph of the curve is a good fit for the points (-I, 3.50), (0, 1.94),
(I, 1.39), (3, 0.89), (5, 0.67).
372 9. CURVE FITTING

Solution hy reduction to previous type. Take the common logarithm of


both sides of the given equation; we obtain log y = log a + h log(2 + x).
Make the substitutions x* = log(2 + x), y* = log y, a* = log a, so
thaty* = a* + hx*. Form the following table:

x y x* y*

-I 3.50 0.000 0.544


0 1.90 0.301 0.288
1 1.39 0.477 0.143
3 0.89 0.699 -0.051
5 0.67 0.845 -0.174

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.

EXAMPLE 3. Determine the parameters in y = a(h + x)c so that its


graph is a good fit for the points (-2.5,17.90), (-1.5,4.70),
(-0.5,2.35), (0.5, 1.45), (1.5, 1.05), (2.5,0.80).
Solution. The given points are plotted on ordinary graph paper and
from the hyperbolic shape of the curve we conclude that a and hare
positive and c is negative. The given equation yields log y = log a +
c log(h + x). Make the substitutions y* = log y, x* = log(h + x),
a* = log a, .so that y* = a* + cx*. The value of a* is to be found,
the values of y* (for the given points) can be found, but the values of
x* cannot be found because h is unknown. Hence the first job is to find
a good estimate for h. This can be done in several ways. Since x + h = 0
9."'. OTHER GRAPHS 373

is a vertical asymptote of the required curve. the diagram tells us that b


is approximately 3. We decide to try b = 2.8. 3. 3.2 and form the
following table:

x x + 2.8 x+3 x + 3.2 Y

-2.5 0.3 0.5 0.7 17.90


-1.5 1.3 1.5 1.7 4.70
-0.5 2.3 2.5 2.7 2.35
0.5 3.3 3.5 3.7 1.45
1.5 4.3 4.5 4.7 1.05
2.5 5.3 5.5 5.5 0.80

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.

EXAMPLE 4. Determine the parameters in Y = a + b sin x + c cos x


so that its graph is a good fit for the points:
~I 0.6 0.7 0.8 0.9 1.0 1.1 1.2 1.3 1.4 1.5
y 0.87 0.98 1.10 1.20 1.30 1.38 1.45 1.53 1.60 1.65

There does not seem to be any good approach to this particular


problem. If we differentiate the given equation twice. we readily obtain
Y + y" = a. Values of y" can be obtained from the given data. since the
points are evenly spaced. by the methods of Chapter 7. but (in this
example) the values of Y + y" will vary so much that no satisfactory
value of a can be obtained. Although various devious devices can be
used to get values for a. b. and c. the methods of the next section will
yield excellent results and so we postpone the completion of this example
for a short time.
374 9. CURVE FITTING

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

c. y = ax&; 2.0 3.0 4.5 7.0


x 11.5
y 4.31 2.33 1.02 0.42 0.17

d. y = ab~; 1.7 2.5 3.4


x 11.3
y 8.55 9.73 12.6 16.8

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

h. y = a + b cos x; xIO.O 0.5 1.0 1.5 1.8 2.0


y 1.430 1.210 0.610 -0.225 -0.755 -1.090

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

k. y = a + b sin x + e sins x (x in degrees);

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.

. y = ax + bez ; x \ 0.6 0.8 1.0 1.2 1.4


Y 0.940 1.375 1.745 2.075 2.305

b. y = aez - be-z ; xl 0.8 1.0 1.5 2.0 3.0


-I
y I -1.420 -0.765 0.810 2.590 9.220
c. y = 2x + aebz ; xl 1.0
1.5 2.0 2.5 3.0 3.5
y 3.470 4.640 5.830 7.045 8.285 9.550

d. y = a + bxc ; x I 0.8 1.3 2.0 3.0 5.0 8.0 10.0


y -1.145 -0.695 -0.100 0.695 2.170 4.230 5.560

e. y = a + becz ; x I 0.7 1.0 1.3 1.6 1.9 2.2 2.5 2.8


y 1.080 1.225 1.335 1.440 1.545 1.630 1.715 1.795

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

I. Y = a(b + x)C; x I 3.5


----_.-
4.0 4.5 5.0 5.5
---_.
6.0 6.5 7.0
y 16.30 8.33 5.38 3.90 3.03 2.44 2.03 1.74

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

J. y = a sin(b + ex), angle in degrees;


x I 200 300 400 500 60 0 70 0 80 0 900 1000
y 0.508 0.734 0.950 1.154 1.348 1.522 1.680 1.819 1.930

9.5. Inconsistent Equations. Many investigations in the natural


sciences and elsewhere lead to a set of m, say, simultaneous equations
in n unknows, where m > n. If the coefficients in these equations were
exact, the equations would normally be consistent; since, however, the
coefficients are, directly or indirectly, obtained as the results of measure-
ments, they are inexact and the equations are therefore, as a rule,
inconsistent. In this section we will discuss methods for finding approx-
imate solutions for systems of inconsistent equations; that is, we will
seek values for the unknowns which when substituted into the equations
376 9. CURVE FITTING

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

One method of finding an approximate solution is to separate the m


equations into n more or less equal groups, add the equations within a
group, and then solve the resulting n equations for the n unknows. As
an illustration, we do

EXAMPLE I. Find an approximate solution for the equations (where x


and yare used in place of Xl , X2)

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

The example illustrates the method; it also illustrates the profound


effect on the answers due to the particular method of grouping.
If we substitute the values of the first solution for x and y into the
original four equations, the respective left-hand sides are 32/3, -14/3,
38/21, 298/21. The respective "errors" are e1 = II - 32/3 = 1/3,
e2 = -5 + 14/3 = -1/3, ea = I - 38/21 = -17/21,e4 = 15 -298/21
= 17/21. We note that

(9.5:2) ~e,=O,

and the solution satisfies the "centroid" equation 8x + 9y = 22 ob-


tained by adding all four equations together (division by 4 to get an
"average" causes no essential change). The same remarks hold for the
other two solutions.
We take a hint from the preceding work on curve fitting. Let

(9.5:3) X; = X;, j = 1,2, ... , n,

be an approximate solution of the simultaneous equations 9.5: I. Define


the errors to be
n
(9.5:4) e. = b, - ~ ajjX; , i = 1,2, ... , m;
;=1

then, in place of 9.5:2, we impose the condition that

(9.5:5)

be a minimum. As before, we can show that S is a minimum at the solu-


tion of the equations Sx; = 0, j = I, 2, "', n, or

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

all a'a b, a:1 a~2 Qilail allb, a,.)J,

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

12X + 43Y = 125.

Solving these two equations, we find X = -26/35, Y = 109/35. Note


that this solution is close to but not on the graph of the centroid equation.
The errors this time are 1/35, 12/35, -22/35, 6/35, respectively.

EXAMPLE 2. An experiment in sugar chemistry gave rise to the following


equations:
133.37x - 2.872xy = 50.13
133.37x - 4.898xy = 49.97

133.37x - 6.923xy = 49.91


133.37x - 8.949xy = 49.84;
find x and y.
Since x has the same coefficient in all four equations, it seems natural
to subtract one equation from another and then solve the resulting
equation for xy. Unfortunately, different choices for the two equations
will result in widely different values for xy. We abandon this attack
and use the method of least squares. Regard x as one variable and xy as
the other; the method of least squares leads to the normal equations

71150.23x - 3153.134 xy = 26653.99

-3153.13x + 160.2513xy = -1180.272.

Solving, we find x = 0.37665, xy = 0.0459129; whence y = 0.12190.


9.5. INCONSISTENT EQUATIONS 379

EXAMPLE 3. Determine the parameters in y = a + h sin x + c cos x


so that its graph is a good fit for the points:

xi ~6 ~7 ~8 03 1.0 1.1 1.2 1.3 1.4 1.5


;ro.s7 0.98 1.10 1.20 1.30 1.38 1.45 1.53 1.60 1.65

(this is the postponed problem, illustrative example 4 of Section 9.4).


We use the method of this section as follows. Substitute the values
of x and y into y = a + h sin x + c cos x; we obtain the ten linear
equations in the unknowns a, h, and c:

a + 0.565b + 0.825c = 0.87


a + 0.644b + 0.765c = 0.98
a + 0.717b + 0.697c = 1.10
a + 0.783b + 0.622c = 1.20
a + 0.841b + 0.54Oc = 1.30
a + 0.891b + 0.454c = 1.38
a + 0.932b + 0.362c = 1.45
a + 0.964b + 0.267c = 1.53
a + 0.985b + 0.170c = 1.60
a + 0.997b + 0.071c = 1.65.

The method of least squares yields the equations

lOa+ 8.319b + 4.773c = 13.060


8.319a + 7.l24b + 3.637c = 11.221
4.773a + 3.637b + 2.873c = 5.632.

Solving, we find a = 0.56, h = 1.12, c = -0.38 so that y = 0.56 +


1.12 sin x - 0.38 cos x is the required equation.

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.

The method of least squares leads to the normal equations

4x + 1.6Oy = 11.9680
l.60x + 0.8928y = 5.413056.

Solving, we find x = 2.002, y = 2.476; we take the point 0: (2.002,


2.476) as the center of the required circle. The distances OA, OB, ~C,
OD, OE are, respectively, 2.9043, 2.9028, 2.9024, 2.9077, 2.9040. We
take the arithmetic average, 2.9042, for the radius so that the equation
of the required circle is (x - 2.002)2 + (y - 2.476)2 = 2.90422 or
x 2 + y2 - 4.004x - 4.952y + 1.704 = O.
Solution 2. The required equation is of the form ax + by + c =
x 2 + y2. Substituting the coordinates of the five points for x and y, we
obtain the set of equations

+ 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.

The normal equations are

7.5a + 26.45b + 5c = 152.503


26.45a + 130.078b + 25.46c = 706.673
5a + 25.46b + 5c = 137.578,
whence a = 4.0 I 0, b = 4.950, c = -1.697. The equation of the required
circle is, therefore, x 2 + y2 - 4.01Ox - 4.950y + 1.697 = 0, a result
close to but different from the previous result.
9.S. INCONSISTENT EQUATIONS 381

We do not investigate here methods for finding approximate solutions


for a set of nonlinear equations which cannot be transformed into a set
of linear equations.

EXERCISE 9.5

1. Find solutions which are good fits for the following sets of equations.

a. 2x - 3y = 14.0 b. x - 8y = 1.2 c. 1.32x + 4.07y = 0.54


5x + y = 9.5 2x + 5y = - 12.4 4.96x + 5.21y = 25.05
3x + y = 4.5 4x - 13y = -8.0 8.22x - 0.58y = 62.64
3x + 2y = I.S 5x - 16y = -10.2 10.57x - 3.94y = 87.78
d. 2.Ix - 5.Oy - 3.2z = 23.55 e. x + 2y - 18 + W = 10.2
3.2x - 2.4y - 0.318 = 13.32 2x - y + 318 - 4w = -17.0
4.5x + 0.4y + 1.918 = 5.32 2x - 3y - 318 + 5w = 15.3
4.9x + 1.8y + 2.718 = 1.S9 3x + y - 18 + 2w = II.8
5.7x - 2.2y + 3.418 = 8.35 5x + 2y + 618 - 3w = -15.1
7x + 4y - 518 - 5w = 19.8
2. Find values for x, y, and 18 which will yield good fits for the following sets of equa-
tions.
a. 3x + 2yl = 8.2 b. 5.Ix - xy = 13.10 c. 2xy - 3yz - xz = 233.4
5x - yl = 9.3 6. Ix + xy = 24.20 3xy + yz - 4xz = 190.2
7x - 2y l = 12.5 7.Ix + 2xy = 31.48 3xy + 3yz + xz = -51.5
9x + yl = 19.1 8.1x - 3xy = 15.38 5xy + 5yz + 3xz = -127.5
3. In examples I and 2, define the error for a particular equation to be the difference
between the right-hand side and the value of the left-hand side when the solution is
substituted for the variables. Determine the various errors.
4. Do all parts of example I, Exercise 9.2, by the methods of this section.
5. Do all parts of examples I and 2, Exercise 9.3, by the methods of this section.
6. Do all parts of example I, Exercise 9.4, by the methods of this section.

7. Do parts a and b of example 2, Exercise 9.4, by the methods of this section.


8. Fit a vertical ellipse to the following points by the methods of this section.

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.

Curtiss, J. H. (ed.), "Numerical Analysis: Proceedings of Symposia in Applied


Mathematics," Vol. VI. McGraw-Hill, New York, 1956.
Davis, D. S., "Nomography and Empirical Equations." Holt, New York, 1955.
Hartree, D. R., "Numerical Analysis." Oxford Univ. Press (Clarendon),
London and New York, 1952.
Hildebrand, F. B., "Introduction to Numerical Analysis." McGraw-Hill,
New York, 1956.
Householder, A. S., "Principles of Numerical Analysis." McGraw-Hill, New
York, 195~.
Johnson, L. H., "Nomography and Empirical Equations." Wiley, New York,
1952.
Kopal, Z., "Numerical Analysis." Wiley, New York, 1955.
Levens, A. S., "Nomography," 2nd ed. Wiley, New York, 1959.
Lipka, J., "Graphical and Mechanical Computation." Wiley, New York, 1918.
Milne, W. E., "Numerical Solution of Differential Equations." Wiley, New
York, 1953.
Nielsen, K. L., "Methods in Numerical Analysis." Macmillan, New York, 1956.
Paige, L. J., and O. Taussky (eds.), "Simultaneous Linear Equations and the
Determination of Eigenvalues." Natl. Bureau of Standards, Appl. Math.
Ser. 29, 1953.
Scarborough, J. B., "Numerical Mathematical Analysis," 5th ed. Johns Hopkins
Press, Baltimore, 1962.
Steffensen, J. F., "Interpolation." Williams & Wilkins, Baltimore, 1927.
(2nd ed., Chelsea, New York, 1950.)
Stiefel, E. L., "An Introduction to Numerical Mathematics," translated from
the German by W. C. Rheinboldt. Academic Press, New York, 1963.
Todd, John (ed.), "Survey of Numerical Analysis." McGraw-Hill,
New York, 1962.
Whittaker, E. T., and G. Robinson, "The Calculus of Observations," 4th ed.
Blackie, London, 1946.
382
Answers

EXERCISE 1.1

1a. Unit. loo b. Tenth. 10-1 c. Thousandth. 10-3 d. Hundredth. 10-1


e. Millionth. 10-8 f. Tenth. 10-1 I. Hundred-thousandth. 10-6 h. Millionth. 10- 8
I. Millionth. 10-' j. Hundred-thousandth. 10-6
2a. Thousand. 108 ; or. hundred. 101 ; or. ten. 10; or. unit. 10. b. Same as a
c. Million. 10'; or. hundred-thousand. 10'; ... ; or. unit. loo d. Unit. loo e. Unit. 10
f. 10; or. unit. loo.
3a. 4 b. 4 c. 5 d. I e. 2 or 3 f. 7 I. 7 h. 5 I. 7 j. 4.
4. 1a. 4.36 X 101 b. 7.502 X 101 c. 2.006 X 10 d. 5 X 10-1 e. 5.0 X 10-6
f. 4.000 X 101 1.0 X 10-6 h. 1.976530 X loo I. 1.000001 X loo j. 8.8309000 X 101
2a. 9.56000 X 10' or 9.5600 X 106 or 9.560 X 10' or 9.56 X 10' b. 9.06000 X 10' or
9.0600 X 10~. etc. c. 1.000000 X 10' or 1.00000 X 10'... I X 10' d. 1.000001 X 10'
e.9.99999 X 10' f. 3.020010 X 10' or 3.02001 X 10'. 3a.4.029 X 108 b.4.029 X 10
c. 5.3670 X 10 d. 2 X 10-' e. 1.90 X 101 or 1.9 X 101 f. 2.000000 X 10
I. 2.000006 X loo h. 3.0002 X 10 I. 8.310400 X 10 j. 8.040 X 10-1
Sa. 4.330 b. 682.5 c. 29.00 d. 102800 e. 0.07654 f. 8976 I. 1.000 h. 1.350
I. 407.4 j. 32.11.
6a. 3.143 b. 3.142 c. 33330 d. 1.000 e. 1.000 f. 0.08994 I. 0.01899
h. 3.629.000 i. 31.01 j. 63360.
7a. 3.1 b. 3.1 c. 33333.3 d. 1.0 e. 1.0 f. 0.1 I. 0.0 h. 3628800.0 I. 31.0
j. 63360.0.
Ia. 3 b. I c. 2 d. 5 e. 2 f. 2 I. 4 h. 4 i. 2 j. 3.

EXERCISE 1.2

1a. 0.015.0.011. 1.1 % b. 0.019.0.0068.0.68 % c. -0.0026.0.00021.0.021 %


d. 100. 0.0028. 0.28% e. 0.0078. 0.00029. 0.029% f. 0.00012. 0.00011. 0.011 %
I. 393. 0.001. 0.1 % h. 0.00004. 0.00021. 0.021 % I. -0.63 (in.). 0.016. 1.6%
j. 0.40 (mm). 0.016. 1.6%.
la. 0.005.0.0003 b. 0.00005.0.00016 c. 0.5.0.011 d. 0.5.0.00007 e. 50.0.0053
or 5. 0.00053 or 0.5. 0.000053 f. 5 X 10-'.0.17 I. 0.05.5.8 X 10-' h. 0.0005.
0.0017 I. 0.05.0.027 ,. 0.5.0.25.
3. 0.000293 4. (y2)"/1 - (e/2)v'i- = 0.0221.
383
3&4 ANSWERS

EXERCISE 1.3

1. P = -0.01 in.; a = 0.0009. 2. P = 0.8 gm; a = 0.00081.


3. P = 0.0005 in.; a = 0.13.
4. The measurement of the cylinder is the more precise and the more accurate.
5. P = -0.0025 in., a = 0.00084; P = -0.005 in., a = 0.00084; P = -0.02 ft,
a = 0.00084.

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

8. Id; I = 0.0083,1 dW 1 = 0.12 lb. 9.1 ~ I = 0.021,1 dF 1 = 0.000009 k.

101~ 1= O.I,ldFI =0.09. 11.1 ~ I 0.066, 1cis 1 0.97.= =

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

2. pb) = 0.841 + 1.284(x - I) - 1.04I(x - 1)1. sin(0.9)1 - PI(0.9) = 0.021.


I
3. pix) = 384 (384 + 192x + 48xl + 8x3 + x'); e - p,(2) = 0.010.
5 I
4. PI(X) = I + 2x + - Xl; error at x = - x3[e X (I - X)-l + 3(1 - X)-I + 6(1 - X)-3
8 2 6
+ 6( I - X)-'] "" - X3 eX, where X is between 0 and x.
3
5. P3(X) = -I - 4(x - I) - 5(x - 1)1. I x - I I < 0.2.
I I I
6. PI(X) = I +"3 x + 18 Xl + 162 x 3. P3( I) = 1.4. Estimated error and actual error "" I.
3 II
7. P3(X) = I + (x - I) - - (x - 1)1 +- (x - 1)1. P3(1.5) = 1.935;
8 48
f( 1.S) - p(1.5) = 0.095.

EXERCISE 2.4

1. 0.27226, 0.82628, 1.4062, 3.0591, 8.0387.


2. 0.09967, 0.19737, 0.46128, 0.74682, 0.88208, 0.88623.
3. 0.1469, 0.4777, 0.8650, 2.130, 6.230, 22.48.
5. 0.9983, -0.03330, -0.3323, 0.01998; 0.9933, -0.06640, -0.3293, 0.03986;
0.9589, -0.1625, -0.3087, 0.09733; 0.8414, -0.7874, -0.2391, 0.1771;
0.4546, -0.4354, -0.01925, 0.2369; -0.1892, -0.II6I, 0.2473, -0.02203.

EXERCISE 2.5

1. 0.00036 (n = 5). 2. 0.18(n = I); 0.0982 (n 4). 5. 2.929, 7.485, 0.701.

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

positive x, mx > Xl. In this case, a minimum exists at m = O.

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

and b are not uniquely determined for a minimum.


386 ANSWERS

EXERCISE 3.1

1. fl (I X 1 - ax - b)I dx = 1 + lal - 2h + 2h1; minimum for Pl(X) = i.

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

1a. y = -3x - I b. y = 1(2x + 25) c. y = 4 d. y = iX' + ix - 1


I
e. y = 2.0667 + 1.0500x - 0.816;X ' f. y = 10 (-6x 8 + 23x l + IIx - 28)

,. y = -II + 6x - Xl h. y = 72(-72 + 430x - 71x1 + x 8)


I. y = 13860 (339x 4 - 21 34x8 -7841x l + 32596x + 74060) J. y = 1 + 6x - iX'.

3a. y = 0.00248 44733x+4.99769 38220 b. y = -0.00000 30786x'+0.00496 27463x


+ 4.4989421504 c. y = 0.00000 00051x 8 - 0.00000 92445x l + 0.0074475989x
+ 4.1651449880 d. Same as c e. Same as c f. 5.9979427726 ,. 5.9979427726,
5.9979435114, 5.9979435132 h. 5.9979435132.

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

1a. -3 1.76 c. 3.0 -3.025


-1.76 25
0 0 4.65 3.2 -3.000 10
2.89 35 -2
3 2.89 3.4 -2.965 8 -I
43 -3
3.6 -2.922 5
48
3.8 -2.874
la. 20 -0.46595
27402
40 -0.19193 -14456
12946 7092
60 -0.06247 -7364 -5310
5582 1782
80 -0.00665 -5582
0
100 -0.00665
(Note: log sin 20 = 9.53405 - 10 = -0.46595, etc.)

EXERCISE l.8
1. V40I = 20.0250; estimated error = 0.0000, actual error = 0.0000

V405.2 = 20.1296; estimated error = 0.0000, actual error = 0.0000

V 409.25 = 20.2299; estimated error = 0.0000, actual error = 0.0000.


lao /( -6.02) = 0.2430, /( -6.125) = 0.2187 c. /(0.011) = 0.803483, /(0.0193)
= 0.682275, /(0.02015) = 0.670995 e. 10(2.015) = 0.2153, 10(2.407) = -0.0011;
U2.507) = 0.4953, 11(2.834) = 0.3984.

EXERCISE l.9
1. V39s = 19.8752; estimated error" 0.0006, actual error = 0.0006

V 415 = 20.3723; estimated error" 0.0007, actual error = -0.0007.


388 ANSWERS

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.

Sa. (n = m = 2) C(x) = ~ (1 - 3 ~ sin 2'IT(x - 1) + cos 'IT(x - 1) .

7. y = 0.048lxe'8CIZ; errors are approximately 1,4,222, 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

la. -2.449, -2.303, 1.303,2.449 b. -0.434,0.768 (each is a double root)


c. -1.949, -1.852, 1.783, 2.052, 3.166.

4a. 2 1.414i, -1 0.707i(2 V2i, -1 ~i)


b. -2.096, 1.500 1.658i, 2.548 0.424i
c. -2 3.162i, 3 2.236i( -2 VIoi, 3 Vsi).
EXERCISE 5.3
1. 2.47345 3. 1.497 5. -1.028 7. 2.870, 3.088
9. 0.3085, 1.467,5.006 13. 10.223 17. 0.137
21. 0.854,2.601, -1.826 24. (a = 401.75) 408.4, (a = 970.23) 5481
25. 2.5943, -0.36939 26. Least positive root, 0.7259.

EXERCISE 5.4

la.1.148,2.197 c. 0.710,0.916, -1.396 e.0.771,1.229.

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

1a. x = -2, Y = 2, !II = 5, w = -I b. x = 2/3, Y = 4, !II = -12/5, w = -5/2


c. x = 0.83, Y = -4.02, !II = 3.91, w = 0.56
d. x = 15.2, Y = 12.9, !II = 0.84, u = -3.75, () = 10.16.
lao x = 3.086, Y = -2.409, !II = -10.322, w = 0.577
b. x = -8.233, Y = 4.114, !II = -0.598, u = -3.294, () = 3.702.

EXERCISE 7.2

1. Usingxo = 0.5,/,(0.5) = 1.79,error = 0.21;/,(0.9) = 1.16,error = -0.05.


la. 0.01440, 0.01569, 0.01618, 0.00694, 0.01744, 0.01718
C. /'(1) = 5.2./'(3) = 3.3,/,(6) = 2.17./'(8) = 1.72.

EXERCISE 7.4

EXERCISE 7.7

la. -1.6941, -0.7240, 0.7921, 2.1094, 4.6530.


C. -19.84136, -4.01038, 12.15403, 53.94016, 106.48444.

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

2. 59.55; 23.85 + 38.98 = 62.83 (Simpson's extended rule, h = t, yields 59.10).


I
lb. P.(x) = - [(e + 41e- 1) - 4(e ' - 4Oe- 1) x + 100e' - 13e- 1) xl)
27
= 0.8323 + 1.0853x + 0.9654x.
390 ANSWERS

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

ISI(x-I)' 1091(x-1)7 7841(x-I)B S6SI9(X-I)'). ( _ 0 4


+ 6! - 7! + 81 - 9! Y 1.5) - .513.
Xl 2x. OXI
9b. Y = 1 + x + -3! + - 4! + - 51 .
Xl a"x3 2a 1x 3xl 4a"x8 (n - 2) ax"
10.. Y = ao + alx + -21 + - 31 + -4!- + -S! + -6!- + ... ..J..' n l + ...
where a is a o al or I according as n = 3k. 3k + I. 3k + 2.
2(x - 1)8 19(x - 1)3 72.S(x - 1). 279.2S(x - 1)1
11. Y = -2(x - I) + 2! + 31 + 41 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

11. (0.2. -2.130). (0.4. -0.755). (0.8.1.216). (1.4.3.751). (2.7.297).


14. (-0.8. 1.098). (-0.6. 1.176). (0. 1). (0.4. 0.517). (I. 0).
15. (1.3. 1.5490). (1.6. 0.9324). (2.5. 0.2426). (3.4. 0.0725). (4. 0.0338).
ANSWERS 391

EXERCISE 8.9

1. (t, x, y) = (9.5,9.76,8.08), (10, 10.54,8.16), (10.5, 11.34,8.24), (11, 12.16,


8.32), (12, 13.86, 8.46), (13, 15.62, 8.61), (14, 17.46, 8.74), (15, 19.36, 8.87).
3. (t, x,y) = (0.1, -0.7952, 1.1048), (0.3, -0.3598,1.3409), (0.5,0.1018,1.6070),
(0.8,0.8206,2.0541), (1,1.3012,2.3818), (1.4,2.2155,3.1154), (1.8,3.0010,3.9866),
(2, 3.3254, 4.4932).
5. (t, x, y, 03') = (1.4,0.336,0.845, -0.592), (1.8,0.588, 0.745, -0.154), (2.2, 0.788,
0.674,0.323), (2.6,0.956,0.620,0.840), (3, 1.099,0.577, 1.394).
7. (1.2, 1.4598), (1.4,2.0370), (1.6,2.7255), (1.8,3.5168), (2,4.4012).
9. (4.4, 7.132), (4.8, 8.325), (5.2, 9.577), (5.6, 10.886), (6, 12.247).
11. (1.2,3.637), (1.4,4.798), (1.6,6.265), (1.8,8.116), (2,10.450).

EXERCISE 9.2

1a(iii). 30x - 14y + II = 0, 98x - 45y + 33 = 0, y = 2.340x + 0.490.


c(iii). y = 1.142x - 0.315, x = 0.872y + 0.318, y = 1.113x - 0.064.
e(iii). y = 3.024x - 0.364, x = 0.329y + 0.140, y = 3.000x - 0.250.
(iii). y = -2.032x + 5.310, x = -0.492y + 2.616, y = -1.736x + 4.043.

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

1a. y = 0.34x1.1 C. Y = 1O.3x-1ol e. y = 0.021(1.565)~ . y = el.B-O.I'~


i. y = 5.12 + 3.07 log x k. y = 0.45 + 2.12sinx - 1.93sinl x.
la. y = 3.36x - 0.59~ c. y = 2x + 1.18e00l1~ e. y = 2.57 - 1.85ro.31~
y = 1O.45(x - 2.8)-l.Il i. y = x-o.'I(1 + 2.05x)1.U.

EXERCISE 9.5

1a. (2.5, -3.1) c. (7.45, -2.28) e. (1,2, -3,2).


2b. (3.34, 1.16).
8. Xl + 0.0875yl - 3.6483x + 1.6552y + 5.9880 = O.
Index

Accuracy, 10 diagonals of table, 80


Adams, J. C., 322 order of, 78
Advancing formula(s}, 330, 331, 344, 348 table of, 79
Aitkin, A. C., 86
Aitkin-Neville processes, 86 Equally spaced points, 97
Algorithmic methods, 137 Error(s}, 7
Approximating polynomial, 67 actual, 7
Arithmetic methods, 137 computational, 12, 106
Asymptotic series (expansion, representa- inherent, 106
tion), 49 margin of, 4, 8
Averages, method of, 358, 367 maximum, 8
maximum relative, 8
Bernouilli, James, 35 per cent maximum relative, 8
Bernouilli numbers, 36 per cent relative actual, 7
Bernouilli polynomials, 51 relative actual, 7
Bessel's equation of order zero, 308 replacement, 23
Boundary conditions, 295 Error analysis, curve fitting, 354, 355, 362,
Bromwich, T. J., 50 377
Error analysis, differential equations, 296,
Carrier curve, 142 303, 319, 323, 332, 337, 338
Cauchy, A. L., see Vandermonde-Cauchy Error function, 26, 29, -41, 47, 88, 91,
determinant 104, 247, 248, 253, 255, 256, 279, 280
Center of gravity, see Centroid Euler numbers, 46
Centroid, 357 Euler's constant, 54
Centroids, method of, 367 Euler's summation formulas, 54, 59
Characteristic function, 250 Everett, J. D., see Laplace-Everett for-
Chords, method of, 194, 209 mula
Correcting formulas, 330, 331, 344, 348 Extrapolation, 117
Cotes, R., see Newton-Cotes formula
Closed type formulas, 273 Factorial polynomial, 220
False position, method of, 192
Dandelin, G., 171 Finite difference(s}, 97
Differential equation solution(s}, 294 order of, 97
general, 294 table of, 98
particular, 294 Fourier series, 128
particular family, 294
pointwise solution, 297 Gauss' central difference formulas, 103
Divided difference(s}, 78 Gaussian coefficients, 288
393
394 INDEX

Gauss' numerical integration formulas, 282 approximate,


Graeffe, C. H., 171 correct significant figures, 4
Graph, 137 decimal representations, I
Graphical methods, 137 round(ing)-off, 4
Gregory's formula, 266 Numerical unit, I
form, 2
Horner's method, 47, 169 Nystrom's formula, 325

Imaginary roots, 181, 196 Open type formulas, 273


Initial conditions, 295 Orthogonal functions, 285
Inspection, method of, 353
Integral equation, 300 Period, 52
Interpolating polynomial, see Approxima- Periodic functions, 52
ting polynomial Picard, E., 299
Interpolation 23 Polynomial interpolation sequence, 112
additional methods, 133 convergence of, 113
inverse, 135 Power series, 30
linear, 23 algebra of, 33
Iteration methods, 137, 185, 203 alternating, 41
computation with, 40
Knopp, K., 50 convergent, 31
Kutta's formulas, 316 differential equations 304
divergent, 31
Lagrange coefficient(s), 75 everywhere convergent, 31
derivative of, 237 nowhere convergent, 31
tables of, 102 numerical integration, 257
Lagrange interpolation formula, 75 radius of convergence, 31
Laplace-Everett formula, 112 Precision, IO
Least squares, method of, 359, 368, 377 Predicting formulas, see Advancing formu-
Legendre polynomials, 284 las
Lineal element, 297 Principle of equal effects, 20
diagram, 297
Lipschitz condition, 301 Raphson, J., see Newton-Raphson method
Literal methods, 137 Reduction method, 200
Lobachevsky, N. I., 171 Reguli falsi, see False position, method of
Root-squaring method, 171
Maclaurin series (expansion), 33 Round(ing)-off, see under Number
MacRobert, T. M., 50 Rule(s), see Scale(s)
Max-degree, 24 Runge, c., 315
Mean, theorem of the, 88 Runge's formulas, 316

Neville, E. H., 86 Scale(s), 142


Newton-Bessel formula, 112 coordinate system of, 142
Newton-Cotes formulas, 273 linear, 142
Newton-Raphson method, 189 mark of, 142
Newton's interpolation formulas, 103 nonuniform, 143
Newton-Stirling formula, 112 origin of, 142
Nomogram, 137, 154 sliding, 151
Normal equations, 360, 368, 377 stationary, 148
Number(s), I uniform, 142
INDEX 395

unit distance, 142 Tables


zero point of, 142 binomial coefficients, 119
Scientific form (notation), 3 binomial coefficient derivatives, 248
Semi-convergent series, see Asymptotic Gaussian coefficients, 289, 290
series Legendre polynomials, 284
Sequence chain(s), 81 Legendre polynomials, roots of, 289, 290
backward, 81 numerical differentiation, 225, 226, 227,
central, 82 228, 232, 233, 236
forward, 81 numerical integration, 262, 263, 264, 265,
Significant digit (figure), 2 274, 275, 276, 277
Simpson's rules (formulas), 273 Taylor series (expansion, theorem), 26
Standard form (notation), see Scientific Trapezoidal rule, 273
form (notation)
Stirling's formula, 56, 58, 60 Vandermonde-Cauchy determinant, 72
Subtabulation, 118
Symbols, --, 49 Wallis' infinite product, 55
10:1,42 Weddle's formula, 273
Weierstrass, K., 67

You might also like