Module for Lagrange Polynomial Approximation

Check out the new Numerical Analysis Projects page.

 

Background.  The Lagrange polynomial of degree [Graphics:Images/LagrangePolynomialMod._gr_1.gif] passes through the [Graphics:Images/LagrangePolynomialMod._gr_2.gif] points  [Graphics:Images/LagrangePolynomialMod._gr_3.gif]  for  [Graphics:Images/LagrangePolynomialMod._gr_4.gif]  and were investigated by the mathematician Joseph-Louis Lagrange (1736-1813).   

Algorithm for the Lagrange Polynomial.  To construct the Lagrange polynomial  

    [Graphics:Images/LagrangePolynomialMod._gr_5.gif]  
    
of degree [Graphics:Images/LagrangePolynomialMod._gr_6.gif],  based on the [Graphics:Images/LagrangePolynomialMod._gr_7.gif] points [Graphics:Images/LagrangePolynomialMod._gr_8.gif] for  [Graphics:Images/LagrangePolynomialMod._gr_9.gif].  The Lagrange coefficient polynomials  [Graphics:Images/LagrangePolynomialMod._gr_10.gif]  for degree [Graphics:Images/LagrangePolynomialMod._gr_11.gif] are:  

    [Graphics:Images/LagrangePolynomialMod._gr_12.gif]  for  [Graphics:Images/LagrangePolynomialMod._gr_13.gif].

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."  

 

Animations (Lagrange Polynomial Approximation  Lagrange Polynomial Approximation).  Internet hyperlinks to animations.

 

Evolution of Mathematica Subroutines for the Lagrange Polynomial.

Mathematica Subroutine (Lagrange Polynomial). Traditional programming.

[Graphics:Images/LagrangePolynomialMod._gr_31.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"  [Graphics:Images/LagrangePolynomialMod._gr_32.gif].  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/LagrangePolynomialMod._gr_33.gif]

Mathematica Subroutine (Lagrange Polynomial). Compact object oriented programming.

[Graphics:Images/LagrangePolynomialMod._gr_34.gif]

Getting comfortable with objects.

 

Example 1. Construct three interpolating polynomials of degree  n=1  for the function  [Graphics:Images/LagrangePolynomialMod._gr_68.gif]  over  [Graphics:Images/LagrangePolynomialMod._gr_69.gif].  
Use the following sets of interpolation nodes.
1 (a).  Use the nodes  [Graphics:Images/LagrangePolynomialMod._gr_70.gif].  
1 (b).  Use the nodes  [Graphics:Images/LagrangePolynomialMod._gr_71.gif].  
1 (c).  Use the nodes  [Graphics:Images/LagrangePolynomialMod._gr_72.gif].

Solution 1.

Example 2.   Form several Lagrange polynomials of degree  n = 2, 3, 4, and 5  for the function  [Graphics:Images/LagrangePolynomialMod._gr_125.gif]  over the interval  [Graphics:Images/LagrangePolynomialMod._gr_126.gif]  using  n+1 equally spaced nodes.  

Solution 2.

Example 3.  Error Analysis.  Investigate the error for the Lagrange polynomial approximations in Example 2.

Solution 3.

Example 4.  Summary of the error bounds over the interval  [0, 1]  for each of the quantities  
4 (a).  Find  [Graphics:Images/LagrangePolynomialMod._gr_211.gif].  
4 (b).  Find  [Graphics:Images/LagrangePolynomialMod._gr_212.gif].  
4 (c).  Find  [Graphics:Images/LagrangePolynomialMod._gr_213.gif].  
4 (d).  Find  [Graphics:Images/LagrangePolynomialMod._gr_214.gif].  

Solution 4.

 

Old Lab Project (Lagrange Polynomial Approximation  Lagrange Polynomial Approximation).  

Internet hyperlinks to an old lab project.  

 

Research Experience for Undergraduates

Lagrange Polynomial Interpolation and Approximation  Lagrange Polynomial Interpolation and Approximation  
Internet hyperlinks to web sites and a bibliography of articles.  
  

Downloads (Lagrange Polynomial Lagrange Polynomial).  Download this Mathematica notebook.  

 

 

 

 

 

 

 

 

 

 

 

(c) John H. Mathews 2003