Euler's method

About this lesson

Calculus BC (AP-aligned) › Euler's method and logistic models

To save a PDF, choose “Save as PDF” in the print dialog.

Euler's method

Euler's method and logistic models.

Warm-up

Three quick questions from earlier lessons.

Discover

y′=yy' = y, y(0)=1y(0) = 1. At (0,1)(0, 1) the slope is 1. Follow the tangent line for a step of 0.50.5. Where do you land?

  1. (0.5, 1.5)(0.5,\ 1.5)
  2. (0.5, 2)(0.5,\ 2)

Key idea

Walk along short tangent lines.

Euler's method for y′=f(x,y)y' = f(x, y), y(x0)=y0y(x_0) = y_0, step hh: xn+1=xn+hx_{n+1} = x_n + h, yn+1=yn+h f(xn,yn)y_{n+1} = y_n + h\,f(x_n, y_n). Smaller steps give better estimates.

Worked example

y′=x+yy' = x + y, y(0)=1y(0) = 1, h=0.5h = 0.5. Estimate y(1)y(1).

y1=1+0.5⋅1=1.5y_1 = 1 + 0.5 \cdot 1 = 1.5
Slope at (0, 1) is 1.
y2=1.5+0.5⋅2=2.5y_2 = 1.5 + 0.5 \cdot 2 = 2.5
Slope at (0.5, 1.5) is 2.
y(1)≈2.5y(1) \approx 2.5
Two steps reach x = 1.

Your turn, guided

Your turn: y′=2yy' = 2y, y(0)=3y(0) = 3, one step with h=0.1h = 0.1.

y(0.1)≈3.6y(0.1) \approx 3.6
3 + 0.1 × 6.

Practice ★

  1. dydx=1x+y\dfrac{dy}{dx} = 1x + y and y(1)=3y(1) = 3. Use one step of Euler's method with h=0.1h = 0.1 to estimate y(1.1)y(1.1).
  2. dydx=4x+y\dfrac{dy}{dx} = 4x + y and y(1)=8y(1) = 8. Use one step of Euler's method with h=0.1h = 0.1 to estimate y(1.1)y(1.1).
  3. dydx=9x+y\dfrac{dy}{dx} = 9x + y and y(1)=4y(1) = 4. Use one step of Euler's method with h=0.1h = 0.1 to estimate y(1.1)y(1.1).

Watch out!

Practice ★★

  1. dydx=y\dfrac{dy}{dx} = y and y(0)=8y(0) = 8. Use Euler's method with two steps of size h=12h = \tfrac{1}{2} to estimate y(1)y(1).
  2. dydx=y\dfrac{dy}{dx} = y and y(0)=4y(0) = 4. Use Euler's method with two steps of size h=12h = \tfrac{1}{2} to estimate y(1)y(1).
  1. The solution of dydx=y\dfrac{dy}{dx} = y, y(0)=1y(0) = 1, is concave up. Does Euler's method with h>0h > 0 over- or underestimate y(1)y(1)?
    1. Underestimate: each step follows a tangent line, which lies below a concave-up curve
    2. Overestimate
    3. It is exact

Exit ticket

Three questions to check you have got it.

  1. dydx=1x+y\dfrac{dy}{dx} = 1x + y and y(1)=3y(1) = 3. Use one step of Euler's method with h=0.1h = 0.1 to estimate y(1.1)y(1.1).
  2. dydx=4x+y\dfrac{dy}{dx} = 4x + y and y(1)=8y(1) = 8. Use one step of Euler's method with h=0.1h = 0.1 to estimate y(1.1)y(1.1).
  3. dydx=9x+y\dfrac{dy}{dx} = 9x + y and y(1)=4y(1) = 4. Use one step of Euler's method with h=0.1h = 0.1 to estimate y(1.1)y(1.1).

Summary card

Euler's method

yn+1=yn+h f(xn,yn)y_{n+1} = y_n + h\,f(x_n, y_n): slope at the current point × step.

Watch out: update the slope at each new point.

CC BY-SA 4.0