MATH3242.03/COSC3122.03

FW03

Solutions to Assignment 1

1. We have the Taylor polynomials

so that

48f(x+h) - 36f(x+2h) + 16f(x+3h) - 3f(x+4h) = 25f(x) + 12hf¢ (x) + O(h5fv)

Solving for f¢ we get

with an error term proportional to h4 fv.

2. The forward difference formula for f¢ is given by

In this case the Richardson extrapolation formula using F2h and Fh is

with an error of O(h2).

3. For the function f = cosec(2x+3),

f¢ = -2cosec(2x+3)cot(2x+3)= -24.5967 at x = 1.5

and

f¢¢ = 4cosec(2x+3)cot2 (2x+3) + 4cosec3(2x+3)) = -352.4077 at x = 1.5

Using the forward difference formula with Richardson extrapolation we have

f¢ = Fh + K1h + K2h2

where

In this case Richardson extrapolation employs the formulae

Fh(2) = 2Fh/2 - Fh

and

yielding the following table of results

 h Fh Fh(2) Fh(3) 0.04 –34.4186 0.02 –28.7002 –22.9817 0.01 –26.4926 –24.2850 –24.7194

We see that the forward difference formula yields only at most one correct digit while the first Richardson extrapolation yields one more. The second extrapolation has an error of 1 in the first decimal place.

For the backward difference formula we have exactly the same set of formulae except that

leading to the following numerical results:

 h Fh Fh(2) Fh(3) 0.04 –19.1002 0.02 –21.5086 –23.9169 0.01 –22.9509 –24.3931 –24.5518

The backward difference formula shows a similar behaviour to the forward difference formula but is somewhat more accurate.

For the central difference formula we have

f¢ = Fh + K h2 + K¢ h4

where

which yields

 h Fh Fh(2) Fh(3) .04 –26.7594 .02 –25.1044 –24.5527 .01 –24.7217 –24.5941 –24.5969

The central difference formula yields more accurate results than either the forward or backward formulae as expected since it has an error of O(h2). Richardson extrapolation gives the correct result to almost 4 decimal places.

For the second derivative we have

f¢¢ = Fh + K h2 + K¢ h4

where

which yields

 h Fh Fh(2) Fh(3) .04 –382.9597 .02 –359.5792 –351.7857 .01 –354.1736 –352.3717 –352.4108

which gives the same sort of accuracy as the CDF for the first derivative. This is to be expected since both formulae have errors of O(h2).

4. From the following tabular data:

 x y 1.17 1.2112 1.33 1.3358 1.41 1.4819

we get the Lagrange interpolating polynomial

= 4.365x2 - 10.133x + 7.092

Note that the data is given to only 5 significant figures (assuming the x values are exact) and there is considerable cancellation in the calculation of the coefficients of the interpolating polynomial. Thus the coefficients of the interpolating polynomial have limited accuracy. (In fact we have kept one more digit than strictly justified to reduce further roundoff error). Differentiating this polynomial gives

P¢(x) = 8.730x - 10.133

which has the value 0.343 at x = 1.2 and 1.216 at x = 1.3.