Skip to content
GATEiit

GATE AE, CE, NM · Numerical Methods

Basic Numerical Differentiation

Basic numerical differentiation from Taylor expansions: forward, backward and central finite differences, O(h) vs O(h²) truncation error, second-derivative stencils and step-size round-off trade-offs.

Before you start

  • Limits, continuity and differentiability →

    Finite differences approximate derivative limits using finite grid spacing h.

  • Taylor series expansion

    Expanding f(x₀ ± h) in Taylor powers reveals whether a stencil cancels O(h) error to achieve O(h²).

This topic comes before: Numerical Error Analysis and Finite-Difference Methods, Interpolation (Linear, Lagrange and Newton Polynomials), Numerical Integration (Trapezoidal and Simpson's Rules), Numerical Solution of ODEs (Euler, Heun and Runge–Kutta Methods)

Concept notes

1. Deriving forward, backward and central difference stencils from Taylor series

Expanding f(x0±h) about x0: f(x0+h)=f(x0)+hf′(x0)+h22f′′(x0)+h36f′′′(x0)+⋯ f(x0−h)=f(x0)−hf′(x0)+h22f′′(x0)−h36f′′′(x0)+⋯

From these two expansions follow all three standard first-derivative formulas:

  • Forward difference (O(h) accurate): f′(x0)≈f(x0+h)−f(x0)h, error ≈−h2f′′(ξ).
  • Backward difference (O(h) accurate): f′(x0)≈f(x0)−f(x0−h)h, error ≈+h2f′′(ξ).
  • Central difference (O(h2) accurate): subtracting the two Taylor series cancels all even powers (h2), leaving f′(x0)≈f(x0+h)−f(x0−h)2h,truncation error=−h26f′′′(ξ).
xf(x)x₀ − hx₀x₀ + hCentral chord O(h²) mirrors tangent at x₀ better than forward O(h)
The symmetric central chord (dashed) eliminates the quadratic error term, matching the tangent slope to O(h²) vs O(h) for forward differences.

2. Second derivative and one-sided 3-point O(h²) formulas

Adding f(x0+h)+f(x0−h) cancels odd terms (h,h3), yielding the standard central second-derivative stencil (used in CFD/heat finite-difference grids): f′′(x0)≈f(x0+h)−2f(x0)+f(x0−h)h2,error=−h212f(4)(ξ). Notice it is exact for any polynomial up to degree 3 (f(4)=0).

At boundaries where x0−h is outside the mesh, a 3-point forward O(h2) formula combines x0,x0+h,x0+2h: f′(x0)≈−3f(x0)+4f(x0+h)−f(x0+2h)2h.

3. Truncation vs round-off error and Richardson extrapolation

  • Halving step h→h/2: forward/backward error drops by 2× (O(h)), while central-difference error drops by 4× (O(h2)).
  • Total error trade-off: dividing by h amplifies machine round-off error ε like O(ε/h), so decreasing h too far makes round-off dominate truncation.
  • Richardson extrapolation: if formula D(h) has error ch2+O(h4), combining D(h) and D(h/2) cancels the h2 term completely: f′(x0)≈4D(h/2)−D(h)3+O(h4).

Formulas to remember

Forward & backward differenceBoth O(h); exact for linear polynomials
D+f=f(x0+h)−f(x0)h,D−f=f(x0)−f(x0−h)h
Central first derivativeO(h²); exact for quadratics (deg ≤ 2)
D0f=f(x0+h)−f(x0−h)2h
Central second derivativeO(h²); exact for cubics (deg ≤ 3)
f′′(x0)≈f(x0+h)−2f(x0)+f(x0−h)h2
Central error bounds
∣Ecent′(h)∣≤h26max⁡∣f′′′∣,∣Ecent′′(h)∣≤h212max⁡∣f(4)∣
One-sided 3-point O(h²)
f′(x0)≈−3f(x0)+4f(x0+h)−f(x0+2h)2h
Richardson extrapolation (O(h²)→O(h⁴))
DRich=4D(h/2)−D(h)3

Common mistakes

  • Dividing central first difference f(x0+h)−f(x0−h)2h by h instead of 2h.
  • Dividing central second difference by 2h2 or h instead of h2.
  • Forgetting that central first difference is exact for quadratics (O(h2), proportional to f′′′), while central second difference is exact up to cubics (O(h2), proportional to f(4)).
  • Assuming smaller h always improves numerical accuracy in floating-point arithmetic: round-off blows up as O(ε/h) or O(ε/h2).
  • Using 4D(h/2)−D(h)3 on an O(h) forward difference (Richardson for O(h) uses 2D(h/2)−D(h)1=2D(h/2)−D(h)).

Worked examples

Try each step yourself, then reveal the working.

Example 1: Forward, backward and central approximations compared

numerical

For f(x)=x3 at x0=2 with h=0.5, compute forward, backward and central approximations to f′(2) and compare with exact f′(2)=12.

  1. Step 1: Evaluate f at x = 1.5, 2.0, 2.5.

    Try it on paper first.

Example 2: Computing second derivative from equally spaced wind-tunnel data

numerical

Given f(1.0)=2.00, f(1.2)=2.64, f(1.4)=3.52, estimate f′′(1.2) using the central second-difference formula.

  1. Step 1: Identify step size h = 0.2.

    Try it on paper first.

Example 3: Improving an O(h²) derivative estimate with Richardson extrapolation

numerical

For f(x)=ex at x0=0, central difference gives D(0.2)=1.006680 and D(0.1)=1.001668. Apply Richardson extrapolation.

  1. Step 1: Choose Richardson weights for an O(h²) central difference.

    Try it on paper first.

Example 4: Determining stencil coefficients using Taylor matching

conceptual

Show why f′(x0)≈−3f(x0)+4f(x0+h)−f(x0+2h)2h achieves O(h2) accuracy.

  1. Step 1: Expand f(x₀+h) and f(x₀+2h).

    Try it on paper first.

Previous year questions

No official PYQ in our currently live papers is tagged with this exact topic yet. The topic test below uses original GATE-style questions.

Topic test

8 questions: original practice questions, with GATE marking (MCQ wrong answers lose marks). Score 60% or more to pass. A new set is drawn each time.

Mark as mastered

Loading your progress…

My revision notes

Notes written by the GATEiit team against the official GATE Engineering Mathematics (AE, CE, NM) syllabus; being checked by a reviewer. Updated 2026-12-04. Spotted a mistake? Use Report an issue on any question, or contact us.