You are on page 1of 4

MAR 2115 Differential Equations & Series - WorkSheet 3

Numerical Approximation Methods for Differential Equations
Advice:You should work to 4 decimal places in all questions.
1.1 Use Euler’s method to solve the initial - value problem
y ′ + 2y = x ; y0 = 0 ; step-length h = 0. 2 up to x = 1.
Show that the exact solution of this equation is
y = 1 e −2x + 2x − 1
4
and compare it with the approximate solution. Do the Euler approximations
under - or overestimate the exact solution?

1.2 Use the Improved Euler method to solve the intial - value problem of Q1.1.
Compare the results with the Euler approximations and comment.

1.3 Solve the initial - value problems
i.

y2
y′ = 1 − x

ii.

y ′ + 2 y = e x ; y1 = 0

;

y1 = 1

for y2 using (a) Euler ’s method

(b) the Improved Euler method

with step h = 0. 5.
Answers
1.1
xn

yn

y

0

0

0

0. 2

0

0. 0176

0. 4

0. 04

0. 0623

0. 6

0. 104

0. 1253

0. 8

0. 1824

0. 2005

1. 0

0. 2694

0. 2838

(Euler)

(Exact)

The Euler approximations underestimate the exact solution.

MAR2115 Differential Eqs & Series - Worksheet 3

1

1.2
xn

yn

0

0

0. 2

0. 02

‘ 0. 4
0. 6

0. 0656

0. 8

0. 2035

1. 0

0. 2864

0. 1286

(Improved Euler)
The Improved Euler method gives much greater accuracy.
All approximations are overestimates for the exact solution.

1.3 (i)

1.3 (ii)
xn

yn

yn

xn

yn

yn

1

1

1

1

0

0

1. 5

1

1. 0834

1. 5

1. 3591

1. 2171

2

1. 1667

1. 2101

2

2. 4341

2. 8659

(Euler)

(Improved Euler)

(Euler)

(Improved Euler)

Suggested solution
y2
1.3 i.
y′ = 1 − x
; y1 = 1
(a) Euler’s
y1 = y0 + h f x0 , y0
= 1 + 0. 51 − 1 = 1
y 2 = y 1 + 0. 5 f x 1 , y 1
(b) Improved Euler
y2
;
y′ = 1 − x
k 1 = h f x n , y n ,

= 1 + 0. 5 1 −

1
1.5

= 1. 166 7

y1 = 1
p

k 2 = h f x n+1 , y n+1

p

y n+1 = y n + k 1
y n+1 = y n + 1 k 1 + k 2
2
p

y 1 = y0 + k 1
= y 0 + h f x 0 , y 0 
= 1 + 0. 5 1 − 11

=1

MAR2115 Differential Eqs & Series - Worksheet 3

2

y1 = y0 + 1 k 1 + k 2
2
p
= 1 + 1 h f x 0 , y 0  + h f x 1 , y 1
2
1
= 1 + 1 0. 51 − 11  + 0. 5 1 − 1.5

2
= 1 + 1 0. 166 67 = 1. 083 3
2
p
y 2 = y1 + k 1
= 1. 0833 + h f x 1 , y 1 
1. 0833 2
= 1. 0833 + 0. 5 1 −
1. 5
= 1. 1921
y2 = y1 + 1 k 1 + k 2
2
p
= 1. 0833 + 1 h f x 1 , y 1  + h f x 2 , y 2
2
1. 0833 2
1. 1921 2
= 1. 0833 + 1 0. 5 1 −
+ 0. 5 1 −
2
1. 5
2
= 1. 0833 + 1 0. 25354 = 1. 210 1
2

MAR2115 Differential Eqs & Series - Worksheet 3

3

y ′ + 2 y = e x ; y1 = 0

1.3 ii.

 y′ = ex − 2 y

; y1 = 0

(a) Euler’s
y1 = y0 + h f x0 , y0
= 0 + 0. 5 e 1 − 2 0
y 2 = y 1 + 0. 5 f x 1 , y 1

= 0. 5e 1 = 1. 359 1
= 1. 3591 + 0. 5 e 1.5 − 2 1. 3591

= 2. 434 1

(b) Improved Euler
y ′ + 2 y = e x ; y1 = 0
 y′ = ex − 2 y

; y1 = 0

k 1 = h f x n , y n ,

p

k 2 = h f x n+1 , y n+1

p

y n+1 = y n + k 1
y n+1 = y n + 1 k 1 + k 2
2
p

y 1 = y0 + k 1
= y 0 + h f x 0 , y 0 
= 0 + 0. 5 e 1 − 2 0

= 0. 5e 1 = 1. 359 1

y1 = y0 + 1 k 1 + k 2
2
p
= 0 + 1 h f x 0 , y 0  + h f x 1 , y 1
2
= 0 + 1 0. 5 e 1 − 2 0 + 0. 5 e 1.5 − 2 1. 3590
2
1
= 0 + 1. 359 1 + 1. 075 1
2
= 1. 2171
p

y 2 = y1 + k 1
= 1. 2171 + h f x 1 , y 1 
= 1. 2171 + 0. 5 e 1.5 − 2 1. 2171
= 1. 2171 + 1. 1376 = 2. 354 7
y2 = y1 + 1 k 1 + k 2
2
p
= 1. 2171 + 1 h f x 1 , y 1  + h f x 2 , y 2
2
= 1. 2171 + 1 0. 5 e 1.5 − 2 1. 2171 + 0. 5 e 2 − 2 2. 3547
2
1
= 1. 2171 + 1. 1376 + 2. 16 = 2. 865 9
2

MAR2115 Differential Eqs & Series - Worksheet 3

4