Key takeaways
- Euler's method: yₙ₊₁ = yₙ + h · f(xₙ, yₙ).
- Use the slope at the start of each step, then move forward by h.
- Smaller steps give better answers: halving h roughly halves the error.
- For growth problems like dy/dx = ky with k > 0, Euler's estimate comes out too low.
In this guide
What is Euler's method?
A differential equation tells you the slope of the solution at every point, but not the solution itself. Euler's idea is simple. Start at a known point, look at the slope there, and walk a short straight step in that direction. At the new point, check the slope again and take another step. Repeat until you reach your target.
It is like walking across a field in fog, checking your compass every few steps. Smaller steps keep you closer to the true path.
Why does Euler's method matter?
Most differential equations in real life, from weather to planetary orbits, have no neat formula for their solution. Computers solve them by stepping forward in small pieces. Euler's method is the simplest version, and every more advanced method builds on the same idea.
It also teaches an important lesson: approximations have errors, and step size controls them. Look at dy/dx = 0.5y from y(0) = 100 up to x = 2. The exact answer is about 271.83.
| Step size h | Euler estimate | Error |
|---|---|---|
| 0.5 | 244.14 | 27.69 |
| 0.25 | 256.58 | 15.25 |
| 0.1 | 265.33 | 6.50 |
Halve the step and you roughly halve the error. That's why Euler's method is called a first-order method.
The formula
| Symbol | What it means | Example |
|---|---|---|
| yₙ | Your current estimate | 100 |
| yₙ₊₁ | The next estimate | 125 |
| h | Step size in x | 0.5 |
| f(xₙ, yₙ) | The slope dy/dx at the current point. Here k·yₙ | 0.5 × 100 = 50 |
| k | Growth rate in dy/dx = k·y | 0.5 |
This calculator uses the equation dy/dx = k·y, starting at x = 0 with y = y₀, and steps until it reaches your target x. For this equation each step is simply yₙ₊₁ = yₙ × (1 + k·h). It lists the first four steps, the final estimate, the exact answer y₀·e^(k·x) and the error.
How to use Euler's method step by step
- 1Write down the start. Note (x₀, y₀) and the step size h.
- 2Find the slope. At the current point,
slope = k·yₙ. - 3Take a step.
yₙ₊₁ = yₙ + h × slopeandxₙ₊₁ = xₙ + h. - 4Repeat. Keep going until x reaches the target. The number of steps is
target ÷ h.
Now choose your own k, start, target and step size below, and compare the estimate with the exact answer.
Try it yourself
Pre-filled with the example — change any value.
Common mistakes to avoid
- Using a big step size. Large h gives a big error. Try halving it and see how the answer moves.
- Forgetting to update x. Each step moves x forward by h.
- Treating the answer as exact. It is an estimate. For growth it usually comes out too low, because the slope keeps rising during each step.
- Miscounting steps. Going from 0 to 2 with h = 0.5 takes 4 steps, not 5.
Tips and tricks
- Make a table: columns for n, xₙ, yₙ and slope keep your working tidy.
- Compare with the exact curve: the separable ODE calculator gives the true solution of dy/dx = ky.
- Same idea for areas: the Riemann sum calculator also adds up small straight pieces.
Where you'll use it in real life
- Video games: physics engines step positions and speeds forward each frame.
- Epidemics: simple models of how a disease spreads day by day.
- Space: a first estimate of a spacecraft's or planet's path.
- Finance: stepping a growing balance forward in time; see the exponential growth calculator.
Quick summary
Euler's method walks along the solution in small straight steps: new y = old y + h × slope at the old point. Smaller steps give smaller errors, at the cost of more work. Use the calculator above to watch the steps and compare the estimate with the exact answer.
Worked example
A savings balance of $100 grows continuously at a rate of 50% per year, so dy/dx = 0.5y. Estimate the balance after 2 years using Euler's method with steps of half a year, then compare with the exact answer. Use k = 0.5, y₀ = 100, target x = 2 and h = 0.5.
- 01ODE: dy/dx = 0.5y, y(0) = 100, target x = 2, h = 0.5
- 02Euler's method: yₙ₊₁ = yₙ + h·f(xₙ, yₙ) = yₙ + h·0.5yₙ = yₙ(1 + 0.25)
- 03Step 1: x=0.5, y=125
- 04Step 2: x=1, y=156.25
- 05Step 3: x=1.5, y=195.3125
- 06Step 4: x=2, y=244.1406
- 07Euler approximation: y(2) ≈ 244.1406
- 08Exact value: y₀·e^(1) = 271.8282
- 09Error: 27.6876
These numbers are pre-filled in the calculator above.
Frequently asked questions
How do I make Euler's method more accurate?
Use a smaller step size h. The error shrinks roughly in proportion to h, so 10 times smaller steps give about 10 times less error, but need 10 times more work.
What is Euler's method for dy/dx = y with h = 0.25?
Starting at y(0) = 1, each step multiplies by 1.25. After four steps, y(1) ≈ 1.25⁴ ≈ 2.4414, compared with the exact value e ≈ 2.7183.
Why is Euler's method called a first-order method?
Its total error is proportional to the step size h (to the first power). Better methods like the classic Runge-Kutta method have errors proportional to h⁴.
Why does Euler's method underestimate growth?
For dy/dx = ky with k > 0, the curve bends upward. Each straight step uses the slope at its start, which is the smallest slope in that step, so the estimate falls a little behind.


