ABSTRACT

The equation for the general Lagrange polynomial is given by Eq. (4.46). The quadratic Lagrange polynomial is given by Eq. (4.45):

P 2 (x) = (x - b)(x - c) f(a) + (x - a)(x - c) f(b) + (x - a)(x - b)f(c)

(a - b)(a - c) (b - a)(b - c) (c - a)(c - b) (4.185)

A FORTRAN subroutine, subroutine lagrange, for implementing the quadratic Lagrange polynomial is presented below. Program main (Program 4.2) defines the data set and prints it, calls subroutine lagrange to implement the solution, and prints the solution. It shows only the statements which are different from the statements in Program 4.1.