Professional Documents
Culture Documents
Homework 4
due 20.11.23 before 8 AM
Exercise 4.1:
Check with a paper-and-pencil calculation that the leading error of the Simpson
rule is indeed of O(h5 ). [Hint: use a Taylor expansion around the center of the
interval x = x1 .]
(5 points)
Exercise 4.2:
Write a MATLAB program which integrates a function f (x) over the interval [a, b]
with both the extended trapezoidal rule and the extended Simpson’s rule. The file
trapez.m is available for download in Moodle and can be used in the solution.
• Both procedures are able to integrate powers xk exactly for small enough k.
Check up to which value of k each algorithm can integrate exactly.
(10 points)
1
Exercise 4.3:
(10 points)
Note: For each exercise we should be able to see, from what you handed in, what
you did and what came out of it. Print out/write down everything we need for
this. If you don’t manage to write a working program, then write down a kind of
pseudo code. That is, explain step by step, what your program should be doing.