Tutorials › AP Statistics › How Step Size Changes Euler Accuracy

Euler and Logistic Methods · Tutorial 584 of 999

How Step Size Changes Euler Accuracy

Learn to compare Euler estimates at a shared target time, calculate their errors, and recognize when reducing the step size may not improve accuracy.

Advanced 11 min read

What You'll Learn

  • Compare Euler approximations that use different step sizes for one initial-value problem.
  • Calculate absolute error by comparing an approximation with an exact solution.
  • Explain why shorter steps often improve an Euler estimate.
  • Follow a derivation showing that accuracy improves as steps shrink for one particular differential equation.
  • Identify a case where a smaller step produces a less accurate estimate.

Why Step Size Matters

Euler’s method approximates a solution by repeatedly using the slope at the start of a short interval. The length of each interval is the step size, usually denoted by \(h\). For an initial-value problem \(y'=f(t,y)\), the update is \(y_{n+1}=y_n+h f(t_n,y_n)\), with \(t_{n+1}=t_n+h\).

When comparing step sizes, keep the initial-value problem and the target time fixed. Otherwise, a difference in the answers may reflect a changed problem rather than a changed step size. If the exact solution is known, its value at the target time gives a reference for measuring accuracy.

Definition: If \(y_{\text{exact}}\) is the exact value at a target time and \(y_{\text{Euler}}\) is the Euler estimate there, the absolute error is \(\left|y_{\text{exact}}-y_{\text{Euler}}\right|\). A smaller absolute error means a more accurate estimate.

A Comparison for Exponential Growth

Consider \(y'=y\), \(y(0)=1\), and estimate \(y(1)\). The exact solution is \(y(t)=e^t\), so the exact target value is \(e\), approximately \(2.71828183\). We can compare Euler estimates using \(h=1\), \(h=0.5\), and \(h=0.25\). Each choice lands exactly at \(t=1\).

Worked Example: Compare Three Step Sizes

For this problem, the slope at each step is the current \(y\)-value. Thus the update is \(y_{n+1}=y_n+h y_n=(1+h)y_n\).

With \(h=1\), one step gives \(y_1=1+1(1)=2\). The absolute error is \(\left|e-2\right|\approx 0.71828183\).

With \(h=0.5\), there are two steps. First, \(y_1=1+0.5(1)=1.5\). Next, \(y_2=1.5+0.5(1.5)=2.25\). The absolute error is \(\left|e-2.25\right|\approx 0.46828183\).

With \(h=0.25\), there are four steps. The successive values are \(y_1=1+0.25(1)=1.25\), \(y_2=1.25+0.25(1.25)=1.5625\), \(y_3=1.5625+0.25(1.5625)=1.953125\), and \(y_4=1.953125+0.25(1.953125)=2.44140625\). The absolute error is \(\left|e-2.44140625\right|\approx 0.27687558\).

For a check, differentiating \(y(t)=e^t\) gives \(y'=e^t=y\), and \(y(0)=1\), as required. Each Euler calculation uses the current value as its slope, and each sequence of steps ends at \(t=1\). Here the smaller steps give estimates closer to \(e\).

Why Smaller Steps Often Help

Over one step, Euler’s method follows a straight-line estimate based on the slope at the beginning of that step. If the actual solution bends, that straight line will generally not match the curve throughout the interval. Taking shorter steps means following the curve in shorter pieces and checking its slope more often.

For the exponential example, this intuition can be made precise. Let \(n\) equal the number of equal steps from \(0\) to \(1\), so \(h=1/n\). The Euler update multiplies the current value by \(1+1/n\) at each step. Starting from \(1\), after \(n\) steps the estimate is \((1+1/n)^n\).

$$ y_n=\left(1+\frac{1}{n}\right)^n $$

This estimate increases as \(n\) increases. To see why, expand it using the binomial theorem:

$$ \left(1+\frac{1}{n}\right)^n = \sum_{k=0}^{n}\frac{1}{k!} \prod_{j=0}^{k-1}\left(1-\frac{j}{n}\right). $$

For a fixed \(k\), each factor \(1-j/n\) in this expression increases as \(n\) increases, so its product does not decrease. When \(n\) increases, the expanded sum also gains an additional positive term. Therefore, the Euler estimate increases with \(n\).

It remains to check that these increasing estimates stay below the exact value \(e\). For \(x>0\), \(\ln(1+x)<x\), since \(\ln(1+x)=\int_0^x \frac{1}{1+t}\,dt\) and the integrand is less than \(1\) for \(t>0\). Taking \(x=1/n\) gives \(n\ln(1+1/n)<1\), and hence \((1+1/n)^n<e\). So in this particular problem, increasing the number of steps moves the estimate upward toward the exact value from below.

What this argument shows: For \(y'=y\), \(y(0)=1\), on the interval from \(0\) to \(1\), using more equal Euler steps gives a closer estimate. This conclusion is established for this problem; it is not a guarantee for every differential equation or every target time.

A Smaller Step Can Be Less Accurate

Euler’s method samples the slope at step starts. If those samples miss important changes in the solution, a coarser step can sometimes happen to give a better endpoint estimate. The following example makes this limitation explicit.

Worked Example: A Coarser Step Gives the Exact Endpoint

Consider \(y'=2t-3t^2\), \(y(0)=0\), and estimate \(y(1)\). An exact solution is \(y(t)=t^2-t^3\): its derivative is \(2t-3t^2\), and its initial value is \(0^2-0^3=0\). Thus the exact target value is \(y(1)=1-1=0\).

With \(h=1\), Euler uses the initial slope \(2(0)-3(0)^2=0\). The estimate at \(t=1\) is \(y_1=0+1(0)=0\), with absolute error \(|0-0|=0\).

Now use the smaller step \(h=0.5\). At \(t=0\), the slope is still \(0\), so \(y_1=0+0.5(0)=0\). At \(t=0.5\), the slope is \(2(0.5)-3(0.5)^2=1-0.75=0.25\). The next estimate is \(y_2=0+0.5(0.25)=0.125\). Its absolute error is \(|0-0.125|=0.125\), which is larger than the error for \(h=1\).

The exact solution confirms the comparison: \(y(1)=0\), while the two Euler estimates are \(0\) and \(0.125\). The curve rises and then returns to its initial height, but the single coarse step samples only its initial slope. In this case, that missed behavior makes the coarse endpoint estimate exact by coincidence.

Another Comparison with a Different Slope Rule

A second example shows the usual pattern for a different differential equation. Consider \(y'=1-y\), \(y(0)=0\), and estimate \(y(1)\). Its exact solution is \(y(t)=1-e^{-t}\), with target value \(1-e^{-1}\approx0.63212056\). The Euler update is \(y_{n+1}=y_n+h(1-y_n)\).

Worked Example: Compare Step Sizes for a Changing Slope

For \(h=1\), the initial slope is \(1-0=1\), so the estimate is \(y_1=0+1(1)=1\). Its absolute error is \(|0.63212056-1|\approx0.36787944\).

For \(h=0.5\), the first update gives \(y_1=0+0.5(1)=0.5\). At that estimate, the slope is \(1-0.5=0.5\), so \(y_2=0.5+0.5(0.5)=0.75\). The absolute error is \(|0.63212056-0.75|\approx0.11787944\).

For \(h=0.25\), the successive values are \(y_1=0.25\), \(y_2=0.25+0.25(0.75)=0.4375\), \(y_3=0.4375+0.25(0.5625)=0.578125\), and \(y_4=0.578125+0.25(0.421875)=0.68359375\). The absolute error is \(|0.63212056-0.68359375|\approx0.05147319\).

For a check, differentiating \(1-e^{-t}\) gives \(e^{-t}\), and \(1-y=1-(1-e^{-t})=e^{-t}\); also \(y(0)=0\). Each Euler update adds the step size times \(1-y_n\), and four quarter-steps reach \(t=1\). In this example, halving the step size from \(0.5\) to \(0.25\) reduces the endpoint error.

Compare Fairly and Interpret Carefully

A step-size comparison is meaningful only when the approximations refer to the same initial-value problem and the same target time. If the step sizes do not divide the interval evenly, the final step may need a different length to reach the target. The updates must use the actual length of each step.

When an exact solution is available, compute the absolute error for each estimate. Do not judge accuracy only by whether the estimate seems numerically large or small, or by which estimate is closer to the previous Euler estimate. Without an exact value or another reliable reference, two approximations can be compared, but their errors are not thereby known.

1
Fix the problem and target.
Use the same differential equation, initial value, and ending time for every comparison.
2
Compute each Euler estimate.
Use the slope at the start of each step and the correct step length in every update.
3
Measure the error when possible.
Compare each estimate with the exact target value using absolute error.
4
Describe the evidence, not a universal rule.
If a finer step has a smaller error, report that result for this problem; do not assume it must hold in all cases.

Common Mistake: Assuming Error Must Decrease

A tempting but unjustified claim is: “Halving the step size always reduces the error.” The counterexample above disproves it. For \(h=1\), the estimate is \(0\) and the error is \(0\). For \(h=0.5\), the estimate is \(0.125\) and the error is \(0.125\). The smaller step is less accurate.

The correction is to treat finer steps as a useful strategy, not a guarantee. Shorter steps often improve Euler estimates because they allow the method to respond more frequently to changing slopes. But the way the slope changes, the location of the target, and the sampled values can affect the endpoint error. Calculate or otherwise assess the error rather than relying on step size alone.

Check Your Understanding

Use the ideas in this tutorial to answer the following questions.

  1. What must remain the same when comparing Euler estimates obtained with different step sizes?
  2. For \(y'=y\), \(y(0)=1\), what is the Euler estimate at \(t=1\) using two equal steps? What is its absolute error in terms of \(e\)?
  3. In the example \(y'=2t-3t^2\), why does the step \(h=1\) give the exact endpoint value even though it does not follow the solution curve between the endpoints?
  4. What does absolute error measure, and how is it calculated when an exact target value is known?
  5. Why is “a smaller step always gives a more accurate result” not a valid general conclusion?

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