Euler’s method: building a numerical solution step by step
Unit 7 · Topics 7.5 · Detailed notes, a worked example, and a self-check with reasoning.
Browse Unit 7 lessons
Understand the idea
Euler's method approximates a solution of a differential equation by following short tangent-line segments. Each step uses the slope evaluated at the current approximate point. It produces a sequence of approximate values, not an exact formula for the solution curve.
For y′=f(x,y), begin with the supplied initial point and a stated step size. Compute the slope, multiply it by the horizontal step, and add the result to the current vertical value. Only after calculating the new point should you evaluate the slope for the next step.
An Euler table should show the old input, old approximate output, slope, and new output. Smaller steps often improve an approximation under suitable regularity conditions, but the numerical result remains an approximation. If concavity is known, tangent-line reasoning can help assess the direction of local error.
xn+1=xn+h,yn+1=yn+hf(xn,yn)
A method you can apply
Record (x0,y0), the signed step size h, and the target input.
At each current point, evaluate f(xn,yn) and compute yn+1=yn+hf(xn,yn).
Update x as well as y, repeat the requested number of steps, and label the result approximate.
Worked example
Use Euler's method with h=0.25 to approximate y(0.5) when y′=x+y and y(0)=1.
At (0,1), the slope is 0+1=1. Thus the first step gives y1=1+0.25(1)=1.25 at x1=0.25.
At the updated point (0.25,1.25), the slope is 0.25+1.25=1.5.
The second step gives y2=1.25+0.25(1.5)=1.625 at x2=0.5.
Euler updates with step size 0.25
Step
Current x
Current y
Slope x + y
Next y
1
0
1
1
1.25
2
0.25
1.25
1.5
1.625
Euler's method gives y(0.5)≈1.625. The second slope must use the first approximate output, not the initial output again.
Try it yourself
Use two Euler steps of size 0.5 for y′=2x−y, y(0)=1, to approximate y(1).
Show solution and reasoning
The first slope is −1, giving y(0.5)≈0.5. The next slope is 2(0.5)−0.5=0.5, giving y(1)≈0.5+0.5(0.5)=0.75.