Tutorials › AP Statistics › Diagnosing Euler Overshoot and Numerical Instability

Euler and Logistic Methods · Tutorial 587 of 999

Diagnosing Euler Overshoot and Numerical Instability

Use the Euler update and its computed sequence to distinguish harmless oscillation from overshoot and numerical instability.

Advanced 9 min read

What You'll Learn

  • Identify overshoot by checking whether an Euler step crosses an equilibrium or other meaningful target.
  • Compute the Euler multiplier for a linear differential equation of the form y' = λy.
  • Determine the step-size ranges for decay, sign alternation, and numerical growth when λ is negative.
  • Compare Euler values with an exact rapidly changing solution.
  • Diagnose a misleading sequence by checking the slope at each step and the size of the update.
  • Distinguish a useful warning sign from a stability guarantee for nonlinear or time-dependent slope rules.

Why Euler Approximations Can Behave Badly

Forward Euler estimates a solution by following the slope at the beginning of each step. This is effective when the slope does not change too dramatically over that step. But a large step can carry the estimate past an equilibrium, past a target value, or into a sequence of unrealistic growth.

The key diagnostic is to compare the step size with the way the slope rule responds to changes in the dependent variable. A rapidly changing solution may require a small step even when the Euler arithmetic is correct. The computed sequence itself provides important evidence: look for sign changes, overshooting, and values that grow when the true solution should be settling down.

Definition: An Euler step overshoots an equilibrium if it carries the approximation from one side of an equilibrium value to the other. A numerical sequence is unstable for the behavior being modeled when its values grow or persist unrealistically instead of following the solution’s expected behavior.

Overshoot and instability are related, but they are not identical. A sequence can cross an equilibrium and then converge toward it by alternating sides. That is oscillatory convergence, not numerical growth. To decide what is happening, inspect both the signs of the deviations and their sizes.

The Euler Update Near an Equilibrium

For an initial-value problem \(y'=f(t,y)\), forward Euler uses step size \(h>0\) and updates according to \(t_{n+1}=t_n+h\) and \(y_{n+1}=y_n+h f(t_n,y_n)\). Each new slope is evaluated at the current time and current approximation. In particular, the method does not keep reusing the initial slope.

A useful diagnostic model is \(y'=\lambda y\), where \(\lambda<0\). Its equilibrium is \(y=0\), and a nonzero exact solution is \(y(t)=y_0e^{\lambda t}\). Since \(e^{\lambda t}>0\), that solution keeps the sign of \(y_0\) and approaches zero as time increases.

For Euler’s method, one step gives:

$$ y_{n+1}=y_n+h\lambda y_n=(1+h\lambda)y_n. $$

The number \(R=1+h\lambda\) is the multiplier for each step. Repeating the update gives \(y_n=R^n y_0\). Thus the size of \(R\) determines whether the numerical values shrink, persist, or grow; its sign determines whether they keep the same sign or alternate.

Theorem: For \(y'=\lambda y\), with \(\lambda<0\), \(h>0\), and \(y_0\ne0\), the Euler values approach zero exactly when \(|1+h\lambda|<1\), or equivalently \(0<h<-2/\lambda\). They keep the same sign while shrinking when \(0<h<-1/\lambda\), and alternate signs while shrinking when \(-1/\lambda<h<-2/\lambda\). At \(h=-1/\lambda\), the first Euler update gives zero, which remains zero thereafter. At \(h=-2/\lambda\), the values alternate with constant magnitude; for \(h>-2/\lambda\), their magnitudes grow. If \(y_0=0\), every Euler value is zero for every \(h>0\), so the step-size classification above applies only to nonzero initial values.

Why the Step-Size Condition Works

The theorem follows directly from the recurrence, rather than from a visual guess about a table. Here is the full argument for the nonzero initial value.

1
Find the one-step multiplier.
Substitute \(y'=\lambda y\) into the Euler rule to get \(y_{n+1}=(1+h\lambda)y_n\). Write \(R=1+h\lambda\).
2
Iterate the update.
Applying the same rule repeatedly gives \(y_n=R^n y_0\). Since \(y_0\ne0\), the behavior is determined by powers of \(R\).
3
Require the magnitudes to shrink.
The powers \(R^n\) approach zero exactly when \(|R|<1\). Therefore \(-1<1+h\lambda<1\).
4
Translate to a step-size range.
Subtracting 1 gives \(-2<h\lambda<0\). Dividing by \(\lambda<0\) reverses both inequalities, yielding \(0<h<-2/\lambda\).

Within that range, \(R>0\) produces same-sign values and \(R<0\) produces alternating signs. The boundary \(R=-1\) gives constant-magnitude oscillation, not decay; when \(|R|>1\), the magnitudes grow. This distinction explains why “the signs alternate” alone is not enough to diagnose instability.

Worked Example: A Step Crosses the Equilibrium

Worked Example: A Step Crosses the Equilibrium

Consider \(y'=-4y\), \(y(0)=3\), with \(h=0.4\). Determine the first two Euler values and compare them with the exact solution.

The Euler multiplier is \(R=1+h\lambda=1+(0.4)(-4)=1-1.6=-0.6\). The first slope is \(y'(0)=-4(3)=-12\), so \(y_1=3+(0.4)(-12)=3-4.8=-1.8\). The approximation has crossed the equilibrium \(y=0\).

At the next step, the slope is \(y'=-4(-1.8)=7.2\). Thus \(y_2=-1.8+(0.4)(7.2)=-1.8+2.88=1.08\). This agrees with the multiplier calculation: \(y_2=(-0.6)^2(3)=1.08\).

The exact solution is \(y(t)=3e^{-4t}\), which remains positive. At \(t=0.4\), it is \(3e^{-1.6}\approx0.606\); at \(t=0.8\), it is \(3e^{-3.2}\approx0.122\). The Euler sequence alternates across zero, but its magnitude shrinks because \(|R|=0.6<1\). It is converging to the equilibrium while giving a poor qualitative prediction of the solution’s sign.

Check: Multiplying the first value by \(R\) gives \((-0.6)(3)=-1.8\), and multiplying the second by \(R\) gives \((-0.6)(-1.8)=1.08\), as in the updates.

Worked Example: A Step Size That Produces Growth

Worked Example: A Step Size That Produces Growth

Consider the rapidly decaying solution of \(y'=-5y\), \(y(0)=2\), using \(h=0.5\). Compute three Euler updates and diagnose the sequence.

The multiplier is \(R=1+(0.5)(-5)=1-2.5=-1.5\). Initially, the slope is \(-5(2)=-10\), so \(y_1=2+(0.5)(-10)=2-5=-3\). At the next point the slope is \(-5(-3)=15\), giving \(y_2=-3+(0.5)(15)=-3+7.5=4.5\). The next slope is \(-5(4.5)=-22.5\), so \(y_3=4.5+(0.5)(-22.5)=4.5-11.25=-6.75\).

The magnitudes \(2,3,4.5,6.75\) increase by a factor of \(1.5\) each step. In contrast, the exact solution \(y(t)=2e^{-5t}\) stays positive and approaches zero. For this equation, decay requires \(0<h<2/5=0.4\). The chosen step size \(0.5\) is outside that range, and the Euler values grow in magnitude.

Check: The three updates multiply the previous values by \(-1.5\): \((-1.5)(2)=-3\), \((-1.5)(-3)=4.5\), and \((-1.5)(4.5)=-6.75\).

Worked Example: Alternation Can Still Converge

Worked Example: Alternation Can Still Converge

For \(y'=-5y\), \(y(0)=2\), use \(h=0.3\). Find the first three Euler values and decide whether the sign changes indicate instability.

Here \(R=1+(0.3)(-5)=1-1.5=-0.5\). The first update is \(y_1=2+(0.3)(-10)=2-3=-1\). The next slope is \(-5(-1)=5\), so \(y_2=-1+(0.3)(5)=-1+1.5=0.5\). The next slope is \(-5(0.5)=-2.5\), giving \(y_3=0.5+(0.3)(-2.5)=0.5-0.75=-0.25\).

The signs alternate, but the magnitudes are \(2,1,0.5,0.25\), each half the previous magnitude. Since \(|R|=0.5<1\), this is oscillatory decay, not numerical growth. The exact solution remains positive, so the alternating signs are still a qualitative defect even though the sequence converges to zero.

Check: Multiplication by \(-0.5\) gives \((-0.5)(2)=-1\), \((-0.5)(-1)=0.5\), and \((-0.5)(0.5)=-0.25\), matching the computed updates.

Rapid Change Near a Nonzero Equilibrium

The same reasoning can be applied to deviations from an equilibrium other than zero. Consider \(y'=-12(y-1)\), whose equilibrium is \(y=1\). Set \(z=y-1\). Then \(z'=-12z\), so the Euler multiplier for the deviation is \(1-12h\). A step can cross the equilibrium if this multiplier is negative; the deviation shrinks only if its absolute value is less than 1.

Worked Example: Oscillation Around an Equilibrium

Use \(h=0.1\) and \(y_0=3\). The initial deviation from equilibrium is \(z_0=3-1=2\), and the deviation multiplier is \(1-12(0.1)=1-1.2=-0.2\). Thus the deviations are \(2,-0.4,0.08,-0.016\), giving \(y\)-values \(3,0.6,1.08,0.984\).

Direct updates confirm the sequence. At \(y_0=3\), the slope is \(-12(3-1)=-24\), so \(y_1=3+0.1(-24)=0.6\). At \(y_1=0.6\), the slope is \(-12(0.6-1)=4.8\), so \(y_2=0.6+0.1(4.8)=1.08\). At \(y_2=1.08\), the slope is \(-12(1.08-1)=-0.96\), so \(y_3=1.08+0.1(-0.96)=0.984\).

The exact solution is \(y(t)=1+2e^{-12t}\). At \(t=0.3\), this is \(1+2e^{-3.6}\approx1.055\), while the Euler value is \(0.984\). The approximation alternates around the equilibrium, but its deviation magnitude is multiplied by \(0.2\) at each step and therefore shrinks. Check: The computed deviations \(2,-0.4,0.08,-0.016\) are precisely successive multiplications by \(-0.2\).

Diagnosing a Computed Euler Table

For a general slope rule, there may be no single fixed multiplier. The slope can depend on both time and the current approximation, so calculate each update from the current row of the table. Use the following checks to interpret the result.

  • Check the direction of the slope. If \(f(t_n,y_n)>0\), the Euler value increases at that step; if \(f(t_n,y_n)<0\), it decreases.
  • Compare the update with the distance to equilibrium or target. The step change is \(h f(t_n,y_n)\). If its size exceeds that distance, the update can cross the target.
  • Check what happens after a crossing. A new slope may reverse direction and pull the next estimate back. Compare the magnitudes of successive deviations to see whether the oscillation shrinks or grows.
  • Test a smaller step size. If the sequence’s behavior changes sharply, the original step may be too large to represent the slope rule reliably.

When the slope rule is differentiable with respect to \(y\), a large value of \(h\left|\frac{\partial f}{\partial y}\right|\) near the current solution can be a warning that Euler steps are too coarse. This is a diagnostic, not a universal stability theorem for every nonlinear or time-dependent equation. The actual sequence and the known behavior of the differential equation still matter.

Common Mistake: Treating Every Sign Change as Instability

A common error is to conclude that any Euler sequence that changes sign must be unstable. For \(y'=-5y\) with \(h=0.3\), that conclusion would label the sequence \(2,-1,0.5,-0.25,\dots\) unstable merely because its signs alternate. But each magnitude is half the previous one, so the sequence approaches zero.

The correction is to check the multiplier’s magnitude as well as its sign. A negative multiplier with magnitude below 1 causes alternating decay; a negative multiplier with magnitude above 1 causes alternating growth. For this equation, \(h=0.3\) gives \(|1-5h|=0.5<1\), while \(h=0.5\) gives \(|1-5h|=1.5>1\). The first oscillation shrinks; the second grows.

Takeaway: A sign change identifies a crossing, not by itself an instability. To diagnose behavior, inspect the size of the deviation from equilibrium at successive steps and compare it with the expected solution.

Check Your Understanding

Use the slope rule and the sequence behavior to answer these questions.

  1. For \(y'=-4y\), what range of positive step sizes makes nonzero Euler values approach zero?
  2. For \(y'=-4y\) with \(h=0.3\), does the Euler sequence alternate, grow, or decay without alternating? Explain using the multiplier.
  3. For \(y'=-5y\), \(y_0=2\), and \(h=0.4\), what are \(y_1\) and \(y_2\)? What is special about this step size?
  4. Why is a sign change in an Euler table not sufficient evidence of numerical instability?
  5. In a time-dependent slope rule, why must each new slope be evaluated at the current time and current approximation?

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