From Local Error to a Finite-Time Guarantee
Forward Euler makes a small error at each step. Those errors do not necessarily remain the same size: a later step can carry forward and amplify the error already present. A global error bound must account for both effects.
We consider a scalar initial-value problem on a finite interval \([0,T]\), with \(T>0\), and divide that interval into \(N\) equal steps of size \(h=T/N\). The exact solution is \(y(t)\), and the Euler values are defined by
The global error at grid point \(t_n\) is \(e_n=|y(t_n)-Y_n|\). The aim is to bound \(e_n\) for every grid point up to the chosen final time.
Assumptions and Local Defect
The slope function must not change too rapidly when its solution input changes. We assume that, for some constant \(L\ge 0\), it satisfies the Lipschitz condition
for every \(t\in[0,T]\) and every pair \(u,v\) in the region containing the exact and Euler solution values. The same \(L\) must work at all these times and values.
For one step starting from the exact solution, define the local defect by
This is the difference between the exact solution after one step and the result of taking one Euler step from the exact value at the start of that step. It is not the global error: the global error also includes the effect of earlier steps. Assume that each local defect has the bound
where \(\tau\ge 0\) is a uniform bound for the chosen step size.
Why the Bound Holds
Write the difference between the exact and numerical values at the next grid point by inserting one Euler step started from the exact value. The triangle inequality, the Lipschitz condition, and the local-defect bound then give the error recurrence.
This recurrence shows the two contributions at each step. The existing error is multiplied by at most \(1+Lh\), while the new local defect adds at most \(\tau\).
For \(L>0\), repeated substitution gives
The middle expression is a finite geometric sum. Its common ratio is \(1+Lh\), and its denominator is \(Lh\), which is positive when \(L>0\). This proves the stated bound. When \(L=0\), the recurrence becomes \(e_{n+1}\le e_n+\tau\); applying it \(n\) times yields \(e_n\le e_0+n\tau\).
A Bound in Terms of Step Size
A common way to bound the local defect is to control the second derivative of the exact solution. If \(y\) is twice continuously differentiable and \(|y''(t)|\le M\) on \([0,T]\), Taylor’s theorem on each step gives
for some \(\xi_n\in[t_n,t_{n+1}]\). Since the exact solution satisfies \(y'(t_n)=f(t_n,y(t_n))\), it follows that
Thus the theorem applies with \(\tau=(M/2)h^2\). At a grid point \(t_n=nh\), the resulting bound for \(L>0\) is
In particular, if the initial value is exact, then \(e_0=0\). For a fixed time interval, the factor \((1+Lh)^n\) is at most \(e^{Lnh}\), because \(1+x\le e^x\) for \(x\ge0\). Therefore, when \(L>0\), a convenient, slightly looser bound is
This makes the finite-time dependence explicit: with \(M\), \(L\), and \(T\) fixed, the bound is proportional to \(h\). If \(L=0\), the second-derivative bound instead gives \(e_n\le (M/2)t_nh\le (M/2)Th\) for an exact initial value.
Worked Examples
Worked Example: Bounding Error for Exponential Decay
Consider \(y'=-2y\), \(y(0)=1\), on \([0,0.5]\), using \(h=0.1\). The exact solution is \(y(t)=e^{-2t}\), since its derivative is \(-2e^{-2t}=-2y(t)\), and \(y(0)=1\). Here \(f(t,y)=-2y\), so
The exact solution has \(y''(t)=4e^{-2t}\), so \(0<y''(t)\le4\) on the interval. We can use \(M=4\), giving the local-defect bound \(\tau=(4/2)(0.1)^2=0.02\). The initial value is exact, so \(e_0=0\). There are \(n=0.5/0.1=5\) steps. The theorem gives
To check against the computed Euler value, the recurrence is \(Y_{n+1}=Y_n-0.2Y_n=0.8Y_n\). Thus \(Y_5=0.8^5=0.32768\). The exact value is \(y(0.5)=e^{-1}\approx0.36787944\), so the actual error is approximately \(|0.36787944-0.32768|=0.04019944\), which is below \(0.148832\). The bound is a guarantee, not an assertion that the error equals the bound.
Worked Example: A Zero Lipschitz Constant
Consider \(y'=t\), \(y(0)=0\), on \([0,1]\), with \(h=0.25\). Since \(f(t,y)=t\) does not depend on \(y\), it is Lipschitz in \(y\) with \(L=0\). The exact solution \(y(t)=t^2/2\) satisfies \(y'(t)=t\) and \(y(0)=0\).
On a step starting at \(t_n\), the exact increment is \(t_nh+h^2/2\), while Euler’s increment is \(t_nh\). Thus every local defect is \(h^2/2=0.25^2/2=0.03125\), so we may take \(\tau=0.03125\). The Euler values are
There are four steps. The \(L=0\) bound gives \(e_4\le e_0+4\tau=4(0.03125)=0.125\). Checking the endpoint, the exact value is \(y(1)=1^2/2=0.5\), and \(|0.5-0.375|=0.125\). Here the bound is attained.
Worked Example: Including an Initial Error
Consider \(y'=y\), with exact initial value \(y(0)=1\), on \([0,0.4]\), and use \(h=0.2\). Suppose the Euler computation instead starts from \(Y_0=1.1\). The exact solution \(y(t)=e^t\) is checked by \(y'=e^t=y\) and \(y(0)=1\). The function \(f(t,y)=y\) has Lipschitz constant \(L=1\).
On \([0,0.4]\), \(y''(t)=e^t\le e^{0.4}\). Taylor’s theorem therefore gives \(\tau\le (e^{0.4}/2)(0.2)^2\), so take \(C=e^{0.4}/2\) in \(\tau=Ch^2\). The starting error is \(e_0=|1-1.1|=0.1\), and there are two steps. The bound is
For a check, Euler gives \(Y_1=1.1+0.2(1.1)=1.32\) and \(Y_2=1.32+0.2(1.32)=1.584\). The exact endpoint value is \(e^{0.4}\approx1.49182470\), so the error is approximately \(|1.49182470-1.584|=0.09217530\), below the bound. The term \(1.2^2(0.1)\) accounts for amplification of the initial error; the other term accounts for local defects.
A Common Error in Applying the Recurrence
A tempting shortcut is to say that \(n\) local defects, each no larger than \(\tau\), contribute at most \(n\tau\) to the final error. That ignores amplification. For example, consider the recurrence \(e_{k+1}\le1.5e_k+0.1\), with \(e_0=0\). The first step gives \(e_1\le0.1\). The second gives \(e_2\le1.5(0.1)+0.1=0.25\), not \(0.2\). The local defect from the first step has been carried forward and enlarged.
The correction is to retain the factor \(1+Lh\) at every step, then sum the resulting geometric series. When \(L=0\), there is no amplification factor beyond \(1\), and the simple sum \(e_0+n\tau\) is justified. For \(L>0\), the theorem’s geometric factor is the appropriate bound.
Check Your Understanding
Use the assumptions and error recurrence from this tutorial to answer the following questions.
- State the Lipschitz condition in the solution variable and explain why its constant must apply throughout the region of interest.
- If the local defects satisfy \(|\delta_{n+1}|\le\tau\), what recurrence bounds \(e_{n+1}\) in terms of \(e_n\)?
- Why does the finite-time bound involve a geometric sum when \(L>0\)?
- If \(|y''(t)|\le M\), what bound does Taylor’s theorem give for a single local defect?
- When \(L=0\), what bound follows after \(n\) steps, including a possible nonzero initial error?