All revision notes topics

5.16 Euler's methodIB Maths: Applications and Interpretation HL: Revision notes

Section 1

What Euler's method does

Many differential equations have no neat formula for the solution. Euler's method builds a numerical approximation instead. We are given a first-order equation dydx=f(x,y)\frac{dy}{dx}=f(x,y) and a starting point (x0,y0)(x_0,y_0), called the initial condition. At any point the equation gives the gradient of the solution curve, so we follow the tangent for a short horizontal distance hh, called the step length, then recalculate the gradient and repeat. The result is a list of points (x0,y0),(x1,y1),(x2,y2),…(x_0,y_0),(x_1,y_1),(x_2,y_2),\ldots that approximate the true curve, joined by short straight segments.

Key termsdifferential equationinitial conditionstep length
Exam tip

The gradient used at each step is the gradient at the START of that step, not the end.

Section 2

The formulae and a worked example

For dydx=f(x,y)\frac{dy}{dx}=f(x,y) with y(x0)=y0y(x_0)=y_0 and step length hh: xn+1=xn+h,yn+1=yn+h f(xn,yn).x_{n+1}=x_n+h,\qquad y_{n+1}=y_n+h\,f(x_n,y_n). Example: dydx=x+y\frac{dy}{dx}=x+y, y(0)=1y(0)=1, h=0.1h=0.1.

  • y1=1+0.1(0+1)=1.1y_1=1+0.1(0+1)=1.1 at x=0.1x=0.1.
  • y2=1.1+0.1(0.1+1.1)=1.22y_2=1.1+0.1(0.1+1.1)=1.22 at x=0.2x=0.2.
  • y3=1.22+0.1(0.2+1.22)=1.362y_3=1.22+0.1(0.2+1.22)=1.362 at x=0.3x=0.3. So y(0.3)≈1.36y(0.3)\approx1.36. The true value is 1.401.40 (3 s.f.), so the estimate is close but not exact.
Key termsEuler's method
Common mistake

Leaving out the step length: the new value is yn+h f(xn,yn)y_n+h\,f(x_n,y_n), not yn+f(xn,yn)y_n+f(x_n,y_n).

Common mistake

Using the new xn+1x_{n+1} in ff. Each step uses the values at the start of the step, xnx_n and yny_n.

Section 3

Using a spreadsheet or GDC

Repeated steps are slow by hand, so in examinations the values are generated using permissible technology. In a spreadsheet, put x0x_0 and y0y_0 in the first row. In the next row type the recurrences, for example =A2+0.1 for xx and =B2+0.1*(A2+B2) for yy, then fill down. Most GDCs can do the same with a recursive sequence or table mode. Keep full precision in the calculator and round only the final answer to 3 significant figures, unless the question says otherwise. A spreadsheet is also the quickest way to answer 'when does yy first exceed...?' questions: read down the column.

Key termsrecurrence
Exam tip

State the recurrence you entered. Method marks are for the formula, even if the calculator does the arithmetic.

Section 4

Accuracy and step length

Each step replaces a curve by a tangent, so a small error is made, and errors build up over many steps. Using a smaller step length hh gives a more accurate estimate but needs more steps. Halving hh roughly halves the final error. If the true solution is concave up (gradient increasing), the tangent lies below the curve and Euler's method underestimates. If it is concave down, Euler's method overestimates. In the example above the gradient x+yx+y increases, so 1.362<1.401.362<1.40.

Key termsconcave up
Common mistake

Saying a smaller step length makes Euler's method exact. It only makes it more accurate.

Section 5

Coupled systems

Two quantities that depend on each other, both changing with time, give a coupled system: dxdt=f1(x,y,t)\frac{dx}{dt}=f_1(x,y,t) and dydt=f2(x,y,t)\frac{dy}{dt}=f_2(x,y,t). Euler's method now steps tt, xx and yy together: tn+1=tn+h,xn+1=xn+h f1(xn,yn,tn),yn+1=yn+h f2(xn,yn,tn).t_{n+1}=t_n+h,\quad x_{n+1}=x_n+h\,f_1(x_n,y_n,t_n),\quad y_{n+1}=y_n+h\,f_2(x_n,y_n,t_n). Both new values use the OLD xnx_n and yny_n. Example: dxdt=−y\frac{dx}{dt}=-y, dydt=x\frac{dy}{dt}=x, x0=1x_0=1, y0=0y_0=0, h=0.1h=0.1. Then x1=1+0.1(0)=1x_1=1+0.1(0)=1 and y1=0+0.1(1)=0.1y_1=0+0.1(1)=0.1. Next x2=1+0.1(−0.1)=0.99x_2=1+0.1(-0.1)=0.99 and y2=0.1+0.1(1)=0.2y_2=0.1+0.1(1)=0.2.

Key termscoupled system
Common mistake

Updating xx first and then using the new xx to update yy. Both updates must use the old values.

Section 6

Predator-prey models

A common coupled model has prey xx and predators yy: dxdt=ax−bxy,dydt=cxy−dy.\frac{dx}{dt}=ax-bxy,\qquad \frac{dy}{dt}=cxy-dy. The term axax is prey growth with plenty of food, −bxy-bxy is prey lost to predators (it needs both to meet), cxycxy is predator growth from eating prey, and −dy-dy is predator deaths. The populations are constant when both rates are zero: y=aby=\frac{a}{b} and x=dcx=\frac{d}{c} (the non-zero equilibrium). Example: dxdt=0.6x−0.03xy\frac{dx}{dt}=0.6x-0.03xy, dydt=0.02xy−0.5y\frac{dy}{dt}=0.02xy-0.5y with x=50x=50, y=10y=10: the rates are 1515 and 55, so with h=0.2h=0.2 we get x1=53x_1=53, y1=11y_1=11. Euler's method on a spreadsheet then shows both populations rising and falling in cycles, with the predators peaking after the prey.

Key termsequilibriumpredator-prey model
Exam tip

Interpret in context: say 'foxes are increasing by 3 per month', not just 'dy/dt = 3'.

That's the notes covered.

Carry on to the next subtopic.

Exam questions on 5.16 Euler's method

  1. A function yy satisfies dydx=2x−y\frac{dy}{dx}=2x-y, with y=3y=3 when x=0x=0. Euler's method with step length h=0.5h=0.5 is used to approximate yy.
    Find the approximation to yy when x=1.5x=1.5.2 marks
  2. The temperature T ∘T\,^\circC of a cup of tea, tt minutes after it is poured, satisfies dTdt=−0.1(T−20)\frac{dT}{dt}=-0.1(T-20), and T=90T=90 when t=0t=0. Euler's method with step length h=2h=2 minutes is used to estimate TT.
    Continue the method to estimate TT when t=6t=6.2 marks
  3. The number of fish PP in a lake, tt years after the lake is stocked, is modelled by dPdt=0.4P(1−P500)\frac{dP}{dt}=0.4P\left(1-\frac{P}{500}\right), with P=100P=100 when t=0t=0. Euler's method with step length h=1h=1 year is used. A GDC or spreadsheet may be used.
    Use Euler's method to estimate the number of fish after 1 year and after 2 years.3 marks
See the full worksheet

Written by the Exaim team, led by Shaun Daswani (Head of Upper Secondary, Improve ME Institute; MSc Financial Mathematics, Imperial College London; BSc, UCL) and Jason Daswani (operational lead, Improve ME Institute; LSE).