Euler Method ODE Calculator
The forward Euler method is the foundational technique for solving differential equations numerically: step along the slope, repeat, and watch a solution unfold. This calculator solves the linear test equation dy/dx = k times y, the standard benchmark, so you can compare the Euler estimate against its exact exponential solution. Enter the rate constant, the starting point, the end point, and the number of steps. It returns the Euler estimate at the end, the exact value, and the absolute error, making it easy to see how shrinking the step size improves accuracy.
Forward Euler formulas
Step size h = (final x - x0) / number of steps
f(x, y) = k * y for this equation
y_next = y + h * f(x, y) = y + h * k * y
Exact solution: y(x) = y0 * e^(k * (x - x0))
Each Euler step advances along the slope at the current point. The exact value comes from the closed-form solution of dy/dx = k y, letting you read off the error introduced by the numerical scheme.
Worked example and notes
- With k = 1, x0 = 0, y0 = 1, final x = 1, the exact value is e, about 2.7183.
- With 10 steps the Euler estimate is (1.1)^10, about 2.5937, an error of about 0.1245.
- With 100 steps the estimate is (1.01)^100, about 2.7048, a much smaller error.
- Global error shrinks roughly in proportion to the step size.
- A negative k models exponential decay; the method works the same way.
Euler method: frequently asked questions
What is the Euler method?
The forward Euler method is the simplest numerical scheme for solving an ordinary differential equation. Starting from a known point, it takes a step of size h along the current slope to estimate the next point: y_next equals y plus h times the slope f(x, y). Repeating this advances the solution across the interval.
Which equation does this calculator solve?
It solves the linear test equation dy/dx = k times y, the standard benchmark for numerical ODE methods. Its exact solution is y = y0 times e to the power k times (x minus x0), so you can compare the Euler estimate against the true value and see the error directly.
Why does the Euler method have error?
Euler approximates a curve by straight-line steps using the slope only at the start of each step. The local error per step is proportional to the step size squared, and the accumulated global error is proportional to the step size. Halving the step roughly halves the global error.
How can I make the Euler result more accurate?
Use a smaller step size, which means more steps across the same interval. As the number of steps increases the Euler estimate converges to the exact solution. Higher-order methods such as Runge-Kutta achieve far smaller error for the same number of steps.
What inputs does the calculator take?
Enter the rate constant k, the initial x and y values, the final x value, and the number of steps. The calculator divides the interval into equal steps, runs forward Euler, and reports the final estimate, the exact value, and the absolute error.
Official sources
- NIST Digital Library of Mathematical Functions: Differential equations and numerical methods.
- NASA Technical Reports Server: Numerical integration of ordinary differential equations.
Reviewed by the CalculatorHub team, edited by James Graham, 16 June 2026. See our methodology.