Lagrange Polynomials
Background.
We have seen how to expand a function
in a Maclaurin polynomial about
involving the powers
and a Taylor polynomial about
involving the powers
. The
Lagrange polynomial of degree
passes through the
points for and
were investigated by the mathematician
Joseph-Louis Lagrange (1736-1813).
Theorem (
Lagrange Polynomial
). Assume that
and
for are
distinct values. Then
,
where
is a polynomial that can be used to approximate ,
and we write
.
The Lagrange polynomial goes through the
points , i.e.
for .
The remainder term
has the form
,
for some value
that lies in the interval
.
The cubic curve in the figure below illustrates a Lagrange polynomial of
degree n = 3, which passes through the four points
for .
Theorem. (Error Bounds for
Lagrange Interpolation, Equally Spaced Nodes) Assume
that defined
on
, which
contains the equally spaced nodes . Additionally,
assume that and
the derivatives of up
to the order are
continuous and bounded on the special subintervals ,
,
,
,
and
,
respectively; that is,
,
for . The
error terms corresponding to these three cases have the following useful bounds
on their magnitude
(i). is
valid for ,
(ii). is
valid for ,
(iii). is
valid for ,
(iv). is
valid for ,
(v). is
valid for .
Algorithm (
Lagrange Polynomial
). To
construct the Lagrange polynomial
of degree
, based
on the
points
for . The
Lagrange coefficient polynomials for
degree
are:
for .
You can use the first Mathematica subroutine that does things in the
"traditional way" or you are welcome to use the second subroutine that
illustrates "Object Oriented Programming."
Mathematica Subroutine (Lagrange Polynomial).
Traditional programming.
The above algorithm is sufficient for understanding and/or constructing the
Lagrange polynomial.
Object Oriented Programming. Welcome to
the brave new world of "Object Oriented Programming." Use the following
Mathematica subroutine which is "programmed" using the "mathematical
objects" . Templates
for the objects are located by going to "File" then select "Palettes", then
select "BasicInput."
Mathematica Subroutine (Lagrange Polynomial).
Object oriented programming.
Mathematica Subroutine (Lagrange Polynomial).
Compact object oriented programming.
|