Why Step Size Should Respond to the Solution
Forward Euler advances an approximation using the slope at the start of each step. If that slope changes substantially before the step ends, the straight-line segment used by Euler may not represent the solution well. A uniform step size can therefore be inefficient: it may be unnecessarily small where the solution changes smoothly, yet too large near a rapid change.
The aim here is to use information available from the differential equation and from Euler computations to identify where smaller steps are worth considering. These indicators guide a numerical choice; by themselves, they do not guarantee a specified error over an entire interval.
Slope Change and Curvature
Consider a scalar initial-value problem \(y'=f(t,y)\), with a solution \(y(t)\). At a point \((t,y)\), the slope is \(f(t,y)\). Along the solution, this slope can change because time changes and because the solution value changes.
If \(f\) has continuous first partial derivatives, the chain rule gives the solution's second derivative:
Here \(f_t\) and \(f_y\) denote partial derivatives with respect to the first and second inputs. The quantity \(y''\) is the solution's curvature in the sense relevant to its departure from a straight line. A large value of \(|y''|\) means the slope changes rapidly along the solution, so a straight Euler segment may become a poor local representation unless the step is shortened.
Curvature is not the same as slope size. A solution can have a large but nearly constant slope and little curvature, or a modest slope that changes quickly. Both the slope and how it changes can matter: the slope indicates the scale of the change in \(y\), while curvature indicates how much that slope varies during a step.
Why Curvature Predicts One-Step Error
Suppose a step starts at time \(t\), at the exact solution value \(y(t)\), and has positive length \(h\). Euler's one-step value is \(y(t)+hy'(t)\). If the solution is twice continuously differentiable on the step, Taylor's theorem gives a point \(\xi\) between \(t\) and \(t+h\) such that
Subtracting the Euler value shows that the difference between the exact endpoint and this one Euler step is \(\frac{h^2}{2}y''(\xi)\). In particular, if \(|y''(s)|\leq M\) throughout the step, then
This is a local bound: it assumes the step starts at the exact value. In a multi-step computation, an existing error in the starting value can also affect the endpoint. The bound nevertheless explains why, when curvature is high, reducing \(h\) can reduce the new one-step error. It also provides a sufficient step-size condition if a bound \(M\) is available: to make this local bound at most a chosen tolerance \(\tau>0\), it is sufficient to require \(Mh^2/2\leq\tau\).
Worked Example: A Changing Slope and Two Step Sizes
Worked Example: A Changing Slope and Two Step Sizes
Apply Euler's method to \(y'=t\), \(y(0)=0\), from \(t=0\) to \(t=2\), first with \(h=1\), then with \(h=0.5\). Compare the estimates.
With \(h=1\), the update is \(y_{n+1}=y_n+h f(t_n,y_n)\). At the first step, \(t_0=0\), \(y_0=0\), and the slope is \(f(0,0)=0\). Thus \(y_1=0+1(0)=0\) at \(t_1=1\). At the second step, the slope is \(f(1,0)=1\), so \(y_2=0+1(1)=1\) at \(t_2=2\).
With \(h=0.5\), the successive slopes at \(t=0,0.5,1,1.5\) are \(0,0.5,1,1.5\). The updates are \(0.5(0)=0\), \(0.5(0.5)=0.25\), \(0.5(1)=0.5\), and \(0.5(1.5)=0.75\). Therefore the successive values are \(0\), \(0\), \(0.25\), \(0.75\), and \(1.5\). The endpoint estimate is \(1.5\).
For a check, \(y(t)=t^2/2\) satisfies \(y'=t\) and \(y(0)=0\), so the exact endpoint value is \(2^2/2=2\). The Euler estimates \(1\) and \(1.5\) are both below \(2\); their respective errors, computed as estimate minus exact value, are \(-1\) and \(-0.5\). The finer step gives a closer result here. The slope increases throughout the interval, and the curvature is \(y''=1\).
Using Successive Euler Estimates
One practical warning sign is that a calculation with a proposed step size gives a noticeably different result from a calculation using smaller steps over the same interval. For instance, one can compare a single Euler step of length \(h\) with two Euler steps of length \(h/2\), starting from the same value. This comparison is often called step doubling. The earlier material on estimating error by step doubling explains that comparison; here, the important point is how to use it as a guide to where a step may need shortening.
If the two endpoint estimates disagree substantially relative to the accuracy needed, the larger step may be crossing a region in which the slope changes enough to matter. A smaller step is then a reasonable next trial. The size of the difference is a diagnostic, not the exact error: both estimates can be inaccurate, and errors can sometimes cancel.
Worked Example: Comparing Euler Estimates for Growing Slopes
For \(y'=2y\), \(y(0)=1\), estimate \(y(1)\) using \(h=0.5\) and \(h=0.25\). Compare the results and check the calculations.
With \(h=0.5\), each update is \(y_{n+1}=y_n+0.5(2y_n)=2y_n\). Starting from \(y_0=1\), the values are \(y_1=1+0.5(2)=2\), then \(y_2=2+0.5(4)=4\). Thus the estimate at \(t=1\) is \(4\).
With \(h=0.25\), each update is \(y_{n+1}=y_n+0.25(2y_n)=1.5y_n\). The successive values are \(1\), \(1.5\), \(2.25\), \(3.375\), and \(5.0625\): for example, \(2.25+0.25(4.5)=3.375\), and \(3.375+0.25(6.75)=5.0625\). The endpoint estimate is \(5.0625\).
As a recurrence check, each value after the initial one is \(1.5\) times the preceding value for \(h=0.25\), and the two \(h=0.5\) updates double the preceding value. The exact solution is \(y(t)=e^{2t}\), since its derivative is \(2e^{2t}=2y(t)\) and \(y(0)=1\). At \(t=1\), this is \(e^2\), approximately \(7.389\) to three decimal places. Both Euler estimates are below this value, and the smaller-step estimate is closer. The curvature is \(y''=4y\), so it increases as the solution grows. The difference between the estimates, \(5.0625-4=1.0625\), is a clear signal that the coarser estimate deserves caution.
A Curvature-Based Step Choice
When a bound for curvature is available, it can give a quantitative first choice of step. The bound must cover the whole proposed step; if shortening the step changes the interval on which the bound is needed, reassess it. The next example shows the calculation and checks the actual one-step difference.
Worked Example: Choosing a Step from a Local Error Tolerance
Consider \(y'=t^2\), starting at \(t=1\) with exact value \(y(1)=0\). Choose a step to \(t=1+h\) so the curvature bound on the one-step error is at most \(0.05\). Test \(h=0.2\).
Since \(y'=t^2\), differentiation along the solution gives \(y''=2t\). On the proposed interval from \(1\) to \(1.2\), \(0\leq 2t\leq 2.4\), so \(M=2.4\) is a valid bound for \(|y''|\). The local error bound for \(h=0.2\) is
Because \(0.048\leq 0.05\), the stated sufficient condition is met. Euler's endpoint value is \(0+0.2(1^2)=0.2\). The exact increment is \(\int_1^{1.2}t^2\,dt=((1.2)^3-1)/3=(1.728-1)/3=0.242666\ldots\). Thus the actual one-step error in magnitude is \(0.242666\ldots-0.2=0.042666\ldots\), which is less than the bound \(0.048\). This check confirms the bound for this step.
A Practical Selection Process
In computations, an exact curvature bound may not be known. Use computed slopes and estimates as diagnostics, and treat a proposed step size as something to test rather than as a guaranteed answer.
Compare \(f(t_n,y_n)\) and the slopes at nearby computed points. A large change suggests that the solution's direction is changing over the interval.
When \(f\) is differentiable, use \(y''=f_t+f_y f\) to assess how quickly the slope varies. If its magnitude is large, try a smaller step.
Where useful, compare Euler estimates made with the proposed step and smaller steps. A large discrepancy calls for caution and further refinement.
Recalculate slopes or the curvature bound on the new interval. Do not assume that a step size suitable earlier remains suitable after the solution begins changing more rapidly.
These checks can motivate using different step sizes in different parts of an interval. They do not, on their own, certify a global error tolerance. Global accuracy also depends on errors already accumulated and on how they affect subsequent steps.
Common Pitfall: Mistaking a Small Starting Slope for a Safe Long Step
For \(y'=t\), \(y(0)=0\), a tempting but incorrect conclusion is that a step of length \(2\) is safe because the starting slope is zero. The resulting Euler calculation is \(y(2)\approx 0+2(0)=0\). But the slope is not zero throughout the interval: it rises from \(0\) to \(2\), and the exact value is \(y(2)=2\). The Euler result misses the change entirely.
The correction is to inspect how the slope behaves within the proposed interval, not just its value at the first point. In this example, the curvature \(y''=1\) and the changing slope both warn that the long straight segment may be inadequate. Dividing the interval into shorter steps gives an estimate of \(1.5\) with \(h=0.5\), as calculated earlier.
The opposite mistake is to shorten every step merely because the slope is large. If \(y'=1000\), the slope is large but constant, so the solution is a straight line and Euler reproduces each step exactly in exact arithmetic. Step size decisions should respond to variation and the accuracy needed, not slope magnitude alone.
Why These Diagnostics Matter
Step-size choices affect both the reliability and the cost of a numerical computation. Taking small steps everywhere can require many updates even on intervals where the solution is nearly straight. Taking large steps everywhere can conceal rapid changes and produce poor estimates. Slope comparisons, curvature, and successive Euler estimates help identify where extra resolution is most useful.
The essential judgment is local: use the proposed step where the solution appears smooth enough for its straight-line approximation, and try shorter steps where slope variation or estimate disagreement is substantial. Keep the distinction between evidence and proof clear: a diagnostic can indicate a problem, while a valid bound requires its stated assumptions and an appropriate bound over the entire step.
Check Your Understanding
Answer these questions using the definitions and reasoning above.
- For \(y'=f(t,y)\), write the formula for \(y''\) along a solution when \(f\) has continuous first partial derivatives.
- If \(|y''|\leq M\) over a step of length \(h\), what upper bound does Taylor's theorem give for the one-step Euler error starting from the exact value?
- Why can a large slope alone be a poor reason to shorten a step?
- What might a substantial difference between one Euler step and two half-steps indicate, and why is that difference not automatically the exact error?
- For \(y'=t\), \(y(0)=0\), explain why a single step of length \(2\) gives a poor estimate even though the initial slope is zero.