Many differential equations have no solution formula, yet the equation still gives the slope of the solution at every point. You can stand at the initial point, walk a short time along the tangent, read the new slope and walk again, but how far from the true solution are you after many such steps? Throughout, is the independent variable, , and the problem is with . This lesson builds Euler’s method, separates the error of a single step from the error left after many steps, and shows how halving the step and checking stability tell you whether the computed numbers deserve trust.
Key terms
Euler’s method
Definition Choose a step size and the grid times for . Euler’s method starts from the given value and computes
so that approximates the exact value . To reach a final time in equal steps, take . The method is explicit, because the new value uses only numbers that are already known. It comes from the tangent line approximation , where the equation supplies . The broken line through the computed points is in general not a solution of the equation, and the numbers can approximate the solution only on an interval inside its interval of existence.
In plain words Read the slope where you are, follow that tangent for a time , then read the slope again where you land. The step size is the time between grid points. A smaller step follows the curve more closely but needs more steps to reach the same final time.
Example Take with and . The slope at the start is . The slope at the new point is recomputed as , not reused, so the two steps are
at the times and . The exact solution is , since its derivative is and its value at is . At it equals , while Euler’s method gives . On this equation every step multiplies the value by , so , which here is .
Local truncation error
Definition Let be the exact solution. The local truncation error of Euler’s method at step is
the part of the exact change over the step that one Euler step, started from the exact value , misses. If has a continuous second derivative on , Taylor’s theorem with remainder gives a time in with
so whenever on the step. The local truncation error is therefore of order . With this sign, a positive value means that the step lands below the exact solution. Some books divide by and call the local truncation error, and with that convention it is of order , so a claim about local order should say which convention it uses.
In plain words Put the start of one step exactly on the true curve. The tangent ignores how the curve bends during the step, and the miss equals half of times the second derivative at some time inside the step, so it shrinks like .
Example On an exact step multiplies the value by , and
Euler’s method keeps only , so a step from the exact value misses by , whose leading term is . The first step, from with , has , close to . With the first miss is , about times smaller. The positive leading coefficient explains why every tangent step lands low on this decaying curve.
Global error
Definition The global error at is the computed value minus the exact value,
after steps that start from . Subtracting the identity from the Euler step gives the exact recursion
Now suppose that is continuous for and all real , that it satisfies the Lipschitz condition there with a constant , and that the exact solution has a continuous second derivative on with . Then, in exact arithmetic, every grid time satisfies
On a fixed finite interval the global error of Euler’s method is therefore of order .
In plain words The global error is the error you actually see at a given time. Each step adds a new local miss and carries the earlier error forward, and the Lipschitz condition limits how much one step can enlarge that earlier error, to at most the factor . Roughly misses of size add up to an error of size .
Example On with we have , so the recursion reads . The first step gives . The second miss is , so . The direct comparison agrees. The negative sign says that the computed value lies below the curve. For the bound, and on , so at the bound is , well above the actual size .
Order of accuracy
Definition A one-step method has order , a positive integer, if for every problem with a sufficiently smooth right side its local truncation error is of order as . For Euler’s method and the Runge-Kutta methods of the next lessons, a Lipschitz condition on then makes the global error of order on a fixed interval inside the interval of existence. This means that there are constants and with for every whenever . Euler’s method has order , with local truncation error of order and global error of order . Under the normalized convention that divides by , the local truncation error has the same order as the global error. The order describes the limit of small steps. For a coarse step the error ratios can be far from what the order predicts, and when the solution is less smooth than the analysis assumes, the observed order can be lower.
In plain words The order tells you how fast the error falls as the step shrinks. In a typical problem, once is small, halving it divides the global error by about . For Euler’s method, half the step gives about half the error for twice the work.
Example For with , here are the Euler values and signed errors at the common time . The last column divides the error in the row above by the error in its own row.
| Steps | Euler value | Signed error | Ratio | |
|---|---|---|---|---|
The value for is exactly . The ratios approach , as order predicts, while the coarsest pair is noticeably off.
Step refinement
Definition Step refinement repeats a computation with the step halved, and so with twice as many steps, and compares the results at the same final time . Write for the value at computed with step . If the global error of a method of order behaves like with independent of , then , so the error of the finer result is estimated by
Subtracting this estimate from gives the improved value , called Richardson extrapolation. Neither formula needs the exact solution, and both are estimates that become reliable only when is small enough for the leading term to dominate. Results at different final times cannot be compared this way, because their difference also contains the change of the exact solution between those times.
In plain words Halve the step and see how far the answer moves. For Euler’s method the move is about as large as the error that remains in the finer answer, and repeated halving shows whether the answers settle down at the expected rate.
Example For at , the steps and give and . With the estimated error of the finer value is , and the actual error is . The extrapolated value is closer to than either computed value. The coarser pair and gives the estimate for an actual error of , which shows that the estimate improves as shrinks.
Numerical stability and positivity
Definition Apply Euler’s method to the decay equation with a constant and . The exact solution stays positive and decreases to . Each Euler step multiplies by the same factor, so
The computed values tend to exactly when , which means . They stay positive and decrease exactly when , which means . At the value drops to after one step, for it alternates in sign while shrinking, at it alternates with constant size, and for its size grows without bound. Accuracy, numerical stability and positivity are three separate questions about the same computed numbers.
In plain words The exact solution always decays, but the Euler numbers decay only when the step is short compared with the time scale . A step can keep the numbers bounded and still be inaccurate, and numbers that do decay can still turn negative in a model of a quantity that cannot be negative.
Example For the factor is . Steps with give positive decreasing values, and steps with give decaying values. With the factor is , and the values , , , at , , , shrink while changing sign, although the true solution is positive. With they alternate between and , and with the factor makes them grow. Even the safe step left an error of about at .
Check yourself
- Use Euler’s method with on , , to approximate . Check that is the exact solution, and give the signed error.
Show the answer
The first slope is , so at . The second slope is , so at . The proposed solution has , and also , with . So , and the signed error is . The solution is concave up, because , so each tangent step lands below the curve.
- Euler’s method with is applied to , . Do the computed values decay, and are they positive? Which step sizes give values that are positive and decreasing?
Show the answer
The factor per step is , so the values are , , , and so on. They decay in size, since the factor has absolute value below , but they alternate in sign, while the exact solution is positive. Decay requires , which means . Positive decreasing values require , which means . The step meets the first condition and fails the second.
- Euler’s method on , , gives at with and with . Estimate the signed error of the finer value without using the exact solution, then compare with the truth. Why must both runs end at the same time?
Show the answer
Each step multiplies by , so the two values are and . With the denominator equals , so the estimated error of the finer value is . The extrapolated value is . The exact value is , so the actual error of the finer value is about , close to the estimate. Both runs must end at because the estimate reads the change between them as approximation error. Values at different times would also differ because the exact solution itself changes between those times.