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=b−aNh = \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+1−ti=ht_{i+1} - t_i = h.

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 wi≈y(ti)w_i \approx y(t_i)

w0=αwi+1=wi+hf(ti,wi),i=0,1,…,N−1\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)−wi∣≤hM2L(eL(ti−a)−1)|y(t_i) - w_i| \leq \frac{hM}{2L}\left( e^{L(t_i - a)} - 1 \right)
Here:
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)−ui∣≤1L(hM2+δh)(eL(ti−a)−1)+∣δ0∣ eL(ti−a)|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 h→0h \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 Examples

Example 1

Apply Euler’s method to y′(t)=y−t2+1y'(t) = y - t^2 + 1, 0≤t≤20 \leq t \leq 2, y(0)=0.5y(0) = 0.5, with N=4N = 4.

Solution Reveal Hide

h=0.5h = 0.5 and f(t,y)=y−t2+1f(t, y) = y - t^2 + 1.

w0=0.5w1=w0+0.5 (w0−0.02+1)=1.25w2=w1+0.5 (w1−0.52+1)=2.25w3=w2+0.5 (w2−1.02+1)=3.375w4=w3+0.5 (w3−1.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)2−0.5ety(t) = (t+1)^2 - 0.5 e^t, giving y(2)≈5.3055y(2) \approx 5.3055.

Example 2

Apply Euler’s method to y′(t)=yy'(t) = y, 0≤t≤0.30 \leq t \leq 0.3, y(0)=1y(0) = 1, with h=0.1h = 0.1. Compare with the exact solution y=ety = e^t.

Solution Reveal Hide
w0=1w1=1+0.1(1)=1.1w2=1.1+0.1(1.1)=1.21w3=1.21+0.1(1.21)=1.331\begin{aligned} w_0 &= 1 \\ w_1 &= 1 + 0.1(1) = 1.1 \\ w_2 &= 1.1 + 0.1(1.1) = 1.21 \\ w_3 &= 1.21 + 0.1(1.21) = 1.331 \end{aligned}
tit_iwiw_iy(ti)y(t_i)Error
0.11.11.105170.00517
0.21.211.221400.01140
0.31.3311.349860.01886

The error grows with ii.

Wolfram Mathematica notebooks

A companion notebook for this note. Open it in Mathematica and evaluate the cells to reproduce the worked example.

The summary notebook defines every function used in this module, with documentation and no examples, as a starting point for your own problems.

Written by November 3, 2026 2 min read
Was this helpful?