# User:Mrrmv

I propose to add to the Interpolation section of the Topic: Numerical Analysis article in Wikiversity. I plan to provide links to all relevant Wikipedia articles on the topic of polynomial interpolation, including but not limited to those on Lagrange interpolation, the Vandermonde matrix, and Newton interpolation. I also plan to search out and add some other relevant links outside of Wikipedia. Furthermore, I will provide an exercise/example for each of the three main types of interpolation. Finally, I plan to write and publish a quiz covering the overall topic. The quiz and the exercises will illustrate the various advantages and disadvantages of each interpolation method.

If another student decides to do the same topic, I can either split the topic with him, or choose another one, my second choice being root-finding methods, and my third choice being numerical differential equations.

## List of polynomial interpolation additions

The following is a list of the actual additions I made to the interpolation section. All changes pertain to polynomial interpolation.

• Links to Wikipedia pages on polynomial interpolation, the Vandermonde matrix, Lagrange interpolation, the Newton form, divided differences, Neville's algorithm, and a comparison of the three methods.
• An example of polynomial interpolation using the Vandermonde matrix, and then an example of the process of interpolating a new polynomial after a point has been added to the data set.
• An example using the same points as above, but this time interpolating with the Lagrange method.
• An example using the same points as above, but this time interpolating in the Newton form.
• An exercise for each of the three methods, each time using a new set of points.
• A concept quiz that covers uniqueness of the interpolating polynomial and comparisons of the methods pertaining to: ease of use, computational cost, and the best choice of method for some situations.

## Project report

As a graduate student in Math 544 at Ohio University, my final project required me to contribute to the Topic: Numerical analysis page on Wikiversity. I chose to add to the section on interpolation. Specifically, I decided to contribrute examples, exercises, a quiz, and links pertaining to polynomial interpolation.

Towards the end of the quarter, I had to choose my topic for the final project and write a brief proposal on what additions I planned to make to the Wikiversity page. Choosing a topic that needed improvement was simple, because all topics on the page were blank except for one. Thus, my topic choice came down to a matter of personal preference. I had never found differential equations to be one of my strengths, and numerical integration can get a bit too hairy sometimes (especially when I'm typing it out). Thus, I chose to contribute to the interpolation section. What we had covered in class was polynomial interpolation, so I limited myself to that.

When deciding exactly what to add to the interpolation section, I kept in mind the purpose of Wikiversity (as opposed to Wikipedia), and followed the example set forth by the instructor in the numerical linear algebra section of the page. That section had links, examples, exercises, and a quiz. So, my proposal was to add links, examples, exercises, and a quiz. Specifically, I'd decided to focus on the three methods of polynomial interpolation that we'd covered in class: the Vandermonde matrix method, the Lagrange method, and the Newton form. My proposal was to provide relevant links to information about each method and polynomial interpolation as a whole, compose and write an exercise or two for each method, and also to write and post an overall concept quiz.

My actual contributions more or less followed the initial proposal. First, I provided Wikipedia links to the pages I felt relevant to the topic. These included a link to the article on polynomial interpolation in general, the Vandermonde matrix subsection of that page, the Lagrange method, the Newton form, divided differences (relevant to the Newton form), Neville's algorithm (relevant to divided differences as well as polynomial interpolation), and a link to the comparison of the three methods that is located in the Newton form article.

Before adding any exercises, I decided it would be good to add an example problem for each method. Each example provides a set of points, and then demonstrates step-by-step the implementation of its respective method in finding the interpolating polynomial for the given points. Furthermore, each example for each method uses the same points, and thus gives the same interpolating polynomial. This demonstrates the uniqueness of the interpolating polynomial for a given set of points. Finally, after finding the interpolating polynomial, each example features a section about adding an additional point to the data set, and finding a new interpolating polynomial with the expanded data. Therefore, the user can gain further insight on the ease-of-use, or lack thereof, of each particular method.

I also added an exercise for each method. Unlike the examples, the exercises do not show every step of each process. They only provide the solution and the setup to their respective methods. The reason I provided some method-specific setup as part of each solution was because, due to the uniqueness of the interpolating polynomial, a student could be asked to use the Newton form, but still find the right answer using the Lagrange method. Thus, I provided a way for them to check that they are using the proper method correctly, thus encouraging and helping each student to properly use the stated method to find the correct answer.

My final addition was a short concept quiz to tie everything together. It covers ease-of-use and situational applications of the methods as well as computational cost and failure. It also touches on the uniqueness of the interpolating polynomial through a set of points. The concept quiz is intended to be completed by the student only after he has visited and studied the various links, read the examples, and completed the exercises. The examples are especially important, as I designed them with a general outline for the concept quiz in mind. Thus, a student who has studied the examples should, through his own insight, be able to correctly answer about three quarters of the quiz.

In summary, I have expanded upon the interpolation section of the numerical methods page. In the spirit of Wikiversity, I have provided links, original examples and exercises, and an original concept quiz in order to help a student learn and understand the concept of polynomial interpolation, specifically using the Lagrange method, Vandermonde matrix, and Newton form.

## Lagrange example

We'll find the interpolating polynomial passing through the points ${\displaystyle (1,-6)}$, ${\displaystyle (2,2)}$, ${\displaystyle (4,12)}$, using the Lagrange method.

We first use the formula to write the following:

${\displaystyle p(x)=-6{\frac {(x-2)}{(1-2)}}{\frac {(x-4)}{(1-4)}}+2{\frac {(x-1)}{(2-1)}}{\frac {(x-4)}{(2-4)}}+12{\frac {(x-1)}{(4-1)}}{\frac {(x-2)}{(4-2)}}}$

After some simplification, we get:

${\displaystyle p(x)=-2(x-2)(x-4)-1(x-1)(x-4)+2(x-1)(x-2)}$

${\displaystyle p(x)=-2(x^{2}-6x+8)-1(x^{2}-5x+4)+2(x^{2}-3x+2)}$

${\displaystyle p(x)=-x^{2}+11x-16}$

Now we'll add a point to our data set, and find a new interpolating polynomial. Let us add the point ${\displaystyle (3,-10)}$ to our set. Starting over with the Lagrange formula, we write:

${\displaystyle p(x)=-6{\frac {(x-2)}{(1-2)}}{\frac {(x-4)}{(1-4)}}{\frac {(x-3)}{(1-3)}}+2{\frac {(x-1)}{(2-1)}}{\frac {(x-4)}{(2-4)}}{\frac {(x-3)}{(2-3)}}+12{\frac {(x-1)}{(4-1)}}{\frac {(x-2)}{(4-2)}}{\frac {(x-3)}{(4-3)}}-10{\frac {(x-1)}{(3-1)}}{\frac {(x-2)}{(3-2)}}{\frac {(x-4)}{(3-4)}}}$

Simplifying, we get:

${\displaystyle p(x)=(x-2)(x-4)(x-3)+(x-1)(x-4)(x-3)+2(x-1)(x-2)(x-3)+5(x-1)(x-2)(x-4)}$

${\displaystyle p(x)=(x^{3}-9x^{2}+26x-24)+(x^{3}-8x^{2}+19x-12)+2(x^{3}-6x^{2}+11x-6)+5(x^{3}-7x^{2}+14x-8)}$

And our polynomial is:

${\displaystyle p(x)=9x^{3}-64x^{2}+137x-88}$

## Lagrange exercise

Find the interpolating polynomial passing through the points ${\displaystyle (1,2)}$, ${\displaystyle (3,4)}$, ${\displaystyle (5,6)}$, ${\displaystyle (7,8)}$, using the Lagrange method.

## Vandermonde example

We'll find the interpolating polynomial passing through the points ${\displaystyle (1,-6)}$, ${\displaystyle (2,2)}$, ${\displaystyle (4,12)}$, using the Vandermonde matrix.

For our polynomial, we'll take ${\displaystyle (1,-6)=(x_{0},y_{0})}$, ${\displaystyle (2,2)=(x_{1},y_{1})}$, and ${\displaystyle (4,12)=(x_{2},y_{2})}$.

Define our interpolating polynomial as:

${\displaystyle p(x)=a_{2}x^{2}+a_{1}x+a_{0}}$.

So, to find the coefficients of our polynomial, we solve the system ${\displaystyle p(x_{i})=y_{i}}$, ${\displaystyle i\in \{0,1,2\}}$.

In order to solve the system, we will use an augmented matrix based on the Vandermonde matrix, and solve for the coefficients using Gaussian elimination. Substituting in our ${\displaystyle x}$ and ${\displaystyle y}$ values, our augmented matrix is:

${\displaystyle \left({\begin{array}{cccc}1&1&1&-6\\4&2&1&2\\16&4&1&12\end{array}}\right)}$

Then, using Gaussian elimination,

${\displaystyle \left({\begin{array}{cccc}1&1&1&-6\\4&2&1&2\\16&4&1&12\end{array}}\right)\rightarrow \left({\begin{array}{cccc}1&1&1&-6\\0&-2&-3&26\\0&-12&-15&108\end{array}}\right)\rightarrow \left({\begin{array}{cccc}1&1&1&-6\\0&-2&-3&26\\0&0&3&-48\end{array}}\right)\rightarrow \left({\begin{array}{cccc}1&1&0&10\\0&2&0&-22\\0&0&1&-16\end{array}}\right)\rightarrow \left({\begin{array}{cccc}1&0&0&-1\\0&1&0&11\\0&0&1&-16\end{array}}\right)}$

Our coefficients are ${\displaystyle a_{2}=-1}$, ${\displaystyle a_{1}=11}$, and ${\displaystyle a_{0}=-16}$. So, the interpolating polynomial is

${\displaystyle p(x)=-x^{2}+11x-16}$.

Now we add a point, ${\displaystyle (3,-10)=(x_{3},y_{3})}$, to our data set and find a new interpolation polynomial with this method. Our polynomial is ${\displaystyle p(x)=a_{3}x^{3}+a_{2}x^{2}+a_{1}x+a_{0}}$, and we get the coefficients by solving the system ${\displaystyle p(x_{i})=y_{i}}$. Constructing our augmented matrix as before and using Gaussian elimination, we get:

${\displaystyle \left({\begin{array}{ccccc}1&1&1&1&-6\\8&4&2&1&2\\64&16&4&1&12\\27&9&3&1&-10\end{array}}\right)\rightarrow \left({\begin{array}{ccccc}1&1&1&1&-6\\0&-4&-6&-7&50\\0&-48&-60&-63&396\\0&-18&-24&-26&152\end{array}}\right)\rightarrow \left({\begin{array}{ccccc}1&1&1&1&-6\\0&-4&-6&-7&50\\0&0&12&21&-204\\0&0&3&{\frac {11}{12}}&-73\end{array}}\right)}$

${\displaystyle \rightarrow \left({\begin{array}{ccccc}1&1&1&1&-6\\0&-4&-6&-7&50\\0&0&12&21&-204\\0&0&0&{\frac {1}{4}}&-22\end{array}}\right)\rightarrow \left({\begin{array}{ccccc}1&1&1&0&82\\0&-4&-6&0&-566\\0&0&12&0&1644\\0&0&0&1&-88\end{array}}\right)\rightarrow \left({\begin{array}{ccccc}1&1&0&0&-55\\0&-4&0&0&256\\0&0&1&0&137\\0&0&0&1&-88\end{array}}\right)}$

${\displaystyle \rightarrow \left({\begin{array}{ccccc}1&0&0&0&9\\0&1&0&0&-64\\0&0&1&0&137\\0&0&0&1&-88\end{array}}\right)}$

Therefore, our polynomial is:

${\displaystyle p(x)=9x^{3}-64x^{2}+137x-88}$.

## Vandermonde exercise

Using a Vandermonde matrix, find the interpolating polynomial that passes through the points ${\displaystyle (1,9)}$, ${\displaystyle (2,9)}$, ${\displaystyle (3,6)}$, ${\displaystyle (7,3)}$. Give both the polynomial, and the augmented matrix you used.

## Newton form example

We'll find the interpolating polynomial passing through the points ${\displaystyle (1,-6)=(x_{0},y_{0})}$, ${\displaystyle (2,2)=(x_{1},y_{1})}$, ${\displaystyle (4,12)=(x_{2},y_{2})}$, using the Newton form of the interpolation polynomial.

The Newton form is given by the formula ${\displaystyle p(x)=\sum _{j=0}^{k}a_{j}n_{j}(x)}$, where ${\displaystyle a_{j}=[y_{0},\ldots ,y_{j}]}$ and ${\displaystyle n_{j}(x)=\prod _{i=0}^{j-1}(x-x_{i})}$, with ${\displaystyle n_{0}(x)=1}$. We start by finding each ${\displaystyle n_{j}(x)}$.

${\displaystyle n_{0}(x)=1}$

${\displaystyle n_{1}(x)=x-1}$

${\displaystyle n_{2}(x)=(x-1)(x-2)=x^{2}-3x+2}$

Next, we find the necessary divided differences. First, ${\displaystyle [y_{0}]=-6}$, ${\displaystyle [y_{1}]=2}$, and ${\displaystyle [y_{2}]=12}$. For the next level, we have:

${\displaystyle [y_{0},y_{1}]={\frac {2+6}{2-1}}=8}$

${\displaystyle [y_{1},y_{2}]={\frac {12-2}{4-2}}=5}$

Finally, we can find:

${\displaystyle [y_{0},y_{1},y_{2}]={\frac {5-8}{4-1}}=-1}$.

Now, we can find the coefficients ${\displaystyle a_{j}}$.

${\displaystyle a_{0}=[y_{0}]=-6}$

${\displaystyle a_{1}=[y_{0},y_{1}]=8}$

${\displaystyle a_{2}=[y_{0},y_{1},y_{2}]=-1}$

Substituting and simplifying, we get our interpolating polynomial:

${\displaystyle p(x)=-6+8(x-1)-(x^{2}-3x+2)=-x^{2}+11x-16}$.

Now let's add the point ${\displaystyle (3,-10)=(x_{3},y_{3})}$ to our data set and find the new polynomial using the same method. Due to the formula for the Newton form, we only have to add the term ${\displaystyle a_{3}n_{3}(x)}$ to our previous interpolating polynomial.

First, we have

${\displaystyle n_{3}(x)=(x-1)(x-2)(x-4)=x^{3}-7x^{2}+14x-8}$.

Now to find ${\displaystyle a_{3}}$ we calculate some more divided differences.

${\displaystyle [y_{3}]=-10}$

${\displaystyle [y_{2},y_{3}]={\frac {-10-12}{3-4}}=22}$

${\displaystyle [y_{1},y_{2},y_{3}]={\frac {22-5}{3-2}}=17}$

${\displaystyle a_{3}=[y_{0},\ldots ,y_{3}]={\frac {17+1}{3-1}}=9}$

So, our new interpolating polynomial is:

${\displaystyle p(x)=-x^{2}+11x-16+9(x^{3}-7x^{2}+14x-8)=9x^{3}-64x^{2}+137x-88}$.

## Newton form exercise

Using the Newton form, find the interpolating polynomial passing through the points ${\displaystyle (x_{0},y_{0})=(9,9)}$, ${\displaystyle (x_{1},y_{1})=(5,7)}$, ${\displaystyle (x_{2},y_{2})=(3,7)}$, and ${\displaystyle (x_{3},y_{3})=(7,1)}$. Also give the four coefficients ${\displaystyle a_{j}}$ from the formula for the Newton polynomial.

## Polynomial interpolation concept quiz

Choose the best answer for each question:

1

Of the following polynomial interpolation methods, which is generally considered the method of choice due to its relative ease of use?

 Vandermonde matrix Lagrange method Newton form

2

Which method is the best choice when the desired degree of the interpolating polynomial is known?

 Vandermonde matrix Lagrange method Newton form

3

Which method is best suited when the desired degree of the interpolating polynomial is unknown?

 Vandermonde matrix Lagrange method Newton form

4

Which method is best suited to the addition of points to the data set?

 Vandermonde matrix Lagrange method Newton form

5

What is the computational cost of finding an interpolating polynomial through ${\displaystyle n}$ points using the Newton form?

 ${\displaystyle O(n)}$ ${\displaystyle O(n^{2})}$ ${\displaystyle O(n^{3})}$ ${\displaystyle O(n^{4})}$

6

What is the computational cost of the Vandermonde method, using Gaussian elimination?

 ${\displaystyle O(n)}$ ${\displaystyle O(n^{2})}$ ${\displaystyle O(n^{3})}$ ${\displaystyle O(n^{4})}$

7

Under what conditions can the Lagrange method of polynomial interpolation fail?

 When ${\displaystyle n>10}$. When ${\displaystyle n}$ is not a perfect square. When two or more of your ${\displaystyle y}$-values are equal. The Lagrange method cannot fail.

8

Given a set of ${\displaystyle n}$ points, exactly how many interpolating polynomials can be found to pass through the points?

 ${\displaystyle 0}$ ${\displaystyle 1}$ ${\displaystyle n}$ ${\displaystyle n-1}$