Project 22: Taylor's formula

Previous project Next project

Taylor's formula is a more accurate local formula than the "microscope approximation." It has many uses. Taylor's formula uses the first derivative f'[x] and a number of higher order derivatives: the second derivative f"[x], which is the derivative of f'[x]; the third derivative f(3)[x], which is the derivative of f"[x]; . Here is the general result:

Theorem 22.1 Taylor's Small Oh Formula Suppose that f[x] has n ordinary continuous derivatives on the interval (a,b). If x is not near a or b and is small, then

for .

When n=1, Taylor's formula is the "microscope approximation,"


Notice that if is small, then its square is small even on a scale of . This makes the second-order formula a more accurate approximation for ,


For example, if , then is only one one-thousandth of that, .

Strictly speaking, the "" in the two formulas cannot be compared. All we know is that when is "small enough" both 's are as small as we prescribe. All we really know is that "eventually" the second-order formula is better than the first-order one. In the Mathematical Background Chapter 8, we make the approximation more precise.

  • Graphical Comparisons
    Show that the Taylor polynomials for sine at x=0 satisfy

    and use the computer to compare the plots of several of the approximations,

    Make similar graphical comparisons for and Exp[0+dx]=e0+dx.


    Figure 22.1: Sine and 3 Taylor Approximations

    22.1 The Increment Equation and Increasing

    It is "clear" that if we view a graph in an powerful microscope and see the graph as indistinguishable from an upward-sloping line at a point x0, then the function must be "increasing" near x0. The previous Project 21 on inverse functions uses this idea in a very computational way. Certainly, the graph need not be increasing everywhere -- draw y=x2 and consider the point x0=1 with f'[1]=2. Exactly how should we formulate this? Even if you don't care about the symbolic proof of the algebraic formulation, the formulation itself may be useful in cases where you don't have graphs.

    Theorem 22.2 Local Monotony Suppose the function f[x] is differentiable on the real interval a<x<b and x0 is a real point in this interval.
    • 1. If f'[x0]>0, then there is a real interval , , such that f[x] is increasing on , that is,

    • 2. If f'[x0]<0, then there is a real interval , , such that f[x] is decreasing on , that is,

    Math Background Section 5.6 has a more complete exposition of this topic. The idea is simple: Compute the change in f[x] using the positive slope straight line and keep track of the error.

    Take x1 and x2 so that . Since (see text Section CD 5.5 and Math Background Theorem 5.4), we may write where m=f'[x0] and . Let so


    The number m is a real positive number, so and , since , . This means f[x2]-f[x1]>0 and f[x2]>f[x1].

    The Math Background shows how to make the approximations precise and thus allow x1 and x2 to range in an interval .

    22.2 Taylor's formula and Bending

    The smile and frown icons of text Chapter 9 are based on a simple intuitive mathematical idea: when the slope of the tangent increases, the curve bends up. We have two questions. (1) How can we formulate bending symbolically? (2) How do we prove that the formulation is true? First things first.

    If a curve bends up, it lies above its tangent line. Draw the picture. The tangent line at x0 has the formula y=b+m(x-x0) with b=f[x0] and m=f'[x0]. If the graph lies above the tangent, f[x1] should be greater than b+m(x1-x0)=f[x0]+f'[x0](x1-x0) or


    This is the answer to question 1, but now we are faced with question 2. The increment approximation says

    so this direct formulation of "bending up" requires that we show that the whole error stays positive for . All we have to work with is the increment approximation for f'[x] and the fact that f"[x0]>0. A direct proof is not very easy to give - at least we don't know a direct one. The second-order Taylor formula will make this easy.

    We have at least formulated the result as follows.

    Theorem 22.3 Local Bending Suppose the function f[x] is twice differentiable on the real interval a<x<b and x0 is a real point in this interval.
    • 1. If f"[x0]>0, then there is a real interval , , such that y=f[x] lies above its tangent over , that is,

    • 2. If f"[x0]<0, then there is a real interval , , such that y=f[x] lies below its tangent over , that is,

    We want you to use the second-order Taylor formula to show the algebraic form of the smile icon. If f[x] is twice differentiable on a real interval (a,b), a<x<b, and x is not near a or b, then for any small


    with .

  • The Local Bending Theorem from Taylor's formula
    Suppose that f"[x0]>0 at the real value x0. If , substitute x=x0 and into Taylor's second-order formula to show the local bending formula. Use the fact that .

    Math Background Section 8.1 has a complete exposition of this topic. In particular, it deals with the question of how far away x1 can be from x0.

    22.3 Symmetric Differences and Taylor's formula

    Taylor's formula can also be used to find a formula for second derivatives and to explain why symmetric differences give a more accurate approximation to first derivatives than the formula .

    Substitute and into Taylor's second-order formula to obtain


    Subtract the two to obtain


  • Symmetric Difference Error

    Solve the last formula above for f'[x], obtaining

    and an error. Why is this formula algebraically a better approximation for f'[x] than the one you obtain by solving the ordinary increment approximation for ? Compare the errors and note the importance of being small.

    Graphically, the approximation of slope given by the symmetric difference is clearly better on a "typical" graph as illustrated below. A line through the points (x,f[x]) and is drawn with the tangent at x in one view, while a line through and is drawn with the tangent at x in the other. The second slope is closer to the slope of the tangent, even though the line does not go through the point of tangency. # 0 0# 0itemnumber) =0pt

    0 #758#>& to0pt1

    to##=0em plus10em&&##=0em plus10em

      and   

  • Sketch the line through the points and (x,f[x]) on the first view. Show that the average of the slopes of the two secant lines on the resulting figure is , the same as the slope of the symmetric secant line in the second view.

    A quadratic function q[dx] in the local variable dx that matches the graph y=f[x] at the three x values, , x, and , is given by


    where y1=f[x], , and .

  • Verify that the values agree at these points by substituting the values dx=0, and .

    Show that the derivative , the same as the symmetric secant line slope. In other words, a quadratic fit gives the same slope approximation as the symmetric one, which is also the same as the average of a left and a right approximation. All these approximations are "second-order."

    It is interesting to compare different numerical approximations to the derivative in a difficult, but known case. This is done in Project 17 on direct computation of the derivative of an exponential. The experiments give a concrete form to the error estimates of the previous exercise.

    When we only have data (such as in the law of gravity in Chapter 10 of the main text or in the air resistance project in the Scientific Projects), we must use an approximation. In that case the symmetric formula is best.

    22.4 Direct Computation of Second Derivatives


    Substitute and into Taylor's second-order formula to obtain


    Add the two to obtain

  • Second Differences for Second Derivatives