Tutorials › AP Statistics › Local Truncation Error in One Euler Step

Euler and Logistic Methods · Tutorial 585 of 999

Local Truncation Error in One Euler Step

Use a Taylor expansion to find the leading signed error from one forward Euler step and explain how it depends on the step size and the solution’s curvature.

Advanced 8 min read

What You'll Learn

  • Define the signed local error for a single forward Euler step starting from the exact initial value
  • Derive its leading term from the second derivative of the exact solution
  • Express the second derivative using a time-dependent differential equation’s slope function
  • Calculate and check one-step errors for linear, time-dependent, and nonlinear equations
  • Distinguish an error’s leading approximation from its exact value
  • Identify when omitting part of the chain rule gives an incorrect error estimate

Why Examine the Error in One Step?

A forward Euler step uses the slope at the start of an interval to estimate the solution at its end. Even if the starting value is exact, the slope usually changes during the step. The resulting difference between the Euler estimate and the exact solution is the local error in one step.

Understanding this error explains why smaller step sizes tend to improve an Euler approximation. More specifically, a Taylor expansion shows that the leading one-step error is proportional to the square of the step size. The coefficient depends on how the solution is bending at the start of the step.

Definition and Sign Convention

Consider an initial-value problem \(y'=f(t,y)\), with exact solution \(y(t)\). At time \(t_0\), suppose the starting value \(y_0=y(t_0)\) is exact. For a step size \(h>0\), the forward Euler estimate at the next time is \(y_0+h f(t_0,y_0)\).

Definition: In this tutorial, the signed local error for one forward Euler step is the exact value at the end of the step minus the Euler estimate: $$ E_{\mathrm{loc}}(h) = y(t_0+h)-\bigl(y(t_0)+h f(t_0,y(t_0))\bigr). $$ The starting value is exact; this definition concerns one step only.

This sign convention means that a positive error indicates that the exact value is greater than the Euler estimate, while a negative error indicates that the exact value is smaller. The error is not necessarily positive.

Deriving the Leading Error

Assume the exact solution has a continuous second derivative near \(t_0\). Taylor’s theorem gives its value after a sufficiently small step as its starting value, plus the first-derivative term, plus a second-derivative term and a remainder:

$$ y(t_0+h) = y(t_0)+h y'(t_0) +\frac{h^2}{2}y''(t_0)+o(h^2). $$

Here \(o(h^2)\) denotes a remainder whose ratio to \(h^2\) tends to zero as \(h\) tends to zero. Since \(y'(t_0)=f(t_0,y(t_0))\), the first two terms are exactly the terms used by the Euler step. Subtracting the Euler estimate leaves the second-derivative term as the leading error.

Theorem: If \(y\) has a continuous second derivative near \(t_0\), the signed local error of one forward Euler step from the exact value satisfies $$ E_{\mathrm{loc}}(h) = \frac{h^2}{2}y''(t_0)+o(h^2). $$ Thus its leading term is proportional to \(h^2\). If \(y''(t_0)\ne 0\), the ratio \(E_{\mathrm{loc}}(h)/h^2\) approaches \(y''(t_0)/2\) as \(h\) tends to zero.

The factor \(h^2\) appears because the Euler step includes the exact solution’s first-order change but not its second-order change. If the solution is curving upward at the start, then \(y''(t_0)>0\) and the leading signed error is positive. If it is curving downward, then \(y''(t_0)<0\) and the leading signed error is negative.

Relating Curvature to the Slope Rule

The curvature can be calculated from the differential equation. For \(y'=f(t,y)\), differentiate both sides with respect to \(t\). The chain rule gives

$$ y''(t) = \frac{d}{dt}f(t,y(t)) = f_t(t,y(t))+f_y(t,y(t))y'(t) = f_t(t,y(t))+f_y(t,y(t))f(t,y(t)). $$

Here \(f_t\) and \(f_y\) are partial derivatives with respect to the first and second inputs of \(f\). This formula requires those partial derivatives to exist along the solution. It shows that the curvature can come from two sources: the slope rule may change directly with time, and it may change as the solution value changes.

1
Find the starting slope.
Evaluate \(f(t_0,y_0)\) to calculate the Euler estimate.
2
Find the starting curvature.
Use \(y''=f_t+f_y f\) at \((t_0,y_0)\), or differentiate a known exact solution twice.
3
Calculate the leading error.
Multiply the curvature by \(h^2/2\). This is the leading term, not generally the exact error.

Worked Examples

Worked Example: Exponential Growth from an Exact Starting Value

Consider \(y'=y\), \(y(0)=1\), and take one Euler step with \(h=0.1\). The exact solution is \(y(t)=e^t\): its derivative is \(e^t=y(t)\), and it satisfies \(y(0)=1\).

The starting slope is \(y'(0)=y(0)=1\). Therefore the Euler estimate is

$$ y_{\mathrm{Euler}}(0.1) = 1+0.1(1) = 1.1. $$

For this equation, \(y''=y\), so \(y''(0)=1\). The leading signed error is

$$ \frac{h^2}{2}y''(0) = \frac{(0.1)^2}{2}(1) = 0.005. $$

The exact signed error is \(e^{0.1}-1.1\). Using the Taylor expansion \(e^{0.1}=1+0.1+(0.1)^2/2+(0.1)^3/6+\cdots\), this is approximately \(0.005170918\), which is positive and close to the leading estimate \(0.005\).

Check: The exact value is approximately \(1.105170918\). Subtracting the Euler value \(1.1\) gives \(1.105170918-1.1=0.005170918\), in agreement with the signed error and its predicted positive sign.

Worked Example: A Slope Rule That Depends on Time

Consider \(y'=t+y\), \(y(0)=1\), with \(h=0.1\). At the starting point, the slope is \(f(0,1)=0+1=1\), so one Euler step gives

$$ y_{\mathrm{Euler}}(0.1)=1+0.1(1)=1.1. $$

To find the curvature, note that \(f_t=1\) and \(f_y=1\). At \((0,1)\), \(f=1\), so

$$ y''(0)=f_t(0,1)+f_y(0,1)f(0,1) =1+(1)(1)=2. $$

The leading signed error is therefore

$$ \frac{(0.1)^2}{2}(2)=0.01. $$

For an exact check, \(y(t)=2e^t-t-1\) solves the equation: \(y'(t)=2e^t-1\), while \(t+y(t)=2e^t-1\), and \(y(0)=2-0-1=1\). At \(t=0.1\), the exact value is \(2e^{0.1}-1.1\), approximately \(1.110341836\). Subtracting the Euler estimate gives an exact signed error of approximately \(1.110341836-1.1=0.010341836\).

Check: The exact error is positive, as predicted by \(y''(0)=2>0\), and is close to the leading estimate \(0.01\).

Worked Example: A Nonlinear Slope Rule

Consider \(y'=y^2\), \(y(0)=1\), with \(h=0.2\). The Euler slope at the start is \(1^2=1\), so the Euler estimate is

$$ y_{\mathrm{Euler}}(0.2)=1+0.2(1)=1.2. $$

Differentiate \(y'=y^2\) with respect to time. By the chain rule, \(y''=2y y'\). Since \(y'=y^2\), this becomes \(y''=2y^3\), giving \(y''(0)=2(1)^3=2\). The leading signed error is

$$ \frac{(0.2)^2}{2}(2) = \frac{0.04}{2}(2) = 0.04. $$

An exact solution, valid for \(t<1\), is \(y(t)=1/(1-t)\). Indeed, \(y'(t)=1/(1-t)^2=y(t)^2\), and \(y(0)=1\). At \(t=0.2\), the exact value is \(1/(1-0.2)=1/0.8=1.25\). Thus the exact signed error is \(1.25-1.2=0.05\).

Check: The exact error is positive, consistent with \(y''(0)=2>0\). It differs from the leading estimate \(0.04\) because the leading term does not include all higher-order terms.

What the Step-Size Dependence Means

For a fixed starting point with nonzero curvature, halving a sufficiently small step changes the leading error by a factor of \(1/4\), because \((h/2)^2=h^2/4\). This compares the leading one-step terms; it does not say that an error at an arbitrary step size is exactly equal to \(\frac12 h^2y''(t_0)\).

If \(y''(t_0)=0\), the displayed leading term vanishes. The actual one-step error may still be nonzero, determined by higher-order terms. If the solution has a continuous third derivative nearby, Taylor’s theorem also gives a remainder of order \(h^3\) after the second-order term. When the second-order coefficient is zero, that third-order term or still higher terms can therefore matter.

The definition here uses the unnormalized difference between the exact endpoint and one Euler step. It isolates the error introduced by that step when its starting value is exact. It does not include inaccuracies already present in an approximate starting value or the effects of repeating many steps.

A Common Chain-Rule Pitfall

A frequent mistake is to calculate \(y''\) as \(f_y\) alone. That omits both the direct time dependence \(f_t\) and the factor \(y'=f\) multiplying \(f_y\). The correct formula is \(y''=f_t+f_y f\).

For example, with \(y'=t+y\) starting at \((0,1)\), using only \(f_y=1\) would give the incorrect curvature \(y''(0)=1\), and hence the incorrect leading error \(\frac{(0.1)^2}{2}(1)=0.005\). The correct calculation includes both terms: \(f_t=1\) and \(f_yf=(1)(1)=1\). Thus \(y''(0)=2\), and the correct leading error is \(\frac{(0.1)^2}{2}(2)=0.01\). The exact error, approximately \(0.010341836\), confirms which estimate is appropriate.

Why This Error Matters

The one-step expansion explains what Euler’s method leaves out: the solution’s curvature contributes a term of size \(h^2\) when the starting value is exact. It also explains why the sign and size of the leading error depend on the differential equation and the location on its solution, not just on the step size.

Keep the interpretation precise: the formula estimates the error from one step begun at the exact solution value. It is a local statement, and its leading term is not automatically the exact error. These distinctions make it possible to use the Taylor calculation accurately without confusing a one-step estimate with the behavior of an entire sequence of steps.

Check Your Understanding

Answer each question using the signed-error convention defined above.

  1. For a one-step Euler calculation, what two values are subtracted to define the signed local error?
  2. If \(y''(t_0)=-4\) and \(h=0.05\), what is the leading signed error?
  3. For \(y'=f(t,y)\), write the formula for \(y''\) in terms of \(f_t\), \(f_y\), and \(f\).
  4. Why is the leading error estimate not generally the exact one-step error?
  5. If the step size is halved, by what factor does the leading one-step error change, provided the starting curvature is fixed and nonzero?

Want all 1,114 practice problems?

This tutorial covers one topic. Calc Pass covers all of AP Calculus AB & BC: 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