Tutorials › Calculus I › How Local Errors Accumulate into Global Error

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

How Local Errors Accumulate into Global Error

Learn to distinguish a one-step truncation defect from the error at a later time and track how the Euler update carries errors forward.

Advanced 9 min read

What You'll Learn

  • Define one-step truncation defect and global error for Euler’s method.
  • Derive the recurrence connecting errors at consecutive steps.
  • Explain why local defects do not generally add independently.
  • Track accumulated error when defects add, are damped, or are amplified.
  • Identify and correct the mistake of equating total error with the sum of local defects.

Two Different Errors

Euler’s method advances a numerical solution one step at a time. At each step, the slope used in the update is based on the current numerical value, which may already differ from the exact solution. It is therefore useful to distinguish two quantities: the error made by one Euler step when it starts from an exact value, and the error in the computed value after many steps.

The first quantity isolates the effect of a single step. The second reflects the history of the computation: new defects arise, while errors already present may be altered by later updates. Understanding that distinction is the key to understanding how local errors accumulate into global error.

Set-Up and Definitions

Consider the initial-value problem \(y'=f(t,y)\), \(y(t_0)=y_0\), and suppose an exact solution \(y(t)\) exists at the times under consideration. On a grid \(t_0,t_1,\ldots,t_N\), write \(h_n=t_{n+1}-t_n\). Forward Euler produces values \(Y_n\) by the update \(Y_{n+1}=Y_n+h_n f(t_n,Y_n)\), starting from \(Y_0=y_0\).

Definition: The one-step truncation defect at step \(n\), denoted \(\delta_{n+1}\), is the difference between the exact solution at the end of the step and the Euler update made from the exact value at the start: $$ \delta_{n+1} = y(t_{n+1})-\left[y(t_n)+h_n f\bigl(t_n,y(t_n)\bigr)\right]. $$ The global error at grid point \(t_n\) is $$ E_n=y(t_n)-Y_n. $$

The defect is defined using the exact starting value \(y(t_n)\), not the computed value \(Y_n\). It measures what this single Euler step would miss if it began without any previous numerical error. The global error, by contrast, measures the difference between the exact and computed values at a particular grid point. Here the defect is unscaled; if a local truncation error is instead defined as \(\delta_{n+1}/h_n\), its contribution to the update is \(h_n\) times that quantity.

The Error Recurrence

The relation between the two errors follows directly by comparing the exact solution and the Euler update. From the definition of the defect, the exact solution satisfies \(y(t_{n+1})=y(t_n)+h_n f(t_n,y(t_n))+\delta_{n+1}\). Subtract the numerical update from this identity.

$$ \begin{aligned} E_{n+1} &=y(t_{n+1})-Y_{n+1}\\ &=y(t_n)+h_n f\bigl(t_n,y(t_n)\bigr)+\delta_{n+1} -\left[Y_n+h_n f(t_n,Y_n)\right]\\ &=E_n+h_n\left[f\bigl(t_n,y(t_n)\bigr)-f(t_n,Y_n)\right]+\delta_{n+1}. \end{aligned} $$

This identity is exact. It does not require a Taylor approximation or a bound on \(f\). It separates the next global error into three parts: the error already present, the change caused by evaluating the slope at different values, and the new one-step defect.

Key takeaway: A local defect is not, in general, simply added to the previous global error. The slope-difference term describes how the existing error affects the next update.

Starting from an exact initial value gives \(E_0=0\). Repeatedly applying the recurrence yields the identity $$E_N=\sum_{n=0}^{N-1}\left(h_n\left[f\bigl(t_n,y(t_n)\bigr)-f(t_n,Y_n)\right]+\delta_{n+1}\right).$$ This is a sum of contributions, but the slope-difference terms depend on the computed values, and those values depend on all earlier steps. Thus the terms are not generally independent local defects.

Worked Example: Defects Add Without Slope Feedback

Worked Example: Euler’s Method for \(y'=t\)

Take \(y'=t\), \(y(0)=0\), and use four equal steps of length \(h=0.25\) to reach \(t=1\). Integrating the differential equation gives the exact solution \(y(t)=t^2/2\). Since the slope \(f(t,y)=t\) does not depend on \(y\), an error in the computed value does not change the slope used at the next step.

The Euler updates are \(Y_{n+1}=Y_n+0.25t_n\):

$$ \begin{aligned} Y_0&=0,\\ Y_1&=0+0.25(0)=0,\\ Y_2&=0+0.25(0.25)=0.0625,\\ Y_3&=0.0625+0.25(0.50)=0.1875,\\ Y_4&=0.1875+0.25(0.75)=0.375. \end{aligned} $$

For any step starting at \(t_n\), the exact solution advances by \(\frac{(t_n+0.25)^2-t_n^2}{2}=0.25t_n+0.03125\). Euler advances by \(0.25t_n\), so each local defect is \(0.03125\). The exact and computed values, and the resulting global errors, are:

$$ \begin{array}{c|c|c|c} n&t_n&y(t_n)&Y_n\quad\quad E_n=y(t_n)-Y_n\\ \hline 0&0&0&0\quad\quad 0\\ 1&0.25&0.03125&0\quad\quad 0.03125\\ 2&0.50&0.125&0.0625\quad\quad 0.0625\\ 3&0.75&0.28125&0.1875\quad\quad 0.09375\\ 4&1&0.5&0.375\quad\quad 0.125 \end{array} $$

At the final time, the four defects add: \(E_4=4(0.03125)=0.125\). Checking directly gives \(y(1)-Y_4=0.5-0.375=0.125\), as required. In this example, the defects add because the right-hand side is independent of \(y\), so the slope-difference term in the recurrence is zero at every step.

When Later Steps Dampen an Error

A previous error need not survive unchanged. The next example has a large first-step error, but the Euler update removes its effect on the subsequent computed values. The local defects still occur, yet the global error at a later time is not their simple sum.

Worked Example: Euler’s Method for \(y'=-y\)

Take \(y'=-y\), \(y(0)=1\), and step size \(h=1\). The exact solution is \(y(t)=e^{-t}\). Euler’s update is \(Y_{n+1}=Y_n-Y_n=0\), so \(Y_1=0\) and \(Y_2=0\).

At the first step, starting from the exact value \(y(0)=1\), Euler predicts \(0\). Thus \(\delta_1=e^{-1}-0=e^{-1}\), and \(E_1=e^{-1}-0=e^{-1}\). At the second step, the defect is calculated from the exact starting value \(y(1)=e^{-1}\). Euler again predicts zero, so \(\delta_2=e^{-2}-0=e^{-2}\). The global error at \(t=2\) is \(E_2=e^{-2}-0=e^{-2}\).

The recurrence shows exactly how the first error changes. At the second step, \(f(y(1))-f(Y_1)=-e^{-1}-0=-e^{-1}\). Therefore, $$E_2=E_1+1(-e^{-1})+\delta_2=e^{-1}-e^{-1}+e^{-2}=e^{-2}.$$ Checking against the values gives \(y(2)-Y_2=e^{-2}-0=e^{-2}\). The first-step error is canceled by the slope-difference contribution; it is not retained as an extra \(e^{-1}\) in the final error.

When Later Steps Amplify an Error

The opposite behavior is also possible: an existing error can influence a later slope in a way that increases the discrepancy. In the next example, each defect is still measured from an exact starting value. The computed trajectory, however, uses its own previously computed value.

Worked Example: Euler’s Method for \(y'=y\)

Take \(y'=y\), \(y(0)=1\), with \(h=1\). The exact solution is \(y(t)=e^t\). Euler’s update is \(Y_{n+1}=Y_n+Y_n=2Y_n\), giving \(Y_0=1\), \(Y_1=2\), and \(Y_2=4\).

For the first step, the exact-start Euler prediction is \(1+1(1)=2\), so \(\delta_1=e-2\). The global error is \(E_1=e-2\), matching the direct calculation \(y(1)-Y_1=e-2\).

For the second step, start from the exact value \(e\), not the numerical value \(2\). The exact-start Euler prediction is \(e+e=2e\), so \(\delta_2=e^2-2e\). The global error at \(t=2\) is \(E_2=e^2-4\). The recurrence confirms it: the slope difference at \(t=1\) is \(f(e)-f(2)=e-2\), so $$E_2=(e-2)+(e-2)+(e^2-2e)=e^2-4.$$

Using \(e\approx2.718282\), the first global error is approximately \(0.718\), while the second is approximately \(3.389\), each rounded to three decimal places. The second defect is approximately \(1.952\); the remaining increase comes from the slope-difference term. Directly, \(e^2-4\approx7.389-4=3.389\), verifying the final error.

Common Mistake: Adding Only the Local Defects

A tempting shortcut is to claim that the global error after \(N\) steps equals the sum of the one-step defects. The growth example provides a concrete counterexample. Its defects sum to \((e-2)+(e^2-2e)=e^2-e-2\), which is approximately \(2.671\). But the actual global error is \(e^2-4\), approximately \(3.389\). The proposed sum is wrong because it omits the slope-difference contributions.

The correction is to use the error recurrence at each step, or to compute the exact solution and numerical value at the target grid point and subtract. Adding the local defects alone is justified only in a situation where the slope-difference terms vanish, as they did for \(y'=t\). More generally, the recurrence—not a bare sum of defects—keeps track of how the numerical method carries earlier errors forward.

Why the Distinction Matters

Local and global errors answer different questions. A local defect asks how accurately one Euler step reproduces the exact solution when started at the exact value. A global error asks how far the entire computed result has moved from the exact solution by a chosen time. A small one-step defect does not, by itself, specify the later global error: the effect of each defect depends on how subsequent updates respond to differences in the solution value.

This perspective gives a practical way to organize an error analysis. First identify the one-step defect. Then write the error recurrence and inspect the slope-difference term. Depending on the differential equation and step size, that term can vanish, reduce the effect of a previous error, or increase it. The recurrence makes clear what must be understood before making a claim about total error.

Check Your Understanding

Use the definitions and recurrence above to answer the following questions.

  1. In the definition of \(\delta_{n+1}\), why is the exact value \(y(t_n)\) used as the starting value?
  2. Write the error recurrence for a uniform step size \(h\) and explain the role of each term.
  3. For \(y'=t\), why do the one-step defects add directly to give the final global error?
  4. For \(y'=-y\) with \(h=1\), what contribution cancels the first global error at the second step?
  5. In the example \(y'=y\), why does adding the two local defects fail to give the global error at \(t=2\)?

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