Skip to content
GATEiit

GATE CE, CH, RA, ES · Numerical Methods

Numerical Error Analysis and Finite-Difference Methods

Absolute, relative, round-off and truncation errors, first-order error propagation, finite-difference operators (Δ, ∇, E), derivative stencils, and 2D Laplace 5-point discretization.

Syllabus scope: Covers round-off vs truncation errors (CE, ES), finite-difference stencils (RA), and explicit/Crank–Nicolson PDE grids (CH).

Before you start

Concept notes

1. Round-Off Error, Truncation Error and Error Propagation

If x∗ approximates true x: absolute error Ea=∣x−x∗∣ and relative error Er=∣x−x∗∣∣x∣ (x≠0). Two fundamentally different error sources trade off against each other:

  • Truncation error: Replacing an infinite limit or series by finitely many terms; shrinks as step size h→0 (e.g. O(h) or O(h2)).
  • Round-off error: Finite floating-point mantissa storage (≈10−16 in IEEE double, 0.5×10−k when rounded to k decimal places). Dividing by tiny h amplifies subtraction round-off like ε/h, so excessively small h increases total error.

First-order error propagation: For f(x1,…,xm) with small independent input errors Δxi, the worst-case output error bound is:

∣Δf∣≤∑i=1m∣∂f∂xi∣∣Δxi∣ For products/powers f=Cx1ax2b, relative errors add weighted by exponents: ∣Δff∣≤∣a∣∣Δx1x1∣+∣b∣∣Δx2x2∣. The condition number κ(x)=∣xf′(x)f(x)∣ measures relative sensitivity.

5-Point Laplace Stencil u(i,j) u(i-1,j) u(i+1,j) u(i,j+1) u(i,j-1) Error vs Step Size h h Err Optimal h* Truncation O(hᵖ) Round-off ∝ ε/h
Left: 5-point Laplace finite-difference stencil averaging 4 grid neighbours. Right: Total error achieves a minimum at optimal h* balancing truncation and round-off.

2. Finite-Difference Operators: Forward, Backward, Central and Shift

For equally spaced nodes xi=x0+ih with yi=f(xi):

  • Forward difference: Δyi=yi+1−yi, Δ2yi=Δyi+1−Δyi=yi+2−2yi+1+yi.
  • Backward difference: ∇yi=yi−yi−1.
  • Central difference: δyi=yi+1/2−yi−1/2.
  • Shift operator E: Eyi=yi+1, Ekyi=yi+k.

Exact algebraic identities: E=1+Δ,∇=1−E−1=ΔE−1,E=ehD where D=ddx. Because the n-th forward difference of a degree-n polynomial anxn+… is constant, Δn(anxn+… )=n! anhn, and every higher difference Δn+1pn(x)≡0 vanishes identically.

3. Finite-Difference Stencils for Derivatives and Order of Accuracy

Subtracting Taylor series around xi yields standard derivative approximations and their exact leading error:

Derivative Formula Accuracy Order
Forward f′(xi) (fi+1−fi)/h O(h)
Backward f′(xi) (fi−fi−1)/h O(h)
Central f′(xi) (fi+1−fi−1)/(2h) O(h2)
Central f′′(xi) (fi+1−2fi+fi−1)/h2 O(h2)

Because the odd powers of h cancel between f(xi+h) and f(xi−h), central differences jump to O(h2) while costing only two function evaluations.

4. Discretizing 1D BVPs and 2D Elliptic PDEs (5-Point Stencil)

Replacing differential operators at interior grid points turns ODE boundary value problems and elliptic PDEs into sparse linear systems Au=b:

  • 1D ODE BVP: y′′+p(x)y′+q(x)y=r(x) at xi becomes: yi+1−2yi+yi−1h2+p(xi)yi+1−yi−12h+q(xi)yi=r(xi) which yields a tridiagonal linear system once known boundary values y0,yN are moved to the RHS.
  • 2D Laplace Equation (uxx+uyy=0) on a square grid (Δx=Δy=h): Summing central second differences in x and y gives the 5-point stencil: ui+1,j−2ui,j+ui−1,jh2+ui,j+1−2ui,j+ui,j−1h2=0  ⟹  ui,j=ui+1,j+ui−1,j+ui,j+1+ui,j−14 Each interior value equals the exact average of its four nearest neighbours.

Formulas to remember

Absolute and relative error
Ea=∣x−x∗∣,Er=∣x−x∗∣∣x∣
Error propagation bound
∣Δf∣≤∑i=1m∣∂f∂xi∣∣Δxi∣
Shift and difference operators
Δ=E−1,∇=1−E−1,E=ehD
n-th difference of polynomial
Δn(anxn+⋯+a0)=n! anhn,Δn+1pn(x)=0
Central first derivative
f′(xi)=fi+1−fi−12h+O(h2)
Central second derivative
f′′(xi)=fi+1−2fi+fi−1h2+O(h2)
Condition number
κ(x)=∣xf′(x)f(x)∣
2D Laplace 5-point stencilValid on uniform grids Δx=Δy=h.
ui,j=14(ui+1,j+ui−1,j+ui,j+1+ui,j−1)

Common mistakes

  • Subtracting relative error bounds instead of adding their absolute magnitudes when variables appear in denominators such as R=V/I or g=4π2L/T2.
  • Shrinking step size h blindly assuming error always decreases: dividing by very small h triggers floating-point subtraction loss (catastrophic cancellation).
  • Confusing O(h) forward difference fi+1−fih with O(h2) central difference fi+1−fi−12h.
  • Using h instead of h2 in the denominator of f′′(xi)≈fi+1−2fi+fi−1h2.
  • Forgetting to include boundary nodes directly inside the 5-point average when writing the sparse equations for interior PDE grid nodes.

Worked examples

Try each step yourself, then reveal the working.

Example 1: Maximum percentage error propagation in cylinder volume

numerical

The volume of a cylinder is V=πr2h. If measured radius r and height h carry maximum relative errors of 1% and 2% respectively, find the maximum possible percentage error in V.

  1. Step 1: Take logarithmic differential of V

    Try it on paper first.

Example 2: Forward difference table and degree detection

numerical

Tabulate the forward differences Δy and Δ2y for f(x)=x2 at x=1,2,3,4, and verify the constant-difference formula n! anhn.

  1. Step 1: Compute y values and first differences

    Try it on paper first.

Example 3: Solving 2D Laplace equation on a grid with 5-point stencil

numerical

Solve ∇2u=0 on a grid with two interior nodes u1,u2 along a horizontal line: top and bottom boundaries are 0, left boundary is 100, and right boundary is 20. Find u1 and u2.

  1. Step 1: Write 5-point average equations for both interior nodes

    Try it on paper first.

Example 4: Discretizing a 1D boundary value ODE with central differences

numerical

Approximate y(0.5) for the boundary value problem y′′(x)=−2 with y(0)=0 and y(1)=0 using central differences and step size h=0.5.

  1. Step 1: Identify the grid and single interior unknown

    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 (CE, CH, RA, ES) syllabus; being checked by a reviewer. Updated 2026-12-01. Spotted a mistake? Use Report an issue on any question, or contact us.