Topic 7.5 · BC

Take one Euler step

Builds on reasoning from a slope field. 6 minutes.

A step along the slope

The chalk curve starts at the orange point \((0, 3)\) and follows \(\frac{dy}{dx} = y - 1\), but you do not have a formula for it. The equation gives only the slope of the curve at each point, which the faint segments show.

At \((0, 3)\) the slope is \(3 - 1 = 2\), so the orange segment rises 2 for each 1 to the right. An Euler step starts at \((0, 3)\) and follows this segment.

Move the slider to choose the step size \(h\), which is the distance the step goes to the right. The end of the step moves along the segment and rises \(2h\), shown in green.

With \(h = 1\), the step ends at \((1, 5)\), but the curve is at about 6.44 there. The red line shows the difference, because the curve bends up and the step stays straight.

Any equation, any start

This field belongs to a different equation. The orange point is the start, and the chalk curve is the solution through it.

Drag the start point. The orange segment turns to the slope that the field gives at the new place.

Change the step size. The step leaves the start along the orange segment, so its end stays on that line.

For every start and every step size, the change in \(y\) is the step size times the slope at the start.

Notation

  1. Write the equation as \(\frac{dy}{dx} = f(x, y)\). The step starts at a known point \(\cy{(x_0, y_0)}\), so you find the slope there by putting \(x_0\) and \(y_0\) into \(f\).

    \[\cy{m} = f(x_0, y_0)\]
  2. The step goes \(h\) to the right, which is its run, so \(x\) grows by \(h\).

    \[x_1 = x_0 + h\]
  3. On a line with slope \(m\), going \(h\) to the right gives a rise of \(m\) times \(h\), which is the change in \(y\). It is green when the step rises and red when it falls.

    \[\Delta y = h\,\cy{m}\]
  4. This is one Euler step: the new \(y\) is the old \(y\) plus the step size times the slope at the old point.

    \[\cy{y_1} = y_0 + h\,f(x_0, y_0)\]

    \(y_1\) is an estimate of \(y(x_1)\). It lies on the straight step, not on the curve.

When it fails

The step is a straight line, and it has the slope of the curve only at the start. Farther along, the curve bends and its slope changes.

The longer the step, the farther its end is from the curve, as the red gap shows. Euler’s method gives a close estimate only when the step is short.

Example 1: a step that falls

Let \(y = f(x)\) be the solution to \(\dfrac{dy}{dx} = 2x - y\) with \(f(1) = 3\). Use one Euler step of size 0.5 to approximate \(f(1.5)\).

  1. Put \(x = 1\) and \(y = 3\) into \(2x - y\). The slope is negative, so the orange segment falls.

    \[m = 2(1) - 3 = -1\]
  2. Multiply the slope by the step size. The change in \(y\) is negative, so it is red.

    \[\Delta y = 0.5\,(-1) = \cr{-0.5}\]
  3. Add the change to the starting height. The step ends at \((1.5, 2.5)\).

    \[f(1.5) \approx 3 + (-0.5) = \cy{2.5}\]

    As a check, the exact value is \(f(1.5) = 1 + 3e^{-1/2} \approx 2.82\). The curve bends up, away from the straight step, and the red line shows the gap.

Example 2: from the slope to the new height

Let \(y = f(x)\) be the solution to \(\dfrac{dy}{dx} = xy\) with \(f(1) = 2\). Use one Euler step of size 0.2 to approximate \(f(1.2)\).

  1. Put \(x = 1\) and \(y = 2\) into \(xy\).

    \[m = 1 \cdot 2 = 2\]
  2. A tempting wrong move: Add the slope to the starting height.

    \[f(1.2) \approx 2 + 2 = 4\]

    The red point \((1.2, 4)\) lies far above the orange step, which is only 2.4 high at \(x = 1.2\). The slope is the change in \(y\) for a run of 1, and this step runs only 0.2.

  3. Multiply the slope by the step size first. The rise is 0.4, not 2.

    \[\Delta y = 2\,(0.2) = \cg{0.4}\]
  4. Add the rise to the starting height. The step ends at \((1.2, 2.4)\).

    \[f(1.2) \approx 2 + 0.4 = \cy{2.4}\]

Practice

Let \(y = f(x)\) be the solution to \(\dfrac{dy}{dx} = y - x\) with \(f(2) = 5\). Use one Euler step of size 0.5 to approximate \(f(2.5)\).

Find the slope at \((2, 5)\) first. Then move the slider to draw the step, which runs 0.5 to the right.

Solution
  1. Put \(x = 2\) and \(y = 5\) into \(y - x\).

    \[m = 5 - 2 = 3\]
  2. Multiply the slope by the step size to find the change in \(y\).

    \[\Delta y = 3\,(0.5) = \cg{1.5}\]
  3. Add the change to the starting height.

    \[f(2.5) \approx 5 + 1.5 = \cy{6.5}\]

Questions

Questions 1 and 2 use the slope field of \(\dfrac{dy}{dx} = \dfrac{x + y}{2}\). Each short segment has the slope of the curve at its center.

  1. An Euler step of size 0.5 starts at the orange dot \((1, 3)\). By how much does \(y\) change?

    • 1
    • 2
    • 0.5
    Answer

    1

  2. An Euler step of size 2 starts at \((2, 0)\). Which point does it reach?

    • \((4, 2)\)
    • \((4, 1)\)
    • \((2, 2)\)
    • \((4, 0)\)
    Answer

    \((4, 2)\)

  3. Let \(y = f(x)\) be the solution to \(\dfrac{dy}{dx} = x^2 - 2y\) with \(f(1) = 3\). Use one Euler step of size 0.1 to approximate \(f(1.1)\).

    • 2.5
    • 3.5
    • −2
    • −5
    Answer

    2.5

Summary

You find the slope at the starting point, multiply it by the step size, and add the result to the starting height.

This works because a line with that slope stays close to the curve for a short distance.

You use it when an equation gives the slope but you have no formula for the curve.

This is one of four skills in topic 7.5 of Which & Why: AP Calculus.