STEP 5

ERRORS

Approximation to functions

An important procedure in Analysis is to represent a given function as an infinite series of terms involving simpler or otherwise more appropriate functions. Thus, if f is the given function, it may be represented as the series expansion

involving the set of functions (fi). Mathematicians have spent a lot of effort in discussing the convergence of series, i.e., on defining conditions for which the partial sum

approximates the function value f (x) ever more closely as n increases. In Numerical Analysis, we are primarily concerned with such convergent series; computation of the sequence of partial sums is an approximation process in which the truncation error may be made as small as we please by taking a sufficient number of terms into account.

  1. Taylor series

    The most important expansion to represent a function is the Taylor series. If f is suitably smooth in the neighbourhood of some chosen point x0,

    ,

    where

    ;

    here h = x - x0 denotes the displacement from x0 to the point x in the neighbourhood, and the remainder term is

    for some point x between x0 and x. (This is known as the Lagrange form of the remainder; its derivation may be found in Section 8.7 of Thomas and Finney ( 1992), cited in the Bibliography.) Note that the x in this expression for Rn may be written as

    The Taylor expansion converges for x within some range including the point x0, a range which lies within the neighbourhood of x0 mentioned above. Within this range of convergence, the truncatiorr error due to discarding terms after the xn term (equal to the value of Rn at the point x) can be made smaller in magnitude than any positive constant by choosing n sufficiently large. In other words, by using Rn to decide how many terms are needed, one may evaluate a function at any point in the range of convergence as accurately as the accumulation of round-off error permits.

    From the point of view of the numerical analyst, it is most important that the convergence be fast enough. For example, if we consider f (x) = sin x, we have

    and the expansion (about x0 = 0) for n = 2k - 1 is given by

    with

    .

    Note that this expansion has only odd-powered terms, although the polynomial approximation is of degree (2k - 1 ) - it has only k terms. Moreover, the absence of even-powered terms means that the same polynomial approximation is obtained with n = 2k, and hence R2k-1 = R2k; the remainder term R2k - 1 given above is actually the expression for R2k. Since then

    ,

    if 5D accuracy is required, it follows that we need only take k = 2 at x = 0.1, and k = 4 at x=1 (since 9! = 362 880). On the other hand, the expansion for the natural (base e) logarithm,

    ,

    where

    is less suitable. Although only n = 4 terms are needed to give 5D accuracy at x = 0.1, n = 13 is required for 5D accuracy at x = 0.5, and n = 19 gives just 1D accuracy at x = 1!

    Moreover, we remark that the Taylor series is not only used extensively to represent functions numerically, but also to analyse the errors involved in various algorithms (for example, STEP 8, Step9, Step10, Step30, and Step31)

    Polynomial approximation

    The Taylor series provides a simple method of polynomial approximation (of chosen degree n)

    which is basic to the later discussion of various elementary numerical procedures. Because f is often complicated, one may prefer to execute operations such as differentiation and integration of a polynomial approximation. Interpolation formulae in STEP22 and STEP23 may also be used to construct polynomial approximations.

  2. Other series expansions

    There are many other series expansions, such as the Fourier series (in terms of sines and cosines), or those involving various orthogonal functions (Legendre polynomials, Chebyshev polynomials, Bessel functions, etc.). From the numerical standpoint, truncated Fourier series and Chebyshev polynomial series have proven to be most useful. Fourier series are appropriate in treating functions with natural periodicities, while Chebyshev series provide the most rapid convergence of all known polynomial based approximations.

    Occasionally, it is possible to represent a function adequately (from the numerical standpoint) by truncating a series which does not converge in the mathematical sense. For example, solutions are sometimes obtained in the form of asymptotic series with leading terms which provide sufficiently accurate numerical results.

    While we confine our attention in this book to truncated Taylor series, the interested reader should be aware that such alternative expansions exist (see, for example, Burden and Faires (1993)).

  3. Recursive procedures

    While a truncated series with few terms may be a practical way to compute values of a function, there is a number of arithmetic operations involved, and it may be preferable to employ possibly available recursive procedures which reduce the arithmetic required. For example, the values of the polynomial

    and its derivative

    for may be generated recursively by Horner's scheme:

    Thus, for successive values of k, one has

    The technique just described is also known as nested multiplication. (Perhaps the student may want to suggest a recursive procedure for higher derivatives of P.)

    Finally, it should be noted that it is common to generate members of a set of orthogonal functions recursively.

Checkpoint

  1. How do numerical analysts use the remainder term Rn in Taylor series?
  2. Why is the rate of convergence so important from the numerical standpoint?
  3. From the numerical standpoint, is it essential for a series representation to converge in the mathematical sense?

EXERCISES

  1. Find the Taylor series expansions about x = 0 for each of the functions:
    1. cosx.
    2. 1/(1 - x).

    Determine also for each series a general remainder term.

  2. For each of the functions in 1. evaluate f(0.5), using a calculator and the first four terms of the Taylor expansions.
  3. Use the remainder term found in 1.3 to find the value of n required in the Taylor series for f(x)=ex about x = 0 to give 5D accuracy for all x between 0 and 1.
  4. Truncate the Taylor series found in 1.3 to give linear, quadratic, and cubic polynomial approximations for f(x) = ex in the neighbourhood of x = 0. Use the remainder term to estimate (to the nearest 0.1) the range over which each polynomial approximation yields results correct to 2D.
  5. Evaluate P(3.1) and P'(3.1), where P(x) = x3 - 2x2 + 2x + 3, using the technique of nested multiplication.
  6. Evaluate P(2.6) and P'(2.6), where P(x) = 2x4 - x3 + 3x2 + 5, using nested multiplication. Check your values using a calculator.

    Answers

    last next