These are from the 10th edition of the book; see the scans if you have another.
The following old exam problems are taken from TMA4135, a course that is almost identical to TMA4123/TMA4125. The problems could just as well have been from a TMA4123/TMA4125 exam.
Make a Matlab function that does interpolation either using Lagrange's method or Newton's divided differences (hint: due to its recursive nature, you might find Newton's divided differences easier to implement if we ignore performance concerns1).)
Test your function by finding the polynomial that interpolates the following values:
\(x\) | -1.5 | -0.75 | 0 | 0.75 | 1.5 |
\(f(x)\) | -14.1014 | -0.931597 | 0.000000 | 0.931597 | 14.1014 |
The values are samples of the \(\tan\) function; plot your interpolation polynomial together with \(\tan\) on \([-1.5, 1.5]\).
Make a Matlab function that approximates integrals using Simpson's method. Table 19.4 on Kreyszig's page 829 is a good starting point. Use your function to approximate \(\int_{-1}^1 e^{-x^2}\, \mathrm{d}x\) (an integral that is impossible to compute analytically).