TL;DR
Many differential equations cannot be solved with a formula. Euler's method gets an approximate answer anyway. Start at the known point, measure the slope there, move a short step along that slope, and repeat. Each step is a straight line, so the path is a chain of short segments that bends the way the true solution bends.
The method is crude. Its error shrinks in proportion to the step size, so you need small steps for a good answer. It is still the foundation for almost every numerical ODE solver.
Where you'll see it: in simulating falling objects and circuits in code, in cooling and population models with no closed-form answer, and in the residual-network view of deep learning, where one layer is exactly one Euler step.
Intuition
Walking with a map that only shows slopes
Suppose you know where you are and which way you are heading, but not the whole road. A reasonable plan is to look at the slope under your feet, walk a short distance in that direction, look again, and repeat. You never see the full curve. You only ever know the local direction, and you assume it stays put for the length of one step.
That is the whole idea. An ODE tells you the slope at every point . You know the starting value , so you know the slope there. The tangent line at that point is a good guess for where the solution goes over a short interval of length .
Why does this matter? Writing a law of nature as an ODE is usually the clearest description of it, but solving the ODE by hand is often impossible. A computer, however, can follow slopes all day. Euler's method turns the rule "how things change" into a loop a computer can run.
- exact solution
- Euler, step 5
- Euler, step 2.5
The math
The setup
Take an initial value problem: an unknown function that obeys
Here is time, is the quantity we track, and is the rule giving its slope. We want approximate values at times , where is a fixed step size.
The update rule
Euler's method is
Read it as: new value equals old value plus step size times slope. The slope is evaluated only at the start of the step and then held fixed for the whole step. That is the source of both the simplicity and the error.
Where the formula comes from
Taylor's theorem (see Taylor series) expands the true solution around :
for some between and . Since , dropping the last term gives exactly the Euler update. The dropped term is the local error, and it is of size .
Order of accuracy
One step makes an error of order . Taking steps to reach a fixed time accumulates about local errors, and . So the global error is of order . Euler's method is called first-order for this reason. Halving roughly halves the error, and reducing the error by a factor of 100 costs about 100 times more steps.
Systems
An ODE system uses the same rule with vectors:
A second-order equation such as becomes a system by setting . Then and , and each step updates position and velocity together.
Worked examples
Solve with , from to , using step . The exact answer is .
- Here , so each step is .
- Step 1: at .
- Step 2: at .
- Error: , about 17 percent of the true value.
Now halve the step to . The multiplier per step is , and after four steps . The error is , about 10 percent. Halving cut the error by a factor of about 1.7, close to the expected 2. Interpretation: Euler's answer is always too low here, because the true curve bends upward and the tangent lines lie underneath it.
A cup of tea starts at in a room at . Newton's law of cooling gives with , in minutes. Its exact solution is , so .
Step minutes:
- At : slope . So .
- At : slope . So .
- Euler says at . The true value is , so the error is .
Step takes four steps and ends at , an error of about . Halving the step cut the error by a factor of about . Interpretation: with a coarse step, Euler predicts the tea cools faster than it really does. For a rough estimate that may be fine; for a precise one, shrink the step or use a better method.
Tradeoffs and failure modes
Euler's method is the right choice when the problem is simple, the step count is cheap, and you want code that fits on one screen. It is the wrong choice when accuracy matters and the step has to be large, or when the system is stiff.
| Situation | What goes wrong | Better choice |
|---|---|---|
| Smooth problem, need many digits | Error is only order ; you need tiny steps | Runge-Kutta methods (order 4 is standard) |
| Stiff system, fast decay plus slow change | Euler becomes unstable unless is tiny | Implicit methods such as backward Euler |
| Long simulation of an oscillator | Energy drifts, amplitude grows slowly | Symplectic or higher-order integrators |
| Quick educational or prototype code | Usually nothing | Euler is fine |
The stiff case is worth seeing once. Take with . The true solution decays quickly to zero. With , each Euler step multiplies by . After one step , after two steps . The numerical solution explodes while the true one vanishes. The fix is to use a step small enough that , which means , or to switch to an implicit method.
History
Euler's method appears in Leonhard Euler's multi-volume work on integral calculus, published in the late 1760s and early 1770s, where he was systematising the theory of differential equations. Euler needed a way to approximate solutions where no closed form was known, and stepping along tangent lines was the most direct approach available with pencil and paper.
The method was largely a computational tool for a long time. Carl Runge and Martin Kutta, around the 1890s and early 1900s, developed the higher-order schemes that now carry their names by evaluating the slope at several points inside each step. Modern solvers in scientific computing still use that family, and the forward Euler step remains the simplest member of it.
Check yourself
QuestionWrite the Euler update for . Which quantity is held constant over one step?Show answer
The update is . The slope , computed at the start of the step, is held constant for the whole step of length . Euler's method never looks at the slope at any point inside the step, which is why its error is only of order per step.
QuestionUse Euler's method with to estimate for , . The exact value is . What is the error?Show answer
Each step multiplies by . After two steps, . The error is , roughly 12 percent. Interpretation: the approximation is low, because for a growing function the tangent line always sits below the curve.
QuestionIf you halve the step size, roughly how much does the global error of Euler's method shrink, and why?Show answer
It roughly halves. The global error is of order , because each local error is of order and there are about steps. Halving halves the global error and doubles the number of steps, so the cost of each factor of two in accuracy is also a factor of two in work.
QuestionWhy can Euler's method blow up on even though the true solution decays to zero?Show answer
Each step multiplies by . Unless , the multiplier is larger than 1 in size, and with it equals , so the iterates grow. The true solution is stable for any step, but the numerical method is only stable for small steps when the system decays fast. This is the stiffness problem.
QuestionA deep residual network computes for each block . Which ODE step does this match, and what does a network with many thin blocks become in the limit?Show answer
It matches one Euler step with applied to the ODE . Each residual block is one step of the solver. Taking more blocks with a smaller effective step approaches the continuous ODE, which is the idea behind residual networks viewed as discretised flows and behind neural ODEs. The continuous limit is what makes the depth of the model a time variable rather than a fixed count.