Newton's Divided Difference

Instructions: (please note the Conventions Used in This Program below...)


Enter the number of values into the textbox above and click the "Setup the Table" button. After you click the button, the lower portion of your browser will display an empty table. Fill in the text boxes corresponding to x and f[xi] (rows highlighted with red text in the left margin). Once you have entered the x and the f[xi] values, click the "Calculate Newton's Divided Difference" button (highlighted in yellow). You can continue doing calculations on the same table with different values (change all or a few x or f[xi] values) multiple times. If you need to do calculations for a table of a different size, however, you'll need to click the "Start Over" button and it will bring you back to this introductory screen. Also, there is a button marked "Send Calculations to Printer" beneath the table for printing a paper copy of your calculation (or you can use the Print icon or command in your browser if it supports printing from frames).

NOTE: This program only has been tested under Netscape Navigator 4.x and Microsoft Internet Explorer 4.x+ successfully. Printing results has been known to be erratic under Netscape 3.x and Microsoft Internet Explorer 3.x.

Conventions Used in This Program


Red coloring indicates a field of input. The user must enter something into the respective textbox. (i.e. x and f[xi] values)
Yellow coloring indicates a button that does something significant in the calculation. (i.e. setting up the table or actual calculating the divided difference).

A Bit of Background on Newton's Divided Difference


Newton's Divided Difference is a way of finding an interpolation polynomial (a polynomial that fits a particular set of points or data). Similar to Lagrange's method for finding an interpolation polynomial, it finds the same interpolation polynomial due to the uniqueness of interpolation polynomials. Newton's Divided Difference uses the following equation called the divided difference to accomplish this task:

f [x0, x1, ... , xn] = f [x1, ... , xn] - f [x0, ... , xn - 1]
xn - x0

and the following equation called Newton's divided difference formula for the interpolation polynomial is where the polynomial is derived from:

Pn(x) = f (x0) + (x - x0) f [x0, x1] + (x - x0)(x - x1) f [x0, x1, x2]
+ ... + (x - x0) ... (x - xn - 1) f [x0, x1, ... , xn]


JavaScript written by Michael Yan. (May 17, 1999) Comments, Suggestions? meyan@ucla.edu.