Skip to main content
Numerical analysis
Lesson 44 of 75
Challenge

Numerical ODEs

Objective. Compare Euler and Runge-Kutta methods.

  1. 1. Learn
  2. 2. Worked example
  3. 3. Practice
  4. 4. Feedback
  5. 5. Continue

Learn: the key idea

Numerical methods for ordinary differential equations approximate the solution of y′ = f(t,y) at discrete steps when no closed form is available. Euler's method uses yₙ₊₁ = yₙ + h f(tₙ,yₙ), a first-order approximation with error O(h) per step, while the classical fourth-order Runge-Kutta method averages four slope estimates per step to achieve error O(h⁴), far more accurate for the same step size. For y′ = y, y(0) = 1, h = 0.1, Euler gives y₁ = 1.1, while RK4 gives y₁ ≈ 1.10517, matching e^0.1 to five decimal places. Smaller step size always improves Euler's accuracy but at the cost of more computation.

Worked example

Use Euler's method with step size h = 0.5 to estimate y(0.5) for the ODE y′ = 2y, y(0) = 1.

0.5 … 0.5
Illustrated card showing 0.5 … 0.5
  1. 1Write Euler's update: yₙ₊₁ = yₙ + h f(tₙ,yₙ) with f(t,y) = 2y.
  2. 2Substitute n = 0: y₁ = y₀ + h(2y₀) = 1 + 0.5(2×1).
  3. 3Compute: y₁ = 1 + 1 = 2.
  4. 4Check: this is one step from t=0 to t=0.5, so y(0.5) ≈ 2.

Answer: y(0.5) ≈ 2

Concept mastery

Based on your past attempts at this lesson — the question types to practise again come first.

Complete a practice set to see your concept breakdown here.

Practice

Practice happens on its own screen, one question at a time. Answers stay hidden until you submit yours, and you can stop and pick up at the same question later.

Start practising

Common mistake. Students assume halving the step size h always halves Euler's error; in fact Euler's global error is proportional to h, but using too large an h on a stiff equation can make the numerical solution diverge entirely rather than merely lose accuracy.

Your progress

Tick each step as you finish it. Your exact reading position is saved automatically, so Continue drops you back on the same line.

0 of 5 steps complete

Your place saves automatically as you read.

My dashboard