|
CS 323 - Spring 2006 Homework 4
Due at start of class: Wednesday, April 5 |
Instructions
Answer the following questions. When writing up your solution,
include some brief narrative to explain your approach (in other
words, show your work; don't just give the final answer.)
Clearly state any assumptions you make.
When you use MATLAB, hand in everything: the programs, transcripts (from the command window) and graphs. Label them (by hand is ok). No need to write a general program (such as one that accepts varying input) unless explicitly specified. Comment the program and output so that it can be understood without too much trouble. Print out any graphs.
Problem 1
You are given three data points:
(x0, y0) = (2,9)
(x1, y1) = (3,8)
(x2, y2) = (4,5)
(a) Derive the interpolating polynomial using Lagrange's formula
(b) Derive the interpolating polynomial using divided differences
(c) Plot the above two polynomials in Matlab over the domain [-2,6]. They should be the same! (So you might consider plotting one using '.' and the other using '-'.)
(d) What is this polynomial, when fully simplified? (Hint, use the above graph; the roots are integers.)
Problem 2
Do problem 26 in § 4.1 (page 136 of text). You'll need divdif.m from the text.
Problem 3
Do problem 2 in § 4.2 (page 143 of text).
To save you the trouble:
f(x) = tan-1(x)
f'(x) = ( 1+x2
) -1
f''(x) = -2x ( 1+x2
) -2