Optimal Numerical Differentiation Using Three Function Evaluations

Similar documents
Remarks on various generalized derivatives

Chapter 4. Matrices and Matrix Rings

Linear Systems and Matrices

LINEAR SYSTEMS AND MATRICES

SPRING 2006 PRELIMINARY EXAMINATION SOLUTIONS

MATH2210 Notebook 2 Spring 2018

Parts Manual. EPIC II Critical Care Bed REF 2031

THE GROUP OF UNITS OF SOME FINITE LOCAL RINGS I

Real Analysis Math 131AH Rudin, Chapter #1. Dominique Abdi

Math 345 Sp 07 Day 7. b. Prove that the image of a homomorphism is a subring.

Lebesgue Measure on R n

Theorem 5.3. Let E/F, E = F (u), be a simple field extension. Then u is algebraic if and only if E/F is finite. In this case, [E : F ] = deg f u.

Exercises for Chapter 1

Multidimensional Riemann derivatives

f(w) f(a) = 1 2πi w a Proof. There exists a number r such that the disc D(a,r) is contained in I(γ). For any ǫ < r, w a dw

UNDERSTANDING RULER AND COMPASS CONSTRUCTIONS WITH FIELD THEORY

MATH 221: SOLUTIONS TO SELECTED HOMEWORK PROBLEMS

Analysis III. Exam 1

is equal to = 3 2 x, if x < 0 f (0) = lim h = 0. Therefore f exists and is continuous at 0.

Core Mathematics 2 Algebra

Math Homework 1. The homework consists mostly of a selection of problems from the suggested books. 1 ± i ) 2 = 1, 2.

SYMMETRICOMPLETIONS AND PRODUCTS OF SYMMETRIC MATRICES

Numerical Integration for Multivariable. October Abstract. We consider the numerical integration of functions with point singularities over

Analysis-3 lecture schemes

Tangent spaces, normals and extrema

MATH 1902: Mathematics for the Physical Sciences I

TAYLOR POLYNOMIALS DARYL DEFORD

EXERCISE SET 5.1. = (kx + kx + k, ky + ky + k ) = (kx + kx + 1, ky + ky + 1) = ((k + )x + 1, (k + )y + 1)

SOLUTIONS TO ADDITIONAL EXERCISES FOR II.1 AND II.2

UMA Putnam Talk LINEAR ALGEBRA TRICKS FOR THE PUTNAM

ELEMENTARY LINEAR ALGEBRA

We have been going places in the car of calculus for years, but this analysis course is about how the car actually works.

Solutions to Final Exam 2011 (Total: 100 pts)

chapter 5 INTRODUCTION TO MATRIX ALGEBRA GOALS 5.1 Basic Definitions

Lecture Notes in Linear Algebra

Ch 7 Summary - POLYNOMIAL FUNCTIONS

Inequalities for the perimeter of an ellipse. G.J.O. Jameson, Math. Gazette 98 (2014)

The Complex Numbers c ). (1.1)

ELEMENTARY LINEAR ALGEBRA

MATH 361: NUMBER THEORY FOURTH LECTURE

a 11 x 1 + a 12 x a 1n x n = b 1 a 21 x 1 + a 22 x a 2n x n = b 2.

THE INVERSE FUNCTION THEOREM

Algebraic Varieties. Chapter Algebraic Varieties

Solution to Set 7, Math 2568

Problem Set 5 Solution Set

Eighth Homework Solutions

MAT Linear Algebra Collection of sample exams

Linear Algebra: Lecture notes from Kolman and Hill 9th edition.

Chapter 1. Matrix Algebra

x x2 2 + x3 3 x4 3. Use the divided-difference method to find a polynomial of least degree that fits the values shown: (b)

MATH 115, SUMMER 2012 LECTURE 4 THURSDAY, JUNE 21ST

A connection between number theory and linear algebra

MORE CONSEQUENCES OF CAUCHY S THEOREM

MATH1050 Greatest/least element, upper/lower bound

A matrix over a field F is a rectangular array of elements from F. The symbol

Elementary linear algebra

ACI-matrices all of whose completions have the same rank

Introduction to Matrices and Linear Systems Ch. 3

MATH 115, SUMMER 2012 LECTURE 12

ENTRY GROUP THEORY. [ENTRY GROUP THEORY] Authors: started Mark Lezama: October 2003 Literature: Algebra by Michael Artin, Mathworld.

THREE-BIT MONOMIAL HYPEROVALS IN PG ( 2, 2 h)

2) e = e G G such that if a G 0 =0 G G such that if a G e a = a e = a. 0 +a = a+0 = a.

Math Homework 2

Matrix Arithmetic. j=1

Trace Class Operators and Lidskii s Theorem

Let X be a topological space. We want it to look locally like C. So we make the following definition.

Local Parametrization and Puiseux Expansion

Chapter 7. Linear Algebra: Matrices, Vectors,

Linear Algebra March 16, 2019

Boolean Inner-Product Spaces and Boolean Matrices

MATH Mathematics for Agriculture II

Scott Taylor 1. EQUIVALENCE RELATIONS. Definition 1.1. Let A be a set. An equivalence relation on A is a relation such that:

1.4 Techniques of Integration

Absolute value equations

Honours Algebra 2, Assignment 8

(x 1, y 1 ) = (x 2, y 2 ) if and only if x 1 = x 2 and y 1 = y 2.

Solution to Homework 1

The Weil bounds. 1 The Statement

SECOND-ORDER RECURRENCES. Lawrence Somer Department of Mathematics, Catholic University of America, Washington, D.C

MATH Linear Algebra Homework Solutions: #1 #6

TEST CODE: MMA (Objective type) 2015 SYLLABUS

CYCLES AND FIXED POINTS OF HAPPY FUNCTIONS

Isomorphisms and Normality of Cayley Digraphs of A5

Math 120 HW 9 Solutions

Functions. Remark 1.2 The objective of our course Calculus is to study functions.

Complex Numbers and Polar Coordinates

Solutions for Chapter 3

On a Balanced Property of Compositions

CHAPTER 8: EXPLORING R

Linear Algebra Notes. Lecture Notes, University of Toronto, Fall 2016

0 Sets and Induction. Sets

ELEMENTARY LINEAR ALGEBRA

ACCRS/QUALITY CORE CORRELATION DOCUMENT: ALGEBRA II

Section 3.2. Multiplication of Matrices and Multiplication of Vectors and Matrices

Math 308 Midterm November 6, 2009

Chapter 2: Matrix Algebra

STOKES THEOREM ON MANIFOLDS

this chapter, we introduce some of the most basic techniques for proving inequalities. Naturally, we have two ways to compare two quantities:

MORE EXERCISES FOR SECTIONS II.1 AND II.2. There are drawings on the next two pages to accompany the starred ( ) exercises.

0.1 Rational Canonical Forms

Transcription:

mathematics of computation volume 37, number 155 JULY 1981 Optimal Numerical Differentiation Using Three Function Evaluations By J. Marshall Ash and Roger L. Jones Abstract. Approximation of f'(x) by a difference quotient of the form h~l{aj(x + bxh) + a2f(x + b2h) + a3f(x + b3h)] is found to be optimized for a wide class of real-valued functions by the surprisingly asymmetric choice of b = (,, b2, b3) = (1/V3-1, 1/V3, 1/V3 + 1). The nearly optimal choice of b = (-2, 3, 6) is also discussed. 1. Introduction. The problem of best approximating the derivative of a function at a single point using two values of the function is "best" solved by using the difference quotient (1) d0(h) =---. We consider the same problem using three values of the function and arrive at three different solutions by interpreting "best" in five different ways. Our best difference quotients are (2) d,(h)-u-, f{x + h) + u2f{x + ich) + cofjx + to2/.) (3) diin) =-3^-. where w = -\ + V3//2 and u2 = -\ - V3//2 are the cube roots of 1, and (A. J, IA 32/(x + 3h) - 27fjx - 2h) - 5f(x + 6h) Section 3 below was motivated by the kind suggestion of J. Lyness. 2. Minimum Truncation Error. Whenever we write /, we will mean either a complex-valued function of a complex variable or a real-valued function of a real variable. In the former case we assume that / is analytic near x and in the latter case that / is five times differentiable at x. The point x will be fixed and the variable h will be small. Our assumptions are chosen to guarantee (i) that /have at x a Taylor expansion to order ha with error Oi\h\5) and (ii) that there be a bound for the modulus off"" near x. Received May 2, 1980; revised October 10, 1980. 1980 Mathematics Subject Classification. Primary 65D25; Secondary 65G05, 39A05. Key words and phrases. Numerical differentiation, discretization error, truncation error, generalized difference quotient. 1981 American Mathematical Society 0O25-S718/81/O0O0-0H2/$03.25 159

160 J. MARSHALL ASH AND ROGER L. JONES Consider the general three-point difference quotient (5) dih) = A"1 2 ajix + b,h) = d(% b)(a). i = i Substituting Taylor's theorem, fix + bth) = 2 3^**/ + ^ßh*b?, J'- 5! into (5) and interchanging the order of summation gives (6) dih) = c/^-hj-1 j-o J- + Oih% cj = 2 atb{, j = 0, 1, 2, 3, 4. i = i For dih) ->f'(x) as /i -» 0, we must have c0 = 0 and c, = 1. This motivates our first definition. Definition 1. A three-point rule for the first derivative is a difference quotient (a, b)(/z) of the form (5) where c0 = 2 a, = 0 and c, = 2 a,, = 1. Definition 2. A three-point rule for the first derivative is of degree k if and only if i/(a, b)(a) = /'(0) for every polynomial / of degree k. Lemma 1. A necessary and sufficient condition for the three-point rule to be of degree 3 is (7) Co = 2 <*, = 0, c3 = 20,A3 = o. The proof of this is immediate from (6) above. Lemma 2. No three-point rule is of degree 4. For a three-point rule to be degree 3, we must have all b distinct. Proof. For a rule to be of degree 4 would require c2 = c3 = c4 0. Write this as a matrix equation B» = bl If all b =?= 0, then the Vandermonde-like matrix B is nonsingular, so a = 0, contrary to c, = 1. If, say, b3 = 0, the three equations c2 = c3 = 0, c, = 1 lead quickly to a similar contradiction. Similarly, if, say, b2 = b3, we may as well combine a2 and a3, which implies we are dealing with a two-point rule. As above, if both b = 0, the two equations c2 = c3 = 0 force a to be zero, contrary to c, = 1. The case of b2 = b3 = 0 is treated similarly. Thus, for a three-point rule to be of degree 3, we must have all b distinct. fa.

OPTIMAL NUMERICAL DIFFERENTIATION 161 Lemma 3. The three-point rule d is of degree 3 if and only if (8) bxb2 + bxb3 + b2b3 = 0. Proof. The first three equations in (7), c0 = c2 = 0, c, = 1, may be written as a matrix equation /3a = where the Vandermonde matrix B is easily inverted. Substitute the result of this,»=[ib2- b,)ib3 - bx)ib3 - b2)l\b2 -, -, - b2), into c3 = 0 to obtain (8). Definition 3. A three-point rule </(a, b) is said to be normalized if min{ Z>, - b2\, \bx - b3\, \b2 - b3\) = 1. Motivation for Definition 3. The mapping h-> ch for a nonzero constant c, which may also be thought of as mapping (a, b) -» (c~'a, cb) while leaving h fixed, obviously does not change anything of substance. In other words, the set of three-point rules dia, b)(/i) partitions into equivalence classes with /(a, b) ~ i/(a', b') if there is a constant c such that a' = c~'a and b' = cb. The quantity c4(a, b) is not a class invariant, for if (a, b) ~ dipi, b'), where (a', b') = (e~'a, eb) with 0 < e < 1, we have (9) c4(a', b') = 12 («r^)(e*,)4 = Ac % b) < c4(a, b). By picking e very small, we can find arbitrarily small c4 without really changing anything. Some normalization is required to keep the vector b from collapsing to 0. In difference quotient (1) or in the standard difference quotient ifix + h) fix))/h, a normalization has been achieved by expressing the error in powers of the distance between the two arguments. Set 5 = min{ >, - b2\, \bt - b3\, \b2 - b3\] and rewrite the dominant error term in (6) as (10) e4äi*'-(^)äi(»)'-0äl<*)'. A simple calculation as in (9) above shows that G = <J(a, b) is constant on each equivalence class. Lemma 4. All three-point rules of degree 3 are of the form _ t\t + 2)f(x + (1 + t)h) - (1 + 2t)f(x + <(1 + /)*) - (/ + 1)V -!)/(* - th) iu> K) t(2t + l)(r + 2)(/2-1)A for some value of t, or are obtained from (11) by a transformation (a, b) -» (c_1a, cb). Proof. Select representatives from each equivalence class by setting bx = 1. Let t = b2. From (8), b3 = -r/(r + 1). Clear fractions by sending (a, b) -» ((l/(r + l))a, (/ + l)b). Our representative quotient becomes (11).

162 J. MARSHALL ASH AND ROGER L. JONES Theorem 1. Let d be a normalized three-point rule of degree 3. Fix h and restrict a and b to be real. Then truncation error is minimized when d = dx. isee Eq. (2).) This minimizing rule is unique up to the transformation (a, b) -» (-a, -b). Proof Let d'iw, b') be any normalized three-point rule of degree 3. By Lemma 1, we have c2(a', b') = c3(a', b') = 0, so to minimize truncation error we must minimize c4(a', b') - By Lemma 4, there is a real number t and an equivalent three-point rule dit) = din.it), b(r)) of the form (11). Since c4(a', b') = c4(a', b')/l3 = G(a', b') = G(a, b) = c4(a, b) /53, where 8 = m.ini =j{\b - bj\} (see (10)), we see that we must minimize G(f) = c4(a(i), bit))\/8(b(t))3 as t varies over R. Substituting the values of a(r) and bit), as given in (11), into c4(a, b) reduces our problem to that of minimizing (i2) Since t is real, we have GW -e^a-izi±m. minfll - <2, 2l + l, ((( + 2) }' «(<) 5(0 \t2-1, - (V3 + l)/2 < / < -V3 + 1, (V3 - l)/2 < t < V3 + 1, \t2 + 2t\, - (VI + 2) < t < - (VÏ + 0/2, V3-2 < t < (VJ - 0/2, 2r + 1, -oo < t < - (V3 + 2), -V3 +l</<"vr3-2, V3+l<i<oo. Substituting this into (12) and using the methods of elementary differential calculus on each interval yields that min G(r) = V3 and that this minimum occurs at t - 1 + VJ, 1 - VJ, (V3-1), j(-v3-1), V3 2, and - V3 2. All six values of r give equivalent difference quotients (the corresponding b vectors are scalar multiples of one another). Normalizing the difference quotient corresponding to t = (V3 1) by sending (a, b) > ((V3 /2)a, (2/ V3 )b) produces difference quotient dx (see (2)) as the unique (up to (a, b) -* (-a, -b)) normalized real three-point rule minimizing truncation error. Theorem 2. Let d be a normalized three-point rule of degree 3. Fix h but allow all variables and functions to be complex-valued. Then truncation error is minimized when d = d2. (See Eq. (3).) This minimizing rule is unique up to the transformations (a, b) ^ (e^a, e'^b), 0 < <p < 2tr. Proof. As in the proof of Theorem 1, we must minimize the function G(0 given in (12). Since / may be complex, '\t2-1 on/1,, 03) Sit) = \,2 + 2t\ ona2, \2t + 1\ ona3,

OPTIMAL NUMERICAL DIFFERENTIATION 163 where A, is the union of the region enclosed by C, u C3 with the region enclosed by C2 u C4, A2 is the reflection of Ax in the line Re t = -\, and A3 = C iax (J A 2), where c1 = {-l + ^,o<, <f), C3 = il +V3 e,9,0 < 0 < "), C4= f 1 +V3 eie, tt < 0 <w}. Figure 1 The shaded area in Figure 1 is Ax. Substitute (13) into (12), use the maximum modulus theorem on (G(i))-1 to see that the minimum of G must occur on one of the three circles of Figure 1, and use the method of elementary calculus on each circle, treating G as the appropriate function of 0 on each C,. The result is min\git)\=\v3 tec y and that the minimum occurs at / = w and u>2. Again, the corresponding difference quotients are equivalent; in fact, both are equivalent to difference quotient d2 (see (3)). Notice that, for any nonzero complex constant c = pe"p, the mapping (a, b) -» (c~'a, cb), gives an equivalent best complex three-point rule minimizing truncation error. Thus the "obvious" best three-point rule here is any one obtained by letting b be the three vertices of any equilateral triangle centered at x. (The word "obvious" is in quotes since the corresponding symmetric choice was not the best one in the real case above.) 3. Roundoff Error. Motivation for Theorem 3. In the previous section, evaluations were assumed to be exact. Here we assume that each computation of the function / may be in error

164 J. MARSHALL ASH AND ROGER L. JONES by as much as ± e where e is a small fixed positive quantity. From (5), we see that this generates a roundoff error bounded by _ (K + \a2\ + N)e _ Ae *R~ h h Fix a difference quotient satisfying (7). From (6) and (7), we see that the dominant term in the truncation error is c4/(4)(x)(4!)~vi3 which is dominated by (14) \c4\âh3 4! where/4 = sup{ /(4)(.y)l : y is near x). Define the overall error E by E = ET + ER. Elementary calculus shows the h which makes E smallest to be given by (15) /_MlV/4 = lkl/j ' E = ^(A3\c4\)i/4fy\y\ for which h we have Theorem 3. Let d be a normalized three-point rule of degree 3. Fix h and restrict a and b to be real. Then overall error is minimized when d = dx. (See Eq. (2).) This minimizing rule is unique up to the transformation (a, b) >(-a, -b). Proof. From (15) it follows that we have to miriimize v43 c4. (Note that (a, b) -» (c"'a, cb) sends A >\c\a, e4 -» c "3 c4, so that this quantity is constant over each equivalence class.) Assume a, b, and t are real. Then 3kl«(2hl)3 2«A4 _ ( \t\t + 2)\ + \2t + 1\ + \jt + 1)V- 1) ( /(2/ + 1)(/ + 2)(/2-1) t\t + l)2 8/8/ (/ + 1)[(2/ + 1)(/ - 1)]3, 8(/ + l)7k[(2/ + \)it + 2)]\ 8/ /(/ + l)[(/ + 2)(/-l)]3, -1 < / < -{-, 1 < / < 00, -00 < / < -2, -\ < t < 0, and -2 < / < -1,0 < / < I. By elementary calculus we have nun^3 c4 = ( )3.2< and that this minimum occurs at / = 1 + V3, 1 - V3, (V3-1), j(-v3-1), V3 2, and - V3 2. Thus rule dx also minimizes the overall error E among all real normalized three-point rules. Theorem 4. Let d be a normalized three-point rule of degree 3. Fix h but allow all variables and functions to be complex-valued. Then overall error is minimized when d = d2. (See Eq. (3).) This minimizing rule is unique up to the transformations (a, b) ^ (e-^a, e""b), 0 < <p < 2*.

OPTIMAL NUMERICAL DIFFERENTIATION 165 Proof. Let z = 2/ + 1. As in the proof of Theorem A3\c4\ = Fiz) where 3, we must minimize. (16) ^=16 \z - lp z + 3 + 16 z + \z + l 3 z - 3 V_ _ z(z2-9) ) \z2-1\ " Inspired by the results of Section 2 (see Theorem 2), we were able to guess that the minimum would occur for / = w and w2, which correspond to z = V3 i or z = -V3 i, where F = 1. Because of the symmetries F(z) = Fiz) = F(-z), it suffices to show that F > 1 at every point of the first quadrant, C+, except V3i. Let r = \z\. For z G C+ and a > 0, we have \z + a\ > r, so, from (16), Hz)> 16 (/ -l)3r+16r+r3(r-3)\3 1 _ r(r2 + 9) ) r2+l 8K *' Direct calculation shows g' > 0 on [9, oo) and g(9) > 1, reducing the domain of investigation to C+ n { z < 9} = D. Finally, a combination of evaluating F on the points of a mesh containing D, together with bounding grad F away from the singularities z = 0, 1, 3, shows F > 1 away from V3 f, while a Taylor expansion of F about V3 i shows F > 1 on the remainder of D \ {V3 /}. Thus three-point rule d2 also minimizes the overall error E among all normizalized three-point rules. 4. A Third Rule and Some Remarks. Motivation for the Third Rule (see (4)). Estimating the first derivative from an equally spaced table adds the constraint that all three b be integers. Under these conditions it is clear from formula (11) that the rule given by (4) is best in a number of ways. It is best among integer three-point rules of degree 3 with respect to (i) minimizing max{ >,} - min{ >,}, (ii) minimizing 2 b2, (iii) minimizing 2 \b \, et cetera. History of Three-Point Rules. Essentially all real three-point rules appearing in the literature have been only of degree 2. (However, compare [3, p. 217].) The most prevalent of these is (-3/(x) + 4/(jc + h) fix + 2h))/2h; see [1]. The complex rule (with b = (1, w, w2)) seems to be well known; see [2]. Comparison of Three-Point Rules. In Table 1 below,/4 is a bound for the modulus of the fourth derivative near x. All derivatives have been normalized to make min 6, bj\ = 1. Observe that the overall error for the rule d3 is only slightly worse than that of the rule dx. (By Theorem 3 it must be worse.) Generalizations. 1. If we use/) > 3 points in our approximating rule, the most we can hope to achieve is (17) c, = 1, c0= c2= = cp = 0. This follows from a simple linear algebra argument like the one found in Lemma 2. Such a difference quotient is easily found in the complex case by letting b be the pth roots of unity and solving the Vandermonde system, c, = 1, c0= c2= = cp_x = 0,

166 J. MARSHALL ASH AND ROGER L. JONES for a. Such a quotient appears in [2]. The last equation in (17) holds automatically from the /^-periodicity. The same result holds in the real case. If p is even, one simply finds the appropriate linear combination of fix + h) fix h), fix + 2h) - fix - 2h),...,fix + ph/2) fix - ph/2). This process is essentially Romberg extrapolation. If p is odd, more delicate arguments are required, but Eqs. (17) can still be satisfied. Table 1 Truncation Error (see (14)) Overall Error (see (IS)) "0- (see (1)) 1/2-1 -1/2 =.,67/3*2 32/3/l/3e2/3,.04/.l/3e2/3 3-2V? 4^3-3 - 2-Ji '1 6 6 6 r-f* 3. V3 h3 =.016 fah 8,1/4 3/4^,1/43/4 (see (2)) 1 1 1 = + 1 -pr -= -1 V3 V3 s/3 (see (3)) v/3 v/3 sß 1 1 /-A 3. -V3 hû =.008 f.h 9 4! H llil/j/v^.793/4/4e3/4 \ß \ß (see (4)) 32 40 27 S 40 40 2 6 3 3 4 ^4 3. 3 -h' 3 4! =.056 /Vi 4 3(37 5)..ri'V/^i^i/J'V/4 2. Pass now to the dth derivative, d > 2. To approximate f(<r>ix) we now need /? > / + 1. As above, we choose (a, b) in such a way that (A) is an approximation to the dth derivative, i.e., that c0 c, = = cd_x 0, cd = d\ (see (6)) and that as many higher order terms be 0 as possible. Again the kind of argument used in Lemma 2 shows that we may hope for cd+x = cd+2 = = cd+ x = 0 at most. As in the preceding generalization 1, we may achieve this in the complex case by letting the components of b be the p pth roots of unity. In the real case, however, we cannot always do as well. For example, let d = 2 and/) = 3. Here l[fix + h) +»fix + ah) + aftx + a2h)]/h2 = /"(*) + /^W»3 so c0 = c, = e3 = c4 = 0, c2 = 2, as desired, while an easy calculation shows this system to be insoluble with a and b real.

OPTIMAL NUMERICAL DIFFERENTIATION 167 Department of Mathematical Sciences DePaul University Chicago, Illinois 60614 1. W. G. Bickley, "Formulae for numerical differentiation," Math. Gaz., v. 25, 1941, pp. 19-27. 2. J. N. Lyness, "Differentiation formulas for analytic functions," Math. Comp., v. 22, 1968, pp. 352-362. 3. Herbert E. Salzer, "Optimal points for numerical differentiation," Numer. Math., v. 2, 1960, pp. 214-227.