Euler Method Calculator
- Euler's method walks the slope field in straight steps: y next = y + h x f(x, y). Here the equation is y' = y with step size h = (1 - 0) / 10 = 0.1.
- The first step uses the slope at the start, f(0, 1) = 1, landing at y = 1.10000 when x = 0.1. Every later step re-reads the slope where it lands.
- After 10 steps the estimate at x = 1 is 2.59374. The exact solution there is 2.71828, so the absolute error is 0.12454 (4.58 %).
- Euler's method is first order: halving the step size roughly halves the global error, at the cost of twice the steps. That predictable trade is why it still introduces every numerical ODE course.
The Euler Method Calculator walks a differential equation forward one small step at a time and shows you the approximate value it reaches. Give it a starting point, a step size and a number of steps, and it applies y next = y + h x f(x, y) at each stage. The method never looks ahead: each step follows the slope where it stands. The results can be modest. For y' = y starting at (0, 1), ten Euler steps of size 0.1 give 2.59374 at x = 1, against an exact 2.71828. That is an absolute error of 0.12454, a relative error of 4.58 %. For y' = x + y from (0, 0), ten steps give 0.59374 against an exact 0.71828, the same absolute error of 0.12454. For y' = y - x^2 + 1 from (0, 0.5), twenty steps to x = 2 give 5.06350 against an exact 5.30547.
Euler's method is the accepted standard for this kind of calculation because it is the simplest honest way to turn a slope rule into numbers, and its behavior is well understood. It is first order: halving the step size roughly halves the global error. That predictable trade-off between step size and accuracy is what makes it the reference method taught first and trusted as a baseline. This page shows the formula, the step-by-step workings, worked examples and sources, so you can check every number yourself rather than take the output on faith.
Worked examples
y' = y, ten steps
(y' = y · 0 · 1 · 1 · 10 steps)
| Euler estimate at the target x | 2.59374 |
| Exact solution at the target x | 2.71828 |
| Absolute error | 0.12454 |
| Relative error | 4.58 % |
| Step size h | 0.1 |
y' = x + y
(y' = x + y · 0 · 0 · 1 · 10 steps)
| Euler estimate at the target x | 0.59374 |
| Exact solution at the target x | 0.71828 |
| Absolute error | 0.12454 |
| Relative error | 17.34 % |
| Step size h | 0.1 |
y' = y - x^2 + 1
(y' = y - x^2 + 1 · 0 · 0.5 · 2 · 20 steps)
| Euler estimate at the target x | 5.06350 |
| Exact solution at the target x | 5.30547 |
| Absolute error | 0.24197 |
| Relative error | 4.56 % |
| Step size h | 0.1 |
How Euler's method works
Euler's method builds a solution one step at a time, and the easiest way to see how is to walk through a single step. Take the equation y' = y starting at the point (0, 1). The derivative tells you the slope at that point, and here the slope equals the y-value, so at (0, 1) the slope is 1. With a step size of h = 0.1, you move right 0.1 in x and up by the slope times the step: 1 × 0.1 = 0.1. The new point is (0.1, 1.1), and the y-value lands at 1.10000 after that one step.
The key move is what happens next. The method does not keep using the original slope of 1. It re-reads the slope at the new point. At (0.1, 1.1) the slope is now 1.1, so the second step rises by 1.1 × 0.1 = 0.11, landing at 1.21000. Each step follows the slope where it stands, y_next = y + h × f(x, y), and never looks ahead. The method assumes the slope stays fixed across the whole step, even though the true curve keeps bending. That flat-step assumption is the source of the error, and it is why the estimate drifts away from the exact answer as you continue.
Run ten of these steps of size 0.1 and you reach x = 1 with y = 2.59374, while the exact value is 2.71828. The absolute error is 0.12454, a relative error of 4.58 %. A good euler method calculator performs exactly this repeated arithmetic, so the numbers you see are the same ones you would get by hand, just without the tedium of tracking each slope.
The pattern holds across different problems. For y' = x + y from (0, 0), ten steps give 0.59374 against an exact 0.71828, the same absolute error of 0.12454. For y' = y - x^2 + 1 from (0, 0.5), twenty steps to x = 2 give 5.06350 against an exact 5.30547. Because Euler's method is first order, halving the step size roughly halves the global error, so smaller steps buy accuracy in a predictable, if slow, way.
The three built-in equations
A good Euler method calculator is only as useful as the examples you can check it against. The tool ships with three built-in equations, and each was picked for one reason: its exact solution is known. That means the calculator never asks you to take its word for anything. Every number it produces can be compared directly against the true value, so the error is measurable rather than assumed. You can watch the method drift away from the exact answer step by step, which is the whole point of studying a numerical technique.
The first equation is y' = y, starting at (0, 1). This is the simplest exponential growth problem, and its exact solution at x = 1 is 2.71828. Running ten Euler steps of size 0.1 gives 2.59374. The gap is 0.12454 in absolute terms, a relative error of 4.58 %. That single run shows both faces of the method: it lands in the right neighborhood, and it clearly undershoots, because each step follows the slope where it stands, y next = y + h x f(x, y), never looking ahead. On a rising curve, that built-in lag always costs you.
The second equation is y' = x + y, starting from (0, 0). Here the slope depends on x as well as y, so the problem is a little less trivial. Ten steps of size 0.1 give 0.59374 at x = 1, against an exact value of 0.71828. The absolute error is again 0.12454 — the same figure as the first equation. That coincidence is worth pausing on: two different equations, the same step size, the same count of steps, and the same absolute gap. It is a clean reminder that error depends on the problem and the setup together, not on how complicated the equation looks.
The third equation is y' = y - x^2 + 1, starting at (0, 0.5). This one runs twenty steps to x = 2 and gives 5.06350, against an exact 5.30547. With more steps over a longer interval, the accumulated gap is larger, which is exactly what you would expect. This is also where the first-order nature of Euler's method becomes practical: halving the step size roughly halves the global error. Try it in the calculator by doubling the number of steps and watching the result move closer to the exact value.
Together the three equations cover growth, a slope that depends on both variables, and a longer run with a nonlinear term. Because each has a known exact answer, you can use them to sanity-check the calculator before trusting it on a problem where no exact solution exists.
- y' = y from (0, 1): ten steps of 0.1 give 2.59374 at x = 1; exact 2.71828; absolute error 0.12454, relative error 4.58 %.
- y' = x + y from (0, 0): ten steps give 0.59374; exact 0.71828; the same absolute error of 0.12454.
- y' = y - x^2 + 1 from (0, 0.5): twenty steps to x = 2 give 5.06350; exact 5.30547.
Reading the error
Numbers from an Euler run mean little on their own. The way to read them is to set the approximation beside the exact value and measure the gap. Take y' = y starting at (0, 1). Ten Euler steps of size 0.1 reach 2.59374 at x = 1, while the exact value is 2.71828. The absolute error is 0.12454, a relative error of 4.58 %. That is the baseline: about four and a half cents lost on every dollar of the true answer.
Now compare a different problem with the same step count. For y' = x + y from (0, 0), ten steps give 0.59374 against an exact 0.71828. The absolute error is again 0.12454 — identical to the first run. The relative error, however, is 17.34 %, because the exact value here is small. Nothing about the method changed; only the size of the answer did. This is why a relative error can look alarming while the absolute miss is modest, and why you should report both when you check results from a euler method calculator.
The third run shows the effect of more, smaller steps. For y' = y - x^2 + 1 from (0, 0.5), twenty steps to x = 2 give 5.06350 against an exact 5.30547. The absolute error is 0.24197, a relative error of 4.56 %. Notice that the relative error sits close to the 4.58 % of the first run, even though the interval is longer and the step size is half. Accuracy here is governed by step size and by how the slope behaves across the interval, not by the number of steps alone.
The pattern behind these figures is order. Euler's method is first order: halving the step size roughly halves the global error. So if a run at h = 0.1 misses by about 4.58 %, a run at h = 0.05 should miss by roughly half that, and a run at h = 0.025 by roughly half again. You can test this yourself by rerunning the same problem at two step sizes and comparing the errors. If the error does not fall by about half when you halve h, something in the setup — the starting point, the step count, or the function — is not what you think it is.
- y' = y, (0, 1), ten steps of 0.1: 2.59374 vs. exact 2.71828 — absolute error 0.12454, relative error 4.58 %.
- y' = x + y, (0, 0), ten steps: 0.59374 vs. exact 0.71828 — same absolute error 0.12454, but 17.34 % relative because the exact value is small.
- y' = y - x^2 + 1, (0, 0.5), twenty steps to x = 2: 5.06350 vs. exact 5.30547 — absolute error 0.24197, relative error 4.56 %.
Step size and accuracy
Step size is the single control that decides how much error an Euler run carries, and the method's first-order nature tells you exactly what to expect from it. Euler's method is first order: halving the step size roughly halves the global error. That is a straight-line trade, not a bargain. If you want ten times the accuracy, you need about ten times the steps — and ten times the arithmetic. A good euler method calculator lets you rerun the same problem at h = 0.1, 0.05, and 0.025 and watch the error shrink by roughly half each time, which is the practical way to confirm the method is behaving as it should.
Concrete numbers make the trade visible. For y' = y starting at (0, 1), ten Euler steps of size 0.1 give 2.59374 at x = 1 against an exact 2.71828. The absolute error there is 0.12454, a relative error of 4.58 %. The same pattern shows up in a different equation: for y' = x + y from (0, 0), ten steps give 0.59374 against an exact 0.71828, the same absolute error of 0.12454. And when the interval is longer, the error accumulates over more ground — for y' = y - x^2 + 1 from (0, 0.5), twenty steps to x = 2 give 5.06350 against an exact 5.30547. Each step follows the slope where it stands, y next = y + h x f(x, y), never looking ahead. That forward-only slope is the source of the error, and smaller steps reduce it only in proportion to h.
So how small should h be? Start by running the problem at two step sizes and comparing the results at the endpoint. If halving h roughly halves the difference, you are seeing clean first-order convergence and the smaller answer is the better one. Keep halving until the change between runs is smaller than the accuracy you actually need. Because the cost is linear in the number of steps, this process is predictable: you can estimate the work before you commit to it, and you can stop as soon as the answer is good enough for your purpose.
There is a point where shrinking h stops being worth it. If you need several digits of accuracy over a long interval, first-order convergence forces a step count that grows quickly, and round-off from very large numbers of tiny steps can begin to compete with the truncation error you are trying to remove. That is when to move on to Runge-Kutta instead. A fourth-order Runge-Kutta method reaches far smaller errors with far fewer steps, so the extra work per step pays for itself once Euler's linear trade becomes too expensive. Use Euler to learn the idea and to get a quick first look; switch to Runge-Kutta when the accuracy target is tight or the interval is long.
FAQs
What does Euler's method give for y' = y at x = 1?
With 10 steps, Euler's method gives 2.59374 at x = 1 for y' = y starting from (0, 1). The exact solution at that point is 2.71828, so the approximation falls short of the true value by 0.12454. The gap shows how the accumulated step-by-step error grows across the interval.
How accurate is Euler's method?
Euler's method is first order. In the 10-step run, it errs by 0.12454, a relative error of 4.58 %. Halving the step size roughly halves the error, so accuracy improves only slowly. To gain much more precision you must take many more steps, which is why higher-order methods are often preferred.
What is the first Euler step for y' = y from (0, 1)?
At (0, 1) the slope equals y, so the slope is 1. Multiplying that slope by the step of 0.1 gives a rise of 0.1, which lands at y = 1.10000 at x = 0.1. This single step is the starting point for the full 10-step run to x = 1.
Why is the relative error bigger for y' = x + y?
The absolute error is the same 0.12454, but the exact answer for this problem is only 0.71828. Dividing the error by that smaller exact value gives a relative error of 17.34 %. The same absolute miss therefore looks much worse when the true answer is small, which is why relative error matters.
How many steps reach x = 2 in the third example?
The third example uses 20 steps of 0.1 to reach x = 2. Euler's method gives 5.06350 there, against an exact value of 5.30547. The difference again shows the accumulated error of first-order stepping over a longer interval with twice as many steps as the earlier run.
When should I not use Euler's method?
Avoid Euler's method for stiff equations or when you need high accuracy. Its error shrinks only in proportion to step size, so precision gets expensive: to cut the error substantially you must shrink the step and add many more steps. For stiff problems or tight tolerances, choose a higher-order or implicit method instead.