4.8.13 · D5Numerical Methods

Question bank — Numerical differentiation — forward, backward, central differences

1,382 words6 min readBack to topic

True or false — justify

Central difference is always more accurate than forward difference for the same .
False in general. Its truncation error is one order smaller ( vs ), so it wins for smooth and moderate ; but if is huge or is in the roundoff-dominated regime, the ordering can break.
The central formula uses the value itself.
False. Central first-derivative uses only the two neighbours; the midpoint value cancels out. The central second derivative does use .
Halving roughly quarters the error of the central first-derivative formula.
True. Its leading error is , and , so the truncation error drops by about — provided you haven't hit the roundoff floor.
Forward and backward differences have the same order of accuracy.
True. Both are ; their leading error terms are and — same magnitude, opposite sign. That opposite sign is exactly why averaging them gives central.
The second-derivative formula is because it divides by .
False. Order comes from the surviving Taylor term, not the denominator. Adding the expansions kills and , leaving an error → .
If is a straight line, all three first-derivative formulas give the exact slope.
True. For a linear , , so every error term vanishes; each formula returns the exact constant slope regardless of .
Making smaller can make the answer worse.
True. Below a certain , the numerator subtracts nearly equal numbers → catastrophic cancellation, and roundoff error grows. Total error has a minimum at finite .
Central difference works fine right at the first row of a data table.
False. It needs both and . At the first row the left neighbour is missing, so you must fall back to forward difference (or a one-sided higher-order formula).

Spot the error

A student writes central difference as . What's wrong?
The span from to has width , not . Dividing by instead of doubles the answer.
A student computes forward difference with the point behind: and calls it forward.
That is the backward difference. Forward looks ahead using ; this one looks behind.
To get , a student subtracts the two Taylor expansions instead of adding. What breaks?
Subtracting cancels the even terms ( dies), leaving — that gives you the first derivative. You must add to keep the even term.
A student claims the forward-difference error is . Fix it.
The error is , first power of (that's why it's ). The belongs to the central first-derivative error, which carries , not .
Someone reads "" as "the error equals ". Why is that wrong?
means the error is proportional to up to a constant times a derivative of ; the actual size is . See Truncation error and Big-O.
A student uses in double precision "to be safe" and gets garbage. Diagnose.
At that , and agree to ~15 digits, so their difference is nearly all roundoff. The term explodes. See Roundoff error and floating point.

Why questions

Why do the two Taylor expansions cancel the term when we subtract them?
In the even-power terms keep the same sign as in , so subtracting removes them, while odd-power terms (, ) flip sign and reinforce. Even ↔ symmetric, odd ↔ antisymmetric.
Why is central difference "one extra order of accuracy for free"?
The symmetry does the work: by sampling equally on both sides, the leading curvature error from the two sides is equal and opposite and cancels, so the first surviving term is — no extra function evaluations needed.
Why can't a computer just take like the limit definition demands?
A machine stores only finite floating-point numbers with a smallest gap ; there are no infinitesimals. Beyond some tiny , subtraction loses all significant digits.
Why does the optimal for central difference scale like ?
Total error ; minimising the sum (balancing a rising against a falling ) sets the derivative to zero, giving .
Why prefer central difference at interior table points but not at the edges?
Interior points have both neighbours available, so central gives for free; edges lack one neighbour, forcing a one-sided () formula unless you reach further in for a higher-order stencil.
Why does adding the expansions leave a denominator for but for ?
The surviving term after adding is , so you divide by to isolate ; after subtracting the surviving term is , so you divide by . The denominator just matches whatever power of multiplies the target derivative.
Why is Richardson extrapolation a natural next step after central differences?
Because the error is a clean power series in , combining results at and can algebraically cancel the leading term, boosting accuracy to without new derivatives.

Edge cases

What does the central second-derivative formula give if is exactly a parabola?
The exact , for any . All terms from onward are zero for a quadratic, so no truncation error remains.
You only have a data table (no formula) — can you still choose small for accuracy?
No. is fixed by the table's spacing; you cannot sample between rows. You can only choose which stencil (forward/central) and whether to interpolate first.
Node spacing in your table is uneven ( with ). Does the standard central formula still hold?
No — the clean cancellation assumed symmetric spacing. Unequal spacing needs a general finite-difference weight derivation, and the naive formula loses an order.
What happens to forward difference at a kink (point where is discontinuous)?
Taylor's theorem needs smooth enough; at a kink the expansion is invalid, so the error estimates break and the formula silently returns a slope that averages across the corner.
If is constant, what does each formula return?
Exactly for the first derivative and for the second — all differences of equal values vanish, matching the true zero derivative for any .
At so large that leaves the region where is smooth, is central still "best"?
Not necessarily. The label only describes the leading term as ; for large higher-order terms dominate and the accuracy comparison is no longer guaranteed.
Can the second-derivative formula ever give a negative value where the true is positive?
Yes — near the roundoff floor, cancellation noise in can flip the tiny result's sign entirely, a classic symptom of being too small.

Connections

  • Taylor series — the source of every cancellation argument above.
  • Truncation error and Big-O — what vs actually claims.
  • Roundoff error and floating point — the floor behind the "smaller isn't better" traps.
  • Richardson extrapolation — exploits the error structure asked about above.
  • Finite difference methods for PDEs — where uneven grids and edge stencils really bite.