Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

problems for chapter 2

NB! If a problem does not ask you to use Matlab, then you should not use Matlab.  You may use Matlab as a fancy calculator.

2.1    practice on Newton,s Divided Diferences

complete the following divided-diference table:

f [ ]

f [ , ]

f [ , , ]

f [ , , , ]

-1

2

1

-4

2

3

6

2

5

1O

use the table to obtain polynomial of degree 3 that interpolates the function values indicated. Do not simplify the polynomial.

2.2    practice on polynomial Interpolations

(a). use the Lagrange interpolation process to obtain a polynomial of least degree that assumes these values:

x

O

2

3

4

y

7

11

28

63

(b). For the points in the Table of (a), ind the Newton,s form of the interpolating polynomial. show that the two polynomials obtained are identical, although their forms may difer.

(c). The polynomial p(x) = x4  - x3  + x2  - x + 1 has the values shown.

x

-2

-1

O

1

2

3

p(x)

31

5

1

1

11

61

Find a polynomial h(x) that takes these values (you don,t need expand it):

x

-3

-2

-1

O

1

2

3

q(x)

193

31

5

1

1

11

61

You don,t need to expand your answer.   (Hint:   This can be done with little work.   Try the Newton,s form.)

(d). The polynomial p(x) = x4  - x3  + x2  - x + 1 has the values shown.

x

-2

-1

O

1

2

3

p(x)

31

5

1

1

11

61

Find a polynomial q(x) that takes these values (you don,t need expand it):

x

-2

-1

O

1

2

3

q(x)

31

5

1

1

11

3O

You don,t need to expand your answer.   (Hint:   This can be done with little work.   Try  the Lagrange form.)

2.3 van der Monde Matrix and Lagrange polynomial

consider the polynomial interpolation for the following data points

x

1

2

3

y

3

4

5

(a). write down the linear system in matrix form for solving the coe伍cients ai  (i = O, . . . , n) of the polynomial pn(x).

(b). use the Lagrange interpolation process to obtain a polynomial to approximate these data points (simplify your answer).

2.4    cardinal Functions

Let Li(x) be the ith cardinal function for a given data points (x0, x 1 , . . . , xn). prove that

Li(x) = 1.

You may verify the statement for n = 1.  Then, establish the result for an arbitrary value of n.

2.5    A Study on polynomial Interpolation in Matlab

The goal of this exercise is to get more familiar with Matlab.

The target problem: Find the interpolating polynomial

p3 (x) = a3x3 + a2x2  + a1x + a0 (1)

that interpolates the following data points:

i

O

5

1O

15

gi

3

8

2

9

(2)

preparations:

a)  show that the coe伍cients to the interpolating polynomial (1) can be found by solving

'1(1)

(1

O

25

1OO

225

12(O)5 )' 'a1(a0))'     ' 8(3) )'

3375(1OOO))' (' a3(a2))' = (' 2)'

(3)

b)  Read through ch.3 “programming in Matlab” in“A PTactical IntToduction  to  Matlab”by Gockenbach, at the web

http://www.math.mtu.edu/~msgocken/intro/intro.pdf

Linear equations

solve the system of linear equations (3) using Matlab.  The interpolating polynomial should be

p3 (x) = O.O48x3  - 1.O2x2  + 4.9x + 3.

simple plots

plot the interpolating points and the interpolating polynomial.  In addition to the function plot try also:

grid  on/off: add or remove a grid on the plot.

xlabel(,text,): put text under x-axis.

ylabel(,text,): put text next to g-axis.

title(,text,): put text above the plot.

Helpdesk. If you want to ind out what Matlab has to ofer in connection with polynomials, you may type in the command:

lookfor polynomial

and see what pops up.  check out how to use the functions polyfit and polyval.  For example, help polyfit, would give you the following information:

POLYFⅠT Fit polynomial to data .

POLYFⅠT(x,Y,N) finds the  coefficients  of  a  polynomial  P(x) of   degree N that fits the data, P(x(Ⅰ))~=Y(Ⅰ),  in  a  least-squares sense .    . . .

Here x is a vector with the x-values, and Y is a vector with g values from the table in (2) in our example.  N is the order of the polynomial, and in our case we use N = 3.  The function returns a vector with the coe伍cients of the polynomial.

use these functions polyfit and polyval to compute and plot the interpolating polynomial for table (2).

what to hand in: The script ile that shows you did this practice, and any output of the ile that you would like to show.

2.6 A Study of Finite Diference in Matlab

consider the inite diference approximation

f(①) 松 [-3f (①) 十 4f (① 十 h) - f (① 十 2h)]

for f (①) = ec  at the point ① = 1.  using the matlab function NumDerErr.m  (provided in canvas

for download) to ill in the Table 2.6.  Then compute the convergence order based on the formula

order = log2

h

ETTh

ETTh/2

order

O.2

O.O2

O.OO2

O.OOO2

2.7 More on Finite Diference

Let the function f (①) be three times diferentiable. consider the inite diference approximation

formula

f(①) Dh(①)  = [-3f (①) 十 4f (① 十 h) - f (① 十 2h)] .                           (4)

Note that this scheme uses values of f at the three points ①) ①十h)①十2h.  This is aone-sided inite diference. In Homework 1, we have already shown that the local truncation error is bounded by ch2  for some constant c, i.e.

'f(①) - Dh(①) ' ch2 .

(a)*. (bonus extra credit) we now sharpen the above error estimate.   show  that  the local truncation error is

'f(①) - Dh(①) ' = h2 f、、、(ξ))       for some ξ e [①) ① 十 2h].

(Hints:   consider  the  polynomial that  interpolates the function  f  at  the  following  3  points: ①) ① 十 h)① 十 2h.)

(b). Now set f (①)  =  tan ① .   use  the formula in  (4)  to approximate the derivative  f(①)  at ① = 1.O, choosing h = O.1, then h = O.O1 and h = O.OO1.  compare with the exact value to get the errors. comment on your results. Are these errors consistent with the error estimate in (a)?

(c). use Matlab to compute the approximation of the derivative of tan ① at ① = 1.O, with the formula in (4), with smaller and smaller values of h. plot the error e as a function of h, use log scale (see Matlab command loglog).  How did you expect the error to behave? How does the actual error behave? For what h value do you get the best result?  what do you think is the cause of this behavior?

what to hand in for part (c): Hand in the Matlab script ile, the relevant output of your code, the plots of errors, and your comments.

2.8    Theory of polynomial Interpolation

verify that both the polynomials

p(①)    =    5①3 - 27①2  + 45① - 21

q(①)   =    ①4 - 5①3  + 8①2 - 5① + 3

interpolate the data

1

2

3

4

g

2

1

6

47

Explain why this does not violate the uniqueness theorem on polynomial interpolation.

2.9 A Question to ponder

It is suspected that the table

-2

-1

0

1

2

3

g

1

4

11

16

13

-4

comes from a cubic polynomial. How can this be tested? Explain your reason and test it.