Tutorials › Calculus I › Estimating Error by Step Doubling

Euler's Method and Numerical Solutions · Tutorial 1441 of 1495

Estimating Error by Step Doubling

You will learn to use the difference between a full Euler step and two half-steps to estimate local error and assess a proposed step.

Advanced 9 min read

What You'll Learn

  • Compute a full Euler step and two half-steps from the same initial value.
  • Derive why their difference estimates the refined value’s local error.
  • Convert the difference into an error estimate for either the coarse or refined result.
  • Assess a proposed step against a stated local-error tolerance.
  • Interpret step-doubling estimates for a system of differential equations.
  • Recognize when local error estimates do not describe accumulated global error.

Why Compare One Step with Two Half-Steps?

Forward Euler gives a simple approximation to a solution of an initial-value problem, but a single computed value does not reveal how far it is from the true solution. Step doubling supplies a practical diagnostic: starting from the same value, compute once with step size \(h\), then compute twice with step size \(h/2\). The two results differ because the approximations respond differently to the changing slope.

The difference is useful because, for a sufficiently smooth problem and a sufficiently small step, it estimates the local error. Here “local” means the error made over this step when the starting value is treated as exact. This is not automatically an estimate of the error accumulated over many steps.

Definition: For \(y'=f(t,y)\), starting value \(y(t_n)=y_n\), and proposed step \(h>0\), the one-step Euler value is \(Y_1=y_n+h f(t_n,y_n)\). The two-half-step value is obtained by taking an Euler step of size \(h/2\), then another Euler step of size \(h/2\) from the resulting point. The step-doubling difference is \(D=Y_2-Y_1\).

How to Compute and Interpret the Difference

Let \(f_n=f(t_n,y_n)\). The midpoint value after the first half-step is \(y_{n+1/2}=y_n+(h/2)f_n\). Evaluate the slope again at the new time and this midpoint value; the two-half-step result is

$$ Y_2 = y_n+\frac{h}{2}f(t_n,y_n) +\frac{h}{2}f\left(t_n+\frac{h}{2},y_n+\frac{h}{2}f(t_n,y_n)\right). $$

The full-step value is \(Y_1=y_n+h f(t_n,y_n)\), so subtraction gives a convenient expression for the difference:

$$ D = \frac{h}{2}\left[ f\left(t_n+\frac{h}{2},y_n+\frac{h}{2}f(t_n,y_n)\right) -f(t_n,y_n) \right]. $$

For a smooth scalar problem, the difference estimates the local error of the two-half-step result. The one-full-step result has about twice that error, to leading order. Consequently, if the requested output is \(Y_2\), use \(|D|\) as its local error estimate; if the requested output is \(Y_1\), use \(2|D|\). The factor matters: the same difference is being used to estimate the errors of two approximations with different step sizes.

Why the Estimate Works

Assume \(f\) is sufficiently smooth near the starting point that Taylor expansions through second order have remainders of order \(h^3\). Define \(g(t,y)=f_t(t,y)+f_y(t,y)f(t,y)\). By differentiating the differential equation along its solution, \(y''(t)=g(t,y(t))\). In the following expansions, write \(g_n=g(t_n,y_n)\), and take \(y_n\) to be the exact starting value.

1
Expand the exact solution.
Taylor expansion along the solution gives \(y(t_n+h)=y_n+h f_n+(h^2/2)g_n+O(h^3)\).
2
Expand the full Euler step.
Since \(Y_1=y_n+h f_n\), its error, defined as exact minus numerical, is \(y(t_n+h)-Y_1=(h^2/2)g_n+O(h^3)\).
3
Expand the second half-step slope.
Taylor expansion of \(f\) at the half-step point gives \(f(t_n+h/2,y_n+(h/2)f_n)=f_n+(h/2)g_n+O(h^2)\).
4
Compare the two-half-step value.
Substitution into its formula gives \(Y_2=y_n+h f_n+(h^2/4)g_n+O(h^3)\). Thus \(D=Y_2-Y_1=(h^2/4)g_n+O(h^3)\), while \(y(t_n+h)-Y_2=(h^2/4)g_n+O(h^3)\).

The last two expressions have the same leading term, so \(D\) estimates the refined result’s error. The full-step error has twice that leading term. This argument explains both the estimate and its limitation: the equality is approximate, with higher-order terms that can matter when the step is not small or the solution changes rapidly.

Local error estimate: For a smooth problem and small \(h\), \(|Y_2-Y_1|\) estimates the local error of the two-half-step value, and \(2|Y_2-Y_1|\) estimates the local error of the one-full-step value. The estimate is conditional on the supplied starting value; it does not include errors accumulated before that value.

Worked Examples

Worked Example: Assessing a Step for \(y'=t\)

Suppose \(y(1)=2\), and assess a proposed step \(h=0.4\). First use one full Euler step. The initial slope is \(f(1,2)=1\), so

$$Y_1=2+0.4(1)=2.4.$$

For two half-steps, the first step has size \(0.2\). It gives \(y=2+0.2(1)=2.2\) at \(t=1.2\). The slope there is \(f(1.2,2.2)=1.2\), so the second half-step gives

$$Y_2=2.2+0.2(1.2)=2.44.$$

Therefore \(D=2.44-2.4=0.04\). The estimated local error is \(0.08\) for the full-step result and \(0.04\) for the two-half-step result. If the allowed local error is \(0.05\), the full-step result does not meet the estimate, while the refined result does.

Check against the exact solution: integrating \(y'=t\) from \(t=1\) gives \(y(t)=2+(t^2-1)/2\). At \(t=1.4\), this is \(2+(1.96-1)/2=2.48\). The actual errors are \(2.48-2.4=0.08\) and \(2.48-2.44=0.04\), agreeing exactly with the estimates in this example.

Worked Example: Estimating Error for \(y'=y\)

Take \(y(0)=1\) and \(h=0.2\). The full Euler step is \(Y_1=1+0.2(1)=1.2\). For the first half-step, \(y=1+0.1(1)=1.1\). The slope at that point is \(1.1\), so the second half-step gives \(Y_2=1.1+0.1(1.1)=1.21\).

The difference is \(D=1.21-1.2=0.01\). Thus the estimated local errors are \(0.02\) for the full-step result and \(0.01\) for the two-half-step result. If the tolerance is \(0.012\) and the refined value is the one to be used, its estimated error is within tolerance.

Check against the exact solution \(y(t)=e^t\). At \(t=0.2\), \(y(0.2)=e^{0.2}\approx1.221403\), rounded to six decimal places. The refined value’s actual error is approximately \(1.221403-1.21=0.011403\), and the full-step error is approximately \(1.221403-1.2=0.021403\). The estimates \(0.01\) and \(0.02\) are close, but not exact; higher-order terms account for the difference.

Worked Example: A Coupled System

For a system, apply Euler’s formula to every component using the same time step. Consider \(y_1'=y_2,\;y_2'=-y_1\), starting from \((y_1,y_2)=(1,0)\), with \(h=0.2\). One full step has initial slope \((0,-1)\), hence \(Y_1=(1,0)+0.2(0,-1)=(1,-0.2)\).

The first half-step gives \((1,0)+0.1(0,-1)=(1,-0.1)\). At this point the slope is \((-0.1,-1)\), so the second half-step gives \(Y_2=(1,-0.1)+0.1(-0.1,-1)=(0.99,-0.2)\). Therefore \(D=Y_2-Y_1=(-0.01,0)\).

Using the infinity norm, defined by \(\|(a,b)\|_\infty=\max(|a|,|b|)\), the difference has size \(0.01\). This estimates the local error of the two-half-step result; the full-step error estimate is \(0.02\). To check, the exact solution is \((\cos t,-\sin t)\). At \(t=0.2\), it is approximately \((0.980067,-0.198669)\), rounded to six decimal places. The refined-value error is approximately \((-0.009933,0.001331)\), whose infinity norm is \(0.009933\), close to \(0.01\).

Common Pitfalls and Practical Interpretation

Using the estimate for the wrong value. A common mistake is to compute \(D=0.01\) and claim that the full-step value’s error is about \(0.01\). For a first-order Euler method, the leading-order estimate for that value is \(2|D|=0.02\); \(|D|=0.01\) estimates the refined, two-half-step value instead.

Comparing runs with different starting values. The full step and both half-steps must begin from the same \(y_n\). Otherwise, their difference includes a change in starting value, and the local-error argument above does not apply as stated.

Confusing local and global error. Step doubling estimates the error generated over one step from the specified starting value. If that starting value already has error, the estimate does not measure or remove it. Errors from earlier steps can also propagate into later values, so a small one-step estimate alone does not certify small total error over a long interval.

Treating the estimate as an exact bound. The Taylor argument gives a leading-order estimate, not a guaranteed upper bound. For a small difference, the approximation can be informative; for a large difference, or a problem whose slope changes sharply within the step, the neglected higher-order terms may be significant. When checking a tolerance, state which of the two computed values will be used and compare its corresponding estimate with the tolerance.

Takeaway: Compute both results from the same starting value. Their difference estimates the local error of the two-half-step Euler result; double its magnitude to estimate the full-step result’s local error. Interpret either estimate as an approximation, not as a bound on accumulated error.

Check Your Understanding

Use the same-starting-value rule and distinguish clearly between the full-step and refined-value estimates.

  1. For \(y'=y\), \(y(0)=2\), and \(h=0.1\), calculate the full Euler value, the two-half-step value, and their difference.
  2. If the difference has magnitude \(0.006\), what local error estimates correspond to the full-step value and the two-half-step value?
  3. Why must both computations start from the same value for the difference to estimate local error?
  4. Does a small step-doubling difference prove that the accumulated error at a much later time is small? Explain.
  5. For a system, what norm or componentwise comparison could be used to summarize the vector difference?

Test yourself: Calculus I final exam practice

Ready to check what you know? Work a full-length practice final, then open the complete worked solutions.

Want all 1,114 practice problems?

This tutorial covers one topic. Calc Pass covers the full Calculus AB & BC curriculum (the core of Calculus I and II): full review, every practice question, and step-by-step solutions to each one.

QR code to download the Calc Pass app

Get the Calc Pass App

Scan to download and practice on the go, with instant scoring.

Calc Pass Volume 1: 1,114 Practice Questions book cover

Vol. 1: 1,114 Questions

The complete practice question bank, organized by AB & BC topic.

View on Amazon
Calc Pass Volume 2: Solutions Manual book cover

Vol. 2: Solutions Manual

Fully worked solutions to every question in Volume 1.

View on Amazon