The Central Idea

Suppose we know values

\[ (x_0,y_0),\quad (x_1,y_1),\quad \ldots,\quad (x_n,y_n), \]

where

\[ y_i=f(x_i). \]

An interpolating function \(p(x)\) satisfies

\[ \boxed{p(x_i)=y_i} \]

for every interpolation node \(x_i\).

Interpolation Versus Approximation

Interpolation is a special form of approximation.

An interpolant is required to match the supplied data exactly:

\[ p(x_i)=y_i. \]

A general approximation method may instead seek a function that is merely close to the data or to the target function.

The next lesson will broaden this idea to approximation of functions.

Interpolation Versus Regression

Regression usually does not require the fitted model to pass through every data point.

Interpolation requires exact agreement at the nodes.

This distinction matters when the data are noisy. Exact interpolation may be inappropriate if the observations themselves contain significant measurement error.

Interpolation Nodes

The input values

\[ x_0,x_1,\ldots,x_n \]

are called nodes.

They must be distinct for ordinary polynomial interpolation:

\[ x_i\neq x_j \qquad \text{when }i\neq j. \]

The Polynomial Interpolation Theorem

Given \(n+1\) distinct nodes

\[ x_0,x_1,\ldots,x_n \]

and corresponding values

\[ y_0,y_1,\ldots,y_n, \]

there exists a unique polynomial \(p_n(x)\) of degree at most \(n\) satisfying

\[ \boxed{p_n(x_i)=y_i} \]

for all \(i=0,\ldots,n\).

Why \(n+1\) Points Determine a Degree-\(n\) Polynomial

A polynomial of degree at most \(n\) has the form

\[ p_n(x) = a_0+a_1x+\cdots+a_nx^n. \]

There are \(n+1\) unknown coefficients.

Matching \(n+1\) distinct data values creates \(n+1\) linear conditions.

The Vandermonde Formulation

Writing

\[ p_n(x) = a_0+a_1x+\cdots+a_nx^n \]

and imposing

\[ p_n(x_i)=y_i \]

produces the linear system

\[ \begin{bmatrix} 1&x_0&x_0^2&\cdots&x_0^n\\ 1&x_1&x_1^2&\cdots&x_1^n\\ \vdots&\vdots&\vdots&&\vdots\\ 1&x_n&x_n^2&\cdots&x_n^n \end{bmatrix} \begin{bmatrix} a_0\\ a_1\\ \vdots\\ a_n \end{bmatrix} = \begin{bmatrix} y_0\\ y_1\\ \vdots\\ y_n \end{bmatrix}. \]

The Vandermonde Matrix

The matrix

\[ V= \begin{bmatrix} 1&x_0&x_0^2&\cdots&x_0^n\\ 1&x_1&x_1^2&\cdots&x_1^n\\ \vdots&\vdots&\vdots&&\vdots\\ 1&x_n&x_n^2&\cdots&x_n^n \end{bmatrix} \]

is called a Vandermonde matrix.

It is nonsingular when the nodes are distinct.

Why We Usually Avoid Solving the Vandermonde System Directly

The monomial-basis formulation is mathematically valid, but Vandermonde systems can become poorly conditioned as the degree grows or the nodes are unfavorably distributed.

Interpolation formulas such as Lagrange and Newton forms expose the same polynomial more directly and often support better numerical workflows.

Linear Interpolation

Given two points

\[ (x_0,y_0) \]

and

\[ (x_1,y_1), \]

the linear interpolant is the line through them.

\[ \boxed{ p_1(x) = y_0 + \frac{y_1-y_0}{x_1-x_0}(x-x_0) }. \]

Example: Linear Interpolation

Suppose

\[ f(2)=5 \]

and

\[ f(4)=9. \]

The interpolating line is

\[ p_1(x) = 5+\frac{9-5}{4-2}(x-2). \]

Therefore,

\[ p_1(x)=5+2(x-2)=2x+1. \]

Estimating Between Two Nodes

Using

\[ p_1(x)=2x+1, \]

the interpolated value at \(x=3\) is

\[ \boxed{p_1(3)=7}. \]

The estimate lies between the two known data values.

The Lagrange Form

The Lagrange interpolating polynomial is

\[ \boxed{ p_n(x) = \sum_{i=0}^{n}y_iL_i(x) }, \]

where the Lagrange basis polynomials are

\[ \boxed{ L_i(x) = \prod_{\substack{j=0\\j\ne i}}^{n} \frac{x-x_j}{x_i-x_j} }. \]

The Key Property of Lagrange Basis Polynomials

Each basis polynomial satisfies

\[ L_i(x_j) = \begin{cases} 1,&i=j,\\ 0,&i\ne j. \end{cases} \]

This is sometimes written with the Kronecker delta:

\[ \boxed{L_i(x_j)=\delta_{ij}}. \]

Why the Lagrange Formula Works

Evaluate

\[ p_n(x) = \sum_{i=0}^{n}y_iL_i(x) \]

at node \(x_k\).

Every term vanishes except the \(k\)-th:

\[ p_n(x_k) = y_kL_k(x_k) = y_k. \]

Therefore, the polynomial interpolates every data value.

Example: Quadratic Lagrange Interpolation

Suppose the data are

\[ (0,1),\qquad(1,3),\qquad(2,2). \]

The basis polynomials are

\[ L_0(x) = \frac{(x-1)(x-2)}{(0-1)(0-2)} = \frac{(x-1)(x-2)}{2}, \] \[ L_1(x) = \frac{x(x-2)}{(1-0)(1-2)} = -x(x-2), \]

and

\[ L_2(x) = \frac{x(x-1)}{(2-0)(2-1)} = \frac{x(x-1)}{2}. \]

Building the Quadratic Interpolant

Combine the basis functions:

\[ p_2(x) = 1L_0(x)+3L_1(x)+2L_2(x). \]

Therefore,

\[ p_2(x) = \frac{(x-1)(x-2)}{2} - 3x(x-2) + x(x-1). \]

This polynomial passes through all three data points.

Lagrange Form Is Symmetric in the Data

No data point is treated as the special starting point.

Each value \(y_i\) multiplies its own basis polynomial \(L_i(x)\).

This makes the structure conceptually clean and useful for theoretical analysis.

Adding a New Node in Lagrange Form

If a new data point is added, most Lagrange basis functions change.

Therefore, the basic Lagrange formula is not especially convenient when data arrive incrementally.

Newton's divided-difference form is better suited to progressive extension.

Newton's Interpolating Form

Newton's interpolation polynomial is written

\[ \boxed{ p_n(x) = a_0 + a_1(x-x_0) + a_2(x-x_0)(x-x_1) +\cdots }. \]

More completely,

\[ p_n(x) = a_0 + \sum_{k=1}^{n} a_k \prod_{j=0}^{k-1}(x-x_j). \]

Divided Differences

Newton coefficients are constructed from divided differences.

The zeroth divided difference is

\[ f[x_i]=f(x_i). \]

The first divided difference is

\[ \boxed{ f[x_i,x_j] = \frac{f(x_j)-f(x_i)} {x_j-x_i} }. \]

Higher Divided Differences

Higher orders are defined recursively:

\[ \boxed{ f[x_i,\ldots,x_{i+k}] = \frac{ f[x_{i+1},\ldots,x_{i+k}] - f[x_i,\ldots,x_{i+k-1}] }{ x_{i+k}-x_i } }. \]

Newton Coefficients

The coefficients in Newton form are

\[ a_0=f[x_0], \] \[ a_1=f[x_0,x_1], \] \[ a_2=f[x_0,x_1,x_2], \]

and, in general,

\[ \boxed{ a_k=f[x_0,x_1,\ldots,x_k] }. \]

Example: First Divided Differences

Using

\[ (0,1),\qquad(1,3),\qquad(2,2), \]

the first divided differences are

\[ f[0,1] = \frac{3-1}{1-0} = 2 \]

and

\[ f[1,2] = \frac{2-3}{2-1} = -1. \]

Example: Second Divided Difference

The second divided difference is

\[ f[0,1,2] = \frac{f[1,2]-f[0,1]}{2-0}. \]

Therefore,

\[ f[0,1,2] = \frac{-1-2}{2} = -\frac32. \]

Building the Newton Interpolant

The coefficients are

\[ a_0=1,\qquad a_1=2,\qquad a_2=-\frac32. \]

Thus,

\[ \boxed{ p_2(x) = 1+2x-\frac32x(x-1) }. \]

This is the same interpolating polynomial obtained from the Lagrange form.

Why Newton Form Is Useful

Newton form has several practical advantages.

Nested Evaluation of Newton Form

Newton form can be evaluated in a nested pattern similar to Horner's method:

\[ p_n(x) = a_0 +(x-x_0) \left[ a_1 +(x-x_1) \left[ a_2+\cdots \right] \right]. \]

This reduces unnecessary arithmetic and improves computational efficiency.

Interpolation Error

Interpolation matches the target function exactly at the nodes, but generally not between them.

If \(p_n\) interpolates a sufficiently smooth function \(f\) at \(n+1\) distinct nodes, then for suitable \(\xi\),

\[ \boxed{ f(x)-p_n(x) = \frac{f^{(n+1)}(\xi)} {(n+1)!} \prod_{i=0}^{n}(x-x_i) }. \]

What the Error Formula Tells Us

The interpolation error depends on two main factors:

  1. the size of the \((n+1)\)-st derivative of the target function;
  2. the node product \[ \prod_{i=0}^{n}(x-x_i). \]

Both the function and the node placement affect accuracy.

Error Is Zero at the Nodes

At an interpolation node \(x=x_j\), the product

\[ \prod_{i=0}^{n}(x-x_i) \]

contains the factor

\[ x_j-x_j=0. \]

Therefore,

\[ f(x_j)-p_n(x_j)=0. \]

Linear Interpolation Error

For two nodes \(x_0\) and \(x_1\), the error is

\[ \boxed{ f(x)-p_1(x) = \frac{f''(\xi)}{2} (x-x_0)(x-x_1) }. \]

This shows why curvature matters in linear interpolation.

Curvature and Linear Interpolation

If \(f''\) is small on an interval, the graph is nearly linear there.

Linear interpolation is then likely to perform well.

Strong curvature increases the potential interpolation error.

Equally Spaced Nodes

A natural first choice is

\[ x_i=a+ih. \]

Equally spaced nodes are convenient and work well for many local or low-degree interpolation problems.

But high-degree interpolation on a long interval can behave poorly near the endpoints.

Runge's Phenomenon

Runge's phenomenon refers to large oscillations that can occur near interval endpoints when high-degree polynomial interpolation uses equally spaced nodes.

Increasing the polynomial degree does not always improve the approximation.

Why High Degree Can Be Problematic

A single global polynomial must satisfy every interpolation condition across the entire interval.

As more nodes are added, the polynomial may develop strong oscillations between them.

This is one reason numerical methods often prefer piecewise low-degree interpolation.

Chebyshev Nodes

Better node placement can reduce endpoint oscillation.

On \([-1,1]\), a common family of Chebyshev nodes is

\[ \boxed{ x_k = \cos \left( \frac{2k+1}{2n+2}\pi \right), \qquad k=0,\ldots,n }. \]

These nodes cluster more densely near the endpoints.

Why Chebyshev Nodes Help

The interpolation error contains

\[ \prod_{i=0}^{n}(x-x_i). \]

Chebyshev node placement controls the maximum size of this product more effectively than equally spaced nodes in important high-degree settings.

Piecewise Linear Interpolation

Instead of fitting one high-degree polynomial through all data points, connect each adjacent pair with a line.

On

\[ [x_i,x_{i+1}], \]

define the local linear interpolant using only the endpoint data.

The result is continuous but generally not differentiable at the nodes.

Advantages of Piecewise Linear Interpolation

Limitations of Piecewise Linear Interpolation

The first derivative generally jumps at the interpolation nodes.

This can be undesirable when smooth slopes or curvature are important.

Cubic splines address this limitation.

Piecewise Polynomial Interpolation

More generally, the interval can be divided into subintervals and a low-degree polynomial assigned to each one.

The pieces are joined according to continuity and smoothness conditions.

This strategy combines local control with smooth global behavior.

Splines

A spline is a piecewise polynomial with prescribed smoothness at the joining points, called knots.

Cubic splines are especially common because cubic pieces provide substantial flexibility while remaining inexpensive to compute.

Cubic Spline Interpolation

On each interval

\[ [x_i,x_{i+1}], \]

a cubic spline uses a polynomial

\[ S_i(x) = a_i+b_i(x-x_i) +c_i(x-x_i)^2 +d_i(x-x_i)^3. \]

The coefficients are selected so neighboring pieces fit together smoothly.

Spline Interpolation Conditions

A standard cubic spline satisfies:

  1. the spline interpolates the data;
  2. adjacent cubic pieces agree at each interior knot;
  3. their first derivatives agree;
  4. their second derivatives agree.

Additional endpoint conditions complete the system.

Natural Cubic Splines

A natural cubic spline imposes

\[ \boxed{S''(x_0)=0} \]

and

\[ \boxed{S''(x_n)=0}. \]

These conditions make the spline behave as though its curvature relaxes at the endpoints.

Clamped Cubic Splines

If endpoint slopes are known, a clamped spline can impose

\[ S'(x_0)=f'(x_0) \]

and

\[ S'(x_n)=f'(x_n). \]

This incorporates derivative information into the interpolation.

Why Cubic Splines Are Popular

Local Versus Global Interpolation

A global polynomial uses all nodes at once.

A local or piecewise method uses only nearby nodes to estimate a value.

Local methods often provide better scalability and robustness when the data set is large.

Extrapolation

Interpolation estimates within the range of known data.

Extrapolation estimates outside that range.

Extrapolation is typically more dangerous because the data no longer constrain the approximation on both sides.

Why Extrapolation Is Riskier

Two functions can agree closely on the observed interval and diverge strongly outside it.

Therefore, a good interpolant inside the data region may still be a poor extrapolant beyond the endpoints.

Interpolation and Measurement Noise

If data contain noise, exact interpolation forces the approximating function to reproduce that noise.

This can create unnecessary oscillation or complexity.

In noisy settings, regression, smoothing splines, or other approximation methods may be more appropriate.

Conditioning of Polynomial Interpolation

Interpolation can be sensitive to:

The interpolating polynomial is mathematically unique, but its numerical representation is not equally stable in every form.

The Choice of Basis Matters

A polynomial can be represented in many bases:

\[ 1,x,x^2,\ldots \]

or Lagrange basis functions,

\[ L_0(x),L_1(x),\ldots,L_n(x), \]

or Newton basis functions,

\[ 1,\, (x-x_0),\, (x-x_0)(x-x_1),\ldots \]

These are mathematically equivalent representations but can differ computationally.

Barycentric Lagrange Interpolation

Direct evaluation of the basic Lagrange formula can be expensive.

A numerically effective reformulation uses barycentric weights

\[ w_i = \frac{1}{ \displaystyle \prod_{\substack{j=0\\j\ne i}}^{n}(x_i-x_j) }. \]

For \(x\) not equal to a node,

\[ \boxed{ p_n(x) = \frac{ \displaystyle\sum_{i=0}^{n} \frac{w_i y_i}{x-x_i} }{ \displaystyle\sum_{i=0}^{n} \frac{w_i}{x-x_i} } }. \]

Why Barycentric Form Is Important

Once the node-dependent weights are precomputed, many evaluations can be carried out efficiently.

Barycentric interpolation is therefore a major practical form of polynomial interpolation.

Handling Evaluation at a Node

The barycentric formula contains terms

\[ \frac{1}{x-x_i}. \]

If \(x=x_i\), the formula should not be evaluated by literal division.

Instead, return the interpolation condition directly:

\[ \boxed{p(x_i)=y_i}. \]

Equally Spaced Divided Differences

When nodes are equally spaced, divided differences connect closely to finite differences.

This leads to specialized forward and backward interpolation formulas.

The general divided-difference framework remains valid whether or not the nodes are equally spaced.

Hermite Interpolation

Standard interpolation matches function values.

Hermite interpolation can match both values and derivatives.

For example, one may require

\[ p(x_i)=f(x_i) \]

and

\[ p'(x_i)=f'(x_i). \]

This allows more local information to be incorporated.

Repeated Nodes in Hermite Interpolation

The divided-difference framework can be extended to repeated nodes.

Derivative information replaces the ordinary quotient when two interpolation arguments coincide.

This creates a unified connection between ordinary interpolation and derivative-matching interpolation.

Interpolation as Reconstruction

Interpolation can be viewed as reconstructing a continuous or evaluable model from discrete samples.

The central question is not merely

\[ p(x_i)=y_i, \]

but also how well the reconstructed function behaves between the nodes.

Choosing the Degree

More data points do not automatically imply that one high-degree polynomial should be used.

A practical choice depends on:

Scaling the Interpolation Interval

It can be useful to map a general interval

\[ [a,b] \]

to

\[ [-1,1]. \]

A standard transformation is

\[ \boxed{ t = \frac{2x-(a+b)}{b-a} }. \]

This standardizes the domain and supports the use of Chebyshev nodes.

Interpolation Error and Distance from Nodes

The error factor

\[ \prod_{i=0}^{n}(x-x_i) \]

grows as \(x\) moves away from the nodes.

This is one reason extrapolation can deteriorate rapidly.

Interpolation Error and Smoothness

The derivative term

\[ f^{(n+1)}(\xi) \]

measures how much higher-order variation the polynomial must capture.

Very smooth functions with controlled derivatives are generally more favorable for polynomial interpolation than functions with sharp features or singularities.

Interpolation Near a Discontinuity

A smooth polynomial cannot reproduce a jump discontinuity exactly between ordinary nodes.

High-degree interpolation near discontinuities may exhibit strong oscillation.

Piecewise methods that respect the discontinuity location are often more appropriate.

A Reliable Polynomial Interpolation Workflow

  1. Inspect the data and confirm distinct nodes.
  2. Determine whether exact interpolation is appropriate.
  3. Choose a polynomial representation.
  4. Use Lagrange form for direct conceptual construction.
  5. Use Newton form for incremental data or divided differences.
  6. Use barycentric form for efficient repeated evaluation.
  7. Estimate interpolation error when derivative information is available.
  8. Check for high-degree oscillation and poor node placement.

A Reliable Piecewise Interpolation Workflow

  1. Order the nodes by increasing \(x\).
  2. Select the interval containing the evaluation point.
  3. Choose local polynomial degree and smoothness requirements.
  4. Construct the local piece.
  5. Enforce continuity conditions across knots when required.
  6. Use spline boundary conditions appropriate to the application.
  7. Check interpolation and smoothness conditions numerically.

Common Error: Confusing Interpolation with Regression

Interpolation forces the model through every supplied point.

Regression generally balances discrepancies rather than eliminating them.

The correct method depends on whether the data should be treated as exact or noisy.

Common Error: Using Repeated Nodes in Ordinary Polynomial Interpolation

Standard Lagrange and divided-difference formulas require distinct nodes.

Repeated-node information belongs to Hermite-type interpolation and requires derivative conditions.

Common Error: Assuming Higher Degree Always Improves Accuracy

High-degree interpolation can oscillate strongly, especially with equally spaced nodes.

Piecewise methods or better node placement may outperform a single global polynomial.

Common Error: Ignoring Node Placement

Interpolation error depends on the node product

\[ \prod_{i=0}^{n}(x-x_i). \]

Choosing nodes is therefore part of the numerical method, not merely a bookkeeping decision.

Common Error: Using the Monomial Basis Automatically

Solving for coefficients of

\[ 1,x,x^2,\ldots,x^n \]

through a Vandermonde system is mathematically valid but may be numerically unfavorable.

Lagrange, Newton, barycentric, spline, or orthogonal-polynomial forms may be more appropriate.

Common Error: Treating Extrapolation Like Interpolation

Accuracy inside the node interval does not guarantee accuracy outside it.

Extrapolated values should be interpreted with greater caution.

Common Error: Interpolating Noisy Data Exactly

Exact interpolation reproduces measurement noise along with the underlying signal.

If the purpose is trend recovery rather than exact table reconstruction, smoothing or least-squares approximation may be preferable.

Common Error: Ignoring Locality

Changing one point in a global polynomial interpolation can change the polynomial everywhere.

Piecewise methods provide stronger local control and are often better suited to large data sets.

Example: Linear Interpolation Formula

Suppose

\[ (x_0,y_0)=(1,4) \]

and

\[ (x_1,y_1)=(5,12). \]

Then

\[ p_1(x) = 4+\frac{12-4}{5-1}(x-1). \]

Therefore,

\[ \boxed{p_1(x)=2x+2}. \]

Example: Interpolating at an Interior Point

Using

\[ p_1(x)=2x+2, \]

the estimate at \(x=3\) is

\[ \boxed{p_1(3)=8}. \]

Example: First Divided Difference as a Slope

If

\[ f(2)=7 \]

and

\[ f(5)=16, \]

then

\[ f[2,5] = \frac{16-7}{5-2} = \boxed{3}. \]

The first divided difference is the secant slope between the two data points.

Example: Checking an Interpolant

Suppose

\[ p(x)=x^2+1 \]

is claimed to interpolate

\[ (0,1),\qquad(1,2),\qquad(2,5). \]

Check:

\[ p(0)=1, \qquad p(1)=2, \qquad p(2)=5. \]

Therefore, the interpolation conditions are satisfied.

Practice 1: Linear Interpolation

Construct the linear interpolant through

\[ (2,6) \]

and

\[ (5,15). \]

Practice 2: Interpolated Value

Using the interpolant from Practice 1, estimate the value at

\[ x=4. \]

Practice 3: Lagrange Basis

For nodes

\[ x_0=0,\qquad x_1=2, \]

find \(L_0(x)\) and \(L_1(x)\).

Practice 4: First Divided Difference

Given

\[ f(1)=4 \]

and

\[ f(3)=10, \]

compute

\[ f[1,3]. \]

Practice 5: Second Divided Difference

Suppose

\[ f[0,1]=2 \]

and

\[ f[1,2]=5. \]

Compute

\[ f[0,1,2]. \]

Practice 6: Interpolation Error

Why is the interpolation error exactly zero at every node?

Practice 7: Runge's Phenomenon

What numerical problem can occur when a high-degree polynomial is fitted through many equally spaced nodes on a long interval?

Practice 8: Piecewise Linear Smoothness

Is a piecewise linear interpolant generally differentiable at its nodes?

Practice 9: Natural Spline Boundary Conditions

State the endpoint conditions for a natural cubic spline.

Practice 10: Interpolation or Extrapolation?

Known data cover

\[ 0\le x\le10. \]

Classify an estimate at:

  1. \(x=6\);
  2. \(x=14\).

Practice Answers

Practice 1

The slope is

\[ \frac{15-6}{5-2} = \frac93 = 3. \]

Therefore,

\[ p_1(x) = 6+3(x-2) = \boxed{3x}. \]

Practice 2

\[ p_1(4) = 3(4) = \boxed{12}. \]

Practice 3

\[ L_0(x) = \frac{x-2}{0-2} = \boxed{\frac{2-x}{2}} \]

and

\[ L_1(x) = \frac{x-0}{2-0} = \boxed{\frac{x}{2}}. \]

Practice 4

\[ f[1,3] = \frac{10-4}{3-1} = \frac62 = \boxed{3}. \]

Practice 5

\[ f[0,1,2] = \frac{5-2}{2-0} = \boxed{\frac32}. \]

Practice 6

At node \(x_j\), the interpolation error factor

\[ \prod_{i=0}^{n}(x-x_i) \]

contains

\[ x_j-x_j=0. \]

Therefore the interpolation error is exactly zero at every node.

Practice 7

The polynomial can develop large endpoint oscillations known as Runge's phenomenon.

Practice 8

Generally, no. Adjacent line segments can have different slopes, so the first derivative usually jumps at the nodes.

Practice 9

\[ \boxed{S''(x_0)=0} \]

and

\[ \boxed{S''(x_n)=0}. \]

Practice 10

  1. \(x=6\): interpolation.
  2. \(x=14\): extrapolation.

What to Remember

Interpolation constructs a function that reproduces known data exactly at specified nodes:

\[ \boxed{p(x_i)=y_i}. \]

Where We Go Next

Interpolation forces an approximation to match specified data exactly. Numerical approximation often requires a broader goal: finding a simple function that is close to a more complicated function over an interval or region.

The next lesson, Approximation of Functions, develops polynomial, rational, orthogonal-basis, least-squares, and minimax ideas for representing functions efficiently without requiring exact agreement at every point.