Euler's method for approximating solutions to differential equations

If a function y(t) satisfies the differential equation

y' = f(t, y)

then for each value of t we have the approximate formula

y(t + h) = y(t) + h.f(t, y)

for small increments of time h (by definition of the derivative). If we want to solve the differential equation with initial conditions

y(t0) = y0

then Euler's method applies this approximate formula over and over again with some fixed time increment h. Thus we get a sequence of values yn approximating y at t0, t0+h, t0+2h, ...

In the following figure, we apply this to the equation y' = y

The blue graph plots the approximate solution, which is effectively a polygon. The initial conditions can be chosen with the blue node, step size with the red node. The Go button runs a loop performing single steps of the calculation, and changes to a b>Stop button. It stops the loop when the button is pressed. To increment just one step, press the button twice quickly.

The Reset button resets the calculation to initial conditions. Initial conditions and step size h can also be chosen by editing the text windows. The window frame can be chosen by moving the corner nodes. You can make slope fields appear by toggling the Slopes button.

[Back to the Mathematics 256 page]

Lecture in .pdf format