Euler's Method
Value: 1
Value: 0.1
Value: 50
Value: 5
Euler's Method
Numerical procedure for solving ODEs with a given initial value:
yₙ₊₁ = yₙ + h × f(xₙ, yₙ)
Blue = Euler approximation  ·  Red = exact solution.

About Euler's Method

Euler's method, proposed by Leonhard Euler in 1768, is the oldest and conceptually simplest algorithm for numerically solving ordinary differential equations. Given the derivative function f(t, y) and a current state (t_n, y_n), it estimates the next state as y_{n+1} = y_n + h·f(t_n, y_n), where h is the timestep. Each step follows the tangent line to the solution curve for a distance h before recomputing the slope. Despite its simplicity, the method is first-order accurate — global error grows as O(h) — and all higher-order methods like Runge-Kutta can be understood as improvements upon this basic idea.

The key limitation of Euler's method is error accumulation. For a simple test ODE dy/dt = −k·y (exponential decay), the exact solution is y₀·e^(−kt), but each Euler step introduces a local truncation error proportional to h²·y''. This error accumulates step by step, so after N steps the global error scales as N·h² = T·h, where T is total simulation time — confirming first-order convergence. Halving the step size halves the final error but doubles the computation, while RK4 achieves fourth-order convergence with only four times the work per step.

This interactive visualization solves a chosen ODE simultaneously with Euler's method and the exact analytical solution, letting you watch the numerical error accumulate in real time. Adjusting the step size h reveals the tradeoff directly: large h computes fast but the Euler trajectory visibly drifts from the true solution, while small h tracks the exact curve closely at the cost of more steps. This makes the tool a clear demonstration of why step-size selection is one of the fundamental practical decisions in numerical ODE solving.