Approximating Solutions Using Euler's Method (College Board AP® Calculus BC): Study Guide

Roger B

Written by: Roger B

Reviewed by: Mark Curtis

Updated on

Euler's method

What is Euler’s method?

  • Euler’s method is a numerical method for finding approximate solutions to first order differential equations

  • It treats the derivatives in the equation as being constant over short ‘steps’

  • At each step you use a linear approximation to approximate the value at the next point

    • See the 'Approximating Values of a Function' study guide in the Linearization topic

  • The differential equation must be in the form dydx=f'(x, y)

    • i.e. dydx is expressed in terms of x and y

  • Start with a known value y0 corresponding to a value x0

    • Then y1=y0+x·f'(x0, y0)

      • x1=x0+x

      • x is the step size

    • y2=y1+x·f'(x1, y1)

      • x2=x1+x

    • y3=y2+x·f'(x2, y2)

      • x3=x2+x

    • etc.

Graph showing Euler's method with points (x0, y0) to (x4, y4). Heavier black line for approximation, lighter black line for exact solution, and slopes of approximation line segments labelled.
Example of an Euler's method approximation
  • An Euler’s method approximation tends to wander away from the exact solution

    • The accuracy can be improved by making the step size smaller

Examiner Tips and Tricks

If an exam question asks you how to improve an Euler’s method approximation, the answer will almost always involve decreasing the step size x.

How do I use Euler’s method with a first order differential equation?

  • STEP 1
    Make sure your differential equation is in dydx=f'(x, y) form

    • It is possible that only one of the variables will appear on the right-hand side of the equation 

      • For example, the derivative may be in terms of x only, dydx=f'(x)

      • The procedure to follow remains the same

  • STEP 2
    Use the recursion equations yn+1=yn+x·f'(xn, yn) and xn+1=xn+x

    • An exam question may tell you the correct value of x to use 

      • or you may need to calculate it from other info provided

      • See the Worked Examples

  • STEP 3
    Start with n=0

    • This gives y1=y0+x·f'(x0, y0) and x1=x0+x

    • The values for x0 and y0 will come from the initial conditions given in the question

    • Your values for x1 and y1 will be carried over into the next step

  • STEP 4
    Continue with n=1

    • This gives y2=y1+x·f'(x1, y1) and x2=x1+x

    • The values for x1 and y1 will come from the previous step

    • The value you find for y2 will usually be the Euler's method approximation you are looking for

Examiner Tips and Tricks

It is possible to perform Euler's method with any step size and any number of steps. In this case you could go on to calculate y3, y4, y5, etc. On the exam, however, the questions almost always involve only two steps.

Examiner Tips and Tricks

You might find it useful to do your workings in a table

n

xn

yn

0

x0

y0

1

x1=x0+Δx

y1=y0+x·f'(x0, y0)

2

x2=x1+Δx

y2=y1+x·f'(x1, y1)

Worked Example

Let y=f(x) be the solution to the differential equation dydx=x3y+1 with initial condition f(0)=2. What is the approximation for f(1) obtained by using Euler's method with a step size of 12 starting at x=0?

Answer:

You need to go from x=0 to x=1 with a step size of 12

  • so there will be 1012=2 steps

Use the formula yn+1=yn+x·f'(xn, yn)

  • where here x=12

  • and dydx=x3y+1

Start with initial value (x0, y0)=(0, 2)

(x0, y0)=(0, 2)

Then x1=x0+Δx

x1=0+12=12

And y1=y0+x·f'(x0, y0)

y1=2+12·((0)3(2)+1)=2+12(5)=12

  (x1, y1)=(12, 12)

Continue from (x1, y1)=(12, 12)

x2=x1+Δx

x2=12+12=1

And y2=y1+x·f'(x1, y1)

y2=12+12·((12)3(12)+1)=12+12(3)=1

  (x2, y2)=(1, 1)

You could also do these workings in a table

n

xn

yn

0

0

2

1

0+12=12

2+12·((0)3(2)+1)=2+12(5)=12

2

12+12=1

12+12·((12)3(12)+1)=12+12(3)=1

So by the Euler method, f(1)y2=1

f(1)1

Worked Example

x

2

2.5

3

f'(x)

5

2

1

f is a twice-differentiable function for all values of x, with f(2)=1. The table above gives values of the derivative of f, f', for selected values of x.

Use Euler's method, with two steps of equal size starting at x=2, to approximate f(3). Show the computations that lead to your answer.

Answer:

You need to go from x=2 to x=3 with two steps of equal size

  • so the step size will be Δx=322=12

Use the formula yn+1=yn+x·f'(xn, yn)

  • where here dydx=f'(x)

  • i.e. where the value of dydx depends on x only

Start with initial value (x0, y0)=(2, 1)

(x0, y0)=(2, 1)

Then x1=x0+Δx

x1=2+12=52

And y1=y0+x·f'(x0)

y1=1+12·f'(2)=1+12(5)=72

  (x1, y1)=(52, 72)

Continue from (x1, y1)=(52, 72)

x2=x1+Δx

x2=52+12=3

And y2=y1+x·f'(x1)

y2=72+12·f'(2.5)=72+12(2)=92

  (x2, y2)=(3, 92)

You could also do these workings in a table

n

xn

yn

0

2

1

1

2+12=52

1+12·f'(2)=1+12(5)=72

2

52+12=3

72+12·f'(2.5)=72+12(2)=92

So by the Euler method, f(3)y2=92

f(3)92

How can I tell if an Euler's method approximation is an overestimate or an underestimate?

  • If the solution to a differential equation is concave down on the interval over which Euler's method is employed

    • then the Euler's method approximation will be an overestimate

    • See the diagram at the start of this study guide for an example of this

  • If the solution to a differential equation is concave up on the interval over which Euler's method is employed

    • then the Euler's method approximation will be an underestimate

  • You can differentiate dydx again with respect to x to find d2ydx2

    • Then d2ydx2<0 tells you the solution is concave down

    • And d2ydx2>0 tells you the solution is concave up

    • Note that you don't need to solve the equation to determine its concavity!

How can I use my graphing calculator to carry out Euler’s method?

  • STEP 1
    Make sure your differential equation is in dydx=f'(x, y) form

  • STEP 2
    Write down the recursion equations yn+1=yn+x·f'(xn, yn) and xn+1=xn+x

    • An exam question may tell you the correct value of x to use 

      • or you may need to calculate it from other info provided

      • See the Worked Example

  • STEP 3
    Use the recursion feature on your calculator to calculate the Euler’s method approximation over the correct number of steps

    • The values for x0 and y0 will come from the initial conditions given in the question

    • Your calculator will output the answer as a table of values

Examiner Tips and Tricks

Be careful with letters. In the exam (and in your calculator’s recursion app) the variables may not be x and y.

Examiner Tips and Tricks

Although your graphing calculator can carry out Euler's method approximations, these questions are usually on the non-calculator part of the exam. So make sure you can do the method 'by hand' as well!

Worked Example

Consider the differential equation dydx+y=x+1 with the initial condition  y(0)=0.5.

(a) Using your graphing calculator, apply Euler’s method with five equal steps to approximate the solution to the differential equation at x=1.

(b) Explain how the accuracy of the approximation in part (a) could be improved.

Answer:

(a)

First rearrange into dydx=f'(x, y) form

dydx=xy+1

Next calculate the step size x; you need to go from x=0 to x=1 in five steps so

x=105=0.2

Put that information into the recursion equations yn+1=yn+x·f'(xn, yn) and xn+1=xn+x

yn+1=yn+0.2·(xnyn+1)

xn+1=xn+0.2

Put those equations into the recursion app on your calculator, and specify the required number of steps (n=5)

Your calculator will output the answers in a table

n

xn

yn

0

0

0.5

1

0.2

0.6

2

0.4

0.72

3

0.6

0.856

4

0.8

1.0048

5

1

1.1638

Note that the last row in the table gives the result you're looking for (i.e. the Euler approximation for y when x=1)

Round to 3 decimal places

y(1)1.164 (3 d.p.)

(b)

Decrease the step size by using a greater number of steps to get from 0 to 1

Unlock more, it's free!

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

the (exam) results speak for themselves:

Build on this topic

Roger B

Author: Roger B

Expertise: Development Editor

Roger's teaching experience stretches all the way back to 1992, and in that time he has taught students at all levels between Year 7 and university undergraduate. Having conducted and published postgraduate research into the mathematical theory behind quantum computing, he is more than confident in dealing with mathematics at any level the exam boards might throw at you.

Mark Curtis

Reviewer: 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.