Euler’s Method Calculator: Solve ODEs with Steps & Graph

This free Euler’s method calculator solves a first-order differential equation $\frac{dy}{dx}=f(x,y)$ step by step: enter the equation, a starting point, a step size, and how many steps to take, and it returns a full iteration table plus a graph of the approximate solution curve.

Final x
Final y (approx)
Steps
Enter dy/dx, a starting point, h and the number of steps, then press Calculate.
Free tool by mlforbeginners.com · embed it: <iframe src="https://mlforbeginners.com/eulers-method-calculator/"></iframe>

What is Euler's method?

Euler's method is the simplest way to solve a differential equation when you cannot find a formula for the answer. Many real-world equations describe how something changes — the rate $\frac{dy}{dx}$ — without telling you the value of $y$ directly. Euler's method walks forward in small steps, using the slope at each point to estimate the next one, tracing out an approximate solution curve. It is the foundation that every more advanced numerical solver builds on.

The formula behind the Euler's method calculator

Starting from a known point $(x_0, y_0)$ and a step size $h$, each new point comes from one simple update:

\( y_{n+1} = y_n + h\,f(x_n, y_n), \qquad x_{n+1} = x_n + h \)

In words: take the current slope, multiply by the step size, and add it on. Repeat, and you have a numerical solution.

How to use this Euler's method calculator

  1. Enter your differential equation as dy/dx = f(x, y) using x and y — e.g. x + y, x*y, or x - y^2.
  2. Set the starting point $(x_0, y_0)$.
  3. Choose the step size h and the number of steps, then press Calculate.

You get the full iteration table and a graph of the approximate solution — no algebra required.

Worked example

Solve $\frac{dy}{dx} = x + y$ with $y(0)=1$, step size $h=0.1$. The first two steps:

Step 1: slope $=f(0,1)=0+1=1$, so $y_1 = 1 + 0.1(1) = 1.1$ at $x=0.1$.
Step 2: slope $=f(0.1,1.1)=1.2$, so $y_2 = 1.1 + 0.1(1.2) = 1.22$ at $x=0.2$.

Continuing ten steps reaches $y(1) \approx 3.19$ — press Load example to see the whole table.

Step size and accuracy

⚠ Smaller steps, better accuracy. Euler's method is only a first-order method: halving the step size $h$ roughly halves the error. A large $h$ is fast but can drift away from the true curve — or even blow up. If your result looks unstable, reduce $h$ and add more steps.

Euler's method vs. better solvers

MethodOrderTrade-off
Euler1stsimplest, least accurate
Improved Euler (Heun)2ndaverages two slopes
Runge–Kutta (RK4)4ththe workhorse of real solvers

Why it matters in machine learning

Numerically solving differential equations is not just a calculus exercise. Neural ODEs treat a network's hidden state as the solution of a differential equation and integrate it forward — with Euler's method as the simplest integrator. Training dynamics, diffusion models, and continuous-time optimizers all lean on the same step-forward idea. To brush up on the slopes that drive it, see our derivative calculator; for the formal theory, the Euler method article on Wikipedia is a good reference.

Frequently asked questions

What does Euler's method do? It approximates the solution of a first-order differential equation $\frac{dy}{dx}=f(x,y)$ by stepping forward from a known starting point using the slope at each step.

What is the Euler's method formula? $y_{n+1}=y_n+h\,f(x_n,y_n)$, where $h$ is the step size and $f(x_n,y_n)$ is the slope at the current point.

How do I make Euler's method more accurate? Use a smaller step size $h$ (with more steps), or switch to a higher-order method such as Improved Euler or Runge–Kutta.

Why did my answer blow up? Large step sizes can make Euler's method unstable, sending values to infinity. Reduce $h$ and try again.

Scroll to Top