# Result

**Some snippets from your converted document:**

Math 578: Assignment 2 13. Determine whether the natural cubic spline that interpolates the table is or is not the x 0 1 2 3 y 1 1 0 10 function 3 1 + x − x x ∈ [0, 1] 2 3 f (x) = 1 − 2(x − 1) − 3(x − 1) + 4(x − 1) x ∈ [1, 2] 4(x − 2) + 9(x − 2)2 − 3(x − 2)3 x ∈ [2, 3] Solution: Yes. Check conditions as follows. Define 3 1 + x − x := S0 (x) x ∈ [0, 1] 2 3 f (x) = 1 − 2(x − 1) − 3(x − 1) + 4(x − 1) := S1 (x) x ∈ [1, 2] 4(x − 2) + 9(x − 2)2 − 3(x − 2)3 := S2 (x) x ∈ [2, 3] Hence, 2 1 − 3x x ∈ [0, 1] f 0 (x) = − 2 − 6(x − 1) + 12(x − 1)2 x ∈ [1, 2] 4 + 18(x − 2) − 9(x − 2)2 x ∈ [2, 3] and − 6x x ∈ [0, 1] 00 f (x) = − 6 + 24(x − 1) x ∈ [1, 2] 18 − 18(x − 2) x ∈ [2, 3] Therefore, S0 (1) = 1 = S1 (1) S1 (2) = 0 = S2 (2) S00 (1) = −2 = S10 (1) S1 (2) = 4 = S20 (2) S000 (1) = −6 = S100 (1) S100 (2) = 18 = S200 (2). Besides, f 00 (0) = f 00 (3) = 0. Hence, function f is the natural cubic spline of the given table. 1 19. Find a natural cubic spline function whose knots are −1, 0 and 1 and that takes these values: x -1 0 1 y 5 7 9 Solution: Suppose the natural cubic spline function has the form ( S0 (x) x ∈ [−1, 0] f (x) = S1 (x) x ∈ [0, 1] Therefore, S000 (−1) = S100 (1) = 0 = z0 = z2 . Assuming that S0 (0) = z1 , and from the equation hi−1 zi−1 + 2(hi−1 + hi )zi + hi zi+1 = b(bi − bi−1 ) yi+1 −yi where bi = hi and i = 1, we can get z1 = 0. Hence, S0 (x) = Ax + B, S1 (x) = Cx + D. Substituting S0 (−1) = 5, S0 (0) = 7, S1 (0) = 7, S1 (1) = 9 into the above equations, we have S0 = S1 = 2x + 7. Therefore, f (x) = 2x + 7 is the natural cubic spline whose knots and values are given in the table. 2 37. The first U.S. postage stamp was issued in 1885, with the cost to mail a letter set at 2 cents. In 1917, the cost was raised to 3 cents but then was returned to 2 cents in 1919. In 1932, it was upped to 3 cents again, where it remained for 26 years. Then a series of increases took place as follows: 1958 = 4 cents, 1963 = 5 cents, 1968 = 6 cents, 1971 = 8 cents, 1974 = 10 cents, 1978 = 15 cents, 1981 = 18 cents in March and 20 cents in October, 1985 = 22 cents, 1988 = 25 cents, 1991 = 29 cents, 1995 = 32 cents, 1999 = 33 cents, 2001 = 34 cents, 2002 = 37 cents, 2006 = 39 cents, 2007 = 41 cents, 2008 = 42 cents. (1) Determine the Newton interpolation polynomial for these data. (2) Determine the natural cubic spline for these data. (3) Using both results, to answer the questions: when will it cost 50 cents to mail a letter? Currently, the cost is 44 cents. What would each of these two types of interpolation predict? Solution: All codes are in the appendix. (1)Suppose x = [1885 1917 1919 1932 1958 · · · 2008], y = [2 3 2 3 4 · · · 42]. Based on divided difference algorithm, Newton interpolation polynomial is p(x) = d1 + d2 (x − 1885) + d2 (x − 1885)(x − 1917) + · · · + d22 (x − 1885) · · · (x − 2007), where the coefficients are [d1 , d2 ,

**Recently converted files (publicly available):**