Euler's Method Calculator

Approximate a differential-equation solution one slope step at a time using a bounded set of safe functions.

Answer

After 10 steps

y ≈ 6.1917364

at x = 2

Numeric solution path

This shows the stepwise numeric path, not a symbolic closed-form solution.

Why this answer

Follow the local slope

At each step, Euler's method uses yₙ₊₁ = yₙ + h·f(xₙ,yₙ): move h across, and h × slope up, using the slope where the step starts.

Why smaller steps help: over one step the true solution bends away from the straight step by an amount that shrinks with the square of h (halve h, about a quarter of the gap). Reaching the same x takes twice as many steps, so the total drift roughly halves each time h is halved, and goes to zero with h.

First slope = 1 → y₁ = 1 + 0.2×1

Why it works

Why does stepping along the slope work?

123across 1up 1 × 100.250.50.751

Step 1 of 6

Follow the slope

The little dashes show the rule y′ = y: at every point, the slope equals the height, so the higher you are, the steeper the climb. We start at (0, 1).

Take one step 1 to the right, keeping the slope you start with. Where do you land?

Make a prediction.

Put it to use

Useful when exact formulas are unavailable

Euler's method is a starting point for numerical differential equations in engineering, biology, finance, control systems, and simulation.

How it works

Euler's method approximates the solution of a differential equation y′ = f(x, y) when you know a starting point. You choose one of three equations (y′ = x + y, y′ = y, or y′ = x − y), enter the starting point x₀ and y₀, the step size h, and the number of steps.

At each step, the calculator finds the slope at the current point, then follows that straight-line slope for a distance h. The new y is the old y plus h times the slope, and the new x is the old x plus h. It repeats this for the number of steps you chose.

The page reports the final y and the x where it lands, and draws the path of points. Smaller steps usually reduce the error but take more iterations. You can use up to 200 steps, and h may be negative to step backward.

yₙ₊₁ = yₙ + h × f(xₙ, yₙ)xₙ₊₁ = xₙ + hFinal x = x₀ + (number of steps) × h

Worked example: y′ = x + y, starting at (0, 1), with h = 0.1 and 3 steps

  1. Step 1: slope f(0, 1) = 0 + 1 = 1, so y₁ = 1 + 0.1 × 1 = 1.1 at x₁ = 0.1.
  2. Step 2: slope f(0.1, 1.1) = 0.1 + 1.1 = 1.2, so y₂ = 1.1 + 0.1 × 1.2 = 1.22 at x₂ = 0.2.
  3. Step 3: slope f(0.2, 1.22) = 0.2 + 1.22 = 1.42, so y₃ = 1.22 + 0.1 × 1.42 = 1.362 at x₃ = 0.3.
  4. Exact solution y = 2eˣ − x − 1 gives y(0.3) = 2 × 1.3498588 − 0.3 − 1 ≈ 1.3997176.
  5. Error: 1.3997176 − 1.362 ≈ 0.0377. Euler undershoots here because the curve bends upward.

Common mistakes

  • Using the slope at the new point instead of the current point. Euler's method always uses f(xₙ, yₙ) from the start of the step.
  • Forgetting to advance x. Each step moves x by h, and the next slope uses that new x.
  • Choosing a large h to save steps. Bigger steps drift further from the true curve, especially when it bends sharply.
  • Counting steps wrong. To reach x = 1 from x = 0 with h = 0.2 you need 5 steps, not 6.

Frequently asked questions

What is the formula for Euler's method?

yₙ₊₁ = yₙ + h × f(xₙ, yₙ), with xₙ₊₁ = xₙ + h. You follow the current slope for one step of size h.

How do I make Euler's method more accurate?

Use a smaller step size. The error at a fixed x is roughly proportional to h, so halving h roughly halves the error.

Does Euler's method overestimate or underestimate?

If the solution curve is concave up, Euler's method underestimates, because the tangent line lies below the curve. If it is concave down, Euler's method overestimates.

How many steps do I need to reach a certain x?

Divide the distance by the step size: steps = (target x − x₀) ÷ h. From x = 0 to x = 1 with h = 0.1, you need 10 steps.