![]()
![]()
for
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
.
Proof Lagrange Polynomials Lagrange Polynomials
The cubic curve in the figure below
illustrates a Lagrange polynomial of degree n = 3, which passes
through the four points
for
.
![[Graphics:Images/LagrangePolyMod_gr_28.gif]](lagrangepoly/LagrangePolyMod/Images/LagrangePolyMod_gr_28.gif)
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
.
Proof Lagrange Polynomials Lagrange Polynomials
Animations (Lagrange Polynomials Lagrange Polynomials). Internet hyperlinks to animations.
Algorithm
( Lagrange
Polynomial
). To
construct the Lagrange polynomial
of degree
, based
on the
points
for
. The
Lagrange coefficient polynomials
for
degree
are:
for
.
Computer Programs Lagrange Polynomials Lagrange Polynomials
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.
![[Graphics:Images/LagrangePolyMod_gr_69.gif]](lagrangepoly/LagrangePolyMod/Images/LagrangePolyMod_gr_69.gif)
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.
![[Graphics:Images/LagrangePolyMod_gr_71.gif]](lagrangepoly/LagrangePolyMod/Images/LagrangePolyMod_gr_71.gif)
Mathematica Subroutine (Lagrange Polynomial). Compact object oriented programming.
![[Graphics:Images/LagrangePolyMod_gr_72.gif]](lagrangepoly/LagrangePolyMod/Images/LagrangePolyMod_gr_72.gif)
Getting comfortable with objects.
Example 1. Construct
three interpolating polynomials of
degree n=1 for the
function
over
.
Use the following sets of interpolation nodes.
1 (a). Use the
nodes
.
1 (b). Use the
nodes
.
1 (c). Use the
nodes
.
Solution
1.
Example
2. Form several Lagrange
polynomials of degree n = 2, 3, 4, and 5 for
the function
over
the interval
using n+1
equally spaced nodes. Then compare the four Lagrange
polynomials.
Solution
2 (a).
Solution
2 (b).
Solution
2 (c).
Solution
2 (d).
Solution
2 (e).
Example
3. Error
Analysis. Investigate the error for the Lagrange
polynomial approximations of degree n = 2, 3, 4, and 5 in
Example 2.
Solution
3 (a).
Solution
3 (b).
Solution
3 (c).
Solution
3 (d).
Example
4. Summary of the maximum error and the
error bounds over the interval [0, 1] that were
found in Example 3.
4
(a). Find
.
4
(b). Find
.
4
(c). Find
.
4
(d). Find
.
Solution
4.
Various Scenarios and Animations for Lagrange Polynomials.
Example 5. Find the
Lagrange polynomial approximation for
,
on the interval
,
,
and
.
Solution
5 (a).
Solution
5 (b).
Solution
5 (c).
Example 6. Find the
Lagrange polynomial approximation for
,
on the interval
.
Solution
6.
Example 7. Find the
Lagrange polynomial approximation for
,
on the interval
.
Solution
7.
Example 8. Find the
Lagrange polynomial approximation for
,
on the interval
,
and
.
Solution
8 (a).
Solution
8 (b).
Example 9. Find the
Lagrange polynomial approximation for
,
on the interval
.
Solution
9.
Example 10. Find
the Lagrange polynomial approximation for
,
on the interval
.
Solution
10.
Example 11. Find
the Lagrange polynomial approximation for
,
on the interval
.
Solution
11.
Example 12. Find
the Lagrange polynomial approximation for
,
on the interval
.
Solution
12.
Example 13. Find
the Lagrange polynomial approximation for
,
on the interval
.
Solution
13.
Example 14. Find
the Lagrange polynomial approximation for
,
on the interval
.
Solution
14.
Example 15. Find
the Lagrange polynomial approximation for
,
on the interval
.
Solution
15.
Example 16. Find
the Lagrange polynomial approximation for
,
on the interval
.
Solution
16.
Example 17. Find
the Lagrange polynomial approximation for
,
on the interval
.
Solution
17.
Animations (Lagrange Polynomial Approximation Lagrange Polynomial Approximation). Internet hyperlinks to animations.
Old Lab Project (Lagrange Polynomial Approximation Lagrange Polynomial Approximation). Internet hyperlinks to an old lab project.
Research Experience for Undergraduates
Lagrange Polynomials Lagrange Polynomials Internet hyperlinks to web sites and a bibliography of articles.
Download this Mathematica Notebook Lagrange Polynomials
Return to Numerical Methods - Numerical Analysis
(c) John H. Mathews 2004