Chapter 4 Interpolation#

In this chapter, we will study the following problem: given data \((x_{i},y_{i}),i=0,1,...,n\), find a function \(f\) such that \(f(x_{i})=y_{i}.\) This problem is called the interpolation problem, and \(f\) is called the interpolating function, or interpolant, for the given data.

Interpolation is used, for example, when we use mathematical software to plot a smooth curve through discrete data points, when we want to find the in-between values in a table, or when we differentiate or integrate black-box type functions.

How do we choose \(f\)? Or, what kind of function do we want \(f\) to be? There are several options. Examples of functions used in interpolation are polynomials, piecewise polynomials, rational functions, trigonometric functions, and exponential functions. As we try to find a good choice for \(f\) for our data, some questions to consider are whether we want \(f\) to inherit the properties of the data (for example, if the data is periodic, should we use a trigonometric function as \(f\)?), and how we want \(f\) to behave between data points. In general \(f\) should be easy to evaluate, and easy to integrate & differentiate.

Here is a general framework for the interpolation problem. We are given data, and we pick a family of functions from which the interpolant \(f\) will be chosen:

  • Data: \((x_{i},y_{i}),i=0,1,...,n\)

  • Family: Polynomials, trigonometric functions, etc.

Suppose the family of functions selected forms a vector space. Pick a basis for the vector space: \(\phi_{0}(x),\phi_{1}(x),...,\phi_{n}(x).\) Then the interpolating function can be written as a linear combination of the basis vectors (functions):

\[\begin{equation*} f(x)=\sum_{k=0}^{n}a_{k}\phi_{k}(x). \end{equation*}\]

We want \(f\) to pass through the data points, that is, \(f(x_i)=y_i\). Then determine \(a_{k}\) so that:

\[\begin{equation*} f(x_{i})=\sum_{k=0}^{n}a_{k}\phi_{k}(x_{i})=y_{i},i=0,1,...,n, \end{equation*}\]

which is a system of \(n+1\) equations with \(n+1\) unknowns. Using matrices, the problem is to solve the matrix equation

\[\begin{equation*} Aa=y \end{equation*}\]

for \(a\), where

\[\begin{equation*} A=\begin{bmatrix}\phi_{0}(x_{0}) & ... & \phi_{n}(x_{0})\\ \phi_{0}(x_{1}) & ... & \phi_{n}(x_{1})\\ \vdots & \vdots & \vdots \\ \phi_{0}(x_{n}) & ... & \phi_{n}(x_{n}) \end{bmatrix},a=\begin{bmatrix}a_{0}\\ a_{1}\\ \vdots\\ a_{n} \end{bmatrix},y=\begin{bmatrix}y_{0}\\ y_{1}\\ \vdots\\ y_{n} \end{bmatrix}. \end{equation*}\]