Two different kinds of wrong
In the last guide you marched an initial-value problem forward with forward Euler, taking step after step of size h. Each step you trusted the slope at the current point and walked a short straight line. The natural question is: how wrong is the dot you finally land on? It turns out there are two answers, and keeping them apart is the single most useful idea in this whole rung. One error is the small mistake a single step makes; the other is the total mistake that has piled up by the time you reach the end.
The single-step mistake is the local truncation error. Imagine you are sitting exactly on the true solution curve at time t_n — no error so far — and you take just one Euler step to t_{n+1}. The true solution will have curved a little during that step, but your straight line did not. The gap between where you land and where the true curve actually is, after that one honest step, is the local error. It measures only the freshly committed sin of the latest step, assuming everything before it was perfect.
The accumulated mistake is the global error: the actual gap between your numerical value y_n and the true solution at t_n, after all the steps you really took, each one starting from the imperfect point the previous step handed you. This is the error you actually care about — it is the number that decides whether your simulated planet ends up in the right orbit. The whole art of the next few guides is understanding how the tiny local errors conspire into the global one.
Where Euler's local error comes from
Taylor's theorem from the calculus rungs does all the work. Start on the true curve y at t_n. Expanding the exact solution one step forward gives y(t_{n+1}) = y(t_n) + h·y'(t_n) + (h^2/2)·y''(xi) for some point xi inside the step. But forward Euler computes only y(t_n) + h·y'(t_n) — it keeps the first two terms and silently drops everything from the h^2 term onward. The leftover, (h^2/2)·y''(xi), is exactly the local truncation error. It is the part of the true motion that the straight line could not see.
true step: y(t_{n+1}) = y_n + h y'(t_n) + (h^2/2) y''(xi)
Euler step: y_{n+1} = y_n + h y'(t_n)
--------------------------------------------------------
local error per step = (h^2/2) y''(xi) = O(h^2)
halve h -> local error per step drops by 4x (2^2)So Euler's local error per step is proportional to h^2 — we write it O(h^2). Read that as a promise about scaling, not an exact value: halve the step and each single step becomes about four times more accurate, because (h/2)^2 is h^2/4. That h^2 is genuinely small when h is small — if h is 0.01 then h^2 is 0.0001. The trap, which the next section springs, is that you do not take just one step.
Why the global error loses a power of h
Here is the accounting that surprises everyone the first time. To cross a fixed interval from t_0 to T, you take N = (T - t_0)/h steps. Each step adds about (h^2/2)·y'' of fresh local error. A crude first guess just adds them up: N steps times O(h^2) each. But N is proportional to 1/h, so N · h^2 is proportional to (1/h) · h^2 = h. The factors of h^2 and the count 1/h partly cancel, and one power of h is lost in going from the local to the global error.
So forward Euler has local error O(h^2) but global error O(h). The honest statement is subtler than just summing, because earlier errors get carried forward and stretched or damped by the dynamics of the equation itself — a careful proof bounds that amplification using the Lipschitz constant of the right-hand side. But the headline survives the careful proof: the global error is O(h), one order lower than the local error. This is the rule for essentially every well-behaved one-step method, and it is why we never quote local error alone.
Order is the price tag
The order of a method, p, is the exponent in its global error O(h^p), and it is the most important number you can know about a method before you run it. It answers the question that actually matters: if I do twice the work — halve h, double the number of steps — how much accuracy do I buy? For an order-p method, halving h multiplies the global error by (1/2)^p. Order 1 halves the error; order 2 quarters it; order 4, like the RK4 method waiting in the next guide, divides it by sixteen. Higher order means each extra unit of work buys far more accuracy.
Order is closely related to the order of convergence you met for root-finding, but with an important difference. There, Newton's quadratic convergence meant each step roughly squared the number of correct digits — error_{n+1} ≈ C·error_n^2, runaway-fast. Here, order p is about how the final error scales with the step size h, not iteration-to-iteration. Both are exponents that govern how fast error falls, but one races toward a root and the other measures the payoff of a finer grid. Do not let the shared word fool you.
There is a tempting fallacy worth killing now: higher order is not free. A higher-order method does more work per step (RK4 evaluates the slope four times per step), and its O(h^p) advantage only kicks in once h is small enough that you are firmly in the asymptotic regime. On a rough, jagged, or stiff problem the smooth Taylor picture that gave you that h^p can break down, and a fancy high-order method may do no better than humble Euler. Order is a promise about the limit of small h on smooth problems — a real promise, but a conditional one.
Measuring order yourself
You do not have to take a textbook's word for a method's order — you can measure it, and you should, because a coding bug very often shows up first as a method that fails to achieve its advertised order. The trick is a convergence study: solve the same problem with a sequence of halving step sizes, compare each numerical answer to a known true solution, and watch how the error shrinks. If halving h roughly halves the error you have order 1; if it quarters the error, order 2; if it cuts it by sixteen, order 4.
- Pick a test problem whose exact solution you know — e.g. y' = y, y(0) = 1, whose true answer is e^t — so you can compute the real error at the final time T.
- Solve it with step h, then again with h/2, h/4, h/8, recording the global error E(h) = |y_N - y(T)| each time.
- Form the ratio E(h) / E(h/2). For an order-p method this ratio approaches 2^p as h shrinks: about 2 for Euler, 4 for an order-2 method, 16 for RK4.
- Better still, plot log E against log h: the slope of the line is exactly the order p. A clean straight line of the expected slope is strong evidence your code is correct.