Euler's method

Lessons and exercises follow the school system and stay in its language.Les leçons et les exercices suivent le système scolaire et restent dans sa langue.Lektionen und Übungen folgen dem Schulsystem und bleiben in seiner Sprache.

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.

Sources and credits

Written with this source as a starting point:

sedifier rewrote the text and added its own examples and exercises.

Written with AI assistance; every answer is checked by our math engine. Not yet reviewed by a teacher.

This lesson: CC BY-SA 4.0, © sedifier · All credits

Euler's method

Euler's method and logistic models.

Warm-up

Three quick questions from earlier lessons.

  1. f(2)=3f(2) = 3 and f′(2)=2f'(2) = 2. Write the local linearization L(x)L(x) of ff at x=2x = 2.
  2. f(x)=xf(x) = \sqrt{x} has f′(x)=12xf'(x) = \dfrac{1}{2\sqrt{x}}. Use the local linearization at x=4x = 4 to estimate 6\sqrt{ 6 }. Give an exact fraction.
  3. Near x=4x = 4, the graph of ff is concave up. Does the local linearization at x=4x = 4 over- or underestimate f(x)f(x) for xx near 44?
    1. Underestimate: the tangent line lies below the curve.
    2. Overestimate: the tangent line lies above the curve.
    3. Neither: near x=4x = 4 the linearization is exact.

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=3x+y\dfrac{dy}{dx} = 3x + y and y(1)=1y(1) = 1. Use one step of Euler's method with h=0.1h = 0.1 to estimate y(1.1)y(1.1).
  2. dydx=16x+y\dfrac{dy}{dx} = 16x + y and y(1)=41y(1) = 41. Use one step of Euler's method with h=0.1h = 0.1 to estimate y(1.1)y(1.1).
  3. 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).

Watch out!

Practice ★★

  1. 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).
  2. dydx=y\dfrac{dy}{dx} = y and y(0)=74y(0) = 74. 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=3x+y\dfrac{dy}{dx} = 3x + y and y(1)=1y(1) = 1. Use one step of Euler's method with h=0.1h = 0.1 to estimate y(1.1)y(1.1).
  2. dydx=16x+y\dfrac{dy}{dx} = 16x + y and y(1)=41y(1) = 41. Use one step of Euler's method with h=0.1h = 0.1 to estimate y(1.1)y(1.1).
  3. 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).

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.

One more step is optional: a challenge. Try it, or finish the lesson now.

Challenge ★★★

  1. dydx=2y\dfrac{dy}{dx} = 2y and y(0)=1y(0) = 1. Use Euler's method with two steps of size h=12h = \tfrac{1}{2} to estimate y(1)y(1).
Sources and credits

Written with this source as a starting point:

sedifier rewrote the text and added its own examples and exercises.

Written with AI assistance; every answer is checked by our math engine. Not yet reviewed by a teacher.

This lesson: CC BY-SA 4.0, © sedifier · All credits