Skip to main content
SingaporeFurther MathsSyllabus dot point

How does Euler's method step a differential equation forward numerically, and what limits its accuracy?

Use Euler's method and the improved Euler (midpoint) method to obtain a numerical solution of a first-order differential equation

A focused answer to the H2 Further Mathematics outcome on numerical solution of ODEs. Euler's method as a tangent step, the step size, accumulation of error, and the improved Euler (midpoint) method for greater accuracy.

Generated by Claude Opus 4.811 min answer

Reviewed by: AI editorial process; not yet individually human-reviewed

Have a quick question? Jump to the Q&A page

Jump to a section
  1. What this dot point is asking
  2. The answer
  3. Examples in context
  4. Try this

What this dot point is asking

SEAB wants you to obtain a numerical (step-by-step) solution of a first-order differential equation dydx=f(x,y)\dfrac{\mathrm{d}y}{\mathrm{d}x} = \mathrm{f}(x, y) with a given initial condition, using Euler's method and its improved (midpoint) variant. You should understand each step as moving along a tangent, the role of the step size, how error accumulates, and why the improved method is more accurate.

The answer

Euler's method

Given dydx=f(x,y)\dfrac{\mathrm{d}y}{\mathrm{d}x} = \mathrm{f}(x, y) and a starting point (x0,y0)(x_0, y_0), Euler's method steps forward by following the tangent:

yn+1=yn+h f(xn,yn),xn+1=xn+h,y_{n+1} = y_n + h\,\mathrm{f}(x_n, y_n), \qquad x_{n+1} = x_n + h,

where hh is the step size. Each step uses the gradient at the current point to predict the next yy.

The geometric picture

At (xn,yn)(x_n, y_n) the differential equation gives the gradient f(xn,yn)\mathrm{f}(x_n, y_n). Euler's method assumes the solution follows that straight tangent for one step of width hh. Because the true curve bends away from the tangent, each step introduces a small error.

Step size and error

A smaller step size hh gives a more accurate result, since the tangent approximation holds better over a shorter interval, but needs more steps. Euler's method has error proportional to hh per unit interval (first order), and the local errors accumulate over the steps, so estimates drift from the true solution as you go further.

The improved Euler (midpoint) method

Euler's method is crude because it uses only the gradient at the start of each step. The improved method corrects this by also using the gradient at the predicted end (or midpoint) and averaging:

k1=f(xn,yn),k2=f(xn+h,Β yn+hk1),yn+1=yn+hβ‹…k1+k22.k_1 = \mathrm{f}(x_n, y_n), \quad k_2 = \mathrm{f}(x_n + h,\ y_n + h k_1), \quad y_{n+1} = y_n + h\cdot\frac{k_1 + k_2}{2}.

Averaging the two end gradients accounts for how the gradient changes across the step, making the method second order (error proportional to h2h^2) and much more accurate for the same hh.

Examples in context

Example 1. Simulating motion with no closed form. When a drag force makes a projectile's equation of motion unsolvable in closed form, Euler or improved-Euler stepping produces the trajectory numerically, the basic idea behind physics simulation engines.

Example 2. Population and climate models. Large systems of differential equations in ecology and climate science are advanced in time by stepping methods of this family; the trade-off between step size, accuracy and computation is exactly the one Euler's method illustrates.

Try this

Q1. Write Euler's method for dydx=f(x,y)\dfrac{\mathrm{d}y}{\mathrm{d}x} = \mathrm{f}(x, y). [1 mark]

  • Cue. yn+1=yn+h f(xn,yn)y_{n+1} = y_n + h\,\mathrm{f}(x_n, y_n).

Q2. How does reducing the step size hh affect the accuracy? [1 mark]

  • Cue. It increases accuracy (the tangent approximation holds better over a shorter step), at the cost of more steps.

Q3. Why is the improved Euler method more accurate than basic Euler? [2 marks]

  • Cue. It averages the gradients at the start and predicted end of each step, accounting for the gradient's change, giving second-order accuracy.

Exam-style practice questions

Practice questions written in the style of SEAB exam questions on this dot point, with worked answer explainers. The year tag is the paper they imitate, not the source.

Original6 marksUse Euler's method with step size h=0.1h = 0.1 to estimate y(0.2)y(0.2) for dydx=x+y\dfrac{dy}{dx} = x + y, given y(0)=1y(0) = 1.
Show worked answer β†’

Euler's method is yn+1=yn+h f(xn,yn)y_{n+1} = y_n + h\,\mathrm{f}(x_n, y_n), where f(x,y)=x+y\mathrm{f}(x, y) = x + y is the gradient.

Start: x0=0x_0 = 0, y0=1y_0 = 1.

Step 1: gradient f(0,1)=0+1=1\mathrm{f}(0, 1) = 0 + 1 = 1. So y1=1+0.1(1)=1.1y_1 = 1 + 0.1(1) = 1.1 at x1=0.1x_1 = 0.1.

Step 2: gradient f(0.1,1.1)=0.1+1.1=1.2\mathrm{f}(0.1, 1.1) = 0.1 + 1.1 = 1.2. So y2=1.1+0.1(1.2)=1.22y_2 = 1.1 + 0.1(1.2) = 1.22 at x2=0.2x_2 = 0.2.

Hence y(0.2)β‰ˆ1.22y(0.2) \approx 1.22.

Markers reward the Euler formula, computing the gradient at each step, and the two-step result y(0.2)β‰ˆ1.22y(0.2) \approx 1.22.

Original7 marksFor dydx=x+y\dfrac{dy}{dx} = x + y with y(0)=1y(0) = 1, use the improved Euler (midpoint) method with h=0.2h = 0.2 to estimate y(0.2)y(0.2) in one step, and explain why it is more accurate than the basic Euler method.
Show worked answer β†’

The improved Euler method first predicts with the gradient at the start, then corrects using the average of the start and predicted-end gradients (or the midpoint gradient). Using the average-gradient form:

Start gradient: k1=f(0,1)=1k_1 = \mathrm{f}(0, 1) = 1. Predicted end value (basic Euler): y~=1+0.2(1)=1.2\tilde{y} = 1 + 0.2(1) = 1.2 at x=0.2x = 0.2. End gradient at the prediction: k2=f(0.2,1.2)=0.2+1.2=1.4k_2 = \mathrm{f}(0.2, 1.2) = 0.2 + 1.2 = 1.4.

Improved estimate using the average gradient: y1=y0+hβ‹…k1+k22=1+0.2β‹…1+1.42=1+0.2(1.2)=1.24y_1 = y_0 + h\cdot\dfrac{k_1 + k_2}{2} = 1 + 0.2\cdot\dfrac{1 + 1.4}{2} = 1 + 0.2(1.2) = 1.24.

So y(0.2)β‰ˆ1.24y(0.2) \approx 1.24. This is more accurate than basic Euler (which uses only the start gradient and gives 1.21.2 in one step) because it accounts for how the gradient changes across the interval by averaging the two end gradients, reducing the truncation error.

Markers reward the predictor gradient, the corrector using the average of the two gradients, the value 1.241.24, and the explanation that averaging the gradient improves accuracy.

Related dot points