Numerical Solutions of First-Order Differential Equations (Edexcel A Level Further Maths: Further Pure 1): Revision Note

Exam code: 9FM0

Mark Curtis

Written by: Mark Curtis

Updated on

Numerical solutions of first-order differential equations

What is the forward difference method?

  • The forward difference method is a numerical method using the iterative formula

    • open parentheses fraction numerator straight d y over denominator straight d x end fraction close parentheses subscript n almost equal to fraction numerator y subscript n plus 1 end subscript minus y subscript n over denominator h end fraction

    • to approximate the particular solution of a first-order differential equation

      • fraction numerator straight d y over denominator straight d x end fraction equals straight f open parentheses x comma space y close parentheses

      • with boundary condition y equals y subscript 0 when x equals x subscript 0

    • using step sizes of h

      • where decreasing h increases the accuracy

  • For each iteration

    • the method uses the gradient at that point to create a straight-line segment

      • which gives an estimate of the next y value

    • This is also known as Euler's method

Graph show the curve of an exact solution, followed by an approximation using line segments. Both start from the point (x0, y0) and the first line segment goes to (x1, y1) with a gradient of (dy/dx) at x0. The second line segment goes to (x2, y2)  from (x1, y1) with a gradient of (dy/dx) at x1, and so on.

Examiner Tips and Tricks

You will be given the formula open parentheses fraction numerator straight d y over denominator straight d x end fraction close parentheses subscript n almost equal to fraction numerator y subscript n plus 1 end subscript minus y subscript n over denominator h end fraction in the exam question, though you may need to change the variables, e.g. fraction numerator straight d theta over denominator straight d t end fraction.

How do I use the forward difference method?

  • To use the forward difference method, see the worked example below

Worked Example

The velocity of a drone, v ms-1, varies with time, t seconds, according to the model

fraction numerator straight d v over denominator straight d t end fraction equals t minus 3 v plus 1

The initial velocity of the drone is 2 ms-1.

Use two iterations of the approximation formula open parentheses fraction numerator straight d y over denominator straight d x end fraction close parentheses subscript n almost equal to fraction numerator y subscript n plus 1 end subscript minus y subscript n over denominator h end fraction to estimate the velocity of the drone after 1 second.

Answer:

Find the step size, h, to get from t equals 0 to t equals 1 in 2 iterations

h equals 0.5

Write out the approximation formula using v, t and h equals 0.5

open parentheses fraction numerator straight d v over denominator straight d t end fraction close parentheses subscript n almost equal to fraction numerator v subscript n plus 1 end subscript minus v subscript n over denominator 0.5 end fraction

Start the first iteration by substituting n equals 0 into the approximation formula

open parentheses fraction numerator straight d v over denominator straight d t end fraction close parentheses subscript 0 almost equal to fraction numerator v subscript 1 minus v subscript 0 over denominator 0.5 end fraction

Identify the initial conditions, t subscript 0 and v subscript 0, from the question

t subscript 0 equals 0 and v subscript 0 equals 2

Find open parentheses fraction numerator straight d v over denominator straight d t end fraction close parentheses subscript 0 by substituting t subscript 0 equals 0 and v subscript 0 equals 2 into fraction numerator straight d v over denominator straight d t end fraction equals t minus 3 v plus 1

table row cell open parentheses fraction numerator straight d v over denominator straight d t end fraction close parentheses subscript 0 end cell equals cell t subscript 0 minus 3 v subscript 0 plus 1 end cell row blank equals cell 0 minus 3 cross times 2 plus 1 end cell row blank equals cell negative 5 end cell end table

Substitute open parentheses fraction numerator straight d v over denominator straight d t end fraction close parentheses subscript 0 equals negative 5 and v subscript 0 equals 2 into the approximation formula and rearrange to find v subscript 1

table row cell negative 5 end cell almost equal to cell fraction numerator v subscript 1 minus 2 over denominator 0.5 end fraction end cell row cell v subscript 1 end cell equals cell negative 5 cross times 0.5 plus 2 end cell row cell v subscript 1 end cell equals cell negative 0.5 end cell end table

The first iteration is now complete

Start the second iteration by substituting n equals 1 into the approximation formula

open parentheses fraction numerator straight d v over denominator straight d t end fraction close parentheses subscript 1 almost equal to fraction numerator v subscript 2 minus v subscript 1 over denominator 0.5 end fraction

Note that the time t has increased by 0.5

table row cell t subscript 1 end cell equals cell t subscript 0 plus 0.5 end cell row blank equals cell 0 plus 0.5 end cell row blank equals cell 0.5 end cell end table

Find open parentheses fraction numerator straight d v over denominator straight d t end fraction close parentheses subscript 1 by substituting t subscript 1 equals 0.5 and v subscript 1 equals negative 0.5 into fraction numerator straight d v over denominator straight d t end fraction equals t minus 3 v plus 1

table row cell open parentheses fraction numerator straight d v over denominator straight d t end fraction close parentheses subscript 1 end cell equals cell t subscript 1 minus 3 v subscript 1 plus 1 end cell row blank equals cell 0.5 minus 3 cross times open parentheses negative 0.5 close parentheses plus 1 end cell row blank equals 3 end table

Substitute open parentheses fraction numerator straight d v over denominator straight d t end fraction close parentheses subscript 1 equals 3 and v subscript 1 equals negative 0.5 into the approximation formula and rearrange to find v subscript 2

table row 3 almost equal to cell fraction numerator v subscript 2 minus open parentheses negative 0.5 close parentheses over denominator 0.5 end fraction end cell row cell v subscript 2 end cell equals cell 3 cross times 0.5 minus 0.5 end cell row cell v subscript 2 end cell equals 1 end table

This is the estimate of v when t equals 1

The velocity after 1 second is approximately 1 ms-1

What is the central difference method?

  • The central difference method is a numerical method using the iterative formula

    • open parentheses fraction numerator straight d y over denominator straight d x end fraction close parentheses subscript n almost equal to fraction numerator y subscript n plus 1 end subscript minus y subscript n minus 1 end subscript over denominator 2 h end fraction

    • to approximate the particular solution of a first-order differential equation

      • fraction numerator straight d y over denominator straight d x end fraction equals straight f open parentheses x comma space y close parentheses

      • with boundary condition y equals y subscript 0 when x equals x subscript 0

    • using step sizes of h

      • where decreasing h increases the accuracy

  • For each iteration

    • the method finds the average gradient from a point before and a point after to estimate the next value of y

  • This means you need two starting points, y subscript 0 and y subscript 1, before you can work out y subscript 2

    • y subscript 0 is given in the question

    • y subscript 1 is found using the forward difference method open parentheses fraction numerator straight d y over denominator straight d x end fraction close parentheses subscript n almost equal to fraction numerator y subscript n plus 1 end subscript minus y subscript n over denominator h end fraction

      • i.e. rearranging open parentheses fraction numerator straight d y over denominator straight d x end fraction close parentheses subscript 0 almost equal to fraction numerator y subscript 1 minus y subscript 0 over denominator h end fraction to give y subscript 1

Examiner Tips and Tricks

You will be given the formulas open parentheses fraction numerator straight d y over denominator straight d x end fraction close parentheses subscript n almost equal to fraction numerator y subscript n plus 1 end subscript minus y subscript n minus 1 end subscript over denominator 2 h end fraction and open parentheses fraction numerator straight d y over denominator straight d x end fraction close parentheses subscript n almost equal to fraction numerator y subscript n plus 1 end subscript minus y subscript n over denominator h end fraction in the exam question, though you may need to change the variables, e.g. fraction numerator straight d theta over denominator straight d t end fraction.

How do I use the central difference method?

  • To use the central difference method, see the worked example below

Worked Example

The nitrate concentration in a river, y mg L-1, changes with the distance downstream, x km, according to the model

fraction numerator straight d y over denominator straight d x end fraction equals x minus fraction numerator 3 y over denominator 2 end fraction

At the point farthest upstream, x equals 0, the nitrate concentration is 1 mg L-1.

(a) Use one iteration of the approximation formula open parentheses fraction numerator straight d y over denominator straight d x end fraction close parentheses subscript n almost equal to fraction numerator y subscript n plus 1 end subscript minus y subscript n over denominator h end fraction to estimate the nitrate concentration 0.5 km downstream.

(b) Hence use the approximation formula open parentheses fraction numerator straight d y over denominator straight d x end fraction close parentheses subscript n almost equal to fraction numerator y subscript n plus 1 end subscript minus y subscript n minus 1 end subscript over denominator 2 h end fraction to estimate the nitrate concentration 1 km downstream.

Answer:

(a)

This is asking for the forward difference method

Find the step size, h, to get from x equals 0 to x equals 0.5 in 1 iteration

h equals 0.5

Write out the approximation formula using h equals 0.5

open parentheses fraction numerator straight d y over denominator straight d x end fraction close parentheses subscript n almost equal to fraction numerator y subscript n plus 1 end subscript minus y subscript n over denominator 0.5 end fraction

Start the first iteration by substituting n equals 0 into the approximation formula

open parentheses fraction numerator straight d y over denominator straight d x end fraction close parentheses subscript 0 almost equal to fraction numerator y subscript 1 minus y subscript 0 over denominator 0.5 end fraction

Identify the initial conditions, x subscript 0 and y subscript 0, from the question

x subscript 0 equals 0 and y subscript 0 equals 1

Find open parentheses fraction numerator straight d y over denominator straight d x end fraction close parentheses subscript 0 by substituting x subscript 0 equals 0 and y subscript 0 equals 1 into fraction numerator straight d y over denominator straight d x end fraction equals x minus fraction numerator 3 y over denominator 2 end fraction

table row cell open parentheses fraction numerator straight d y over denominator straight d x end fraction close parentheses subscript 0 end cell equals cell x subscript 0 minus fraction numerator 3 y subscript 0 over denominator 2 end fraction end cell row blank equals cell 0 minus fraction numerator 3 cross times 1 over denominator 2 end fraction end cell row blank equals cell negative 1.5 end cell end table

Substitute open parentheses fraction numerator straight d y over denominator straight d x end fraction close parentheses subscript 0 equals negative 1.5 and y subscript 0 equals 1 into the approximation formula and rearrange to find y subscript 1

table row cell negative 1.5 end cell almost equal to cell fraction numerator y subscript 1 minus 1 over denominator 0.5 end fraction end cell row cell y subscript 1 end cell equals cell 0.5 cross times open parentheses negative 1.5 close parentheses plus 1 end cell row cell y subscript 1 end cell equals cell 0.25 end cell end table

The nitrate concentration 0.5 km downstream is approximately 0.25 mg L-1

(b)

This is asking for the central difference method, which requires knowing y subscript 0 and y subscript 1 first

Find y subscript 0 at x subscript 0 equals 0 from the question

y subscript 0 equals 1

Find y subscript 1 at x subscript 1 equals 0.5 from the answer in part (a)

y subscript 1 almost equal to 0.25

Now use the central difference formula with n equals 1

open parentheses fraction numerator straight d y over denominator straight d x end fraction close parentheses subscript 1 almost equal to fraction numerator y subscript 2 minus y subscript 0 over denominator 2 cross times 0.5 end fraction

Find open parentheses fraction numerator straight d y over denominator straight d x end fraction close parentheses subscript 1 by substituting x subscript 1 equals 0.5 and y subscript 1 almost equal to 0.25 into fraction numerator straight d y over denominator straight d x end fraction equals x minus fraction numerator 3 y over denominator 2 end fraction

table row cell open parentheses fraction numerator straight d y over denominator straight d x end fraction close parentheses subscript 1 end cell equals cell x subscript 1 minus fraction numerator 3 y subscript 1 over denominator 2 end fraction end cell row blank equals cell 0.5 minus 3 cross times fraction numerator 0.25 over denominator 2 end fraction end cell row blank equals cell 0.125 end cell end table

Substitute open parentheses fraction numerator straight d y over denominator straight d x end fraction close parentheses subscript 1 equals 0.125 and y subscript 0 equals 1 into the approximation formula and rearrange to find y subscript 2

table row cell 0.125 end cell almost equal to cell fraction numerator y subscript 2 minus 1 over denominator 2 cross times 0.5 end fraction end cell row cell y subscript 2 end cell equals cell 0.125 cross times 2 cross times 0.5 plus 1 end cell row cell y subscript 2 end cell equals cell 1.125 end cell end table

The nitrate concentration 1 km downstream is approximately 1.125 mg L-1

What else could I be asked about difference methods?

  • You need to know that as you decrease the step size, h,

    • the central difference method gives values closer to the true solution than the forward difference method

      • i.e. its errors are smaller

  • You need to know how to find the percentage error of your estimate if given the actual value

    • using the formula

      • percentage space error space equals space fraction numerator vertical line estimate minus actual vertical line over denominator actual end fraction cross times 100 percent sign

  • If the estimate is less than the actual value

    • it is an underestimate

  • If the estimate is greater than the actual value

    • it is an overestimate

Examiner Tips and Tricks

To compare an estimate to an actual answer, you either need to be given the actual answer or you need to solve the differential equation algebraically.

Worked Example

The velocity of a drone, v ms-1, varies with time, t seconds, according to the model

fraction numerator straight d v over denominator straight d t end fraction equals t minus 3 v plus 1

The initial velocity of the drone is 2 ms-1.

Two iterations of the approximation formula open parentheses fraction numerator straight d y over denominator straight d x end fraction close parentheses subscript n almost equal to fraction numerator y subscript n plus 1 end subscript minus y subscript n over denominator h end fraction give an estimate of the velocity after 1 second as 1 ms-1.

By solving the differential equation,

(a) determine whether the estimate is an overestimate or an underestimate,

(b) find the percentage error of this estimate.

Answer:

(a)

This differential equation can be solved using the integrating factor method

First rearrange into the correct form, fraction numerator straight d v over denominator straight d t end fraction plus straight p open parentheses t close parentheses v equals straight q open parentheses t close parentheses

fraction numerator straight d v over denominator straight d t end fraction plus 3 v equals t plus 1

Find the integrating factor

straight e to the power of integral 3 d t end exponent equals straight e to the power of 3 t end exponent

Rewrite the differential equation

fraction numerator straight d over denominator straight d t end fraction open parentheses v straight e to the power of 3 t end exponent close parentheses equals open parentheses t plus 1 close parentheses straight e to the power of 3 t end exponent

Integrate both sides

v straight e to the power of 3 t end exponent equals integral open parentheses t plus 1 close parentheses straight e to the power of 3 t end exponent straight d t

Use integration by parts on the right-hand side

v straight e to the power of 3 t end exponent equals 1 third t straight e to the power of 3 t end exponent plus 2 over 9 straight e to the power of 3 straight t end exponent plus c

Make v the subject to get the general solution

v equals 1 third t plus 2 over 9 plus c straight e to the power of negative 3 t end exponent

Find c using v equals 2 when t equals 0

2 equals 2 over 9 plus c
c equals 16 over 9

Write out the particular solution

v equals 1 third t plus 2 over 9 plus 16 over 9 straight e to the power of negative 3 t end exponent

Now, to compare after 1 second, substitute in t equals 1 to get the actual answer

table row v equals cell 1 third plus 2 over 9 plus 16 over 9 straight e to the power of negative 3 end exponent end cell row blank equals cell 0.6440658... end cell end table

Compare the estimate of v equals 1 to the actual solution

The estimate of 1 ms-1 is an overestimate of the actual value, 0.644 ms-1 to 3 s.f.

(b)

Use fraction numerator vertical line estimate minus actual vertical line over denominator actual end fraction cross times 100 percent sign to find the percentage error of the estimate

fraction numerator vertical line 1 minus table row blank blank 0 end table table row blank blank. end table table row blank blank 6440658 end table table row blank blank. end table table row blank blank. end table table row blank blank. end table vertical line over denominator table row blank blank cell 0.6440658... end cell end table end fraction cross times 100 equals 55.26.... percent sign

Round to 3 s.f.

The percentage error is 55.3%

Unlock more, it's free!

Join the 100,000+ Students that ❤️ Save My Exams

the (exam) results speak for themselves:

Mark Curtis

Author: Mark Curtis

Expertise: Maths Content Creator

Mark graduated twice from the University of Oxford: once in 2009 with a First in Mathematics, then again in 2013 with a PhD (DPhil) in Mathematics. He has had nine successful years as a secondary school teacher, specialising in A-Level Further Maths and running extension classes for Oxbridge Maths applicants. Alongside his teaching, he has written five internal textbooks, introduced new spiralling school curriculums and trained other Maths teachers through outreach programmes.