Professional Documents
Culture Documents
Author(s): J. A. C. Weideman
Source: The American Mathematical Monthly, Vol. 109, No. 1 (Jan., 2002), pp. 21-36
Published by: Mathematical Association of America
Stable URL: http://www.jstor.org/stable/2695765 .
Accessed: 20/12/2014 04:13
Your use of the JSTOR archive indicates your acceptance of the Terms & Conditions of Use, available at .
http://www.jstor.org/page/info/about/policies/terms.jsp
.
JSTOR is a not-for-profit service that helps scholars, researchers, and students discover, use, and build upon a wide range of
content in a trusted digital archive. We use information technology and tools to increase productivity and facilitate new forms
of scholarship. For more information about JSTOR, please contact support@jstor.org.
Mathematical Association of America is collaborating with JSTOR to digitize, preserve and extend access to
The American Mathematical Monthly.
http://www.jstor.org
xj = jh, j = 0,..., N.
73 e
{I(f) - M1o(f)l < -- ;_ 0.28. (5)
310
Truebutuseless,thisboundoverestimatesthe actualerror(4) by a factorof about108.
It's like saying the distancebetweenNew Yorkand Londonis less than 1011 miles
(abouta milliontimesthe circumferenceof the earth!).
At thispointmanyteachingassistantsandevena few professorsfindthemselvesat a
loss for wordsto explainthis spectacularfailureof the errorbound(2). The exceptions
are the numericalanalysts,who would be quick to point out that the midpointrule
(as well as the trapezoidalrule)is moreaccuratethanusualwhen appliedto integrate
smoothperiodicfunctionsover one period.For such functionsthe convergenceis so
quick that the standarderrorestimatebecomes irrelevant.This is illustratedin the
followingtable.
which yields the estimates3.3 x 10-2, 1.2 x 10-6, 6.4 x 10-12 when N = 4, 8, 12,
respectively.These numberscomparefavorablywith the values listed in the middle
columnof the table,despitethe fact thatN is not particularlylarge.
4We use the notationaN - bN to denote that 1imNoo aN/bN = 1.
TABLE 1. Examples
Essential
Example convergencerate Section
f2(x) = sin(x/2) 1/N2 4
f7(x) =e 2N2 1/ 8
f3(x) = sin3(x/2) 1/N4 4
f6(x) = e(C0SX-1)/(CoSX+l) e-(312)N2/3 7
f4(x) = 1/(a-cosx), a > 1 rN (O < r < 1) 5
fA(x) = eacosx 1/NN 6
f1 (x) = cos kx, k an integer exact (N > k) 3
Ourprincipalaim was to writethis paperin such a way thatit may serve as sup-
plementaryreadingfor the firstcoursesin integralcalculusor numericalanalysis.For
this reasonwe shallpresentthe examplesin increasingorderof mathematicalsophis-
tication(as opposedto increasingspeedof convergence).
To readSections2-5 the studentrequiresnothingmorethanfamiliaritywith geo-
metricseries,partialfractions,andEuler'sformulae'o = cos 0 + i sin0. The strategy
we follow in Section 5 is based on Fourierseries, but we shall assumeno previous
exposureto this technique.Termwiseintegrationof such series will be used, andthis
we will haveto askthe first-yearstudentto accepton good faith.
27ik 1 2 112
j e dx= ie = (e2ik ) =O
to theseintegrals.Applyingthe
Let us now also computenumericalapproximations
trapezoidalruleyields
N-1 N-1
TN(eikx) = h + E ekx 1 e27ik) = hZ e2 iku/N (8)
j=l j=O
TN(eikx) = h1 2ik
( 27r(-l)f
(N=e,l,02,o.t.h.
MN(eikx) fork-=N (11)
We arereadyfor ourfirstexample.
By using the formula(9) one concludesthat the exact value I (fi) = 0 is obtained
whenk is not an integralmultipleof N; in particular,this happenswhen N > k. Sim-
ilarargumentsapplyto the midpointrule.
On the basis of these examplesone mightconjecturethatfor a functionto be in the
"perfectconvergence"class, symmetryis necessary.This appearsnot to be the case.
In [11, p. 124] a functionis cited that has no apparentsymmetryproperties,yet is
integratedexactlyby the trapezoidalrule. Involvingthe M6biusfunctionof number
theory,it is one of those fractal-likefunctionsthat are continuousbut not absolutely
continuous.
NE1 +
-1- e2Ti/N e-7i/(2N) + e7ri/(2N) 7r
1 x x3
cotx - - = -- - 45 - , O < IxI < 7f (14)
7r21
I(f2) - TN(f2) 3 N2
J741
I() - TN(f3) -3
The factor 1/N4 confirmsthat the convergenceis fasterthan typical. The standard
errorboundis of limiteduse, as the followingtableshows (computedwith K = 3/4).
N II (f3)-TN(f3)I Errorbound(3)
10 3.3 x 10-4 1.6 x 10-1
20 2.0 x 10'- 3.9 x 10-2
40 1.3 x 10-6 9.7 x 10-3
What we intend to do is to derive an explicit formula for the errors in the middle
column. This will show that the error decreases at essentially a geometric rate rN for
some positive r < 1 that we shall determine.
To this end, we express f4(x) as
1 eix
where r satisfies
r2 -2ar + 1 = 0.
r = a- a-, (17)
Since Ire--x = I < 1 for each real value of x, the first two terms inside the square
brackets may be expanded as geometric series
00
1 = E rk +ikx
1reii k=O
Finally, we obtain
Students who have had a course in advanced calculus or analysis will recognize
in the right-hand side of (18) the Fourier series of the function f4(X).6 We shall not
make any use of the properties of Fourier series, except to note that it is in fact valid
to integrate this particular series termwise with respect to x. Doing so yields, as an
6The function f4 (x) is relatedto the Poisson kernel that appearsin the solution of boundaryvalue problems
defined on the circle.
28 ?M
THE MATHEMATICAL ASSOCIATION OF AMERICA [Monthly109
r rN
I(f4) -TN(f4)= 8 1-r2 1 rN (21)
d t (-log10 r)N.
ex(t+t1)/2 = E Ik(X)tk.
k=-oo
to this integralas
yields the midpointapproximation
Summing(22) term-by-term
00
MN(f5) = 21 Io(a) + 4X Z(-1)e IeN(a),
f=1
27r 1/2 ea N
wherethe Fouriercoefficientsaregivenby
F2w776k - \1-3/2
L33/2 ( 6 ).
By takingthe nearestintegerone obtainsa sequenceof values,namely,
N =2,4,7, 11, 16,20,26,31,37,43,50,56,64,71,79,...,
thatshouldyield particularlysmallerrors.Forexample,withN = 31 one gets I (f6) -
T31(f6) 7.5 x 10-9. Increasingthe numberof subintervalsto N = 33 yields the
_
for some t in [0, 2cr]. The Bk are the Bernoulli numbers [1, p. 804].
The function(32) does not satisfy f7(0) = f7(2w), and thereforeone expectsthe
typicalconvergencerate 1/N2. The numericalresultsin the table,however,seem to
indicatemuchquickerconvergence.To see why,note thatall odd derivativesat x = 0
vanish,while at x = 2w many of them are negligible:f7(27r) o10-16, f7"(2w) t
l0-14, f7""'(2r) t 10-12, etc. Whenworkingto aboutsixteensignificantdigits,as we
did here, the derivativetermsin the Euler-Maclaurin formulacancel for all practical
purposesand the numerical resultsindicatea convergence rate much fasterthanthe
expected 1/N2. It shouldbe in
kept mind,however, that the numbersin the middle
columnrepresenttransientbehavior.If the computationsweredoneto higherprecision
andfor largervaluesof N, the convergencewould eventuallysettle into the standard
1/N2 rate.
This observationdates back at least half a centuryto a paperof E.T. Goodwin [8],
whichwas inspiredby a paperof AlanTuring[10, p. 214]. In turn,thesedevelopments
inspiredFrankStengerto developthe powerfulmachineryof sinc functions[12].
For periodicfunctionsthat are infinitelydifferentiable,like our functionsf4(x),
f5(x), and f6(x), the Euler-Maclaurinformulapredictsa convergenceratefasterthan
any powerof h (or 1/N). On the otherhand,the formulais not sufficientlypowerful
to determinethe rateprecisely.For this one has to go to methodsbased on analytic
functiontheory.Using residuecalculus,for example,the following theoremmay be
proved[9, p. 211].
9. CONCLUSIONS. The main theme of this essay is that, when the integrandis
smoothandperiodic,the midpointandtrapezoidalrulesareveryefficient.Using more
sophisticatedrules may not be worth the effort. One such rule is Simpson'srule,
which normallyconvergesat a rate 1/N4. Typicallyderivedby computingthe area
underpiecewisequadraticapproximations of the function,Simpson'srulemay also be
viewed as a weightedaverageof the midpointandtrapezoidalrules
Whenthis rule is appliedto the functionf4(x) = 1/(a - cos x), for example,the er-
ror estimates(20) and (21) show that the rate of convergenceis roughlyrN12 (with
r definedby (17)). This is fasterconvergencethanthe 1/N4 rate that is typical for
Simpson'srule.Nevertheless,one wouldneed abouttwice as manypointsto achieve
the same accuracyas eitherthe midpointor the trapezoidalrule.
One shouldnot concludefrom this, however,thatthe midpointor the trapezoidal
rule beat all-comershands down when the integrandis smooth and periodic.For
f4(x) = 1/(a - cos x), with a = 1 + E and 0 < E << 1, the powerful Gauss-Legendre
rule is superior,althoughthis superioritydisappearsas a increases (see Davis [4,
p. 54]). If one changesthe minussign in the denominatorinto a plus (so thatthe peak
of the graphis in the middleof the intervalratherthanat the endpoints),thenthe mid-
pointandtrapezoidalrulesremainthe clearwinners,as demonstrated in [5]. Numerical
resultshave also indicatedthatboth the midpointand trapezoidalrules integratethe
functionsf5 (x) andf6(x) betterthanthe Gauss-Legendre ruledoes.
The rapidspeed of convergencemay be exploitedin variousways. First, it may
be useful for the computationof special functions(see Luke [10, chapter15]). The
applicationof these rules to the integral(23), for instance,representsa respectable
tool for computingIo(x), providedx is not too large.
Second,consideran integralfor which the typicalrateof convergenceis the stan-
dard1/N2. One may attemptto improvethe accuracyby a changeof variables,with
the aim of makingthe integrand"moreperiodic."Such transformation methodsare
discussedin [6, pp. 107-135] and[9, p. 220].
Third,thereis the Fourierspectralmethod.Based on the differentiationof trun-
cated Fourierseries such as (26), this is a powerfulmethodfor solving differential
equations[3], [14]. Whenthe underlyingfunctionis smoothandperiodic,the rateof
convergenceof the Fourierspectralmethodis similarto the rateof convergenceof the
I N-1
Ck -E Z f
(x j )e27rijk/N
Not only has our discussionshown that this is the "right"way to approximatethe
integral,butthe summaybe evaluatedefficientlywiththe FastFourierTransform(see
Atkinson[2, p. 181] or Kress [9, p. 167]). This is an algorithmthat approximatesN
of the coefficientsCk in asymptotically0 (N log N) algebraicoperations.By contrast,
directsummationrequires0 (N2) operations.The FFThas revolutionizedapproaches
to applicationssuchas signalprocessinganddigitalimaging.
ACKNOWLEDGEMENTS. The authorthanks An6l Kemp, a student at the University of Stellenbosch. Her
honorsproject,writtenunderguidance of the author,dealt with analyzing the errorin the trapezoidalrule by the
method of residue calculus. Useful suggestions by Bob Burton, Dirk Laurie, Nick Trefethen, and particularly
David Elliott are also acknowledged.
REFERENCES
ANDRE WEIDEMAN spent the 1980s at the University of the Free State in Bloemfontein, South Africa,
where he earned a Ph.D. in Applied Mathematics and also landed his first teaching position. The 1990s were
spent at Oregon State University in Corvallis, Oregon, where he rose to the rank of Associate Professor in the
MathematicsDepartment.In the 2000s he finds himself back in South Africa, as Professor in the Department
of Applied Mathematics,University of Stellenbosch. In his free time he likes to enjoy good food and music
with his wife Marf, play chess and other board games with their children (Hendrik,Nicolaas, Rina-MarO,or
bike in the beautiful JonkershoekValley just outside their home in Stellenbosch.
Departmentof Applied Mathematics, Universityof Stellenbosch, Stellenbosch 7600, SouthAfrica
weideman@dip.sun.ac.zaor weideman@na-net.ornl.gov