Modern Analytic and Computational MetlhodS in Science and Mathennallfs RICHARD h EIJ.MAN. editor
Integration for Engin...
70 downloads
788 Views
4MB Size
Report
This content was uploaded by our users and we assume good faith they have the permission to share this book. If you own the copyright to this book and it is wrongfully on our website, we offer a simple DMCA procedure to remove your content from our site. Start by pressing the button below!
Report copyright / DMCA form
Modern Analytic and Computational MetlhodS in Science and Mathennallfs RICHARD h EIJ.MAN. editor
Integration for Engineers and Scientists William Squire West Virginia University Morgantown, West Virginia
American Elsevier Publishing Company, Inc. NEW YORK 1970
AMERICAN FLSEVIER PUBLISHING COMPANY, INC. 52 Vanderbilt Avenue, New York, N.Y. 10017
ELSEVIER PUBLISHING COMPANY. LTD. Barking, Essex, England
ELSEVIER PUBLISHING COMPANY 335 Jan Van Galenstraat. P.O. Box 21 1 Amsterdam, The Netherlands
Standard Book Number 444-00075-5 Library of Congress Card Number 71-101037
Copyright © 1970 by American Elsevier Publishing Company. Inc.
All rights reserved. No part of this publication may be reproduced. stored in a retrieval system, or transmitted in any form or by any means, electronic. mechanical, photocopying, recording, or otherwise, without the prior written permission of the publisher, American Elsevier Publishing Company, Inc.. 52 Vanderbilt Avenue, New York, N.Y. 10017.
Printed in the United States of America
Preface HIS book is primarily intended for students and practicing scientists or engineers faced with the problem of evaluating integrals
beyond those treated in elementary textbooks or listed in the standard tables. It should also be useful to teachers. Although a search of the library
will turn up a number of advanced works dealing with the fundamental theory of the integral, these are of little help in evaluating specific integrals. Actually, for this aspect of the subject, the older problem-oriented advanced
calculus texts are generally superior to their modern counterparts. The general neglect of Liouville's work on integration in finite terms is difficult
to explain. Apparently no American nor European calculus text makes more than a brief reference to it, though there are two excellent presentations (Hardy and Ritt) available in English. In regard to numerical methods the situation is better. The advent of the high-speed computer has brought about a revival of interest, and a number of excellent treatments are available, particularly the monographs by Davis and Rabinowitz, Nikolsky, and Krylov. I believe, however, that the present treatment fills a definite need for an extensive presentation on a somewhat more elementary level. The following quotation by J. L. Synge [Quart. App!. Math., 9 (1951), p 113-114] is apropos: "The modern meaning of the words 'mathematical proof' is well known: they imply a faultless logical chain
which starts from undefined elements and axioms, no loop-holes or exceptions permitted. Those subjects which, like topology, have been developed in that spirit of rigor, present an almost impenetrable front to applied mathematicians or engineers. The extraction of one needed result, and an
understanding of what it means, demand a long and careful study in an uncongenial atmosphere, unrelieved by interpretations in terms of natural phenomena. It is obvious that this state of affairs cannot persist. Each mathematical
subject must be treated on several levels, varying from that of extreme rigor down to simple intuitive descriptions with no proof at all. We get this variety of treatment in older branches of mathematics, partly because the
creators had not got the modern standards of rigor, and partly because these matters have been looked at so long by so many people and from so many different angles.
INTEGRATION FOR ENGINEERS AND SCIENTISTS
Much of the argument that passes for proof in physics and engineering is
not proof in the mathematical sense, and it is unlikely that the practical subjects will ever submit to the strict mathematical discipline. There seems to be an incompatibility between those minds which excel in logic and those
which are capable of dealing successfully with problems suggested by nature. The word `proof' has such a general usage that it is inconceivable that it should be employed only in its strictest mathematical meaning. Physicists and engineers will continue to use it in a looser sense, and will regard as proved any proposition with regard to which they can assemble sufficient evidence to convince them of its truth. As Descartes pointed out long ago,
to `prove' something by a series of logical steps, and to `see' or 'understand' it are not the same thing; and what the physicist or engineer needs is the `seeing' and the `understanding'." The present treatment assumes no background beyond the usual undergraduate course in differential equations. This has resulted in the omission of some powerful methods, such as contour integration and the method of steepest descents, that depend on a knowledge of the theory of functions of a complex variable, but it is believed that this is not serious because of the availa-
bility of adequate treatments. While we have tried to take the impact of the computer into account, no specific knowledge of computer programming
is assumed in the text. However, a number of illustrative FORTRAN programs are included as appendices and many of the numerical problems are intended to be worked with a computer rather than by hand. The first chapter of the book covers background material and tries to
relate the practical aspects to the basic theory. The second chapter is a review of the methods for evaluating indefinite integrals covered in calculus
courses unified by Liouville's theory. Use is made of devices, such as differentiation with respect to a parameter, that are not used in the elementary
courses because of the conventional sequence of topics, which postpones partial differentiation to a later stage. The third chapter covers exact and approximate methods for evaluating definite integrals. I have found that engineering students can reach graduate school without learning that there are methods for evaluating a definite integral other than substituting the limits in the indefinite integral.
The fourth and fifth chapters treat numerical methods for evaluating integrals. The methods in the fourth chapter use only values of the integrand, whereas those in the fifth chapter also use the values of the derivatives of the
integrand. While the presentation is not as rigorous or detailed as those available elsewhere, it is probably the most extensive single compilation of methods presently available. At this time when the impact of the computer is revolutionizing computations, it does not appear possible to make a definite
PREFACE
judgment regarding the best methods. The objective is therefore to present a wide range of methods so that the reader can either pick one adapted to his particular problem or see how to devise a modification suited to his particular circumstances. The last chapter gives a brief account of the theory of integral equations and shows how the quadrature methods in Chapter 4 can be used to develop methods for numerical solution. Although the book has not been designed for any of the usual courses in American universities, the last three chapters could be used as the basis for a specialized second course in numerical methods. The first three chapters would be a useful supplement for honors sections in calculus.
I have tried to present integration not as a completed logical structure but as a field with its roots in the past yet still offering ample scope for further development. An attempt has been made to cite references of varying
degrees of difficulty, particularly for important topics. In order to show current developments, it has sometimes been necessary to cite reports of limited availability. On the other hand, secondary sources have often been cited. To some extent this has been done on the basis of my convenience, and apologies are tendered to those deprived of their due. An attempt has been made to provide interesting and meaningful exercises. Correction of errors and suggestions would be appreciated. The most
interesting applications occur en passant in papers on other subjects and are difficult to locate through abstract journals, so I appeal to the interested reader for examples of ingenious evaluations for future editions. My research in numerical methods for evaluating integrals, which led to some methods described in Chapters 4 and 5, was supported by an AFOSR grant in 1963-1965. However, the main support for this book came from West Virginia University and my department through lightened teaching loads, and from the computer center, which provided computer time. I am grateful to Mrs. Donna Moore and Mrs. Georgette Healy for typing the manuscript and to Dr. Richard Bellman for his editorial encouragement. Finally, I acknowlegde the inspiration of Dr. Norman Davids, who 25 years ago in a course on boundary-value problems introduced me to the concept
of Gaussian quadrature. Morgantown, West Virginia January 1970
WILLIAM SQUIRE
Contents CHAPTER 1
General Background 1 1.1. Introduction ................................................................................ 3 1.2. Riemann, Stieltjes and Lesbesgue Integrals .................................. 8 1.3. Multiple and Iterated Integrals ...................................................... 14 1.4. Improper and Infinite Integrals .................................................... 1.5. Mean Value Theorems .................................................................. 20 1.6. Inequalities .................................................................................. 21 1.7. Indefinite Integrals versus Definite Integrals ................................ 25 1.8. Fractional Integration and Differentiation .................................... 28 1.9. Line Integrals .............................................................................. 29 1.10. Surface and Volume integrals ...................................................... 31 1.11. Symmetry Arguments .................................................................. 31 Bibliographic Notes and Comments .............................................. 34
CHAPTER 2
Analytic Evaluation of Indefinite Integrals 2.1. Introduction ................................................................................ 2.2. Liouville's Classification of the Elementary Functions .................. 2.3. Basic Theorems for Integration in Finite Terms ............................ 2.4. Practical Integration of Rational Functions .................................. 2.5. Practical Integration of Algebraic Functions ................................ 2.6. Elliptic Integrals .......................................................................... 2.7. Integration of Elementary Transcendental Functions .................... 2.8. Symbolic Automatic Integration .................................................. 2.9. Derivation of Integrals from Differential Equations ...................... 2.10. Approximate Methods .................................................................. 2.11. A Practical Example .................................................................... Bibliographic Notes and Comments ..............................................
39 41 45 49 52
57 58 63 68 70 72 75
CHAPTER 3
Analytic Evaluation of Definite Integrals 3.1. Introduction ................................................................................ 77 3.2. The Gamma Function .................................................................. 79 3.3. Classical Calculus Methods .......................................................... 84 3.4. Series Methods ............................................................................ 90 3.5. Complex Variable Methods .......................................................... 93 3.6. Some General Forms for Definite Integrals .................................... 94 3.7. Use of Integral Transforms .......................................................... 96 3.8. Frullanian Integrals ...................................................................... 99 3.9. The Willis Expansion .................................................................... 105 3.10. Laplace's Method ........................................................................ 108 3.11. Integration By Parts Methods ...................................................... 111 3.12. Concluding Remarks and Examples ............................................ 115 Bibliographic Notes and Comments .............................................. 120
CHAPTER 4
Numerical Evaluation of Integrals 4.1. Introduction ................................................................................ 125 4.2. Simple Quadrature Formulas with Specified Nodes ...................... 127 4.3. Chebyshev's Equal Weight Quadrature Formulas ........................ 132 4.4. Gaussian Quadrature .................................................................. 135 4.5. Convergence of Quadrature Formulas .......................................... 138 4.6. Error Analysis .............................................................................. 139 4.7. Compounding and Adaptive Integration ...................................... 144 4.8. Extrapolation Methods ................................................................ 148 4.9. The Bernstein Quadrature Formula .............................................. 152 4.10. Monte Carlo Methods .................................................................. 153 4.11. `Best" Quadrature Formulas ........................................................ 154 4.12. Riemann and Riemann-Stieltjes Sums .......................................... 157 4.13. Integration of Periodic Functions ................................................ 158 4.14. Improper Integrals ...................................................................... 160 4.15. Product Integration ...................................................................... 164 4.16. Trigonometric Weight Functions .................................................. 170 4.17. Integrals Over An Infinite Range .................................................. 174 4.18. Indefinite Integrals ...................................................................... 178 4.19. Multiple Integrals ........................................................................ 181 4.20. Linear Integrodifferential Operators ............................................ 186 Bibliographic Notes and Comments .............................................. 189
CHAPTER 5
Quadrature by Differentiation 5.1. Introduction ................................................................................ 197 5.2. Compound Rules with Correction Terms ...................................... 198 5.3. Simple Quadrature Rules Using Derivatives .................................. 201 5.4. Summation Formulas .................................................................. 205 5.5. The Generalized Midpoint Rule with a Weight Function ................ 206 5.6. Linear Eigenvalue Problems ........................................................ 208 5.7. Boundary-Value Problems .......................................................... 214 Bibliographic Notes and Comments .............................................. 219 CHAPTER 6
Integral Equations 6.1. Introduction ................................................................................ 221 6.2. Classification of Integral Equations .............................................. 222 6.3. Conversion of Differential to Integral Equations .......................... 223 6.4. Direct Derivation of Integral Equations ........................................ 227 6.5. Exact Solution of Integral Equations ............................................ 231 6.6. Liouville-Neumann Theory .......................................................... 238 6.7. Fredholm Theory ........................................................................ 241 6.8. Hilbert-Schmidt Theory ................................................................ 243 6.9. Numerical Solution of Volterra Equations .................................... 245 6.10. Numerical Solution of Fredholm Equations .................................. 250 6.11. Practical Example ........................................................................ 254 Bibliographic Notes and Comments .............................................. 260 APPENDIX 1 List of Doctoral Dissertations on Integration and Integral Equations .... 267
APPENDIX 2 Integration Functions and Subroutines ................
..................... 273
APPENDIX 3 Subroutines for Solving Integral Equations ............................................ 287
AUTHOR INDEX ...................................................................... 293 SUBJECT INDEX ...................................................................... 299
Chapter 1
GENERAL BACKGROUND
1.1
INTRODUCTION
Mathematical expressions involving integrals frequently arise in science and engineering. These expressions can be classified as explicit integrals and integral equations. An explicitt' integral such as
y(x) _ `I
X2
exp(xt) costdt
(1.1)
0
has a known integrand, while an integral equation such as
y(x) = 1 + J (x-t)y(t)dt
(1.2)
0
has an unknown function in the integrand. Equations such as
y + I X (x-t)y(t)dt,
(1.3)
0
where both derivatives and integrals of the unknown function appear, are called integrodiferential equations. To a physicist or engineer, integration generally means either the inverse of differentiation or the area under a curve. Present-day mathematicians have developed more sophisticated conceptions of the integral. While these abstract logical structures are not immediately applicable, a brief account is necessary background. It is important to be able to read the mathematical literature and discuss problems with mathematicians. Experience has shown that pure mathematics when suitably interpreted has useful applications. Although we now use the same symbolism for the integral as an antiderivative and as an area under a curve, these concepts have separate histories. Obviously the concept of an antiderivative could not arise until the end of the seventeenth century, when Newton and Leibniz created the differential calculus. The concept of area under a curve (quadrature) goes back to the Greeks. Archimedes' method of exhaustion came very close to the idea of integration.
INTEGRATION FOR ENGINEERS AND SCIENTISTS
2
An interesting determination of the area between curves is the "lunes of Hippocrates." Hippocrates of Chios, a fifth century B.c. mathematician, was a contemporary of the famous physician. His books have not survived but some of his theorems are included in Euclid's Elements. He proved that the area of a circle is proportional to the square of the radius, though his method did not determine the numerical value of the proportionality factor. From this result and the Pythagorean theorem for right triangles it follows that the area of a semicircle with the hypothenuse as a diameter is equal to the sums of the areas of the two semicircles with the sides as diameters. Therefore the construction in Fig. 1.1 involving an isosceles (45°) right triangle shows that the area of two moon-shaped shaded regions (the lunes) is equal to the area of the right triangle. If the sides of the triangle
Figure 1.1
are taken as 1, the area of each Tune is #. This remarkable result was the source of the persistent interest in squaring the circle. It was believed that if this area could be evaluated, so could that of a simple figure such as a circle. The evaluation of the area of a tune by analytical geometry and calculus involves calculating
A= J o
- ( x - )Z]}dx - I
([+-(x-})2]#--
}dx.
(1.4)
For this problem the classical geometrical approach is superior to the modern
analytical approach. The geometrical approach, however, depends on an ingenious device applicable only to the particular problem, whereas the analytical method is a general technique for determining the area between curves. This book solves many problems involving integrals. Some are handled by special devices, others by general procedures. No one is clever enough or has enough time to handle all his problems by special methods, so a knowledge of general procedures is essential. While the ability to invent
ingenious devices is to some degree an inherent talent, practice and the
(1.1)
3
GENERAL BACKGROUND
study of examples can enhance this ability considerably. We benefit by the work of our predecessors and the inspired proof of one generation becomes a routine homework problem in the next. The scope for ingenuity, however, always becomes wider. The general methods simply open up new fields. Exercises 1
Derive (1.4) by analytical geometry and evaluate the integrals.
2
(a) Show that the area between three equal cotangent circles (Fig. 1.2a)
is
r2(31/2-n;'2).
By using the concept of orthogonal projection, prove that the area between
(b)
three congruent parallel cotangent ellipses is (Fig. 1.2b) ab(3'"2-n/2).
Figure 1.2a
Figure 1.2b
1.2 RIEMANN, STIELTJES, AND LEBESGUE INTEGRALS
Toward the end of the nineteenth century, Lebesgue formulated properties that the integral of any bounded function should have. b+h
6
f(x) dx = I
(a)
Ja+h
a
(b)
f(x-h)dx;
Jbfdx+ `cfdx+Jafdx=0; a
b
c
f.b
f.b
f,.b
(c)
( fi+.f2)dx=
(d)
If f > 0 and b > a, b
J'fdx>0;
fidx+
f2dx.
six
INTEGRATION FOR ENGINEERS AND SCIENTISTS
4 1
1 dx = 1.
(e) 0
(f)
Iffn
(x) < fn+ 1 (x)
lim fn(x) =f(x)
and
for all x
n-ao
then lim
fbf(x)dx a
Although mathematicians have developed more than sixty kinds of integrals,
the general problem of satisfying all six conditions simultaneously is still
unsolved. Most of the theory is of little interest to the scientist, as the difficulties involve "pathological" functions that are not encountered in applications.
To provide background, a few important definitions of integration are outlined. These can be ordered in a systematic scheme (1), the Riemann definition being least general. Each more general definition reduces to the less general definition when it is meaningful, but gives a result for some additional cases. Lebesgue-Stieltjes Lebesgue
Stieltjes
Riemann (1) 1.2.1
Riemann Integration
The Riemann definition is closest to the one used in elementary calculus
courses and is in fact used in some modern texts. Consider a bounded function f, which needs not be continuous, defined over the range a 5 x < b. The range of integration is divided into arbitrary intervals by taking a set of division points
a=x0<x1 <x2<x3
O,p>-1,n 0);
(3.16b)
0
x° o
(1 +x'")9
_l
p+1
In
In
q- p+1
(3.16c)
m
The first two are easily proven by the substitutions t = x' and t = sine x, respectively. The third can he transformed into the second by setting x' = tang 0. An interesting specialization of (3.16b) "li
"i2
tan" x dx = 0
cot" x dx = 0
>t
2cos(nir/2)
(3.17)
is obtained by setting 2a-I = I -2b and using a well-known identity
1'(x)1(1-x) =
>t
(3.18)
.
sin 7rx
3.2.2 Product Representations
A number of proofs of (3.18) are given in the literature. Every one that the author has seen uses some advanced concept. An instructive one uses infinite product representations. A general method for expanding a function that is analytic in the complex plane and has an infinite number of simple zeros is the expression
zl
f(z) =f(0) eXP Cf(0) Jk=I -[ exp f(O)
I
\ak/
(1
-?I
(3.19)
ak)
where the ak's are the zeros of f(z). Applying this to J'(x) = sin nx/x, which
INTEGRATION FOR ENGINEERS AND SCIENTISTS
82
has zeros at ak = ±kn/n, gives +
sinC x =n
k
x
-l
f (1
=n F k= 1
\1
exp(kn
knl eXp(kn) \1 + kn/ expL-
\kn/
n2 x2
0o
=nfl(1k=1 k2 n2
(3.20)
It can be shown that
l+zexp
r(z)-exp(-yz) k=1 H
z
k
_\\\
(3.21) k
where y is a number known as Euler's constant that will be encountered again in Section 3.8. It is easily seen that
r(z)r(-z) =
(3.22)
- Z2 kF1
1-(Z 2 /
r(-z) _ - r(1 -z)
k2)*
(3.23)
z
is obtained, and by setting n = I in (3.20) and inverting, the desired result
r(z)r(1-z) =
it
(3.24)
sin nz
is obtained. 3.2.3
Dirichlet's Multiple Integrals
An interesting reduction of a repeated integral to a single integral due to Dirichlet is
ffltj 0, I(k) = ir/2; but when k is negative, x
1(k)
sin u du u
o
=-
sin u du o
u
=-
(3.51)
-.
2
An interesting example that combines integration with respect to a parameter and interchange of the order of integration was used by Childs to evaluate the double integral 1(p, a, b) =
I
--
I
exp[-(ax2 + 2pxy + by2)]
dxdy,
(3.52)
xy
which arises in statistics. The method is based on differentiating with respect to p to eliminate the I/xy and then integrating after changing the
(3.3.e)
89
ANALYTIC EVALUATION OF DEFINITE INTEGRALS
order of integrations. The expression to be integrated is v
1(p, a, b) =
-2J f exp(-byz) o
exp[-(axz + 2zxy)]dxdydz. "0
o
(3 .53)
The lower value 0 in the outside integral was taken because 1(0, a, b) = 0 since the integral is antisymmetrical about the origin when p = 0. This was also used to validate the interchange in the order of integration. The original integrand does not satisfy the requirements because of the singularity at the origin, but the integrand
exp[- (axz + 2pxy + byz)] - exp[- (axz + byz)] xy
gives the same result, is well behaved at the origin, and has the same derivative with respect to p.
The inner integral is evaluated by using a device known as completing the square, that is writing exptzz
exp - a
(xz
+ Z zy x) = a
yz
[_a(xZyl exp+
/
a
a
z
(3.54)
so that //n
1(p, a, b) = -2l
oJ -
`\a
-2n
dz
o (ab-z2)
exp
zz
- I b - ") yzldydz
\
a/
= -2naresinr
p L(ab)'1z].
(3.55)
Exercise
I
Show that the following equations are valid by derivations using methods similar to those shown in this section.
)21
w
ex 0
Io
xl/z
- x - a 1dx=-If 2 ( x
exp - (X2 + _ )]dx cos ax
o 1+xz
dx = I e-°. 2
-
.
7r2 z
exp(- 2a).
INTEGRATION FOR ENGINEERS AND SCIENTISTS
90 i/ 2
J
In sin xdx = --1n2. 2
0
-.
/2
n3
InsinxIntanx =
16
0
sin px cos qx X =
I
it
if p > q;
0
n
4
=0 sinm x dx
n
cos' x + sinm x
4
ax
It
(1 + x2)(1 + x`)
4
if p = q;
ifp(0)
(S) =
nt
n=o
ao
s" _ Y Ans",
(3.125a)
n=o
the expression
I = Y (- 1)"A"f"(0) 00
n=o
(3.125b)
n!
is obtained.
Willis has determined the An's for some important cases:
f"(0).
e-ar f(t)dt = n=0
0 J'o
sinatf(t)dt = n=o
f0'0
Cosatf(t) fo"o
(3.126a)
an+1 '
(-1)" l`2a'(0 2n+1
(3.126b)
a
"Y- (-1)"fa2(n+1(0)(3.126c) =O
$sintf(t)=f(o_ oadt 2 )"E
(-1)nl(2n-1)(0)' 1
(3.126d)
(2n-1)a""
ANALYTIC EVALUATION OF DEFINITE INTEGRALS
(3.9)
fo*
107
exp(-i2/a2)f(t)dt = 0.5n112 an- (2)RJ(2ni0)) + (3.126e) I
n=1 (2n-1)!
f
3() f(4)(0)-
dolaIJ(t)dt=a[J(0)-2f(2)(0)+
2!
000
(3.126f) 1
5 (2)3J(6)(0) + ...1;
3 I
f
Jo
J1
C)J(t)dt =
`
+ aLJ(1)(0) + "f(3,(0)+ 2! «'02
Exercise I
By using the forms given in (3.126), find expansions for (a)
F (b)
,fo
J1+tt)dt,
(c)
exp(- m2 t2)cos tdt, Jf0 (d)
I
sin x sin mx o
dx x
as series in m and examine the convergence.
JJ
...1
(3.126g)
108
INTEGRATION FOR ENGINEERS AND SCIENTISTS
3.10 LAPLACE'S METHOD
Obviously in many cases it will not be possible to evaluate a definite integral exactly either by the methods described in the preceding section or
by other methods, and it will be necessary to resort to either numerical methods (which are discussed in the next chapter) or approximations. Unfortunately, the more powerful approximate methods involve complex variable theory, so that this book is restricted to a brief treatment of methods involving only real variables. In many cases the integrand has sharp peaks that make the main contribu-
tion. By simplifying the integrand by means of an approximation that is accurate in these regions, an integrable form that gives a close approximation to the exact value is obtained. For example, consider 00
1(t) = jex(-tx2)ln(1+x+x2)dx
(3.127)
where the integrand has two peaks near x = 0. The peak is not at x = 0 because the in term vanishes there. For small x
ln(1 +x+x2);x++x2-+jx3,
(3.128)
so the integral is approximated by
I(t)
exp(-tx2)(x
+ x2
-
x3)dx.
(3.128a)
f'Q Because of symmetry, the odd powers make no contribution, so 1/2
I(t) - I
_co
exp(-tx2)x2dx = (i6
(3.129)
t3
By taking additional terms in the power series, it can be shown that the next term is of order t - 112 . The accuracy therefore increases as t becomes larger and the peaks sharper. The basic principle is also applicable to integrals over a finite range. To illustrate, we evaluate
1(n) = f x"sin x dx
(3.130)
0 o
for large n. The integrand has a sharp peak near x = it, so the approximation sin x - n-x can be used, which gives
1
1
J x°(n-x)dx = nn+2(n+1 o
_
1l n+2)
) (3.131
(3.10)
109
ANALYTIC EVALUATION OF DEFINITE INTEGRALS
It is easily shown that
_
1
(n+1
_
1
1
n2+3n+2
n+2
so that for large n 7rn+2
I(n) -
(3.132)
n2
A somewhat more elaborate procedure, more in the spirit of Laplace's
method, is to note that the peak of the approximate integrand is at x = n/(n + 1)n and therefore set
1(n) - 2
f"I(n+l)+c
x"(7r-x)dx=2nn+2ft"(1-t)dt 1
(3.133)
s
where a = 1/(n+1) ^-' 1/n. Integration gives
1 -(1-s)"+1 _ 1 -(1-E)n+2
1( n )=2 nn+ 2
n+2
n+1
L
( 3 . 134)
Expanding by the binomial theorem through e2 checks (3.132).
The use of Laplace's method is facilitated by the use of three general theorems: 1.
If h(x) is a real continuous function having an absolute maximum at x = 0 and approaching - oc as x approaches both ± oo, then for large t eth(=)
dx =
eth(o)
[th(22n
)(0)]
II. If in addition to the conditions on h, g is an integrable function that can be expanded in a power series around x = 0, then for large t f,,9 (x) eth(x)
dx
g (0)eth(o)Ith
11/2.
2 0) (2)(
III. If h is a real continuous function having a maximum at x = a and h(x) < 0,then th(Q)
eth(x) ,.,
Ja
th(a)*
INTEGRATION FOR ENGINEERS AND SCIENTISTS
110
Perhaps the best-known application is Stirling's approximation to n! for large n. Using the integral definition, we have
n! =
t"e-`dt.
(3.135)
fo
I ntroducing
the variable t = n (I + x) transforms this into ac
n! =
n"(1+x)"exp[-n(1+x)]ndx
i
(3.136) OD
exp{-n[x - ln(1+x)]}dx.
= n"+' exp(-n) J i
The function
h(x)=In(1+x)-x=- 2x2 + x3 3
- x44 +
(3.137)
has a maximum at x = 0 and is negative over the range of integration. While the function In (I +x) is not defined for x < -1, from the power series expansion, it appears that for any number of terms the contribution from - oo to - l will be negligible. Therefore, the first theorem can be invoked to give n ! = (2 nn)'l2(!e)a.
(3.138)
It is obvious that the location of a peak can always be shifted to x = 0 by a change of variable and that integrands with several peaks can be treated by adding the contributions of the peaks. In some cases the integrand must be manipulated to bring it into a suitable form. For example
1(a) =
f
ex
Zdz = n1J2exp(-2a)
(3.139)
z
is not suitable as it stands because the parameter a does not multiply both terms. However, by letting z = a'l'2x, we get 1(a) = a'/2 J
exp[-a(x2 + X2 2 )]dx,
(3.140)
which brings the parameter into the right place. However, h has twin
(3.11)
ANALYTIC EVALUATION OF DEFINITE INTEGRALS
111
maxima at ± 1. By making a linear change of variable x = I + u, we obtain
x2+ I =(1+u)2+(1+u)2 (3.141)
Therefore
1(a) = 2a112exp(-2a) J
exp[a(-4u + ---)]du
(3.142)
which, on applying Theorem I, gives the exact result. Exercises 1
Show that (a)
o
exp(-x2-tx-1)dx'=(3)1/2exp[-3(1)2/31
(Abramowitz). (b)
J/2 2"
ex(1+x2)"dx
Jo (De Bruijn). 2
Find an approximation for
J'exP(t sin x) dx valid for large t.
3.11
INTEGRATION BY PARTS METHODS
This section describes two methods that can be considered generalizations of the familiar technique of integrating by parts. The ordinary integration by parts technique splits the integrand into factors
1(a) = l
fg dx
(3.143)
a
in such a way that f (")g"+ 1 -0 as x
co (where gk is the k" integral of g).
INTEGRATION FOR ENGINEERS AND SCIENTISTS
112
Integration by parts gives
J0fdL
1(a) =fg1
(3.144)
Because of the condition only the lower limit contributes to the product and repeated applications give N
1(a)= "=0 (-1)"l`"'(a)ge+l + (- 1)N+1
(3.145)
f(N+1)gN+I dX.
1.
As an example, for J.- e-' dx/x, g (x) can be taken as a-', giving f (x) = l 1x and the expansion a0 a-s
e-a
ap
00
dx=-0 n!a-"+N!
N
a "=o
X
a-=
x
dx.
(3.146)
This is an asymptotic expansion that gives accurate results for large a but always diverges for sufficiently large N because of the N! multiplying the remainder. 3.11.1
Boley's Method
Boley has developed a modification that gives a convergent expansion. However, it is of limited practical value because it involves other integrals that are often as difficult to evaluate as the original integral. The method is based on splitting the range of integration into parts, beginning with
fgdx = +
E.
ao
fgdx + I fgdx,
(3.147a)
0,
and then applying integration by parts to the second integral on the right to obtain 00oC
00
1
Jfgdx =
fgdx +fg1 fo4
(
Of
-
fu)gIdx. f-C-0
(3.147b)
(3.11.2)
113
ANALYTIC EVALUATION OF DEFINITE INTEGRALS
The process is then continued. This gives
ii(_1)"
f Joo
N
+n=0I (-1)"+1 f(n)gn+1 a"+, ao
+(- 1)N+1
(3.148)
f(N+1)gN+ldx.
aN+,
Under suitable restrictions on f and g the third integral will vanish as N - 00 and the second summation will only involve evaluation at a,,+,. This will be true if f ()(x) approaches zero steadily as x -+ oo for all n and g. (x) is bounded, or vice versa. The key feature of Boley's method is the choice of the ak's to make the two series converge. It can be seen that if ga+, is bounded, the second series will converge if r(")(an+
1
f(n- 1)(an)
< 1
(3.149)
for n > 1,
+fl
and it can be shown that this also guarantees convergence of the first series. f(2) _ Applying this to J' a-x/x dx, for which f = 1/x, f(') = -1/x2,
_ -2/x3, and so on, with ak = k +I gives 2 e-x
a-x
x
dx =
fI
x
- z23 xex+ 234 x3ex
(3.150)
+-+-+ . e-2
a-3
4
27
The integrals on the right cannot be evaluated in closed form, but by using tabulated values, Boley found that the three finite integrals and two correction terms gave a value accurate to one part in 103. 3.11.2 The Leplace-Winckler Expansion
The Laplace-Winckler expansion can be derived by introducing a set of auxiliary functions kv defined by
IV= -,
(3.151a)
INTEGRATION FOR ENGINEERS AND SCIENTISTS
114
(3.151b)
k+ IV - lVkt1,
and starting with ac
fdx =
-,vf dx.
a f"o
(3.152)
o
Integration by parts gives
fdx = Iv(a)f(a) +
I
a
Ivfdx.
a
(3.153)
On the basis of Eq. (3.152) 1 of = - 24.
(3.154)
Integrating by parts and repeating the process gives
j
('x
N
ac
f(x) dx = f(a)
v(a) - J N+ 1 of dx.
n=1
a
(3.155)
a
An alternate derivation can be obtained by setting f(x)dx = u(a)f(a).
(3.156)
f."o
Differentiation gives
-f (a) = u (a)f (a) + u(a)f(a),
(3.147a)
which can be rearranged to give u(a) _
-f(a) [1+u(a)].
(3.157b)
f (a)
If this is treated as an iterative sequence
k+lu(a)=
f(a) [I+ku(a)]
(3.158a)
L(a) = v(a), a
(3.158b)
a
and the iteration is started with tu(a)
the result is equivalent to (3.155).
(3.12)
115
ANALYTIC EVALUATION OF DEFINITE INTEGRALS
Applying this procedure to J a-"lx dx does not give a satisfactory result. In this case, tv(a) =I +a and kv(a) =I +a, so the series is obviously
divergent. However, on applying it to If exp(-x2)dx, the well-known asymptotic expansion
exp(-x2 )dx=
exp(-a2)
1
1
2
a
a3
a
+-+ 3
15
as
a'
(3.159)
is obtained. Exercises
I
(a) Show by Boley's method that (0
dx sinx= E (j-1)!
x
j=1
(x /2)
f("j -I)i/2) )
dx cos(jir-x)X
(b) Transform the integrals on the right into x/2
Jo
sin t dt
t+(j-1)( 7r/2)
and evaluate the first three terms of the series by using the approximation
sint=t-!--1)I-t13. 2
Find the Laplace-Winckler expansion of
dx f,.,o
and compare the result for n = -1 with Eq. (3.146). 3.12 CONCLUDING REMARKS AND EXAMPLES
When definite integrals that cannot be evaluated by substituting the limits into the indefinite integral arise in practical applications, a preliminary analysis should be made before attempting to evaluate the integrals. First it
should be determined whether the integrals exist or whether a Cauchy principal value or other generalization is involved. Particular care should be
exercised in cases where several integrals are involved because in such cases the existence of a solution to the problem does not guarantee that the individual integrals are well behaved. The Frullanian integrals are examples of well-behaved integrands that can be split into singular parts.
INTEGRATION FOR ENGINEERS AND SCIENTISTS
116
After confirming the existence of the integrals, it is advisable to reduce the number of parameters involved to a minimum. For example, the integral
I (a, b) = fo'o exp[-(ax2 + bx)] dx
(3.160)
appears to depend on two parameters, a and b. However, by straightforward
manipulation based on completing the square, it can be transformed into
I (a, b)) = a-'"2ex
6
P(4a
ex p(- u2) du
(3.161)
ei2a""=
so that it can be expressed as an explicit function a-'/2 exp(b2/4a) multi-
plied by an integral depending on only one parameter, b/2a112. This appreciably reduces the amount of work required to tabulate the integral for
an extensive range of a and b. Dimensional analysis can sometimes be used to obtain such reductions. The parameters in the integral can be assigned dimensions in terms of the variables, and the Vaschy-Buckingham it theorem can be used to reduce the number of parameters. Thus in (3.160), since the arguments of functions such as exponentials must be dimensionless, a = [x- 2] and b = [x-'] while
I = [x]. The two parameters a and b form the dimensionless group ba'/ 2 so that
I = a-'/2f(ba-1/2)
(3.162a)
I = b-' g(ba-112).
(3.162b)
or
It can easily be seen that the two forms are equivalent since
b-lg(ba-1/2) =a- 1/2 9
bua 1/2) 2 =
a-I12 f(ba-112).
(3.163)
Applying this procedure to the simple Frullanian form 1(a, b) =
f '0 [f(ax) -f(bx)] dxx
(3.164)
o
shows that I (a, b) = f(a/b).
(3.165)
(3.12)
117
ANALYTIC EVALUATION OF DEFINITE INTEGRALS
Furthermore since interchanging a and b changes the sign of the integral, must satisfy the functional equation
f
(3.166)
f(b/a) = -f(a/b).
This shows that (3.167)
I (a, b) = const. ln(b/a).
For a double integral such as
I(p, a, b) =
j-°-woo
-°°ao
exp[-(axz + 2pxy + by2)]
dx dy
xy (3.168)
_ which was evaluated in Section 3.3, the constants are assigned dimensions in terms of x and y. While I is dimensionless, a = [x- 2], b = [Y-2 1 and
p = [x-1y-']. Therefore
p
1(p, a, b) =f (ab)ii2],
(3.169)
which reduces the number of parameters to 1. The integral can be rewritten in terms of dimensionless variables u = a''2x and v = b'12y to give
I[ab '72] = I ( )
j
expL- I u2 + abP/2 uv + v2/J du
\
-00
(
)
(3.170)
uv v
After reducing the integral to the simplest form, the next step is to search
tables of definite integrals. Even if the integral is not listed, most of the exact methods begin with related integrals. It should be remembered, however, that tables of integrals are not infallible. The author encountered an incorrect entry while trying to evaluate
I(r) = - f J -oo
sin rx ln(l _ sin2xldx, rx xz J
(3.171)
\\\
which arises in the theory of a diode detector circuit driven by random noise.
This integral is proper since the singularity at the origin is integrable. It cannot be reduced by dimensional considerations since both r and x are
INTEGRATION FOR ENGINEERS AND SCIENTISTS
118
dimensionless. The natural approach is to expand the logarithm in a series to obtain for (3.172) sin rx sin2k x d + 1(r) = ?
i
rk=1
X
o
Since the integrand is an even function of x, the limits were changed to 0 to oo and the factor 2 added. An entry in Bierens de Haan (222 Table 159 No.17) reads
sin°xsin2gx o
dx
x'+
rz
=(-1)Q2o+i
2q a.
(3.173)
Setting a = 2k and 2q = r gives
1(r)_2
(-1)2k
r k=i
Ir
2
2 +
-n
00
lk
E rk=i 4k
(3.174)
for r < 2. The sum is easily evaluated to give (3.175)
3r
However, this is incorrect. It can be seen that as r - 0 X2.
1 = -2
In1 - sinX1 )dx = const., fo
\
(3.176a)
and it has been shown that 1
2n
= 1.275659 - 0.125r - 0.039306r2 + ---
(3.176b)
for r < 2. Therefore (3.173) is erroneous, though the discontinuity at r =2 is real. When, as is often the case, the definite integral cannot be evaluated exactly, the choice is between analytical approximations as described in this chapter and numerical methods, which are covered in the next two chapters. It would appear that the development of the computer favors the purely numerical approach and that analytical approximations may become a lost art in the future. However, the development of symbolic manipulation programs may reverse this trend.
J3.12)
ANALYTIC EVALUATION OF DEFINITE INTEGRALS
119
In practice, we should be alert for simple approximations adapted to the particular problem. For example, the integral
exp[- (st + at-°)] dt
1.(s, (X, p) = J
(3.177)
0
arises in statistical mechanical calculations. Approximations valid for either small or large s have been developed but a simple device gives a universal approximation. First the integral is converted to x
1=
Y S
exp[-y(u + u-p)] du
(3.178)
o
where y = (cc?)"( ' +p). For p = I the integral can be evaluated since
fooD exp[-y(u + u-')]du = 2K,(2y)
(3.179)
where K, is a Kelvin function.
The device that gives a general approximation is the rewriting of the integrand as
exp[-y(u + u-')] = exp[-y(u + u-)] {1 - (1 - exp[-y(u-p - u-')]}, so that
J 0'0
exp[-y(u + u-°)]du =
-
o
fo
exp[-y(u + u-')] du
f{1 -exp[-y(u-° - u-')])exp[-y(u + u-')]du.
(3.181)
It can be seen that the second integral is much smaller than the first integral.
Examination shows that exp-y(u+u- ')] vanishes at u = 0 and oo and has
a maximum at u = 1, while {l-exp[-y(u-p-u-')]) vanishes at u = 1 where it changes sign and has a maximum value of 1. There is therefore cancellation, which reduces the value of the integral. Therefore, neglecting the second integral gives
exp[- (st + at-p)] dt =, Jo
2
(asp)'ni+p) K, [2((xsp)11("+p)].
(3.182)
s
It is left as an exercise to find error bounds on this result by obtaining upper and lower bounds for the neglected second integral.
INTEGRATION FOR ENGINEERS AND SCIENTISTS
120
Exercise 1
Show that (a)
xexp(xz)erf(x)dx = n1/z [exp(12) - 1] 2 Jo (t2-x2)'12 (SIAM Rev. Problem 64-8); (b)
a-"cos ix
°
°°
-O Jo
(t
z
2 uz +a)
it
dtdx = +t [bt + (t +aa z
2)1/2i n
(SIAM Rev. Problem 65-5); (c)
7-3
f x fx fx o
0
du dvdw
1-CosuCosvcosw=(4"3)-1l,4(1)
0
(Math. Magazine Problem 612).
BIBLIOGRAPHIC NOTES AND COMMENTS
The most extensive table of definite integrals is D. Bierens de Haan's Nouvelles Tables d'Integrales Definies (Hafner, New York, 1957). This volume, originally published at Amsterdan in 1867, contains 8339 entries. A supplement by C. F. Lindman, Examen des Nouvelles Tables d'Integrales
Definies de Bierens de Haan (G. E. Stechert, New York, 1944), contains corrections and additions. A paper by E. W. Sheldon, "Critical Revision of de Haan's Tables of Definite Integrals," Amer. J. Math. 34(1913), 89-114, gives a critical discussion, particularly of the treatment of principal values, in which de Haan's tables are often incorrect.
An earlier book by D. Bierens de Haan, Expose de la Theorie, des Proprietes, des Formules, de Transformation et des Methodes d'Evaluation des Integrales Definies, has only about 3000 entries but contains an exposition of the methods used to obtain the entries.
Good modern tables are those of I. M. Ryzhik and I. S. Gradshteyn, Tables of Series Products and Integrals (Academic Press, New York, 1966)
and of W. Grobner and W. Hofreiter, Integraltafel, Vol. II (Springer, Vienna, 1961). Y. L. Luke's Integrals of Bessel Functions (McGraw-Hill, New York, 1962), is an excellent treatment of a specialized but important field, and M. Abramowitz and I. Stegun, Handbook of Mathematical
(3)
ANALYTIC EVALUATION OF DEFINITE INTEGRALS
121
Tables (Gov't. Printing Office, Washington, D. C., 1964) has many useful results for the higher transcendental functions.
M. Geller, "A Table of Integrals Involving Powers, Exponentials, Logarithms and the Exponential Integral," Jet Propulsion Lab. Tech. Rept. 32-469 (August 1, 1963), has many useful results. An extensive account of the classical methods with numerous examples is J. Edwards' Treatise on Integral Calculus Vol. II (Chelsea, New York, 1954). An excellent brief account on which we have drawn heavily is E.
Rufener's "Die Methoden zur Ermittlung der bestimmten Integrale", Inaugural dissertation, Basel, 1953. Many examples involving higher transcendental functions are worked out in 0. J. Farrel and B. Ross, Solved Problems (Macmillan, New York,
1963). The paper by M. Abramowitz, "On the Practical Evaluation of Integrals," SIAM J. 2(1954), 20-35, has some interesting examples and introduces approximate methods. SECTION 3.1
J.D. Williams, "An Approximation to the Probability Integral", Ann. Math. Statistics 17(1946), 363-369. SECTION 3.3
See Edwards and Rufener for more extensive coverage. Equation (3.52) is from D. R. Childs, "Reduction of the multivariate normal integral to characteristic form," Biometrika 54 (1967), 293-300. G. H. Hardy, in "The Integral f sinx(dx/x)," Math. Gaz. 5(1909), 88-103 and 8(1915), o for evaluating this integral and attempts to assess 301-313, collects a number of methods
their relative difficulty numerically. Hardy's collected works are in the process of publication; Volume 5 will contain some very interesting material. SEcnON 3.4
Probably the best-known old-fashioned algebra book is H. S. Hall's and S. R. Knight's Higher Algebra, 4th ed. (Macmillan, New York, 1950; first published in 1887). A number of series evaluations of integrals are given in L. Euler's Collected Works, Vols. 18-20. (The old-fashioned notation is probably a greater obstacle than the Latin text.)
A modern treatment is H. T. Davis, The Summation of Series (Principia Press, San Antonio, Texas, 1962). SECTION 3.5
The use of complex parameters goes back to Euler. Edwards has several sections on this topic (pp. 342-361).
For those interested in complex variable methods Smith [7] has a good introductory account. Chapter 6 of Whittaker and Watson [8] is a classic. Those wishing to go still further should consult E. L. Lindeldf, Le Calcul de Rfsidus (Gauthier-Villars, Paris, 1905), and M. L. Rasulov, Methods of Contour Integration (North Holland, Amsterdam, 1967).
122
INTEGRATION FOR ENGINEERS AND SCIENTISTS
F. Klein, On Riemann's Theory of Algebraic Functions and Their Integrals (Dover, New York, 1963) is a translation of a classic with an unusual approach based on an analogy with fluid flow. An interesting recent paper by R. P. Boas, Jr., and L. Schoenfeld, "Indefinite Integration by Residue" [SIAM Rev. 8(1966), 173-183], includes (3.5) and (3.6) among other examples. SECTION 3.6
Some of the expressions (3.70a, b) date back to Liouville. We do not know of a complete treatment of these relations but have picked them out from various sources, including Edwards. (The author is indebted to his colleage Prof. H.W. Gould for some interesting references and examples, particularly for this section.) SECTION 3.7
The most extensive set of tables are A. Erdelyi, Tables of Integral Transforms, 2 vols. (McGraw-Hill, New York, 1954). V. A. Ditkin and A. P. Prudnikov [Integral Transforms and Operational Calculus Macmillan (Pergamon), New York, 1965] have a smaller set of tables combined with an exposition of the theory and applications.
An excellent introduction to the theory is C. J. Tranter's Integral Transforms in Mathematical Physics (Methuen, London, 1956). A more advanced treatment is the article "Functional Analysis" by 1. N. Sneddon in Vol.
of Handbuch der Physik (Springer,
Berlin, 1955). An interesting development of the subject based on modern algebraic concepts is L. Berg, Operational Calculus (North Holland, Amsterdam, 1967). A very extensive presentation of the practical applications is G. Fodor, Laplace Transforms in Engineering (Akedemiai Kiado, Budapest, 1965).
H. A. Mellers, "On an Operational Method for Computing Definite Integrals," USSR Comp. Moth. Math. Phys. 1(1961), 683-704.
E. Weber, "Complex Convolutions Applied to Nonlinear Problems," Proceedings of Symposium on Nonlinear Circuit Analysis (Polytechnical Press, Brooklyn, 1957), pp. 409-428. SECTION 3.8
A. Ostrowski, "On Some Generalizations of the Cauchy-Frullani Integral," Proc. Natl. Acad. Sci. USA 35(1949), 612-616.
G. H. Hardy, "A Generalization of Frullani's Integral," Messenger Math. 34(1905), 11-18.
E. B. Elliot, "On Some (General) Classes of Multiple Definite Integrals," Proc. London Math. Soc. 8(1877), 35-47, 146-158. SECTION 3.9
H. F. Willis, "A Formula for Expanding an Integral as a Series," Phil. Mag. 39(1948), 455-459. SECTION 3.10
This section is based on Chapter 4 of N. G. De Bruijn, Asymptotic Methods in Analysis (North Holland, Amsterdam, 1958), which also covers methods using complex variable theory.
(3)
ANALYTIC EVALUATION OF DEFINITE INTEGRALS
123
SECTION 3.11
B. A. Boley, "A Method for the Numerical Evaluation of Certain Infinite Integrals," MTAC 11(1957), 261-264.
S. R. Boley, "Numerical Evaluation of Certain Infinite Integrals," Columbia Univ. Inst. Flight Structures Rep. (October 1959). The Laplace-Winckler expansion was revived in a thesis by W. Richardson,"Asympto-
tic Methods of Evaluating f'Of(x) dx," Univ. of North Carolina (Mic 60-6993). This contains some interesting results but is very difficult reading. SECTION 3.12
The basic theorem of dimensional analysis is usually attributed to E. Buckingham, "On Physically Similar Systems," Phys. Rev. 4(1914), 354-376. However, it was given by A. Vaschy, uSur Jes Lois de Similitude en Physique,>) Ann. Telegraph. 19(1892). 25-28. A discussion of Vaschy's work (including translations) appears in R. Esnault-Pelterie, Dimensional Analysis (Editions F. Rouge, Lausanne, 1948). This is a unique presentation
of the subject by a pioneer in aeronautics and astronautics. It is somewhat difficult to read because the author translated it himself but will repay the effort. Equation (3.176b) is derived by J. K. Mackenzie in"Evaluation of a Fourier Transform," SIAM Rev. 9(1967), 219-222. Many interesting integrals appear in the problem section of this journal. For example, (3.177) is Problem 67-10, SIAM Rev. 9(1967), 593-599. Research Exercises 1
Explore the use of the methods based on differential equations developed in Section 2.9 for evaluating definite integrals. (In particular, consider the case when the right side of (2.80) vanisher. This is known as a Sturm-Liouville problem.)
2
Consider the problem of the efficient arrangement of a table of definite integrals. (Consult Ryzhik and Gradshteyn.) Would it be feasible to put a really extensive table
in a computer and then have a program to check a proposed integral against this table? (The problem of tabulation was considered in the 1967 MIT dissertation by J. Moses ("Symbolic Integration") refered to in Section 2.8.]
Chapter 4
NUMERICAL EVALUATION OF INTEGRALS
4.1
INTRODUCTION
In this chapter numerical methods for evaluating integrals are presented. The basic form in most of the methods covered is fo6
N
Wjf(xj).
w(x)f(x)dx ^,
(4.1)
J=1
The points x j at which the integrand is evaluated are called the nodes or abscissas of the quadrature formulas and the W j's are the weights. The function w(x) in the integrand is called a weight function. Its use may result in a considerable increase in the efficiency of the numerical integration. Cases where one or both of the limits are infinite and where the integral has singularities are treated. A brief discussion of multiple integrals and some forms involving integrodifferential operators is also included. The history of numerical integration goes back to Newton and his contemporaries but the advent of the high-speed automatic computer has resulted in a marked revival of interest and change in emphasis. When calculations were carried out by hand or on a desk calculator with the help of tables of functions, quadrature formulas with equally spaced nodes were favored and simple weights were a considerable advantage. On a computer, functions are evaluated by analytic approximations of the type described in Chapter 2, so there is no advantage to simple nodes and the computer can store any eight-place weight as easily as a simple integer. One of the first results,
therefore, was a revival of interest in Gaussian formulas, which some mathematicians had considered museum pieces. The concept of "practical"
was revolutionized and procedures such as the Monte Carlo method, which involve a tremendous amount of computation, became feasible. One result of the new procedures is that extensive calculations involving
numerous integrations have to be performed on the computer without any opportunity to examine the numerical value of the integrands for features, such as rapid oscillations or singularities, that might result in loss of accuracy.
126
INTEGRATION FOR ENGINEERS AND SCIENTISTS
Considerable effort has been devoted to the development of automatic integration routines aimed at relieving the user of the necessity of thinking. The goal is a routine that, when supplied with a function defining the integrand, the limits of integration, and a tolerance, will return a value accurate
within the tolerance or the best possible value with a warning that the tolerance is not satisfied.
Our opinion is that this is not a proper utilization of the capabilities of the computer. It is an attempt to accomplish the impossible by brute force. It is true that such routines can be made to work for most examples encountered in practice, but in theory it is always possible to construct examples for which any predetermined program will fail because the a - S procedure of classical analysis is reversible. It is true that there always exists a step size b small enough so that the error involved in replacing an integral by a sum is less than any specified value. However, even neglecting the problems
resulting from working with a limited number of significant figures, in a numerical calculation the step size must be specified. Then it is always possible to construct functions for which the error will exceed any C. There-
fore, the generality that an automatic integration routine achieves at the expense of efficiency cannot be relied upon.
We believe that the proper approach is to utilize the capabilities of the computer for the computation of the weights and nodes of a quadrature formula adapted to the class of integrals to be evaluated. For this reason we cover a wide variety of quadrature formulas in this and the next chapter, with the goal of enabling the reader to choose or construct one adapted to
his requirement. To achieve this wide coverage it has been necessary to present many results without detailed proof and to minimize numerical examples. However, a number of illustrative programs are included in Appendix 2.
In this and the next chapter there appear statements that one integration procedure is "better" than another. These mean either that (1) the specified procedure gives a better result for some particular example that we hope is representative, or (2) it is exact for higher-degree polynomials. Or these
statements mean that (3) although both procedures being discussed are exact for polynomials of the same degree, the preferred one has a smaller coefficient for the remainder term. Such criteria are probably significant when comparing methods with same basis, such as the Chebyshev and Gaussian rules based on polynomial approximation, but the problem of comparing such methods with the Monte Carlo methods or the "best" methods is unresolved.
(4.2)
127
NUMERICAL EVALUATION OF INTEGRALS
4.2 SIMPLE QUADRATURE FORMULAS WITH SPECIFIED NODES
This section presents formulas for evaluating integrals over a finite range by expressions of the form N
6
f
f(x) dx
(4.2)
WW f(x;)
a
with specified values of x;. Expressions of this type are useful for dealing with experimental data. Apparently the ease with which sets of weights for specific cases can be calculated on a computer is not generally realized. The most commonly used formulas with specified nodes are those using equal spacing, which have been extensively tabulated for the forms IN
Jo
f(x)dx =;-,i Wf(j N -1 N
1
o
f(x)dx
W;f(2j-1
E ;=,
f1f(x)dx ^
j=1
o
(4.3a) l
(4.3b)
2N
;f
W
(4.3c)
N+1
Equations (4.3a) are the closed Newton-Cotes formulas, while Eqs. (4.3b) are the open Newton-Cotes formulas. Equations (4.3c) constitute a family of open formulas; developed by Steffensen, that are useful in the numerical solution of differential equations. Open formulas have all the nodes inside the range of integration, whereas closed formulas use the end points. There is no generally accepted designation for formulas using points outside the range of integration, some examples of which are considered in the next chapter. Recently there has been some interest in a class of formulas proposed by Clenshaw and Curtiss: +1
I j=1 N
f(x)dx ^
0-OR N-1
J,
(4.4a)
which for a standard range 0 to 1 becomes
J
I f(x) dx =
Wjr ! N
=1 2
f 10.51 l + cos (1-1)n)l. L
\\\
N-1 J
(4.4b)
NUMERICAL EVALUATION OF INTEGRALS
(4.2)
128
Although these are generally based on an expansion of the integrand in Chebyshev polynomials, the W j's can be determined conveniently by the methods of this section.
The weights are determined by making the quadrature formula exact for N powers of x beginning with x°. Since integration is a linear operation, this makes the formula exact for polynomials of degree N- 1. The justification for this procedure is the Weierstrass approximation theorem, which states
that over a finite range any continuous function can be approximated to any desired accuracy by a polynomial. This does not mean, however, that any sequence of polynomial approximations will converge, a point that is discussed further later. We present two general procedures for calculating the required weights. The first is an algebraic method using the set of N equations
b`-a'
_ YN
i = 1, 2, ..., N,
Wj(xj)I-1
j=1
(4.5)
to determine the W j's. The notation is unusual in that the xj's are known quantities and the W j's are the unknowns. The determinant of the coefficients is of a type, known as a Vandermonde determinant, that cannot vanish, so there is always a solution. Furthermore, if the xj's are rational numbers, so are the W j's.
The second method, based on the Lagrange interpolation polynomial, gives an explicit expression for the weights involving the integral of a
,
polynomial. Given a set of points xk and a variable v, the polynomial
Ij(U) -
is
i#j xj-xi
(4.6)
1 when v = x j and 0 when v is any of the other x's. Therefore, the
polynomial N
P(v) _ I f(xj)lj(U),
(4.7)
j=1
which is of degree N- 1, coincides withf(v) at the N points xj. The assumption underlying the quadrature formulas of this section is that b
b
J f(x)dx = J p(v)dv. a
a
(4.8)
(4.2.1)
129
NUMERICAL EVALUATION OF INTEGRALS
Comparison with the basic form shows that b
II(v_x&)dV
WJ = J l1(v)dv = a
a
X,-X;
( 4.9)
Since the integrand is a polynomial, the integral is easily evaluated once the
product is multiplied out. However, this involves considerable algebra, particularly for large N. The calculation could be done on a computer either by developing a suitable symbolic manipulation routine or by using the numerical integration routines described below, which are exact for polynomials. We leave this as an exercise for the interested reader and content ourself with giving a program using the first method in Appendix 2. As we show in Section 4.20, this program can also be used to determine weight
for interpolation, numerical differentiation, and approximation of other linear operators. It should be noted that if the nodes are symmetrically disposed about the midpoint, so that
x;-a =
(4.10a) b-xN-J+1.
then by a simple symmetry argument WN-J+I = WJ.
(4.IOb)
This reduces the number of integrals to be evaluated if (4.9) is used and reduces the size of the system of linear equations if (4.5) is used. As the work involved in solving a system of N linear equations increases as N 3, this represents a considerable saving of work. 4.2.1
Specific Examples
To illustrate the two methods, we calculate the weights for Eq. (4.3a) with N = 3 by both methods. We have ('1
f I(x)dx = WII(o) + W2 l(+) + W3I(1),
(4.11)
J{0
but since by symmetry W, = W3, the equations to be solved are
1=2WI+W2i
(4.12a)
I =WI+iW2.
(4.12b)
INTEGRATION FOR ENGINEERS AND SCIENTISTS
130
The equation for i = 2 is a multiple of (4.12a), a general phenomenon in symmetrical cases. The solution is W, = W3 = * and W2 = . Using Eq. (4.9) with x, = 0, x2 = }, and x3 = I gives W1
_
' (v-])(v-1)dv=a'9
fv(v-1)
W2 =
0 O(-)
(4.13a)
(-#)(-1)
0
dv =
-4f' (v2-v)dv = 3
.
(4.13b)
0
The resulting expression I
f0
f(x) d x = 6 E j'(0) +f(1)] + 2 f(4),
(4.14)
known as Simpson's two-thirds rule, is probably the most widely used integration formula. It is interesting to note that when applied to x3 it gives I
x3dx=
6(0"}'1)+32 (8)=q,
(4.15)
f
which is exact. It is a general principle that formulas of the type being considered in this section with an odd number of nodes are exact for a polynomial of degree N instead of N- 1, and in most cases are actually better than the same type of formula with an additional node. Since extensive tabulations of weights are available and a program for generating weights is given in Appendix 2, we list only a few low-order formulas here. Actually, for reasons that are discussed later, the high-order formulas are not often used in practice. The simplest closed Newton-Cotes formulas are the trapezoid rule o
f(x)dx
f(x)dx
I[f(0)+f(l)],
(4.16a)
$[f(0) +f(1)] + '' [f(;) +f(;)],
(4.16b)
J0,
which is called Simpson's three-eighths rule, and Boole's rule I
f
f(x) dx ^-
9
[f(0) +f(1)] + 3 [f(j) +f($)] +'- f(#)
(4.16c)
(4.2.1)
131
NUMERICAL EVALUATION OF INTEGRALS
The simplest open Newton-Cotes formulas are the midpoint rule J
1
f(x)dx ^' f(#),
(4.17a)
followed by
Jf(x) dx ^' # [f(j) +f($)],
(4.17b)
0
f t f(x)dx - e [f(6) +f(6)] + *f(2),
(4.17c)
0
f(x) dx = a e [.r(e) +f('-s)] + ae [f(-e) +f(S)]
(4.17d)
0
The Steffensen formulas also begin with the midpoint rule; then we have
J^' fix) d x = #[f(3) +f(3)],
(4.18a)
0
f(x) dx
3 [f(#) +f(j)] - f(#),
(4.18b)
3
J0'
f(X)dx = Z4 [f(S) +f(5)] + 24 [f(s) +f(-)]
(4.18c)
Jo0
In general, the open formulas are inferior to the closed formulas. The midpoint rule, which is slightly superior to the trapezoid rule, is the most important exception. Exercises I
Derive the general transformation to find the weights and nodes for b'
f Ja
N
Wj f(x;)
f(x) dx = j=l
when given those for b
j
f(x) dx = a
Wj f(x j). j=1
INTEGRATION FOR ENGINEERS AND SCIENTISTS
132 2
Calculate the first four Clenshaw-Curtiss weights.
3
We give the following results to be used as test examples of the various quadrature rules for finite intervals presented in this chapter. t
I
x1/2 dx =
0
J
1
x3J2 dx =
0
f'
t
i
0 1+?
J' s
o l+x
= 0 37988551
= 0.77750463
2 dx
Jo 2+sinlOttx = 0.86697299
dx
J
0 x4+x2+0.9
1+X4 4
xdx
o e-1
dx = 0.69314718
fodx
dx
= 1.1547005
= 0.79111645
Show that the value of the Nth-order Vandermonde determinant is
fl
(x, -x,).
I -i
(mj+t)dt.
(4.107b)
When w(x) = sin px, the weights are Wj = 2 p-' sin pSsin pmj,
(4.108a)
(4.16)
NUMERICAL EVALUATION OF INTEGRALS
171
and for w(x) = cos px (4.108b)
Wj = 2 Sp- ` sin pS cos pm;.
These expressions, which are much simpler than Filon's, show the basic
principle of weights dependent on a, b, and p, which can give accurate results using only one node in many cycles. The simplicity of the weights also clarifies a phenomenon that has caused some analysts to oppose the use of this method with less than one node per cycle. It can be seen that if p (b - a)/2 N = kn, the weights given by (4.108a) or (4.108b) vanish, but this is easily avoided.
To illustrate the power of the method, the integral ex cos px d x =
I
1 - e (cos p + p sin p)
(4.109)
1 + pz
0
was evaluated using 10, 20, and 40 points. The results for the percentage of error were as shown in Table 4.8; they show a loss of accuracy asp increases. The higher-order formulas (such as Filon's) do much better, and in the next chapter a modification of the midpoint rule using a correction term involving f is presented that also increases the accuracy markedly. Table 4.8
N=10
p
-0.0133
1
1.516
10 100
1000 10000
N=20
N=40
-0.0033
0.0008 0.0930
0.3735
-2.303
-4.147
7.584
7.691
-39.25
28.17
-0.5777 7.718 6.984
A. M. 0. Smith has developed generalized three- and five- point rules for evaluating integrals of the form n
f f(x)csinos [pg (x)] dx a
where f and g are slowly varying. The principle will be shown by developing
a compound one-point rule for z
Jiiz
x3 sin px4 dx =
cos(p/16) - cos 16 p
4p
(4.110)
INTEGRATION FOR ENGINEERS AND SCIENTISTS
172
According to Eq. (4.107a, b) N
2 I
x3sinpx4dx
(4.111a)
Wi J=1
1/2
where s
sin p(mj + 1)4 dt.
Wj =
(4.111b)
s
The slow varia tion of g is used by setting +s
s
sinp(m; +4m3 t)dt.
sinp(m;+()4 dt
4.112)
-s
-s This gives
12 x3 sin px4 dx u 1/2
2
N
p 1=i
sin pmj3 S sin pm j
Pm;
Using this gave the results in Table 4.9, which show that the method gives reasonably good results. Table 4.9 p 1
10
100
1000
4.16.1
Exact
N = 40
N = 160
N = 640
0.488927
0.489790
0.488984
0.488940
0.0446648 0.00399453
0.04436636
0.0446417
0.0049024
0.0041104
0.0446569 0.0040258
0.00042816
0.00047649
0.000484205
-0.00007647
Euler Summation
An alternate procedure for oscillatory integrands, which requires more
work but is capable of better accuracy, involves splitting the range of integration into parts, using the zeros of the integrand as points of separation;
evaluating the individual integrals; and then adding a sequence of alternating terms of almost equal magnitude without losing significant figures by
roundoff. There are a number of transformations for accomplishing this, the oldest and best known being due to Euler. The derivation is presented in
Chapter 6. For the present we note that given a sequence of terms a,, a2, ..., aN, a second sequence b, , b2, ..., bN_, can be obtained by bk =
(4.16.1)
173
NUMERICAL EVALUATION OF INTEGRALS
= ak+ak+1 and a third sequence by ck = bk+bk+1, and so on. The sum of la1+Jb1+act+...+ M,
I
will be the same as the sum of the original sequence but the convergence will often be greatly improved. For example, the value of 1/(1 + 0.9) is 0.5263. The sum of the first two terms is 0.1; after applying the Euler transformation, the sum of the first two terms is 0. 525.
For evaluating the integrals over a half cycle, Lobatto formulas are convenient because the values at the end points are zero. Alternatively, Price has given simple rules of the form (k+ i)n
N
sinyf(y)dy = (-1)k Y HJf(ka+x1),
(4.113)
J=1
k,
which eliminates the calculation of the sine terms. Longman has shown the accuracy of this class of methods by evaluating (10,000ir2 - x2)112 sinxdx = 298.435716,
(4.114)
Using 16-point Gaussian quadrature and a modification of the Euler transformation gave 298. 43558. The generalized midpoint rule, on the other hand, can only give five significant figures before roundoff error sets in, (10,000ir2_x2)112 cannot be evaluated accurately by because the function the midpoint rule unless the step size is very small. Exercises 1
Evaluate °
f
1
2 3
x"
cos
sin
sin °° _ cos it x dx, fl x : sin 2 x dx and fo x In x dx cos
by integrating between successive zeros and applying the Euler transformation (SIAM Rev. Problem 68-8). Investigate the use of Aitken extrapolation as a device for improving the convergence of series. Write a program for determining Fourier coefficients using a "Filon-type" quadrature rule.
INTEGRATION FOR ENGINEERS AND SCIENTISTS
174
4.17 INTEGRALS OVER AN INFINITE RANGE
In the preceding section formulas were included for evaluating integrals over an infinite range when the integrand had a proper weight function such as fo e-sf(x)dx. The use of these formulas is limited and it is not feasible to force integrands into the proper from. For example, rewriting
= f '0 e-x ex dx 1+x2 fo 1+x2 - Jo dx
°°
(4.115)
will not give satisfactory results. The product integration rules are based on
the assumption that f(x) can be approximated by a polynomial, and this does not hold for e"(1 +x2)-'. Replacing the upper limit by a large finite value u has drawbacks. In order to make the neglected part 5.- dx/(1 +x2) =
;1/u, which will be called the termination error, small, it is necessary to make u very large. This makes it difficult to use a simple interpolatory formula over the entire range, and compounding involves either a large number of nodes or variable spacing. 4.17.1
Transformation to a Finite Range
It has frequently been noted that a suitable change in variable can transform an integral over an infinite range into an integral over a finite range, but no systematic study has been made of the practical utility of this procedure. Our work will utilize the equivalent procedure of transforming the
quadrature formula rather than the integral to obtain rules of the form
oj=I
f
W
f(x) dx
^-N
Wjf(xj).
(4.116)
However, such rules are subject to a basic indeterminacy. Since
fo" f(x) dx = f ; f(Sx) dx, o
(4.117)
0
the weights and nodes can be multiplied by an arbitrary scaly factor S. When N is large enough, the value obtained will be insensitive t'
of S within reasonable limits. However, if S is too small,
,
'
-hoice Modes
will be small and the contribution for large x will not be properly accounts ' for; and if S is too large, the contribution from small values of x will not I evaluated correctly.
(4.17.1)
175
NUMERICAL EVALUATION OF INTEGRALS
It is easy to generate suitable transformations. Any monotone functions t (x) satisfying either
t(0) = I and t (co) = 0
(4.118a)
or
and
t(0) = 0
(4.118b)
t(oo) = I
will transform the integral, giving x
I
j f(x)dx =
f[x(t)]
0
dx (4.119)
dt.
dt
o
Some simple examples are given in Table 4.10.
Applying such a transformation to an open quadrature rule
f
I o
Y Ajf(ij)
f(t)dt
(4.120)
j=I
gives weights and nodes for (4.116)
wj=Aj
(4.121a)
and
xj = x(tj).
(4.121b)
Table 4.10
t(x)
dx
x(t)
Transformed integral
di
ex
I
-in t
f(-1n t) t
X
t
1+x
1-t
tank x
} 1n
o
(1-t) I I +t
I
1-t
1-r
dt
z
2
I f(1-tt)
o
dt 1-t
$'f(+ln-±.t) dt o
I-t 1-r
2
INTEGRATION FOR ENGINEERS AND SCIENTISTS
176
As pointed out earlier, these weights and nodes can be multiplied by a scaling factor S.
We have found the following transformation, for which the scaling factor has a simple interpretation, convenient to use. Splitting the range of integration into two parts 0 to S and S to oo and introducing t = x/S into the first part and t = Six into the second part gives 1(x) dx = S J o
Jo
[f(st) + t 2f
\S/Jdt.
(4.122)
This transforms an open N-point rule for the 0 to 1 range into a 2N-point rule for the infinite range with W; = SAi and
Wi =
SA
'-"
t 1-N
and
x; = Sty ,
xi =S-,
1 < j < N, N + 1 < j < 2N.
(4.123a)
(4.123b)
ti-N
This procedure is equivalent to approximating the integrand by a series in
ascending powers of x for x < S and by a series in inverse powers for x > S. None of the transformations appears to have any significant advantage for a fixed number of nodes, but (4.123 a, b) gives twice as many nodes in the infinite range for a specific conventional formula. The Appendix includes
a program in which the N = 20 Gaussian and Kronrod formulas are transformed to evaluate integrals over an infinite range. It is easy to change the program to use any of the other transformations. Experience with the program indicates the following. 1.
It will evaluate simple integrals such as j dxl(l +x2), Jo a-" dx, or J10 exp(-x2)/(1 +x2)dx to seven-figure accuracy for a considerable range of S. Surprisingly, excellent accuracy is also obtained for strongly damped oscillatory integrands such as Jo a-T sin dx or Jo exp(-x2) cos x dx.
2.
Integrals with weakly damped oscillations such as Jo (sin x/x)2 dx and integrals with singularities such as Jo X_ 1/2 e-' dx or Jo dx/[x'12(1 +x)] are evaluated to three or four significant figures. However, a suitable transformation can remedy this. For example, by introducing u2 = x, we obtain ox0'
I /2
exp(- x) dx = 2
exp(- u2) du = 1.772454. fof'0
(4.124)
(4.17.2)
177
NUMERICAL EVALUATION OF INTEGRALS
The program gave S
fox`'/2e_x dx 2 f o exp(-x2)dx
1.0
3.16
10
1.755811
1.742855 1.772454
1.719805
0.316
0.1
1.763095 1.772454
1.7671951 1.772437
1.772454
Underllow
3. The rules will not work for conditionally convergent integrals such as sin x
-- dx
°°
or
x
o
cos x2 dx.
o
The values obtained fluctuate wildly as S is varied. 4.17.2 Goodwin-Moran Method
Another approach to the evaluation of integrals over an infinite range begins by considering the application of the trapezoid rule to the range - 00 to + 00. The simple rule + N
+ co
Jf(x)dx
h
0o
j=-N
(4.125)
gives surprisingly accurate results in some cases involving integrands such as exp(-x2). The governing factor is the rate at which the derivatives vanish as
lxi -+ oo. Integrands such as (1 +x2)-' do not give this high degree of accuracy. Since +00
f
+00
f(x) dx = f-00 f(x+a)dx,
(4.126)
- 00
(4.125) can be rewritten as j=+N
+CO
f(x)dx = h E f(jh+6)
(4.127)
j=-N
00
to center the summation and avoid adding negligible terms for either large
positive or negative arguments. P...k. P. Moran has suggested taking advantage of the accuracy of this simple procedure by transforming integrals over other ranges to integrals over - oo to + co. Thus by taking x = e', we obtain +00
f(x)dx = fo
f(e`)e`dt. 00
(4.128)
INTEGRATION FOR ENGINEERS AND SCIENTISTS
178
Applying (4.127) to the right side gives
f(x) dx
Sin r [f(S) + Y tJ f(Sr') + r-' f(Sr-')].
(4.129)
i=t
The nodes in this formula form a geometrical progression, which seems more logical than uniformly spaced nodes for an infinite integral. This idea was utilized by H. V. Norden in connection with the numerical inversion of Laplace transforms. A simple alternative way of obtaining weights for such a formula is to take nodes in a geometrical progression for the range 0 to I
and determine weights by either the interpolatory method described in Section 4.2 or by the method described in section 4.11 and then obtain the nodes and weights for x > I by Eq. (4.123 a, b). Exercises
I
Compare the methods based on transformation with the Goodwin-Moran procedure for some known integral over an infinite range.
2
Devise three additional transformations to convert an infinite range to a finite range.
3
Generalize the Goodwin-Moran expression to an integral with a finite lower limit. 4.18 INDEFINITE INTEGRALS
Since an integral with a variable upper limit can be transformed to the standard range 0 to I by
f
x 0
f(x)dx = xJ I f(xt)dt,
(4.130)
o
in principle the methods described previously can handle such cases. In practice, however it is usually desired to evaluate (4.130) for a number of values of x, so proper organization of the calculation can save considerable time.
We start by considering the problem of an integrand tabulated at equally spaced values of the independent variable and restrict ourselves to rules using only these values. The simplest procedure is repeated use of the trapezoid rule but obviously this will not be accurate unless the step size is small and the error involved will tend to accumulate. Furthermore, since the
values of the integrand are available, a higher-order formula involves relatively little work. The conditions set above require equally spaced integration rules with some nodes outside the range of integration to get the
NUMERICAL EVALUATION OF INTEGRALS
(4.18.1)
179
process started. The weights for such rules, which can be calculated by the methods of Section 4.2, have been tabulated by Mikeladze. The simplest procedure is to start by (n+ 1)h
f(x)dx ^-_ nh
h
{Sf(nh) + 8f [(n+l)h] -f[(n+2)h]}
(4.131a)
12
and obtain the last value by
J(n-1)h(x)dx . 12[Sf(nh)+8f[(n-1)h]-f[(n-2)h]. (4.131b) n This is more effective than starting by (4.131 a) and then using Simpson's rule to integrate two steps. The next higher-order procedure would begin with
f(x)dx = 24[9f(O) + 19f(h) - 5f(2h) +f(3h)],
(4.132a)
I
do the intermediate steps with (n+ 1)h
f(x)dx
J
124h{f(nh)
-
+f[(n+1)h]}
4{f[(n-1)h] +f[(n+2)h]},
(4.132b)
and obtain the final value with 1)hf(x)dx t
24{9f(nh)+19f[(n-1)h]-5f[(n-2)h]+f[(n-3)h]}.
,1(
(4.132c) 4.18.1
Stability of Indefinite Integration
A class of formulas can be derived by using available values of the integral. For example, combining Simpson's two-thirds rule and Eq. (4.131 a) gives (n + 3)h
f
f(x)dx - 5g[(n+1)h] - 4g[(n+2)h]
eh
+ 2hf[(n+1)h] + 4hf[(n+2)h]
(4.133a)
INTEGRATION FOR ENGINEERS AND SCIENTISTS
180
where kk
f(x)dx.
g(kh) =
(4.133b)
0
This formula is very unstable, as is shown later by a numerical example. The theory of the instability has been studied extensively in connection with numerical methods for solving differential equations. If we consider only the g terms in (4.133 a), it is equivalent to a difference equation
g(n+2)+4g(n+1)-5g(n)=0,
(4.134a)
which has solutions of the form c.?" where A is a solution of the associated characteristic equation
,2+4k-5=0.
(4.134b)
The roots are a = + I and A = - 5. The second root causes the instability because its modulus is greater than 1, so that it increases rapidly with n. A root of modulus greater than 1 or a multiple root of modulus I corresponds to a strong instability. Krylov has shown how to construct stable expressions of high precision but they involve nodes at irrational points. As noted in the introduction, for computer calculations it is unnecessary to use only rational nodes. Although it is necessary to use a unit spacing to re-use computed values of the integrand, formulas of the form ('(n+1)k
f(x)dx - h
JIf
nk
i=+M N
i=-M J=I
W,;f[(n+i+t;)h]
(4.135)
can be developed. The simplest example of such a formula with N = 1 and
M = 1 is (n + 1)k
f(x)dx =
24{f[(n-})h] + 22f[(n+1)h] +f[(n+2)h]},
(4.136)
Ink
which is exact for cubics, as there are four parameters, the three weights, and t1 = 1. Krylov gives a number of such formulas. 4.18.1
Example
To illustrate the methods developed above, fX
es dx = ex - 1
(4.137)
0
was computed by a number of these methods from 0 to I in steps of 0.1 and the results are shown in Table 4.11.
(4.19.1)
NUMERICAL EVALUATION OF INTEGRALS
181
Table 4.11
x
es-1
0.2 0.3 0.4 0.5 0.6 0.7 0.8
0.221403 0.349859 0.491825 0.648721 0.822119 1.01375 1.22554
Exact [Start Eq. (4.131a)] Trapezoid Simpson's rule Eq. (4.133a) Eq. (4.131 a, b) rule 0.221587 0.350150 0.492234 0.649262 0.822804 1.01460 1.22656
0.221393 0.349844 0.491803 0.648693 0.822083
0.224736 0.353538 0.499230 0.656900 0.834497
1.01371 1.22549
1.02743 1.23499
0.221385 0.349911 0.491502 0.650246 0.814383 1.052299 1.03269
0.9
1.45960
1.46082
1.45954
1.47999
2.42365
10
1.71828
1.71971
1.71832
1.74415
-3.10223
The instability of (4.133a) is clearly evident. The trapezoid rule appears to
be superior to Simpson's rule because Simpson's rule is used for a larger
interval, 2h as against h. Exercise
I
Evaluate Ix sec= irx dx directly and by rewriting it as
47r- z x +
1-2x
z
sect nx
Jo
-
41r
-2
(1-2x)2
dx
(Eisner-Squire).
4.19 MULTIPLE INTEGRALS
This section presents a brief account of methods for evaluating multiple integrals. The presentation is principally in terms of the two-dimensional
case to permit simple geometrical interpretations, but the method can obviously be extended to higher dimensions. In spite of considerable recent
activity in this area, the general theory is relatively undeveloped and no comprehensive account of the subject is available. The methods can be classified as (1) combinations of one-dimensional quadrature formulas; (2) interpolatory formulas for simple regions; and (3) Monte Carlo methods. 4.19.1
Combinations of One-Dimensional Rules
It was shown in Chapter 1 that for a region possessing certain geometrical properties multiple integrals can be transformed to iterated simple integrals,
and that arbitrary regions can be decomposed into such simple regions. A very general method of evaluating multiple integrals was first employed in 1829 by F. Minding, who used a combination of Gaussian rules.
INTEGRATION FOR ENGINEERS AND SCIENTISTS
182
There are two drawbacks to this procedure. The first is the rapid increase
in the number of nodes with the increase in the dimensionality of the problem. For example, if four-point Gaussian quadrature is used (which is exact for a seventh-degree polynomial), integration over a two-dimensional region requires 16 evaluations of the integrand, integration over a threedimensional region requires 64 evaluations, and so on. The second difficulty, pointed out by Price in 1963, is that integration with respect to one of the variables can make the integrand poorly behaved for integration with respect to another variable. Price considered the integral of f(x, y) = I over the region between the x and y axes and the parabola y = 1-x2 (see Fig. 4.3). The integral can be written as either 1
I -X2
Ia =
f(x, y) d y dx 0
(4.138a)
0
or y) v2
I
ly =
JJ (1 0
f(x, y)dxdy.
(4.138b)
0
y=I-x2
0
x Figure 4.3
The value is 1, the integrals being easily evaluated analytically in either formulation. Let us consider the application of Simpson's two-thirds rule
(4.19.1)
183
NUMERICAL EVALUATION OF INTEGRALS
to these integrals. For (4.138 a) we get 1Q
r 6I
L
3/4
]
J(0, y)dy + 4J o
.f(G, y)dy+0.
o
(4.139)
A second application of Simpson's rule to the two nonvanishing integrals then gives 1a = 3-L6 [f(0,0)+4f(0,1)+f(0,
+
i
[f(#, 0) + 4f(},
s)
1)] (4.140)
+f(}, $)],
which for f(x, y) = I gives the correct value . For (4.138b) the first application of Simpson's rule gives 1b = 6L f l f(x, 0) dx + 4 J 0
5
f(x, })dx+0.I
(4.141)
0
The second application then gives
1b = 36[f(0,0)+4f(},0)+f(1,0)]
+ 9 [f(0, }) + 4f(}'3, }) +f(-, 5, }) ].
(4.142)
This gives a value j+} i, which is appreciably off. Price calculated the integral using the compounded Boole's rule and obtained the values in Table 4.12. These results show the effect of roundoff error on the nominally exact result given by (4.138 a) and the limitation of the accuracy that can be obtained by (4.138 b) as the result of the combinaton of roundoff and truncation error. Table 4.12
Number of points 5
9 17
33
lb 0.65652626 0.66307927 0.66539809
1, 0.66666668 0.66666667 0.66666676 0.66666672
65
0.66621795 0.66650784
129
0.66660944
0.66666813
257
0.66664446
0.66666923
0.66666688
INTEGRATION FOR ENGINEERS AND SCIENTISTS
184
In this simple example the reason for the difficulty is obvious, the introduction of an integrand (1-y)'12 with a derivative that becomes infinite. We have in Section 4.14 described methods for dealing with such cases; the difficulty is that in multiple integrals they are not apparent by inspection of the original integrand. Interpolatory Rules
4.19.2
The superior efficiency of interpolatory rules can be shown by deriving an expression
fl
P1-x2
f(x, y) dy dx
I o
o
fI
f(1-Y)if'
f(x, y) dx dy
I
Jo
0
W1.1(0, 0) + W2 f(0, 1) + W3 f(1, 0)
(4.143)
the weights being determined by making the rule exact for f(x, y) = 1, f(x, y) = x, and f(x, y) = y. The system of equations W, + W2 + W3 = 2
(4.144a)
W3-isa
(4.144b)
W2 = I
(4.144c)
determines W2 and W3 directly and W, = 3/20. Equation (4.140) gives the exact answer forf(x, y) = x but gives 13/18 for f(x, y) = y. Equation (4.142) also gives the exact answer for f(x, y) = x, but gives 5'/2/3 forf(x, y) = y. The following difficulties arise in generating interpolatory rules in more than one dimension. 1. It is not possible to evaluate the integral of even a simple power function over an arbitrary multidimensional region. 2. There is no general analog of the Lagrange interpolation formula for functions of a number of variables, so it is not possible to write a function that will assume specified values at an arbitrary set of points. Formulas are available, however, when the points form a lattice.
3. The theory of orthogonal polynomials in several variables is in its early stages. It is not in general possible to obtain multidimensional analogs of the Gaussian formulas because there are no equivalent theorems about the reality of the roots and their location inside the domain of the integration.
(4.19.3)
185
NUMERICAL EVALUATION OF INTEGRALS
4.19.3 The Center of Gravity Formulas
It is obviously impossible to tabulate weights and nodes for all the possible domains that may arise in practice. Therefore, simple domains that
can be combined to approximate the domain of interest are important. There are three and only three simple geometrical figures that can cover a plane region without gaps or overlap. These are the equilateral triangle, the rectangle, and the hexagon. The reason for this is that at a point where the figures join, the sum of the angles must be 360°. This can only be obtained by six equilateral (60°) triangles, four rectangles, or three hexagons.
We present a set of simple cubature formulas using the vertices and central point of these three figures:
Jjf(xy) dx dy A
3
A 12
[9fccnier + I Jvertices
(4.145a)
a
JJf(x,
y) dx d y
[2fccntcr 6
jJf(x, y) dx d y = 2
+ Y fvertices].
6 11 42fcenter + 5 [-, fvertices]
(4.145b)
(4.145c)
A collection of higher-order formulas for these regions and for other simple plane and solid figures is given by Abramowitz and Stegun. Exercises 1
Evaluate
t 4+x2+y2
t
f
(x2+y2)tf2dzdy.
o
o
(The exact value is } [25 In (1+ 2 1/2) +2 1/ 2].) 2
Evaluate 1/4 o
[1 1(4 o
exp[(x2+y2)2 (x2+y2)ti2
dxdy
(value - 0.5096).
This can be attacked as a double integral or converted to a/a
exp(Jsec©)dO - 2.
2 o
INTEGRATION FOR ENGINEERS AND SCIENTISTS
186
3
Find h
h
0
0
ln(x2+y2)1'2cos5xy2 dxdy as a function of h = 0.1(0.1)0.5. (The value for 0.1 is =0.0267.) (Price.)
4.20 LINEAR INTEGRODIFFERENTIAL OPERATORS
Functions arise in practice that are defined by a combination of integration and differentiation. Frequently the evaluation involves differentiation of an experimentally determined function. Typical examples are
fA(i)
F( x) =
o (x-t)
dt
(4 . 146 a )
and
I(x) = J
x
(4.146b)
0
which arise in the calculation of sonic boom; or j* b fb
T(x)T(t)lnIx-tj dxdt,
W= a
(4.147)
a
which occurs in the theory of wave drag in supersonic flow. T is either the first or second derivative of a tabulated function. While ad hoc methods have been developed for these problems, they are usually laborious. We will show how the methods developed in this chapter can be used to calculate derivatives and integrodifferential operators. 4.20.1
Numerical Differentiation
The problem of estimating derivatives from experimental values is an important problem in its own right and has been studied extensively. All numerical differentiation methods are essentially curve-fitting procedures that use the experimental points to determine the constants in an assumed functional form that is differentiated analytically. Unfortunately, two curves that agree very closely can have markedly different slopes. For example, the Weierstrass approximation theorem guarantiees that y =x# can be approximated over a finite range by a polynomial to any desired accuracy, but a polynomial will have a finite slope while y has an infinite slope at x = 0.
(4.20.1)
NUMERICAL EVALUATION OF INTEGRALS
187
Values of the derivative obtained by numerical differentiation of experi-
mental data cannot be considered experimental values. The numerical differentiation process involves a hypothesis, and markedly different results can be obtained by different procedures.
The method of undetermined coefficients described in Section 4.2 is easily modified to obtain constants for the expression N
f(x1)
Y_ Wjf(xi)
(4.148)
j=1
where the weights Wj depend on x; (except for N = 2). The weights are determined by the set of linear equations
kx;`-' _
j=1
Wjx;
(4.149)
for k = 0, 1, 2, ..., N- 1. For N = 2 this gives
AX) = f(x2) - f(xl)
(4.150)
which does not involve x; . For N = 3
f(xl)[X2 + 2Xi(X3-X2) - Xg]+ + J(x2)[x3 + 2x1(x1-x3) - x;] + + f(x3)[xi + 2x,(x2-x1) -x21
Axl) _
(4.151)
x1 x2(x2-x1) + x1 x3(x1 -x3) + x2x3(x2-x3)
and the complexity increases rapidly with N. A computer program for carrying out the process for arbitrary N is included in Appendix 2. Since the numerical differentiation process magnifies the effect of experimental scatter, Lanczos has suggested a procedure in which a quadratic is fitted to five equally spaced points by a least squares procedure. This gives
the simple expression
/(X) = 2[f(x+2h)-f(x-2h)]
[f(x + h) - f(x - h)] ; (4.152a)
Joh
for points at the end of the range Lanczos gives AX)
(x) =
- 21f(x) + 13f(x+h) + 17f(x+2h)- 19f(x+3h) 20h
(4.152b)
INTEGRATION FOR ENGINEERS AND SCIENTISTS
188
and
f(x+h) _ - llf(x) + 3f(x+h)20hf(x+2h) +f(x+3h), (4.152c) using only four points. Equation (4.152a) can be generalized to j=+N f(x) =
j=-N
/h
jf(x +jh)
j=+N
Y jf j=-N
(4.153)
when more points are available. 4.20.2
General Method of Undetermined Coefficients
The usual methods for evaluating integrodifferential operators such as occur in (4.146 a, b) or (4.147) is to use a numerical procedure for the differen-
tiation and a conventional approach to the integrations. Singularities such as arise in (4.146 a) are generally handled by a subtraction transformation such as
f4(t) o
(xt) 'iz
dt = 2 A(x)x'rz +
`o ,4(t) - A Zx)
(x-t)
J
dt
(4.154)
to obtain a well-behaved integrand. It is our opinion, as yet unsupported by calculations, that the method of undetermined coefficients is a better approach to the problem, and that in the spirit of Eq. (4.148) coefficients should be found for N
L[f ] ^
W; fl a j).
(4.155)
J=1
For Eq. (4.146a) this would be
A(t)dt
o (x-t)
,,, x3/z
W;A(xu;) j=1
(4.156)
The u j's could be specified and the W j's determined from the system of equations 1
k(k-1)
uk-2
N
liz du = Y_ W;xk,
o (I - u)j=1
k = 0, 1, 2,..., N-1,
(4.157)
taking N >, 3. It can be seen that the system of equations is basically the same as (4.5), so that the computer program in Appendix 2 can be used. It
(4.20.2)
189
NUMERICAL EVALUATION OF INTEGRALS
is interesting to note that interpolation can also be considered a linear operator, so that the program can be used to determine weights for expressions N
f(x)
E Wif(xf)
(4.158)
=t
for a specified set of xj's. Exercises 1
The heat flux is related to the reading of a thin film resistance gauge by
9(t)
k
' 0
E(r)dz (t-,r)312'
Devise a numerical scheme to evaluate this integral and test it on
E(t) = t, 5,
0