Motivation
Consider a function defined along the interval . While we may be able to calculate it by hand, in practice, computers are unable to calculate all possible types of functions - and in these cases, it’s necessary to approximate the function .
A common way to do this is by approximating using a polynomial
As the existence of these polynomials is guaranteed, granted we have continuity (see below).
Theorem: Weierstrass Approximation
If is a function that is continuous on the interval , then for any , there exists a polynomial such that for all ,
In other words, there exists a polynomial that can become infitesminally close to our function .
One of the most popular polynomial approximations out there is the Taylor Series approximation.
Supposing that is differentiable times, then its Taylor Series approximation about is given as
This approximation is good, but is typically only used for error estimation, as it has a few issues.
- This approximation requires to be differentiable -times, limiting the functions we can approximate.
- This approximation is only good for approximations around !
Below, we explore alternative, more practical ways to approximate .
The Interpolation Problem
The Interpolation Property
One way we can approximate functions is by using interpolation.
Given distinct nodes along the function’s domain, interpolation aims to find a polynomial such that for all ,
In other words, the polynomial guarantees equality at all points , and approximates the function elsewhere. Such a function is said to satisfy the interpolation property.
This polynomial must have the minimum degree needed to achieve this. This gives us some notion of uniqueness for interpolating polynomials - otherwise, without this restriction, we could construct infinitely many polynomials that interpolate .
We typically want to minimize our degree, so we can minimize error with our approximation.
Example: Non-Uniqueness of Interpolators
Let have the interpolating property. Then, we can create a polynomial of higher degree with the same interpolating property.
This argument could be repeatedly applied to obtain higher and higher degrees!
The following theorem sets an upper bound on the degree needed for such a polynomial.
Theorem: Interpolation - Maximum Degree Needed
If are distinct nodes, then for any set of values , there exists a unique polynomial with degree such that the interpolation property holds.
How can we explicitly construct such polynomials?
Lagrange Interpolating Polynomials
One way we can explicitly construct such polynomials is by using the Lagrange Interpolating Polynomial.
Suppose we have distinct nodes. Then, for any , define the polynomial
Note how we don’t include the and terms.
By this definition, we know that given any polynomial, called the basis polynomials, for any ,
And furthermore, the degree of each polynomial is .
Summing the polynomials, we can obtain the Lagrange Polynomial.
Which, by property of the basis functions, is guaranteed to be equal to at (all other basis functions will drop to 0 except the function).
Example: Lagrange Interpolating Polynomials
Let , and let . We find
We first determine each polynomial.
We use these to create our Lagrange Polynomial.
Lagrange Form Benefits
The Lagrange Form can particularly be useful if we have the same fixed points for different ‘s, as our basis functions remain the same! This will avoid computational costs
Compare this with Newton’s Form (later), where we’d have to recalculate all the divided differences.
Newton’s Form of Interpolation
Another way we can explicitly construct such polynomials is by using Newton’s Form of Interpolation.
This method attempts to find the polynomial in the form
Where are constants we are attempting to find.
Suppose we have distinct nodes. Then, we define the divided difference of .
- The zeroth divided difference of at is
- The first divided difference of at uses the zeroth divided difference.
- The second divided difference of at uses the first divided difference.
- The divided difference of at uses the divided difference.
The below diagram illustrates how we would calculate the divided difference on .
graph LR 0[x<sub>0</sub>]; 1[x<sub>1</sub>]; 2[x<sub>2</sub>]; 3[x<sub>3</sub>]; 0 -.-> 4["f[x<sub>0</sub>]"]; 1 -.-> 5["f[x<sub>1</sub>]"]; 2 -.-> 6["f[x<sub>2</sub>]"]; 3 -.-> 7["f[x<sub>3</sub>]"]; 4 & 5 -.-> 8["f[x<sub>0</sub>,x<sub>1</sub>]"]; 5 & 6 -.-> 9["f[x<sub>1</sub>,x<sub>2</sub>]"]; 6 & 7 -.-> 10["f[x<sub>2</sub>,x<sub>3</sub>]"]; 8 & 9 -.-> 11["f[x<sub>0</sub>,x<sub>1</sub>,x<sub>2</sub>]"]; 9 & 10 -.-> 12["f[x<sub>1</sub>,x<sub>2</sub>,x<sub>3</sub>]"]; 11 & 12 -.-> 13["f[x<sub>0</sub>,x<sub>1</sub>,x<sub>2</sub>,x<sub>3</sub>]"];
These divided differences become our coefficients! Using , we can find our coefficient as
Giving us polynomial
Note that by our above uniqueness theorem, the polynomial obtained here should be the same as the Lagrange Polynomial.
Theorem: Divided Differences and Permutations
If is any permutation of our points , then their divided differences are the same.
Example: Newton's Interpolation
Let , and let . We find
We find our divided differences.
We now use these differences to find our polynomial.
This is equivalent to the polynomial we found using Lagrange’s Method!
Newton Form Benefits
The Newton Form can particularly be useful if we need to add more fixed points for the same . This will keep our divided differences the same, as we can use these already calculated divided differences to easily calculate the extra differences we need!
Compare this with Lagrange, where we’d have to recalculate all the basis functions if we add a new node.
Errors in Interpolation
Let have continuous derivatives on some interval .
Let be the interpolating polynomial at distinct nodes . Then, for all , there exists an error such that
We prove this fact below.
Proof
Let .
Suppose is one of the interpolating nodes. Then, we are done.
Suppose is not one of the interpolating nodes. Define
Which has degree , with leading term .
We use this to define the function with continuous derivatives
Where is chosen such that .
We know that because is not an interpolating node, is defined.
Because of this, we know that , and as well as all terms drop to 0! So, drops to 0 at .
Without loss of generalization, assume are ordered. Then, by Rolle’s theorem, there must exist points between each consecutive pair such that - in other words, there are distinct nodes where will drop to 0.
- Reapplying Rolle’s theorem, there must be distinct nodes where will drop to 0.
- Reapplying Rolle’s theorem, there must be distinct nodes with will drop to 0.
- …
Continuing this way, we find that at some point, which we’ll call .
This can be refactored to obtain the above result.
Hermite Interpolation
Problem Stated
Above, we saw that given distinct nodes, we can form a polynomial that equals our function at these points! Now, what if we had more information about at these nodes, like ‘s derivatives? Could we create a polynomial that interpolates on these derivatives as well?
Consider the following example.
Example: Finer Interpolations of
Find a such that
Notice how we now have 2 conditions at the same node!
It’s definitely possible to find an interpolating polynomial! Plugging our values into the polynomial , we get a system of equations! Solving for it, we can find the polynomial
Note how in the above example, it seems reasonable to expect that as we have 3 conditions, the degree of our polynomial is . But this is not necessarily the case! Consider the following:
With 2 conditions, we may expect to find a polynomial with degree . But such a polynomial isn’t possible when (we’ll need a higher degree)! Moreover, even if , we do not have enough information to produce a unique polynomial!
So, it’s definitely possible to interpolate values of and simultaneously, but additional conditions are needed to ensure the existence of a unique .
This problem is known as hermite interpolation, and is formally stated as follows. Consider the distinct nodes with the strict ordering .
We want to find a polynomial , whose degree is such that
Such a polynomial is known as a hermite polynomial.
Where every node has conditions (derivatives). In other words, we need a polynomial which will equal all of the given derivatives for nodes provided!
Note that this means for a given problem, we have conditions. As the number of unknowns in , we need to be equal to this sum! So, if we have the following number of unknown values (or less), we can guarantee uniqueness!
Generalized Newton’s Form of Interpolation
Let’s reconsider our above example from another perspective.
Observation: Generalizing Newton's Form
Define non-distinct nodes (note how they’re now non-distinct) , , . Let’s attempt to use Newton’s form of interpolation to find
We can use Newton’s method to get this far normally, but we don’t know what to do with a divided difference on repeated elements! However, we’ve seen from our earlier example that we can find our polynomial as
So we should expect . Expanding our divided difference, we normally should expect
So ! Interestingly enough, this is precisely equal to ! This suggests that there is a connection between our divided difference with repeated elements, and ‘s derivative at these repeated values!
In fact, given a divided difference
If we take the limit as , we’ll get our derivative!
Thus, it makes sense that ! While we won’t formally prove it, we’ll state this observation in the following lemma.
Lemma: Generalizing Newton's Form
Let be non-distinct nodes with the ordering . Then for a function continuous on derivatives , the order divided difference satisfies
Note that if , then all the nodes are the same due to the ordering of the nodes that we force.
This lemma lets us find divided differences on non-distinct nodes! Suppose we have conditions on the same node for . Define node to represent any single condition on some node .
Note that this number is equal to , or .
Then, using Newton’s Form, our required polynomial is given as
Where we can use the above lemma to solve for the divided differences.
Consider the following example.
Example: Newton's Form for Hermite Interpolation
Find the Hermite polynomial using
First, note that there are two distinct nodes, 0 and 2. We’ll denote them as
Furthermore, note that both nodes have 2 conditions, , .
We have all information up to our highest derivative for each node,so we can guarantee uniqueness of our polynomial!
We define our total notes, including repetitions, and use this to find our polynomial.
We find the divided differences as
We put these together to findour polynomial! We know our polynomial is given as
Example: Newton's Form for Hermite Interpolation (2)
Suppose we find the hermite polynomial such that for all . Note that in this case, we only have one distinct node.
Because all of our terms are equal to the same , when we write out our polynomial, we get
This is, interestingly enough, the truncated Taylor series expansion of at !
Theorem: Error Estimate on Hermite Polynomials
Consider , the function continuous on derivatives along the interval . Furthermore, consider polynomial with degree such that for distinct nodes ,
A polynomial approximating the nodes at the conditions given
and , then , there exists an such that
This estimates our error on hermite polynomials!
Issues with Interpolation
Below, we discuss issues that we face when interpolating polynomials.
Runge’s Phenomena
When interpolating a function with high degree polynomials, interpolations on equally spaced points can create oscillations along the edges of the interval being interpolated. This is known as Runge’s Phenomena.
Consider the following function, commonly known as the Runge Function
Now, consider the interpolating polynomial on equally-spaced nodes, with degree . We have the following polynomials.

We can see that as we increase the degree of our polynomial, we get larger and larger oscillations at the end of the interval! This creates a ton of error.
How could we resolve this issue?
Resolving Runge’s Phenomena: Chebyshev Nodes
One way to resolve this issue is to pick non-equidistant nodes that will prevent oscillations from occurring around the edges! By concentrating our nodes around the edges, we make constrain the polynomial more so that it cannot oscillate.
In fact, one example of how we could choose these nodes is Chebyshev nodes, which are distributed more densely near the edges of the interval than the interior.
Resolving Runge’s Phenomena: Splines
Another way we could resolve this issue is by using piecewise interpolating polynomials! By combining polynomials together that interpolate different portions of our interval, we can minimize the maximum degree polynomial we use.
This is the idea behind splines! A spline of degree having knots is a function with the following properties:
- On each interval between knots , is a polynomial of degree .
- is continuous on derivatives in the interval .
We call ‘s knots, as they serve as “connections” for our piecewise polynomials.
Example: Splines
Consider a spline of degree 1! Then, for all pairs of nodes, we’ll have piecewise lines approximating our function!
We don’t have to chooose our knots to be our interpolating nodes, though, this is quite a convenient choice.
One of the most commonly used types of splines is the cubic spline ()! In such a spline, each piecewise polynomial on has degree .
Furthermore, to be interpolating, the following must hold:
-
All polynomials in a spline must satisfy
In other words, they must equal our nodes at their given value, and furthermore, our last polynomial should also match our last node as well.
-
Our spline must be continuous up to 2 derivatives, meaning
In other words, our polynomials’ derivatives (up to the 2nd) must match with the polynomials they’re connected to.
As we have degree 3 polynomials, we have unknowns! However, summing up the information needed for the interpolation above, we only have conditions (equations), which is not enough information!
One common way to address this is by setting boundary conditions for the polynomials.
- Natural (Free) Boundaries: Setting the 2nd derivatives at the boundaries to be 0 - .
- Clamped Boundaries: Setting and .
Using natural boundaries, we will have to solve the system , where and
With our splines being given in the equation
Where for all , and .
In MATLAB, we can solve this system using the
splinefunction!
