Skip to content
GATEiit

GATE ME, CE, IN, CH, XE + 8 more · Numerical Methods

Numerical Solution of ODEs (Euler, Heun and Runge–Kutta Methods)

Single-step and multi-step numerical integration of initial value problems: Forward/Backward Euler, Modified Euler (Heun), RK-2 and RK-4 methods, truncation errors, and step-size stability.

Before you start

Concept notes

1. Forward Euler, Backward Euler and Modified Euler (Heun's Method)

Given the initial value problem y′=f(x,y) with y(x0)=y0 and uniform step size h=xn+1−xn:

  1. Forward (Explicit) Euler: Uses only the slope at the start of the interval: yn+1=yn+hf(xn,yn) Simple (1 evaluation per step) with local truncation error O(h2) and global error O(h) (first-order accurate).
  2. Backward (Implicit) Euler: Evaluates slope at the unknown endpoint (xn+1,yn+1): yn+1=yn+hf(xn+1,yn+1) This requires solving an equation at each step, yet stays unconditionally stable for decaying modes.
  3. Modified Euler / Heun's Method (Predictor–Corrector RK-2): Predicts yn+1∗=yn+hk1 with k1=f(xn,yn), computes k2=f(xn+h,yn+1∗), and averages both endpoint slopes: yn+1=yn+h2(k1+k2) Because averaging trapezoidal slopes cancels the h2 term, Heun's method achieves local error O(h3) and global error O(h2).
x y Exact y(x) x₀ x₀ + h Euler (slope k₁ = f(x₀,y₀)) Heun RK-2: average (k₁ + k₂)/2 O(h²) local error
Forward Euler follows only the initial tangent k₁ and drifts off curved solutions, while Heun's RK-2 averages initial and predicted endpoint slopes.

2. Runge–Kutta Second-Order (RK-2) and Classical Fourth-Order (RK-4)

Runge–Kutta methods achieve higher-order Taylor accuracy using extra slope evaluations inside [xn,xn+h] instead of computing analytical partial derivatives of f(x,y).

  • Midpoint RK-2: Evaluates k1=f(xn,yn), k2=f(xn+h2, yn+h2k1), and updates yn+1=yn+hk2. Global order: O(h2).
  • Classical RK-4 (Simpson-weighted slopes): k1=f(xn,yn),k2=f ⁣(xn+h2, yn+h2k1) k3=f ⁣(xn+h2, yn+h2k2),k4=f(xn+h, yn+hk3) yn+1=yn+h6(k1+2k2+2k3+k4) When f(x,y)=f(x) depends only on x, k2=k3 and RK-4 reduces directly to Simpson's 1/3 rule on [xn,xn+h], giving local truncation error O(h5) and global error O(h4).

3. Truncation Error Orders and Step-Size Stability Analysis

Always distinguish local truncation error (LTE) (one step from exact yn) from global accumulated error across N=(b−a)/h∝1/h steps (always one power of h lower):

Method Function evals / step Local error (1 step) Global order
Forward / Backward Euler 1 O(h2) O(h) (order 1)
Heun / Midpoint (RK-2) 2 O(h3) O(h2) (order 2)
Classical RK-4 4 O(h5) O(h4) (order 4)

Linear stability on test ODE y′=λy (λ<0):

  • Forward Euler: yn+1=(1+hλ)yn. Boundedness ∣1+hλ∣≤1 requires −2≤hλ≤0, i.e., 0<h<2∣λ∣. Exceeding 2∣λ∣ produces growing sign-alternating oscillations.
  • Backward Euler: yn+1=11−hλyn. Since ∣1/(1−hλ)∣<1 for every h>0 when λ<0, it is A-stable (unconditionally stable).

4. Multi-Step Predictor–Corrector Methods and Higher-Order Systems

Multi-step methods reuse previously computed points (xn−1,fn−1),(xn−2,fn−2) instead of internal midpoints, cutting evaluations to 1–2 per step after startup:

  • Adams–Bashforth (explicit predictor) integrates an interpolating polynomial through past slopes fn,fn−1,…; for 2-step AB-2: yn+1=yn+h2(3fn−fn−1).
  • Adams–Moulton (implicit corrector) includes fn+1; Milne's and Adams–Bashforth–Moulton PECE schemes pair an explicit predictor with an implicit corrector.

Higher-order ODEs: Reduce an n-th order ODE like y′′+ay′+by=g(x) to a first-order system by setting y1=y, y2=y′:

and apply Euler or RK-4 simultaneously to the vector (y1,y2)T at every k1,k2,k3,k4 stage.

Formulas to remember

Forward Euler methodLocal error O(h2), global error O(h).
yn+1=yn+hf(xn,yn)
Backward Euler (implicit)Unconditionally stable for Re⁡(λ)≤0.
yn+1=yn+hf(xn+1,yn+1)
Heun / Modified Euler (RK-2)
yn+1=yn+h2[f(xn,yn)+f(xn+h,yn+hf(xn,yn))]
Midpoint RK-2
yn+1=yn+hf ⁣(xn+h2,  yn+h2f(xn,yn))
Classical RK-4 updateGlobal error O(h4) (4 slopes per step).
yn+1=yn+h6(k1+2k2+2k3+k4)
Forward Euler stability limit
∣1+hλ∣≤1  ⟹  h≤2∣λ∣(λ<0)
2-step Adams–BashforthRequires RK-2/RK-4 for the first starting step.
yn+1=yn+h2(3fn−fn−1)

Common mistakes

  • Confusing local truncation error with global truncation error: RK-4 has local error O(h5) over a single step, but global error O(h4) across a fixed interval [a,b].
  • Using yn instead of updated midpoint/predicted values when evaluating k2,k3,k4 in RK-4 or Heun's method.
  • Assuming Backward Euler is higher order than Forward Euler because it is unconditionally stable, both Euler methods have global order O(h).
  • Forgetting that for systems of coupled ODEs (u1′=f1,u2′=f2), all k1 values must be computed before any k2 value is evaluated.
  • Ignoring stiff decay modes (λ<0 large): choosing h>2/∣λ∣ in Forward Euler causes immediate numerical blow-up even on an exponentially decaying true solution.

Worked examples

Try each step yourself, then reveal the working.

Example 1: Two steps of Forward Euler on a first-order IVP

numerical

Given dydx=x+y with y(0)=1, use Forward Euler with step size h=0.2 to approximate y(0.4).

  1. Step 1: Compute step 1 from x = 0 to x = 0.2

    Try it on paper first.

Example 2: Single step of classical RK-4 with exact decimal verification

numerical

Use one step of classical fourth-order Runge–Kutta (RK-4) with h=0.2 to approximate y(0.2) for dydx=−2xy, y(0)=1.

  1. Step 1: Evaluate the four intermediate slopes k1, k2, k3, k4

    Try it on paper first.

Example 3: Modified Euler (Heun's method) single-step estimate

numerical

Approximate y(0.2) using Modified Euler (Heun's method) with h=0.2 for dydx=y−x, y(0)=2.

  1. Step 1: Predict y* at x = 0.2 with Euler slope

    Try it on paper first.

Example 4: Maximum stable step size for Forward Euler vs Backward Euler

conceptual

Consider the stiff decay ODE y′=−50y with y(0)=1. For what range of positive step size h does Forward Euler remain non-explosive, and how does Backward Euler behave for h=0.1?

  1. Step 1: Apply Forward Euler amplification factor criterion

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