Differential equations: Euler's method: watch it solved step by step
Follow the slopes of dy/dx = f(x, y) step by step from a starting point, and see how close the estimate is. Level: University. Type any problem of this kind and the Lab works it out and animates every move, with a plain-words explanation of why.
Worked example: dy/dx = 2x, y(0) = 0, h = 0.25, to x = 1
- Understanding the problem. A differential equation gives the slope of a curve at every point. We know where the curve starts, so we can follow the slopes and trace it out in small steps.
- Euler's idea. At each point the slope tells us which way the curve is heading. Take one small step h along that tangent: the height changes by about slope × h.
- The first step. Work out the slope at the start, then step along it.
- Repeat for every step. Each row uses the end of the row above as its new start.
- How good is the estimate?. Euler's method follows tangents, so it drifts off a curving solution. Comparing with a much finer method (Runge-Kutta, 20 times more steps) shows the error.
- The answer. Halving the step size roughly halves the error: smaller steps trade more work for more accuracy.
Answer: y(1) ≈ 0.75 by Euler (a finer method gives ≈ 1)
Practise differential equations: euler's method with problems the Lab marks for you.