Euler's method, step by step
5 min read
Short answer
From , take a step of size along the tangent: , . Repeat. The error shrinks roughly in proportion to , so halving the step about halves the error.
The idea
The ODE tells you the slope at the current point. Pretend the slope stays constant for a short step , move along it, and recompute the slope at the new point. It replaces a curve by a polyline.
Error and better methods
Euler's method has global error of order : you lose a small amount each step, and the errors accumulate. Methods like improved Euler (Heun) and Runge-Kutta evaluate the slope more cleverly and reach order 2 and 4.
Worked example
For , , estimate with .
at . at . The exact value is , so the estimate is too low (the curve bends upward, so tangents underestimate).
Try it yourself
For , , take two steps of to estimate .
Show the answer
. .
Keep going with practice
Vidi's numerical-methods lessons build on this step to simulate motion in mechanics.