Euler's method is a numerical technique for approximating the solution of an ordinary differential equation when an initial value is known. Starting from that value, it repeatedly advances a short distance using the slope prescribed by the equation at the current point. Named after Leonhard Euler, it is one of the simplest methods in numerical analysis and a basic example of a first-order, explicit, one-step integration method. Unless otherwise qualified, “Euler's method” usually means the forward Euler method, rather than the related backward Euler method.
Definition and construction
Consider the initial-value problem
Here is the independent variable, often time, and specifies the derivative of the unknown function . Choose a positive step size and define grid points
Euler's method constructs approximations through the recurrence relation
The quantity is the estimated slope at the current numerical state. Multiplying it by estimates the change in over the next step.
The method is:
- Explicit: the next value is obtained directly from already known quantities, without solving an equation for .
- One-step: the next value depends only on the current state and current time, not on a history of earlier numerical values.
- First-order: under suitable regularity assumptions, its error over a fixed integration interval is proportional to as tends to zero.
A variable grid is also possible. With , the update becomes
Geometric and analytic interpretations
Tangent-line approximation
At a point on the exact solution, the differential equation gives the slope of the tangent line. Euler's method follows that tangent for one step, then recomputes the slope at the new approximate point.
Connecting successive numerical points by straight segments produces an Euler polygon. The polygon does not generally lie on the exact solution curve: each segment uses a slope frozen at its left endpoint, even though the true slope may change throughout the step.
Taylor expansion
If the exact solution is sufficiently smooth, its Taylor expansion gives
Substituting and discarding terms of degree two and higher yields Euler's update. The notation , an instance of big-O notation, describes how a quantity is bounded as becomes small.
Integral approximation
The fundamental theorem of calculus gives
Approximating this integral by a left-endpoint rectangle gives
Replacing the exact current value with the numerical approximation produces Euler's method. When depends only on time, the method reduces to accumulating a left-endpoint Riemann sum.
Worked example
Consider
whose exact solution is the exponential function . Euler's method gives
so that
For , the first few values are:
| Euler approximation | Exact value , rounded | |
|---|---|---|
| 0.0 | 1.000000 | 1.000000 |
| 0.1 | 1.100000 | 1.105171 |
| 0.2 | 1.210000 | 1.221403 |
| 0.3 | 1.331000 | 1.349859 |
At , ten steps give
compared with . Reducing the step size to gives
The error decreases by approximately a factor of two, consistent with first-order convergence. For this particular problem, the method underestimates the solution because the slope increases during each step; Euler's method does not underestimate solutions in general.
Accuracy and convergence
Two distinct errors are important.
Local error
The local one-step error is the error made by a single Euler step when it starts from the exact value:
If is bounded, then
Terminology varies: some texts call this the local truncation error, while others use that term for the normalized quantity , which is .
Global error
The global error compares the computed and exact solutions after many steps:
Suppose satisfies a Lipschitz condition in its second argument, with constant , and the exact solution has on the interval of interest. Then
Starting from an exact initial value, for this implies
Consequently, on a fixed finite interval,
The errors introduced at individual steps accumulate and propagate through approximately steps, producing an global error. The bound also shows that first-order convergence alone does not guarantee a small error: the interval length and the sensitivity of the underlying equation matter.
Numerical stability
Numerical stability concerns how a numerical method propagates perturbations and errors. Its behavior is commonly examined using the scalar test equation
where may be a complex number. Euler's method gives
Thus its amplification factor is
The region of absolute stability is
the closed disk centered at with radius in the complex plane. Strict inequality gives decay of the numerical solution.
For real , numerical decay requires
At the upper boundary, the numerical solution alternates sign without decaying. Above it, the numerical solution grows in magnitude even though the exact solution decays.
Stiff equations
A stiff differential equation contains rapidly decaying modes that can impose severe stability restrictions on explicit methods, even when the solution of interest changes slowly. Forward Euler may then require extremely small steps for stability rather than for accuracy, making it computationally inefficient.
Oscillatory systems
For a purely imaginary , with real nonzero ,
Forward Euler therefore amplifies an undamped oscillatory mode for every positive step size. This makes it poorly suited to long-time simulation of conservative oscillations: apparent energy growth can be a numerical artifact rather than a property of the model.
Systems of equations and implementation
For a system with state vector ,
the same formula applies componentwise:
Higher-order ordinary differential equations can first be rewritten as first-order systems. For example,
becomes
Forward Euler then updates both components from the same old state:
Using the newly computed velocity in the position update would define a different scheme.
For a constant linear system , where is a matrix,
Its eigenvalues help identify step-size restrictions, although nonnormal matrices can also exhibit transient amplification that eigenvalues alone do not describe.
Each Euler step requires one evaluation of . Only the current state needs to be retained unless the full trajectory is required. In floating-point arithmetic, decreasing the step size indefinitely is not guaranteed to improve results: more steps introduce more rounding operations, and very small increments may be lost when added to much larger state values.
Related methods
Backward Euler
The backward Euler method uses the slope at the new point:
It is implicit and generally requires solving an algebraic equation, often with Newton's method for nonlinear problems. It is also first-order, but its stability region contains the entire left half-plane, making it useful for many stiff problems.
Higher-order explicit methods
Euler's method is the simplest member of the Runge–Kutta family. Additional slope evaluations can improve accuracy. One example is Heun's method:
Under suitable smoothness assumptions, this method has second-order global accuracy. The phrase “improved Euler method” is used inconsistently, sometimes for Heun's method and sometimes for the explicit midpoint method; the update formula is therefore more precise than the informal name.
History and applications
Euler developed the method in his eighteenth-century work on differential equations. Its simple construction made it a foundational example in the development and teaching of numerical integration.
It remains useful for introductory computation, simple nonstiff simulations, and analysis of more elaborate algorithms. Applying forward Euler in time after a spatial finite-difference discretization is a basic approach to time-dependent partial differential equations, although spatial discretization may impose increasingly restrictive time-step limits.
Euler's method also connects continuous and discrete models. Applying it to the gradient flow
gives
which is gradient descent with a fixed step size. In both settings, the step size influences stability and convergence; a discrete trajectory need not preserve all qualitative properties of its continuous counterpart.