Why this step? Subtract f(x) and divide by h — exactly what the formula does.
hf(x+h)−f(x)=f′(x)+2hf′′(x)+6h2f′′′(x)+⋯
So
D+f(x)−f′(x)=2hf′′(x)+O(h2)=O(h).Why this matters: the leading error is ∝h → first order accurate. The exact remainder (Lagrange form) is 2hf′′(ξ) for some ξ∈(x,x+h).
Write both expansions:
f(x+h)=f(x)+hf′+2h2f′′+6h3f′′′+⋯f(x−h)=f(x)−hf′+2h2f′′−6h3f′′′+⋯Why subtract? The even-power terms (f, f′′) cancel, leaving only odd ones:
f(x+h)−f(x−h)=2hf′(x)+3h3f′′′(x)+⋯
Divide by 2h:
D0f(x)−f′(x)=6h2f′′′(x)+O(h4)=O(h2).Why this matters: the cancellation kills the O(h) term → second order. Halving h cuts truncation error by ~4.
The machine doesn't store f(x) exactly; it stores f~(x)=f(x)+δ, where ∣δ∣≤εm∣f(x)∣ and εm≈2.2×10−16 (double precision machine epsilon).
For the central formula, the computed numerator carries error up to 2ε where ε=εm∣f∣, so:
εround≲2h2ε=hε.Why 1/h? We divide a roundoff that does not shrink by a tiny h → it blows up. This is catastrophic cancellation: f(x+h) and f(x−h) are almost equal, so subtracting loses significant digits.
Why differentiate? The minimum of E(h) is where E′(h)=0.
E′(h)=3hM3−h2ε=0⇒h3=M33εhopt=(M33ε)1/3∼ε1/3≈6×10−6
At that point E∼ε2/3≈10−11 — not machine precision! For forward difference you get hopt∼ε1/2≈10−8, E∼ε1/2.
Imagine measuring a hill's steepness by walking two steps apart and seeing how much higher you got. Big steps give a rough answer (you miss the hill's curve) — that's truncation error. Tiny steps should be perfect... but your ruler can only read so many digits, so when the two heights are almost the same, the tiny difference is mostly measurement junk — that's rounding error. There's a "just right" step size, not too big, not too small. Stepping across your point (one ahead, one behind) is cleverer than only stepping forward, because the errors on each side cancel.
Dekho, jab hum derivative f′(x) ko computer pe nikalte hain, toh limit nahi le sakte — bas ek chhota h daal dete hain. Isse do tarah ke error aate hain. Pehla, truncation error: humne Taylor series ki tail kaat di, isliye answer thoda galat. Forward difference mein yeh error O(h) hota hai, lekin central difference mein f(x+h) aur f(x−h) ko subtract karne se even terms (f, f′′) cancel ho jaate hain, aur error O(h2) ban jaata hai — yaani bahut accurate. Yaad rakho: "Forward is First, Central Catches Curvature."
Dusra enemy hai rounding error. Computer har number ko sirf 16 digit tak store karta hai (machine epsilon ε≈10−16). Jab h bahut chhota ho jaata hai, toh f(x+h) aur f(x−h) almost barabar ho jaate hain — unko subtract karne pe significant digits gayab ho jaate hain. Isko catastrophic cancellation kehte hain, aur yeh error ε/h ki tarah badhta hai jaise h→0.
Toh dono ko jodo: total error E(h)=6h2M3+hε. Yeh ek U-shape banata hai. Bahut bada h → truncation zyada; bahut chhota h → rounding zyada. Beech mein ek sweet spot hai, hopt∼ε1/3≈6×10−6. Galti yeh hai ki students sochte hain "h jitna chhota utna achha" — yeh galat hai! Us point ke baad answer kharab hone lagta hai. Isliye sahi h choose karna ek skill hai, aur Richardson extrapolation jaise tricks se hum accuracy aur badha sakte hain.