Math 204/GEAI 1224, Spring 2025
2.5: Autonomous Equation and Population Dynamics
2.7: Euler’s Method
It is an unfortunate and sad fact that solutions of the vast majority of first-order initial value
problems cannot be found by analytical means.
♣ We have seen one way to approach the problem, by drawing the direction/slope field (方向
場/斜率場) for the differential equation and then to visualise the qualitative behaviour (定性
行為)of the solution from the direction field.
♣ However, this graphical approach doesn’t lend itself to quantitative computations or comparisons (定量計算或比較)!
That being said, we sketch approximate solution curves using the slope field by “tracing the tangent line”. It is natural to ask if we can use these tangent lines to approximate the solution at
a given time. This is the idea behind the following numerical method (數值方法) called Euler’s
method.
Euler’s Method (歐
歐拉方 法) with Step Size (迭
迭代 步 長 ) h
Given the initial value problem
dy = f (x, y)
,
dx
y(x0 ) = y0
the Euler’s method with step size h > 0 consists of applying the iterative formula (迭
迭代 公
式)
yn+1 = yn + h · f (xn , yn ), n ≥ 0,
to compute successive approximations (逐
逐 次 近 似 值 ) y1 , y2 , y3 , . . . to the exact values
y(x1 ), y(x2 ), y(x3 ), . . . of the exact solution (精確解) y = y(x) at x1 , x2 , x3 , . . . , respectively.
Problem 1. Use Euler’s method to approximate the solution to the following initial value problem
on the interval [0, 5] with step size h = 1.
y
dy
= x + ; y(0) = −3.
dx
5
Math 204/GEAI 1224, Spring 2025
2.5: Autonomous Equation and Population Dynamics
Error Bounds
We have three types of errors we need to worry about when using any numerical approximation:
1. The local error (局
局部 誤 差) is the error introduced at a single step.
2. The cumulative error (累
累積 誤差 ) is the result of all previous errors adding up.
3. The round-off error (捨
捨 入 誤 差) is the result of your computer rounding digits to some
number. For example, MATLAB keeps 16 digits. Maple let us choose how many digits to
keep; the maximum digits is 38, 654, 705, 646.
Error in Euler’s Method
Suppose the initial value problem
dy
= f (x, y(x)); y(x0 ) = y0 ,
dx
has a unique solution y(x) on the interval [x0 , b] for some b > x0 and assume that y(x) has a
continuous second derivative on [a, b]. Then Euler’s method is first-order accurate (一
一階
精 確). That is, there exists a constant C > 0 (independent of the step size h) such that the
cumulative error after n steps satisfies
|y(xn ) − yn | ≤ Ch for every n = 1, 2, 3, . . . .
Page 2