Back to the on-screen lesson ·

Euler's method

Following a solution nobody has a formula for, one tangent at a time: $y_{\text{next}} = y + h\,f(x, y)$, the slope recomputed at every new point, and the concavity that decides which side of the truth the estimate lands on.

Paper packet. Every task here also exists on screen, where it is checked automatically; answers written on paper are not assessed by Nydus. When you are back at a device, enter your answers there.

1. What you will learn

By the end of this lesson you can take Euler steps to estimate a solution no formula gives, recomputing the slope from the differential equation at each new point and multiplying it by the step size before adding. You can lay the steps out as a table, plot where they land, say which side of the true curve the estimate falls on and why concavity rather than the method decides it, and say what dividing the step size buys and what it costs.

2. What you bring to this

You can separate a differential equation and sketch a slope field. Most differential equations cannot be separated, and most have no formula for their solution at all — but every one of them still tells you the slope at every point, and that is enough to follow the solution by hand.

3. Words you will need

Step size $h$: how far along $x$ each step goes.

Euler step: $y_{\text{next}} = y + h \times f(x, y)$, where $f(x, y)$ is the slope the equation gives at the point you are on.

First order: the error over a fixed interval is roughly proportional to $h$.

Local truncation error: how much one step gets wrong; the errors of the separate steps accumulate.

4. Following the tangent, over and over

A differential equation hands you the slope at every point. Euler's method uses it in the only way that needs nothing else: stand at a point, take the slope the equation gives you there, walk along that tangent for a short distance, and then ask the equation again.

$$y_{\text{next}} = y + h\,f(x, y)$$

That is the linear approximation, applied once. Euler's method is the linear approximation applied repeatedly, each time starting from wherever the last step landed.

The slope is recomputed every step. This is the whole method and the whole way it goes wrong. Reusing the first slope draws one straight line, and a straight line is exactly what the solution of an interesting differential equation is not.

Which side the answer falls on is decided by concavity. A tangent lies below a concave-up curve and above a concave-down one, so Euler under-estimates a solution that is concave up and over-estimates one that is concave down. Work it out from the shape of the solution rather than remembering a rule.

It is first order, which is not a compliment. Halving the step roughly halves the error and doubles the work. It is taught because it is the simplest thing that works, and because every better method is a refinement of the same idea.

Another way: picture

Picture walking across a hillside in fog with a compass that tells you the slope of the ground exactly where you stand. You take a few paces in that direction, stop, and read the compass again. The path you trace is made of straight segments and the hillside is not, so you drift — and the shorter your paces, the less you drift and the longer it takes.

Another way: steps

  1. Write down the starting point and the step size.
  2. Put that point into the equation to get the slope there.
  3. New value equals old value plus step size times slope.
  4. Move $x$ along by the step size.
  5. Repeat from step 2 with the new point — never with the old slope.

5. Three steps, written out

Following $\dfrac{dy}{dx} = x + y$ from $(0, 1)$ with $h = 1$:

StepStart atSlope thereNew value
1$(0, 1)$$0 + 1 = 1$$1 + 1 \times 1 = 2$
2$(1, 2)$$1 + 2 = 3$$2 + 1 \times 3 = 5$
3$(2, 5)$$2 + 5 = 7$$5 + 1 \times 7 = 12$

The slope column is the interesting one: $1$, then $3$, then $7$. A single straight line would have used $1$ three times and arrived at $4$ instead of $12$.

6. Three things that trip people up

Reusing the first slope. The slope belongs to the point, and the point moves. Recompute it every step.

Forgetting to multiply by the step size. The slope is a rate; the rise across the step is the rate times $h$. Adding the slope itself is the same mistake as confusing a speed with a distance.

Guessing which side the estimate is on. It is not a property of Euler's method but of the solution's concavity, and it can be settled in one line: a tangent lies below a curve that holds water.

7. One step, and what it is made of

  1. For $\dfrac{dy}{dx} = 2y$ with $y(0) = 3$, take one step of size $0.1$. The slope at $(0, 3)$ is $2 \times 3 = 6$.

    Slope first, at the point you are on.

  2. The rise across the step is $0.1 \times 6 = 0.6$.

    Rate times step size.

  3. So $y(0.1) \approx 3.6$. The true value is $3e^{0.2} \approx 3.66$ — the estimate is low, as a concave-up solution demands.

8. Two steps, with the slope recomputed

  1. Continue from $(0.1, 3.6)$. The slope there is $2 \times 3.6 = 7.2$, not the $6$ used before.

    A new point means a new slope.

  2. The rise is $0.1 \times 7.2 = 0.72$, so $y(0.2) \approx 4.32$.

  3. Had the first slope been reused, the answer would have been $4.2$. One step in, and the two methods have already parted company.

9. Your turn: one step of size $0.5$ for $\dfrac{dy}{dx} = x + y$ from $(0, 2)$

  1. The slope at $(0, 2)$ is $0 + 2 = 2$, taken from the equation at that point.

    Substitute the point you are on.

  2. The rise across the step is $0.5 \times 2 = 1$.

    Slope times step size.

  3. Your turn: work this step out. Its working is at the end of the packet.

    So the estimate is $y(0.5) \approx 3$, and the next step would start from $(0.5, 3)$ with a slope of $3.5$ — a different number entirely.

10. Guided practice

For $\dfrac{dy}{dx} = x + y$ with $y(0) = 1$, take three Euler steps of size $1/2$. For each step give the slope you use and the value you reach.

$x$ at the startSlope used$y$ after the step
Step 10
Step 20.5
Step 31

11. Guided practice

For $\dfrac{dy}{dx} = y$ with $y(0) = 2$, take two Euler steps of size $1$. Give the value after the first step, then after the second.

after one step: p, after two: q

12. Practice

For $\dfrac{dy}{dx} = 2y$ with $y(0) = 1$, take three Euler steps of size $1$ and plot the point reached after each.

Plot your answer on the grid:

12342468101214161820222426steps takenvalue

13. Practice

Euler's method is applied to $\dfrac{dy}{dx} = 6y$ with $y(0) = 6$, whose true solution is $6e^{6x}$. Does the estimate come out too high or too low?

14. Practice

Put the parts of a single Euler step for $\dfrac{dy}{dx} = x + 4y$ into the order you do them.

Number the steps in order (write the number in the box):

15. Somewhere new

Euler's method with a step of $1$ estimated $y(6)$ and was out by $8$. The calculation is repeated with a step of $\dfrac{1}{2}$. Roughly how far out is it now?

Answer:

16. Lesson test

Lesson test: one question per skill, one attempt each, no hints. Your answers are checked when you submit.

17. Test question

For $\dfrac{dy}{dx} = x + y$ with $y(0) = 1$, take three Euler steps of size $1/2$. For each step give the slope you use and the value you reach.

$x$ at the startSlope used$y$ after the step
Step 10
Step 20.5
Step 31

18. What you can do now

You can run Euler's method and say how much to trust it. Without looking: what has to be recomputed at every step, what decides whether the estimate is too high or too low, and what happens to the error when the step size is halved?

Working for the steps left to you

9. Your turn: one step of size $0.5$ for $\dfrac{dy}{dx} = x + y$ from $(0, 2)$, step 3