9.8. Exercises on Approximating Derivatives, the Method of Undetermined Coefficients and Richardson Extrapolation#

Exercise 1#

Show that for a three-point one-sided difference approximation of the first derivative

\[Df(x) = \frac{C_{0} f(x) + C_1 f(x + h) + C_2 f(x + 2h)}{h} + O(h^p)\]

the most accurate choice is \(C_0 = -3/2\), \(C_1 = 2\), \(C_2 = -1/2\), giving

\[Df(x) \approx \frac{-3 f(x) + 4 f(x + h) - f(x + 2h)}{2 h} + O(h^2).\]

and verify that this is of second order

Do this by setting up the three equations as above for the coefficients \(C_0\), \(C_1\) and \(C_2\), and solving them. Do this “by hand”, to get exact fractions as the answers; us the two Taylor serei formulas, but now tak advanta of what we saw above, whi cis that the error stsrts at the terms in \(D^3f(x)\), so use the forms

\[f(x+h) = f(x) + Df(x) h + \frac{D^2f(x)}{2} h^2 + \frac{D^3f(x)}{6} h^3 + O(h^4)\]

and

\[f(x+2h) = f(x) + 2 Df(x) h + 2 D^2f(x) h^2 + \frac{4 D^3f(x)}{3} h^3 + O(h^4)\]

Exercise 2#

Repeat Exercise 1, but using the degree of precision method.

That is, impose the condition of giving the exact value for the derivative at \(x=0\) for the monomial \(f(x) = 1\), then the same for \(f(x) = x\), and so on until there are enough equations to determine a unique solution for the coefficients.

Exercise 3#

Verify that the most accurate three-point centered difference approximation of \(D^2 f(x)\), form

\[D^2f(x) \approx \frac{C_{-1} f(x - h) + C_{0} f(x) + C_1 f(x + h)}{h^2}\]

is given by the coefficients \(C_{-1} = C_1 = 1\), \(C_0 = -2\) in that this is of the highest order; \(p=2\).

That is

\[D^2f(x) = \frac{f(x - h) -2 f(x) + f(x + h)}{h^2} + O(h^2).\]

Do this by hand, and exploit the symmetry.

Note that it works a bit better than expected, due to the symmetry.

Exercise 4#

Repeat Exercise 3, but using the degree of precision method.

Exercise 5#

Derive a symmetric five-point approximation of the second derivative, using the Method of Undetermined Coefficients; I recomend that you use the simpler second, “monomials” approach.

Note: try to exploit symmetry to reduce the number of equations that need to be solved.

Exercise 6#

Use the symmetric centered difference approxmation of the second derivative and Richardson extrapolation to get another more accurate approximation of this derivative.

Then compare to the result in Exercise 5.