In this topic, we will talk about quite an important use of polynomials – interpolation. This operation is commonly used in computational mathematics, and it is almost the main one. We will discuss what it is and what kinds of interpolation there are, and will examine one of the more popular ones in detail. This is where we will need the knowledge of polynomials.
What is interpolation?
Assume that we have a finite set of dots on the plane , where none of repeat. We want to find such a function , that will contain all the dots. Since the function will be defined everywhere, then with its help we could find values of the dots that were not initially given, like the intermediate ones.
For example, let's say we have certain days of the month when we know the temperature, and we want to assume it for other days. This is where interpolation would come in handy.
Currently, there are many ways to perform interpolation. The choice of the algorithm depends on many factors: how accurate the chosen method is, what the cost of using it is, how smooth the interpolating function is, how much data it requires etc. But we will start with the simplest one: the linear interpolation.
Linear interpolation
Let's say we have two dots: and . We would like to know what the value for could be. To find it, we will make a line from the first point to the second. And after that all we need is to find for said point, which will be our assumption, and the resulting line will be the interpolating function for our dots. Time to examine and find out what the value we've been looking is for .
Let's write the linear equation for two dots and substitute into it.
After substituting we get . We found that for will be . And the interpolating function is .
Now imagine that we have not just two dots, but many of them, what are we going to do then? That's right, we will keep connecting two nearby dots with lines and will get a polyline, which to some degree approximates the function. Take a look at the image below to get an idea of what we are talking about.
Lagrange interpolating polynomial
Say, we have a set of dots on the plane, coordinates of which don't repeat. We would like to find a polynomial that would go through all of them and would have a degree of . Such a polynomial is called the Lagrange polynomial and is noted . Such a polynomial, that by the way has no more than roots, is also the only one, but we won't give the proof here.
Let's try to understand how to make it. The formula for it has the following form: , where:
Note, that have certain properties:
are polynomials of degree
when
Indeed, is such a multiplication that is missing one factor. If we substitute instead of , then all factors will be , therefore their product will also be . Now if we substitute , where , then there will be a factor equal to zero, and as a result, the product will also be zero.
Let's take a look at an example.
Say, we have dots: . It means that we can find a polynomial of degree that will interpolate all these dots.
First, find all by using the formula:
After that, calculate also with the formula:
We got the polynomial of degree : .
You can see the polynomial and the given dots on the graph, everything fits!
Other kinds of interpolation
We have taken a look at two types of interpolation: the linear interpolation and the interpolation with Lagrange polynomial. But there are also approaches. One of the popular ones is using the Newton's interpolating formula. It is very convenient to use when the coordinates of the dots are equally spaced.
Conclusion
In this chapter we have discussed interpolation, what types of interpolation exist. Furthermore, we have examined one of the common interpolation methods: using the Lagrange interpolating polynomial.