Skip to main content

Second derivative central difference scheme

Short answer

Central formula: (f_{i+1}−2f_i+f_{i-1})/h², order O(h²). For f=x⁴ at x=1.2, exact f''=17.28. With h=0.2: 17.36; with h=0.1: 17.30. Error reduces fourfold on halving h, confirming second-order accuracy.

Derive the central difference formula for the second derivative d2f/dx2d^2f/dx^2 and state its order. For f(x)=x4f(x)=x^4, estimate f′′(1.2)f''(1.2) using h=0.2h=0.2 and h=0.1h=0.1, and compare with the exact value.

Derivation

Add the Taylor series of fi+1f_{i+1} and fi−1f_{i-1}:

fi+1+fi−1=2fi+h2fi′′+h412fi′′′′+⋯f_{i+1}+f_{i-1}=2f_i+h^2f''_i+\frac{h^4}{12}f''''_i+\cdots

Solve for fi′′f''_i:

fi′′≈fi+1−2fi+fi−1h2,error=−h212fi′′′′=O(h2)\boxed{f''_i\approx\frac{f_{i+1}-2f_i+f_{i-1}}{h^2}},\qquad \text{error}=-\frac{h^2}{12}f''''_i=O(h^2)

It is second-order accurate, and it uses three points (stencil i−1, i, i+1i-1,\ i,\ i+1). It is the basic formula for diffusion terms.

Numerical for f=x4f=x^4 at x=1.2x=1.2

Exact: f′′=12x2=12×1.44=17.28f''=12x^2=12\times1.44=17.28.

h = 0.2: f(1.0)=1.0f(1.0)=1.0, f(1.2)=2.0736f(1.2)=2.0736, f(1.4)=3.8416f(1.4)=3.8416

f′′≈1.0−2(2.0736)+3.84160.22=0.69440.04=17.36f''\approx\frac{1.0-2(2.0736)+3.8416}{0.2^2}=\frac{0.6944}{0.04}=17.36

h = 0.1: f(1.1)=1.4641f(1.1)=1.4641, f(1.3)=2.8561f(1.3)=2.8561

f′′≈1.4641−2(2.0736)+2.85610.01=0.1730.01=17.30f''\approx\frac{1.4641-2(2.0736)+2.8561}{0.01}=\frac{0.173}{0.01}=17.30
hhEstimateError
0.217.36+0.08
0.117.30+0.02
exact17.280

The error falls by a factor of 4 when hh is halved, confirming second-order accuracy. It also matches theory: h212f′′′′=0.0412×24=0.08\dfrac{h^2}{12}f''''=\dfrac{0.04}{12}\times24=0.08 for h=0.2h=0.2.

Answer: f′′(1.2)≈17.36f''(1.2)\approx17.36 (h=0.2h=0.2) and 17.3017.30 (h=0.1h=0.1); exact 17.28.

✓ Answer checked by Claude Opus 5.5 (high effort)

All Applied Computational Fluid Dynamics chapter 3 questions →