Tutorials › Calculus I › Euler Steps Near Singularities and Discontinuous Slopes

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

Euler Steps Near Singularities and Discontinuous Slopes

Distinguish a computable Euler update from a trustworthy step, and learn to keep numerical intervals on one side of singularities and slope discontinuities.

Advanced 11 min read

What You'll Learn

  • State the condition required to compute a forward Euler update.
  • Distinguish an update that is algebraically defined from a step that respects the differential equation’s domain.
  • Identify why crossing a singular time can invalidate a numerical step.
  • Split a step at a known discontinuity and use the appropriate slope on each side.
  • Check for state-dependent singularities between the current and predicted values.
  • Explain why local smoothness makes the Euler increment a reasonable approximation.

Why the Region of a Step Matters

A forward Euler calculation uses one slope to advance an approximate solution. That is straightforward when the slope function is defined and regular throughout the region being approximated. Near a point where the slope is undefined or discontinuous, however, a numerical update can be misleading: its arithmetic may be possible even though the step crosses a point at which the differential equation cannot be followed in the usual way.

For an initial-value problem \(y'=f(t,y)\), with current approximation \(y_n\) at time \(t_n\), the forward Euler update with step size \(h>0\) is

$$ y_{n+1}=y_n+h f(t_n,y_n), \qquad t_{n+1}=t_n+h. $$

The formula evaluates \(f\) at the left endpoint. It does not automatically check what happens between \(t_n\) and \(t_{n+1}\). That is the key issue in this tutorial.

Key distinction: An Euler update is computable if \(f(t_n,y_n)\) is defined. It is appropriate for approximating the solution over the step only if the step also respects the region where the differential equation has a defined, sufficiently regular slope.

What Counts as a Regular Region?

Think of the differential equation as having a region of the \((t,y)\)-plane in which its slope function is defined and continuous. A point where the formula for \(f\) is undefined is a singular point for that formula. A point or curve where the slope changes discontinuously is a discontinuity. Either can divide the plane into regions where different reasoning applies.

Continuity in a neighborhood of the current point is a useful local condition: nearby points have slopes close to the current slope. For a standard local existence-and-uniqueness guarantee, a common sufficient condition is that \(f\) is continuous in a neighborhood and locally Lipschitz in \(y\) there. The Euler step itself requires only that \(f(t_n,y_n)\) be defined, but that bare requirement does not provide the same assurance about the solution or its approximation.

For screening a proposed step, ask whether the time interval crosses a known singular time or discontinuity. If the issue depends on \(y\), also check whether the predicted movement could reach a state where \(f\) is undefined. A step that ends on or crosses such a boundary should not be treated as an ordinary step within one regular region.

Worked Example: A Step Crossing a Singular Time

Worked Example: A Step Crossing a Singular Time

Consider \(y'=1/(1-t)\), \(y(0)=0\). The slope is undefined at \(t=1\). What happens if one Euler step uses \(h=1.2\)?

At the starting point, the slope is

$$ f(0,0)=\frac{1}{1-0}=1. $$

The update gives

$$ y_1=0+1.2(1)=1.2, \qquad t_1=0+1.2=1.2. $$

The arithmetic is defined because \(f(0,0)\) exists. But the time interval from \(0\) to \(1.2\) crosses \(t=1\), where the slope is undefined. The update is therefore not a valid approximation to one solution segment through that entire interval.

This is consistent with the exact solution. Since \(y'=1/(1-t)\), integration with \(y(0)=0\) gives \(y(t)=-\ln(1-t)\) for \(t<1\). This solution cannot be continued through \(t=1\) as a finite real-valued solution. The Euler result \(1.2\) does not fix that obstruction.

For a step that stays on the safe side, take \(h=0.4\). Then \(f(0,0)=1\), so \(y_1=0+0.4(1)=0.4\) at \(t_1=0.4\). The step remains in \(t<1\). This check establishes that the step does not cross the singular time; it does not by itself certify a small approximation error.

Check: The computed increment is \(h f(0,0)=0.4(1)=0.4\), so the updated value and time are \(y_1=0.4\) and \(t_1=0.4\), both on the regular side of the boundary.

Why a Discontinuity Calls for a Split

A discontinuity in the slope is different from a pole such as \(1/(1-t)\), but a step can still hide important information by crossing it. If the slope changes at a known time, the interval should be split there. The first step uses the slope on the first side; the next step uses the slope on the other side. This lets the calculation represent the change rather than extending one side’s slope across the whole interval.

A value assigned to the slope at the single switching time does not remove the jump on either side. When the equation specifies a right-hand branch at the switch, the step starting at that time uses that branch. The example below makes this convention explicit.

Worked Example: Splitting a Step at a Slope Discontinuity

Suppose \(y(0)=0\), and

$$ f(t,y)= \begin{cases} 1, & t<1,\\ 4, & t\geq 1. \end{cases} $$

A single step of length \(2\) evaluates the slope at \(t=0\), where it is \(1\). It therefore gives \(y_1=0+2(1)=2\) at \(t=2\). But it has carried the pre-switch slope over the interval after \(t=1\).

Instead, split the calculation at \(t=1\). For the first step, \(h=1\) and \(f(0,0)=1\), so

$$ y(1)\approx 0+1(1)=1. $$

For the second step, start at \(t=1\). The specified branch there is \(f=4\), so

$$ y(2)\approx 1+1(4)=5. $$

Here, the split result agrees with the exact change: the slope is \(1\) over a duration of \(1\), then \(4\) over a duration of \(1\), giving total change \(1(1)+4(1)=5\).

Check: The two Euler increments are \(1\) and \(4\), and \(0+1+4=5\). The unsplit update gives \(2\) because it uses only the first branch’s slope across a region where that branch no longer applies.

State-Dependent Singularities

Not every boundary is a fixed time. The slope might be undefined at certain values of \(y\). For example, \(f(t,y)=-2/y\) is undefined at \(y=0\). In such cases, checking only the time endpoints is not enough: the proposed change in \(y\) may reach or pass a state-space boundary.

The straight segment represented by an Euler step joins \((t_n,y_n)\) to \((t_{n+1},y_{n+1})\). If that segment crosses a boundary where \(f\) is undefined, the step should be treated with caution even when the endpoint value itself is not singular. The segment is a screening aid, not a proof of the unknown exact path; it can nevertheless reveal an obvious reason not to take the step as an ordinary update.

Worked Example: An Euler Endpoint Beyond a State Singularity

Consider \(y'=-2/y\) with \(y(0)=1\), and try \(h=1\). At the initial point, the slope exists:

$$ f(0,1)=-\frac{2}{1}=-2. $$

The Euler update is

$$ y_1=1+1(-2)=-1, \qquad t_1=1. $$

The endpoint \(y_1=-1\) is not itself a singular value. But the straight segment from \(y=1\) to \(y=-1\) passes through \(y=0\), where \(f\) is undefined. The step crosses the state boundary and should not be accepted as an ordinary step within the domain of this equation.

The exact equation gives an independent check on the obstruction. Multiplying by \(y\) and differentiating \(y^2\) along a solution gives

$$ \frac{d}{dt}(y^2)=2yy'=2y\left(-\frac{2}{y}\right)=-4. $$

Using \(y(0)=1\), we obtain \(y^2=1-4t\). The positive solution reaches \(y=0\) when \(1-4t=0\), or \(t=1/4\), well before the proposed endpoint \(t=1\).

A shorter step of \(h=0.2\) gives \(y_1=1+0.2(-2)=0.6\), which stays positive at its endpoint. The predicted straight segment from \(1\) to \(0.6\) also stays away from zero. This avoids the immediate crossing seen with \(h=1\), but, as with any single-step check, it is not a general proof of accuracy.

Check: For \(h=1\), the endpoint calculation is \(1-2=-1\), and the straight segment crosses \(0\). For \(h=0.2\), the calculation is \(1-0.4=0.6\), and the segment stays between \(0.6\) and \(1\).

Why Regularity Supports the Euler Update

The reason to avoid discontinuities and singularities is visible in the exact change over a step. Suppose a solution \(y(t)\) exists on \([t_n,t_n+h]\), where \(h>0\), and write \(y_n=y(t_n)\) for this justification. The differential equation implies

$$ y(t_n+h)-y(t_n) = \int_{t_n}^{t_n+h} f(t,y(t))\,dt. $$

Euler replaces the slope throughout the interval by its starting value, giving the increment \(h f(t_n,y(t_n))\). Subtracting this proposed increment from the exact one shows precisely what must be small for the step to be reasonable:

$$ y(t_n+h)-y(t_n)-h f(t_n,y(t_n)) = \int_{t_n}^{t_n+h} \bigl(f(t,y(t))-f(t_n,y(t_n))\bigr)\,dt. $$

If the slope along the solution is continuous, its values near the start approach the starting slope as the interval shrinks. Thus the average slope over a sufficiently short interval approaches the value Euler uses. A discontinuity or singularity inside the interval defeats that simple comparison: the integrand may jump or fail to be defined.

A quantitative version follows if the slope along the solution changes at most linearly with time from the initial value. Suppose, for some constant \(K\geq 0\), that

$$ \left|f(t_n+s,y(t_n+s))-f(t_n,y(t_n))\right|\leq Ks \quad\text{for }0\leq s\leq h. $$

Using the integral expression, the absolute difference between the exact and Euler increments is then bounded by

$$ \begin{aligned} \left|y(t_n+h)-y(t_n)-h f(t_n,y(t_n))\right| &\leq \int_0^h Ks\,ds\\ &=\frac{K h^2}{2}. \end{aligned} $$

This bound explains the role of regularity: when the slope changes in a controlled way throughout a step, replacing it by its starting value incurs a controlled local error. If a step crosses an undefined or discontinuous point, the stated bound cannot be applied across that step.

A Practical Boundary Check

Before computing or accepting an Euler step near a suspected problem point, use the following checks. They assess whether the proposed interval stays within a region where the slope formula makes sense; they are not a substitute for a full error analysis.

1
Locate the issue.
Identify times or states where \(f(t,y)\) is undefined, and locate any known jumps in its value.
2
Check the starting evaluation.
Verify that \(f(t_n,y_n)\) exists. If it does not, the Euler formula cannot be used at that point.
3
Check the proposed interval.
Determine whether the time interval crosses a known time boundary, or whether the predicted state movement reaches or crosses a state boundary.
4
Keep separate regions separate.
For a known jump, end the step at the switch and begin a new step using the appropriate branch. Do not step through a singular point as if the slope remained regular.

Sometimes the location of a crossing is not known exactly. A computed endpoint alone cannot guarantee that the true solution stayed in the regular region between steps. In that situation, treat the numerical result cautiously rather than interpreting a successful calculation as evidence that no boundary was crossed.

Common Mistake: “The Formula Returned a Number”

A common error is to check only whether the slope at the starting point is defined. In the first example, \(f(0,0)=1\) exists, so \(h=1.2\) produces the number \(1.2\). But the step crosses \(t=1\), where the slope is undefined. The correction is not to perform the same update more confidently: it is to recognize that the proposed interval leaves the regular domain and keep the step on the valid side of the boundary.

A related mistake is to use a pre-discontinuity slope for a whole step that extends past a known jump. In the piecewise example, that gives \(2\) rather than the split calculation \(5\). The correction is to end a step at the switching time and apply the new branch after the switch. A computable result is not, by itself, proof that the chosen interval was appropriate.

Takeaway: Euler’s formula uses a slope at one point, but its interpretation concerns a change over an interval. Near singularities or discontinuous slopes, check the whole proposed interval and keep steps within the regular region whenever possible.

Check Your Understanding

For each question, focus on whether the step remains in a region where the slope function is defined and regular.

  1. For \(y'=1/(2-t)\), why is a step from \(t=1\) to \(t=3\) problematic even if the starting slope is defined?
  2. If a slope changes from \(2\) to \(6\) at a known time, why should a step that spans that time be split?
  3. For \(y'=-1/y\), what state value must an Euler step avoid crossing?
  4. What is the difference between an Euler update being computable and being appropriate for approximating a solution over the step?
  5. In the derivation of the Euler increment error, what condition allows the slope difference to be bounded by \(Ks\)?

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