Transcript
Page 1: Topic 12.4_ Higher-Order Derivatives

Topic 12.4: Higher-Order Derivatives

https://ece.uwaterloo.ca/~dwharder/NumericalAnalysis/12Differentiation/higher/complete.html[15-Aug-14 7:51:41 PM]

Look for people, keywords, and in Google:

Topic 12.4: Higher-Order Derivatives

Introduction Notes Theory HOWTO Examples Engineering Error Questions Matlab Maple

Given three or more equally-spaced points, we can find an interpolating polynomial passing through thosepoints, find the 2nd, 3rd, or even higher derivative of that polynomial, and evaluate the derivative at a pointto get an approximation of the derivative at that point.

Background

Useful background for this topic includes:

5. Interpolation13.1 Centred Divided-Difference Formulae

References

Bradie, Section 6.2, Numerical Differentiation, Part II, p.443.Mathews, Section 6.2, Numerical Differentiation Formulas, p.339.Chapra, Section 23.1, High-accuracy Differentiation Formaulas, p.632.

Interactive MapletA Differentiation Formula Generator

To generate the formula for higher derivatives, select 2nd, 3rd, etc. instead of 1st in the third drop-downbox.

Theory

The theory for finding the nth-order derivatives is the same as that for finding simple derivatives: Given asequence of equally spaced points (either around or preceding a given point x0), find the interpolatingpolynomial of the appropriate degree, differentiate the interpolating polynomial n times (instead of once) andevaluate that interpolating polynomial at the point.

For the sake of completeness, we will list the centred and backward divided-difference formulae here. In eachcase, the format of Richardson extrapolation we found could be used to improve the approximations for theO(h2) formulae on this page.

Centred Divided-Difference Formulae

For each derivative, centred divided-difference formulae are O(h2) and O(h4), respectively.

Second Derivatives (3 and 5 point interpolations)Third Derivatives (5 and 7 point interpolations)Fourth Derivatives (5 and 7 point interpolations)Fifth Derivatives (7 and 9 point interpolations)Backward Divided-Difference Formulae

For each derivative, backward divided-difference formulae are O(h) and O(h2), respectively. Note that in allcases, the O(h) formula is equivalent to the corresponding O(h2) centred divided-difference formula, onlyshifted by h.

Second Derivatives (3 and 4 point interpolations)Third Derivatives (4 and 5 point interpolations)

Page 2: Topic 12.4_ Higher-Order Derivatives

Topic 12.4: Higher-Order Derivatives

https://ece.uwaterloo.ca/~dwharder/NumericalAnalysis/12Differentiation/higher/complete.html[15-Aug-14 7:51:41 PM]

Fourth Derivatives (5 and 6 point interpolations)Fifth Derivatives (6 and 7 point interpolations)

HOWTO

Problem

Approximate a higher derivative of a univariate function f(x) at a point x0. We will assume that we are givena sequence of points (xi, f(xi)) around the point of interest (either before or around). We will not look atiteration because the process of Richardson extrapolation converges significantly faster.

Assumptions

We need to assume the function has an nth derivative if we are to bound the error on our approximation.

Tools

We will use interpolation.

Process

If we are to evaluate the second derivative at the point (xi, f(xi)) and have access to the two surroundingpoints, (xi − 1, f(xi − 1)) and (xi + 1, f(xi + 1)), then we may find the interpolating polynomial, differentiate ittwice, and evaluate that derivative at xi:

This is simply another form of the formula

where h is the distance between the points, that is, h = xi - xi − 1.

If we have access to two points on either side of xi, we can calculate

where h = xi - xi − 1.

This is another form of the formula:

We could perform the same operations with higher derivatives, however, it should be noted that to calculatethe nth derivative, we require at least n + 1 points.

Examples

Example 1

Given the data points ..., 3.2, 3.3, 3.4, 3.5, 3.6, ... which measure the rotation of a satellite dish at points intime, with angles 1.05837 1.15775 1.25554 1.35078 1.44252, approximate the acceleration of the angle attime 3.4 using both the 2nd-order and 4th-order centred divided-difference formulae for the 2nd derivative.

(1.35078 − 2 1.25554 + 1.15775)/0.12 = −0.255 and (-1.44252 + 16 1.35078 − 30 1.25554 +16 1.15775 − 1.05837)/(12 0.12) = −0.2550833333 .

Thus, −0.25508333333 is the more accurate answer, but even the 2nd-order formula is reasonably close.

Engineering

To be completed.

Error

2nd-Order Centred Divided-Difference Formula

To determine the error for the 2nd-order centred divided-difference formula for the second derivative, weneed only look at the two Taylor series approximations:

Page 3: Topic 12.4_ Higher-Order Derivatives

Topic 12.4: Higher-Order Derivatives

https://ece.uwaterloo.ca/~dwharder/NumericalAnalysis/12Differentiation/higher/complete.html[15-Aug-14 7:51:41 PM]

and

Add these two equations and transfer the 2f(x) to the left-hand side to get

If we divide both sides by h2 and make the approximation that:

then we can rearrange the equation as

Thus, the error is O(h2).

4th-Order Centred Divided-Difference Formula

A similar sum may be used to find the error of the 4th-order divided difference formula. If you add the linearcombination -f(x + 2h) + 8 f(x + h) - 8 f(x - h) + f(x - 2h) of the 5th-order Taylor series approximations,then, after dividing by 12h, we are left with the error term:

If we divide through by -1/30 and factor out the h4, we get

Now, examining the contents of the parentheses, we note that the coefficients 2/3 - 1/6 - 1/6 + 2/3 = 1, andtherefore, the contents of the parentheses is an approximation of the average of f(5)(x) on the interval [x -2h, x + 2h], and thus, we may approximate the error by

Thus, the error is O(h4).

Questions

Question 1

Approximate the rate-of-change of the current at the midpoint of the incoming data ..., 7.2, 7.3, 7.4, 7.5,7.6, ... where the charge on a capacitor these times is 0.00242759 0.00241500 0.00240247 0.002390010.00237761.

Answer: -0.000007 and -0.0000071667.

Matlab

In Matlab, you would approximate the derivative numerically:

>> ( sin( 1.7 ) - sin( 1.3 ) )/0.4

which would approximate the actual derivative of cos(1.5).

Maple

Maple calculates derivatives symbolically:

> diff( sin(x), x ); cos(x)

For more help on the diff routine, enter:

?diff

Copyright ©2005 by Douglas Wilhelm Harder. All rights reserved.

Department of Electrical and Computer EngineeringUniversity of Waterloo200 University Avenue WestWaterloo, Ontario, Canada N2L 3G1+1 519 888 4567 http://www.ece.uwaterloo.ca/~ece104/


Recommended