Problem set 9

Problems from the textbook

These are from the 10th edition of the book; see the scans if you have another.

  • 19.3: 3 (scan - the one that begins with "Quadratic interpolation")
  • 19.5: 4, 7, 8 (scan)

Old exam problems

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.

Programming problem 1 (harder than problem 2)

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]\).

Programming problem 2 (easy)

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).

Voluntary repetition problems

1)
A naive implementation, which is fine here, will compute most coefficients several times. The interested student might want to consider memoization, but that's certainly not neccessary here!
2015-03-06, spreeman