What's New
About the Project
NIST
3 Numerical MethodsAreas

§3.4 Differentiation

Contents

§3.4(i) Equally-Spaced Nodes

The Lagrange (n+1)-point formula is

3.4.1 hft=hf(x0+th)=k=n0n1Bknfk+hRn,t,
n0<t<n1,

and follows from the differentiated form of (3.3.4). The Bkn are the differentiated Lagrangian interpolation coefficients:

3.4.2 Bkn=dAkn/dt,

where Akn is as in (3.3.10).

If f(n+2)(x) is continuous on the interval I defined in §3.3(i), then the remainder in (3.4.1) is given by

3.4.3 hRn,t=hn+1(n+1)!(f(n+1)(ξ0)ddtk=n0n1(t-k)+f(n+2)(ξ1)k=n0n1(t-k)),

where ξ0 and ξ1I.

For the values of n0 and n1 used in the formulas below

3.4.4 h|Rn,t|hn+1(cn|f(n+2)(ξ1)|+1n+1|f(n+1)(ξ0)|),
n0<t<n1,

where cn is defined by (3.3.12), with numerical values as in §3.3(ii).

Two-Point Formula

3.4.5 hft=-f0+f1+hR1,t,
0<t<1.

Three-Point Formula

3.4.6 hft=-12(1-2t)f-1-2tf0+12(1+2t)f1+hR2,t,
|t|<1.

Four-Point Formula

3.4.7 hft=k=-12Bk3fk+hR3,t,
-1<t<2,
3.4.8 B-13 =-16(2-6t+3t2),
B03 =-12(1+4t-3t2),
B13 =12(2+2t-3t2),
B23 =-16(1-3t2).

Five-Point Formula

3.4.9 hft=k=-22Bk4fk+hR4,t,
|t|<2,
3.4.10 B-24 =112(1-t-3t2+2t3),
B-14 =-16(4-8t-3t2+4t3),
B04 =-12t(5-2t2),
B14 =16(4+8t-3t2-4t3),
B24 =-112(1+t-3t2-2t3).

Six-Point Formula

3.4.11 hft=k=-23Bk5fk+hR5,t,
-2<t<3,
3.4.12 B-25 =1120(6-10t-15t2+20t3-5t4),
B-15 =-124(12-32t+3t2+16t3-5t4),
B05 =-112(4+30t-15t2-12t3+5t4),
B15 =112(12+16t-21t2-8t3+5t4),
B25 =-124(6+2t-21t2-4t3+5t4),
B35 =1120(4-15t2+5t4).

Seven-Point Formula

3.4.13 hft=k=-33Bk6fk+hR6,t,
|t|<3,
3.4.14 B-36 =-1720(12-8t-45t2+20t3+15t4-6t5),
B-26 =160(9-9t-30t2+20t3+5t4-3t5),
B-16 =-148(36-72t-39t2+52t3+5t4-6t5),
B06 =-118t(49-28t2+3t4),
B16 =148(36+72t-39t2-52t3+5t4+6t5),
B26 =-160(9+9t-30t2-20t3+5t4+3t5),
B36 =1720(12+8t-45t2-20t3+15t4+6t5).

Eight-Point Formula

3.4.15 hft=k=-34Bk7fk+hR7,t,
-3<t<4,
3.4.16 B-37 =-15040(48-56t-168t2+140t3+35t4-42t5+7t6),
B-27 =1720(72-108t-213t2+240t3-10t4-36t5+7t6),
B-17 =-1240(144-360t-48t2+260t3-45t4-30t5+7t6),
B07 =-1144(36+392t-147t2-224t3+70t4+24t5-7t6),
B17 =1144(144+216t-264t2-156t3+85t4+18t5-7t6),
B27 =-1240(72+36t-267t2-80t3+90t4+12t5-7t6),
B37 =1720(48+8t-192t2-20t3+85t4+6t5-7t6),
B47 =-15040(36-147t2+70t4-7t6).

For corresponding formulas for second, third, and fourth derivatives, with t=0, see Collatz (1960, Table III, pp. 538–539). For formulas for derivatives with equally-spaced real nodes and based on Sinc approximations (§3.3(vi)), see Stenger (1993, §3.5).

§3.4(ii) Analytic Functions

If f can be extended analytically into the complex plane, then from Cauchy’s integral formula (§1.9(iii))

3.4.17 1k!f(k)(x0)=12πiCf(ζ)(ζ-x0)k+1dζ,

where C is a simple closed contour described in the positive rotational sense such that C and its interior lie in the domain of analyticity of f, and x0 is interior to C. Taking C to be a circle of radius r centered at x0, we obtain

3.4.18 1k!f(k)(x0)=12πrk02πf(x0+reiθ)e-ikθdθ.

The integral on the right-hand side can be approximated by the composite trapezoidal rule (3.5.2).

Example

f(z)=ez, x0=0. The integral (3.4.18) becomes

3.4.19 1k!=12πrk02πercosθcos(rsinθ-kθ)dθ.

With the choice r=k (which is crucial when k is large because of numerical cancellation) the integrand equals ek at the dominant points θ=0,2π, and in combination with the factor k-k in front of the integral sign this gives a rough approximation to 1/k!. The choice r=k is motivated by saddle-point analysis; see §2.4(iv) or examples in §3.5(ix). As explained in §§3.5(i) and 3.5(ix) the composite trapezoidal rule can be very efficient for computing integrals with analytic periodic integrands.

§3.4(iii) Partial Derivatives

First-Order

For partial derivatives we use the notation ut,s=u(x0+th,y0+sh).

3.4.20 u0,0x=12h(u1,0-u-1,0)+O(h2),
3.4.21 u0,0x=14h(u1,1-u-1,1+u1,-1-u-1,-1)+O(h2).

Second-Order

3.4.22 2u0,0x2=1h2(u1,0-2u0,0+u-1,0)+O(h2),
3.4.23 2u0,0x2=112h2(-u2,0+16u1,0-30u0,0+16u-1,0-u-2,0)+O(h4),
3.4.24 2u0,0x2=13h2(u1,1-2u0,1+u-1,1+u1,0-2u0,0+u-1,0+u1,-1-2u0,-1+u-1,-1)+O(h2).
3.4.25 2u0,0xy=14h2(u1,1-u1,-1-u-1,1+u-1,-1)+O(h2),
3.4.26 2u0,0xy=-12h2(u1,0+u-1,0+u0,1+u0,-1-2u0,0-u1,1-u-1,-1)+O(h2).

Laplacian

3.4.27 2u =2ux2+2uy2.
3.4.28 2u0,0 =1h2(u1,0+u0,1+u-1,0+u0,-1-4u0,0)+O(h2),
3.4.29 2u0,0=112h2(-60u0,0+16(u1,0+u0,1+u-1,0+u0,-1)-(u2,0+u0,2+u-2,0+u0,-2))+O(h4).

Fourth-Order

3.4.30 4u0,0x4 =1h4(u2,0-4u1,0+6u0,0-4u-1,0+u-2,0)+O(h2).
3.4.31 4u0,02x2y =1h4(u1,1+u-1,1+u1,-1+u-1,-1-2u1,0-2u-1,0-2u0,1-2u0,-1+4u0,0)+O(h2).

Biharmonic Operator

3.4.32 4u=4ux4+24u2x2y+4uy4.
3.4.33 4u0,0=1h4(20u0,0-8(u1,0+u0,1+u-1,0+u0,-1)+2(u1,1+u1,-1+u-1,1+u-1,-1)+(u0,2+u2,0+u-2,0+u0,-2))+O(h2),
3.4.34 4u0,0=16h4(184u0,0-(u0,3+u0,-3+u3,0+u-3,0)+14(u0,2+u0,-2+u2,0+u-2,0)-77(u0,1+u0,-1+u1,0+u-1,0)+20(u1,1+u1,-1+u-1,1+u-1,-1)-(u1,2+u2,1+u1,-2+u2,-1+u-1,2+u-2,1+u-1,-2+u-2,-1))+O(h4).

The results in this subsection for the partial derivatives follow from Panow (1955, Table 10). Those for the Laplacian and the biharmonic operator follow from the formulas for the partial derivatives.

For additional formulas involving values of 2u and 4u on square, triangular, and cubic grids, see Collatz (1960, Table VI, pp. 542–546).