Euler’s Method Calculator

  • Free
  • No sign-up
  • Works on phones
  • Shows the working
Physics & Applied#24

Euler's Method ODE Solver

Approximates \(y' = F(x, y)\) step by step, compared with RK4.

This Euler’s method calculator approximates the solution of a first-order initial value problem \( y' = F(x, y) \), \( y(x_0) = y_0 \). Type the right-hand side, the starting point, a step size and where you want to stop, and it returns the first rows of the step table, the Euler estimate at the endpoint, and a fourth-order Runge–Kutta (RK4) value for comparison.

It’s built for differential equations homework, checking a hand-made table, or seeing how much accuracy you lose with a large step. It’s free and needs no sign-up.

Euler's method calculator: Euler’s method for y′ = y with step 0.5 (points) underestimates the true solution y = eˣ…
Euler’s method for y′ = y with step 0.5 (points) underestimates the true solution y = eˣ, reaching 5.06 at x = 2 instead of e² ≈ 7.39.

How to use the Euler’s method calculator

  1. Enter \( F(x, y) \) in the y’ = F(x, y) box, using x and y. Write powers with ^ (x^2), and use sin(), ln(), sqrt() and e^(x). Implicit multiplication works, so 2x y and x sin(y) are fine.
  2. Enter the initial condition as x₀ and y₀.
  3. Choose the step h (it must be positive) and the value Solve up to x where you want the estimate. The number of steps is \( (x_{\text{end}} - x_0)/h \), rounded to a whole number.
  4. Press Solve ODE. The table lists \( n \), \( x_n \), \( y_n \) and the slope \( F(x_n, y_n) \) for the first five steps, then the Euler value, the RK4 value and the difference between them.

How it works

Euler’s method follows the slope field in straight segments. At each point it evaluates the slope, walks a distance \( h \) along the tangent line, and repeats:

A green scientific calculator, notebook, and pen on a white surface.

$$x_{n+1} = x_n + h$$

$$y_{n+1} = y_n + h\,F(x_n, y_n)$$

Each step uses a linear approximation. This is the same tangent-line estimate a linear approximation calculator makes. So, error per step is about proportional to \( h^2 \). Over a fixed interval, total error is roughly proportional to \( h \). The RK4 column uses four slope samples per step. It is far more accurate at the same \( h \). This makes it a useful reference when no exact solution exists. If your equation is simply \( y' = ky \), you do not need an euler’s method calculator. The exponential growth calculator gives the exact solution.

Worked example

Estimate \( y(1) \) for \( y' = y - x^2 \), \( y(0) = 1 \), with \( h = 0.2 \). That’s \( (1 - 0)/0.2 = 5 \) steps. You can type these same values into the calculator above.

Close-up of a calculator's keypad with numbers and function buttons.
\( n \) \( x_n \) \( y_n \) slope \( y_n - x_n^2 \)
0 0.0 1 1
1 0.2 1.2 1.16
2 0.4 1.432 1.272
3 0.6 1.6864 1.3264
4 0.8 1.95168 1.31168

For instance, the second step is \( y_2 = 1.2 + 0.2(1.2 - 0.04) = 1.432 \). The last step gives

$$y_5 = 1.95168 + 0.2(1.31168) = 2.214016$$

This equation has an exact solution, \( y = x^2 + 2x + 2 - e^x \). It satisfies \( y(0) = 1 \). So \( y(1) = 5 - e \approx 2.28172 \). The Euler estimate is low by about \( 0.0677 \). An euler’s method calculator shows the RK4 row agrees with the exact value to four decimal places.

Now change \( h \) to 0.1, 0.05 and 0.01 in the calculator. Each time you halve the step, the Euler error roughly halves too. That’s what “first-order method” means in practice.

Reading the output (and when to distrust it)

  • Difference between Euler and RK4. Treat it as a rough error estimate for the Euler value. If it’s large compared with the answer, shrink \( h \).
  • Consistent undershoot or overshoot. When the solution curve is concave up, the tangent lines sit below it and Euler underestimates; when it’s concave down, Euler overestimates.
  • “The solution blows up” message. Some equations, such as \( y' = y^2 \), have solutions that shoot to infinity at a finite \( x \). No step size fixes that; the true solution doesn’t exist past that point.
  • Wild oscillations. For fast-decaying equations like \( y' = -40y \), a step that’s too large makes Euler’s values flip sign and grow. Reduce \( h \) until the output settles.
  • Too many steps. The tool caps the run at 200,000 steps, so a tiny \( h \) over a long interval needs a larger step.

For the method itself, with a full hand-worked table and the reasoning behind the error, read our guide to Euler’s method.

Worked example: how the step size changes the answer

Solve \( y' = y \), \( y(0) = 1 \), up to \( t = 1 \). The exact answer is \( e \approx 2.71828 \).

Step size \( h \)StepsEuler’s estimateError
0.52\( 1.5^2 = 2.25 \)0.468
0.254\( 1.25^4 \approx 2.441 \)0.277
0.110\( 1.1^{10} \approx 2.594 \)0.125

Halving the step roughly halves the error: Euler’s method is first-order accurate. It always underestimates here because the solution curves upward, and each tangent-line step falls below it.

Better methods

Improved Euler (Heun’s method) and Runge–Kutta methods average several slopes per step. They are far more accurate for the same step size. The classical fourth-order Runge–Kutta method with \( h = 0.25 \) gets within about 0.0001 of \( e \) for this problem. You can use an euler’s method calculator for these computations.

Practice problems

  1. Use Euler’s method with \( h = 0.5 \) for \( y' = 2t \), \( y(0) = 0 \), to estimate \( y(1) \).
  2. What is the exact answer?

Answers: 1. \( y_1 = 0 + 0.5 \times 0 = 0 \), \( y_2 = 0 + 0.5 \times 1 = 0.5 \). 2. \( y = t^2 \), so \( y(1) = 1 \).

Related guides

Further reading

For an introduction to the equations themselves, read differential equations.

FAQ

Does the Euler’s method calculator show every step?

The table shows the first five steps in full, with \( x_n \), \( y_n \) and the slope at each one, then the final Euler estimate at your endpoint. For five steps or fewer, that’s the entire table.

What step size should I use for Euler’s method?

Start with whatever your problem specifies. If you’re choosing, keep halving \( h \) until the Euler value stops changing at the precision you need, or until it matches the RK4 row closely.

Why does the calculator also show RK4?

Runge–Kutta 4 uses four slope samples per step, and its error shrinks like \( h^4 \), so it’s a strong stand-in for the exact answer. The gap between the two tells you how far off the Euler estimate is.

Can I solve second-order equations with it?

Not directly. The tool handles a single first-order equation \( y' = F(x, y) \). A second-order equation has to be rewritten as a system of two first-order equations, which this calculator doesn’t accept.

Embed this calculator on your website

Teachers, tutors and bloggers are welcome to use this calculator for free. Copy the code below and paste it into any page (in WordPress, use a "Custom HTML" block). The small script makes the calculator grow to fit its answer; if your site removes scripts, it still works at a fixed height. Please keep the credit link.

More calculators

See all calculators