
| CHAPTER RESOURCES: PROJECTS
CHAPTER 7 |
| Numerical Analysis In the project for Chapter 7 you used matrix arithmetic to find coefficients for an eighth degree polynomial whose graph passes through nine given points. In general, interpolating a polynomial through n points will involve solving a system of n equations in n unknowns to find the coefficients for a polynomial of degree n -- 1. In these activities you'll use a calculator program to automate the process of finding coefficients for polynomials that closely imitate some of the other functions you have studied. The process of finding good polynomial approximations for nonpolynomial functions is at the heart of the branch of mathematics called numerical analysis. Polynomials are important because you can compute them by just adding and multiplying, which is exactly what calculators and computers are good at (in a sense it's all they know how to do). When you press the square root button or the log x button on your calculator, it's actually giving you a polynomial approximation. In the Download section of this College Algebra and Trigonometry site you'll find a TI-83 program called Sysfour.83p, which solves a system of four equations in four unknowns. (If you don't have a programmable calculator that can use this program, you can still do all of these activities: you'll just have to enter the coefficient matrix and constant matrix yourself and set up the solution by computing the inverse of the coefficient matrix.) We'll work with fourth degree polynomials, so we should need to solve a five by five system, but we'll arrange it so all of our functions go through the origin, which means that the constant term will always be 0. So we'll always have four coefficients to find. Here's an example of what we'll be doing. We want to find a fourth degree polynomial g(x) that "imitates" the function over the interval [0, 4]. We'll do this by computing the value of f at 1, 2, 3 and 4, and then we'll construct a fourth degree polynomial that goes through these points. We'll give our polynomial the constant term 0, so it will also agree with f when x is 0. First we'll have the calculator compute the values of f at 1, 2, 3 and 4 and put them in a column matrix called B. B will contain the square roots of 1, 2, 3, and 4: ![]() The coefficient matrix C will look like this: ![]() Then we can find the coefficients of g on the calculator by computing C-1B, or, in the notation of the TI-83, [C] -1[B]. For our sample function g, we'll get the following matrix of coefficients: ![]() Now in the Y= window we can define Y1 to be the function Define Y2 to be the target function, square root of x, and look at the two graphs. Set the x range to be something like [-1, 5] and you'll see a graph similar to this: ![]() We've marked the five given x values (including the origin) with crosses, and you can see that our polynomial g agrees with the square root function at these five points. This is no surprise, since we arranged it that way. The fit is excellent between 1 and 4, not so good between 0 and 1. After 4 the polynomial diverges rapidly from the square root graph, and for x less than 0 the polynomial has values and the square root isn't even defined! Another way to check the fit is to evaluate the two functions at several points. Here are a few examples: ![]() This is typical of polynomial approximations: They may be quite good in the range covered by the points you used to construct the approximation, but are likely to fail badly outside this range. In the activities below you'll construct approximations for several other nonpolynomial functions and compare graphs and values to see where your approximation is good and where it breaks down. ACTIVITIES For each function f in Activities 1 through 4, use matrix arithmetic to find a fourth degree polynomial g that matches the target function f exactly at x = 1, 2, 3, and 4. Since the functions f all go through the origin you can also match f at x = 0 by setting the constant term of your polynomial to 0. If you can download and use the program Sysfour.83p for solving a system of four equations in four unknowns you can automate a few steps of the process. Note in any case that you only have to enter the coefficient matrix C once: it's the same for each problem. (We call C the "coefficient matrix" because its entries are the coefficients of the linear system you are solving. When you solve the system, the solution is also a set of coefficients, the coefficients of the polynomial g.) For each function f, graph f and g over the x range [-1, 5]. How good is the fit? Now compute some values of f and g at noninteger x values in the range. What does the typical error seem to be? What is the largest error in the interval [0, 4]? When the graphs are very close, it's easier to look at errors if you plot the difference of the two functions. In our example, this would mean plotting the function Y3 defined as You'll need to graph this in a separate plotting window since you'll want to let the plot scale itself by using ZoomFit. Now you can find the largest error by using the Trace feature of the calculator.
FURTHER READING ON THE WEB In each of the Activities above you found a fourth-degree polynomial whose graph passes through five given points. This is called an interpolating polynomial, and in general the lowest-degree polynomial that interpolates n points will have degree n - 1. As you saw from your graphs, the interpolating polynomial may have a very steep graph outside the range covered by the given points. It may be useful for interpolating values of the target function you are trying to match, but it's not much good for extrapolation, that is, for estimating values outside this range. The more closely you constrain the values of a polynomial by forcing it to go through a set of points, the more wildly it will behave elsewhere. At the Web site http://www.wam.umd.edu/~petersd/interp.html you'll find a Java applet that lets you place points anywhere on the coordinate plane and then draws the interpolating polynomial. Once you have some points and the graph, click on the Move Points button and watch the interpolating curve change as you drag the points around. You'll see that some configurations force the curve to get very steep. When you have 8 or more points you'll see that moving one point very slightly may cause a radical change in a completely different part of the curve. The polynomial amplifies a tiny movement into a large one at a remote location. This is typical polynomial behavior. |