MATH3242.03/COSC3122.03

FW03


Assignment 1 Due: Wed., Jan. 21, 2004



1. Use Taylor polynomials to show that



with an error term proportional to h4 f(5).


2. Show that applying Richardson extrapolation to the forward-difference formula for

f ' with step sizes 2h and h is equivalent to using the formula



What is the dependence on h of the error term?



3. For the functions cosec(2x+3) and :

a) Use the forward-difference formula, the backward-difference formula and the central-difference formula to approximate the first derivatives of these functions at x = 1.5. Take h = 0.04. Quote results to 4 decimal places.


b) Repeat part (a) for the function cosec(2x+3) taking h = 0.02 and 0.01. Put the results for all three values of h in a table and then use Richardson extrapolation to improve the accuracy of the derivative. Compare these with the exact values.


c) Find an approximate value for the second derivatives of these two functions using the values given in part (a) for x and h. Use Richardson extrapolation as in part (b) to improve the results for cosec(2x+3). Compare with the exact values. Note that the erro term for the second derivative formula is of the form K1h2 + K2h4.



4. Given the following tabular data:

x

y

1.17

1.2112

1.33

1.3358

1.41

1.4819

find the Lagrange interpolating polynomial through these three points and use it to find an approximation to at x = 1.2 and 1.3. Give your answer to the number of significant digits warranted by the data (you can assume the x values are exact but the y values are correct only to the number of digits given in the table).


5. Write a MAPLE program to approximate the derivative of the function (x+1)ln(x-1) at x = 1.2 using both the forward- and central-difference formulae. In order to illustrate the problem of roundoff error restrict the accuracy of the calculations to 6 significant digits by using the MAPLE command

> Digits:=6;

Take a series of values for h = 10-n with n = 1, 2, ..., 6.

Which value of h gives the most accurate result in each case?

For this question:

- hand in a copy of the MAPLE program including the results;

- put comments in the program to explain what you are doing.


6. Use the IMSL routines DCSINT in FORTRAN or cub_spline_interp_e_cnd in C to calculate a cubic spline interpolation to the data given below. Then use DCSDER or cub_spline_value to calculate the first and second derivatives of the spline interpolation at the points 0.9 and 1.05. In C you can also use the routines spline_interp and spline_value. See my website for information on using IMSL.


x

y

0.5

2.473

0.7

2.061

0.8

1.797

1.0

1.375

1.15

0.988