Euler's Method

Work in progress. This note is still being written and incomplete.

Euler’s method approximates the solution of a well-posed IVP at equally spaced mesh points, using the first-order Taylor expansion.

Mesh Points

Choose a positive integer NN. The step size is h=baNh = \dfrac{b - a}{N}. The mesh points are

ti=a+ih,i=0,1,,Nt_i = a + ih, \quad i = 0, 1, \ldots, N

with t0=at_0 = a, tN=bt_N = b, and ti+1ti=ht_{i+1} - t_i = h.

Approximations are produced only at the mesh points. Values between them come from interpolation.

Difference Equation

First-order Taylor expansion of yy about tit_i, assuming yy is twice differentiable

y(ti+1)=y(ti)+hf(ti,y(ti))+h22y(ξi),ξi(ti,ti+1)y(t_{i+1}) = y(t_i) + h f(t_i, y(t_i)) + \frac{h^2}{2} y''(\xi_i), \quad \xi_i \in (t_i, t_{i+1})

Dropping the second-order term and writing wiy(ti)w_i \approx y(t_i)

w0=αwi+1=wi+hf(ti,wi),i=0,1,,N1\begin{aligned} w_0 &= \alpha \\ w_{i+1} &= w_i + h f(t_i, w_i), \quad i = 0, 1, \ldots, N-1 \end{aligned}

Theoretical Error Bound

If ff satisfies a Lipschitz condition with constant L>0L > 0 and y(t)M|y''(t)| \leq M for some M>0M > 0, then for each i=0,1,,Ni = 0, 1, \ldots, N

y(ti)wihM2L(eL(tia)1)|y(t_i) - w_i| \leq \frac{hM}{2L}\left( e^{L(t_i - a)} - 1 \right)
  • MM: bound on y|y''| over [a,b][a, b]
  • LL: Lipschitz constant of ff

The bound is proportional to hh. Euler’s method has order 1.

Computational Error Bound

With round-off, each step carries an error bounded by δ\delta. The computed values uiu_i satisfy

u0=α+δ0ui+1=ui+hf(ti,ui)+δi+1,δi<δ\begin{aligned} u_0 &= \alpha + \delta_0 \\ u_{i+1} &= u_i + h f(t_i, u_i) + \delta_{i+1}, \quad |\delta_i| < \delta \end{aligned}

Then for each i=0,1,,Ni = 0, 1, \ldots, N

y(ti)ui1L(hM2+δh)(eL(tia)1)+δ0eL(tia)|y(t_i) - u_i| \leq \frac{1}{L}\left( \frac{hM}{2} + \frac{\delta}{h} \right)\left( e^{L(t_i - a)} - 1 \right) + |\delta_0|\, e^{L(t_i - a)}

As h0h \to 0 the factor hM2+δh\dfrac{hM}{2} + \dfrac{\delta}{h} \to \infty. Error grows with decreasing hh once hh is small enough. The minimizing step size is

h=2δMh = \sqrt{\frac{2\delta}{M}}

Worked Example

IVP y(t)=yt2+1y'(t) = y - t^2 + 1, 0t20 \leq t \leq 2, y(0)=0.5y(0) = 0.5, with N=4N = 4, so h=0.5h = 0.5 and f(t,y)=yt2+1f(t, y) = y - t^2 + 1.

w0=0.5w1=w0+0.5(w00.02+1)=1.25w2=w1+0.5(w10.52+1)=2.25w3=w2+0.5(w21.02+1)=3.375w4=w3+0.5(w31.52+1)=4.4375\begin{aligned} w_0 &= 0.5 \\ w_1 &= w_0 + 0.5\,(w_0 - 0.0^2 + 1) = 1.25 \\ w_2 &= w_1 + 0.5\,(w_1 - 0.5^2 + 1) = 2.25 \\ w_3 &= w_2 + 0.5\,(w_2 - 1.0^2 + 1) = 3.375 \\ w_4 &= w_3 + 0.5\,(w_3 - 1.5^2 + 1) = 4.4375 \end{aligned}

Hence y(2)w4=4.4375y(2) \approx w_4 = 4.4375. The exact solution is y(t)=(t+1)20.5ety(t) = (t+1)^2 - 0.5 e^t, giving y(2)5.3055y(2) \approx 5.3055.

Written by September 13, 2026 3 min read
Was this helpful?