# Runge's phenomenon

The red curve is the Runge function.
The blue curve is a 5th-order interpolating polynomial (using six equally-spaced interpolating points).
The green curve is a 9th-order interpolating polynomial (using ten equally-spaced interpolating points).
At the interpolating points, the error between the function and the interpolating polynomial is (by definition) zero. Between the interpolating points (especially in the region close to the endpoints 1 and −1), the error between the function and the interpolating polynomial gets worse for higher-order polynomials.

In the mathematical field of numerical analysis, Runge's phenomenon is a problem of oscillation at the edges of an interval that occurs when using polynomial interpolation with polynomials of high degree over a set of equispaced interpolation points. It was discovered by Carl David Tolmé Runge when exploring the behavior of errors when using polynomial interpolation to approximate certain functions.[1] The discovery was important because it shows that going to higher degrees does not always improve accuracy. The phenomenon is similar to the Gibbs phenomenon in Fourier series approximations.

## Introduction

The Weierstrass approximation theorem states that every continuous function f(x) defined on an interval [a,b] can be uniformly approximated as closely as desired by a polynomial function Pn(x) of sufficiently large degree ≤ n, i.e.,

$\lim_{n \rightarrow \infty} \left( \max_{a \leq x \leq b} | f(x) -P_n(x)| \right) = 0.$

Interpolation at equidistant points is a natural and well-known approach to construct approximating polynomials. Runge's phenomenon demonstrates, however, that interpolation can easily result in divergent approximations.

## Problem

Consider the function:

$f(x) = \frac{1}{1+25x^2}.\,$

Runge found that if this function is interpolated at equidistant points xi between −1 and 1 such that:

$x_i = \frac{2i}{n} - 1,\quad i \in \left\{ 0, 1, \dots, n \right\}$

with a polynomial Pn(x) of degree ≤ n, the resulting interpolation oscillates toward the end of the interval, i.e. close to −1 and 1. It can even be proven that the interpolation error increases (without bound) when the degree of the polynomial is increased:

$\lim_{n \rightarrow \infty} \left( \max_{-1 \leq x \leq 1} | f(x) -P_n(x)| \right) = +\infty.$

This shows that high-degree polynomial interpolation at equidistant points can be troublesome.

### Reason

The error between the generating function and the interpolating polynomial of order n is given by

$f(x) - P_n(x) = \frac{f^{(n+1)}(\xi)}{(n+1)!} \prod_{i=1}^{n+1} (x-x_i)$

for some $\xi$ in (−1, 1). Thus,

$\max_{-1 \leq x \leq 1} |f(x) - P_n(x)| \leq \max_{-1 \leq x \leq 1} \frac{|f^{(n+1)}(x)|}{(n+1)!} \max_{-1 \leq x \leq 1} \prod_{i=0}^n |x-x_i|.$

For the case of the Runge function, interpolated at equidistant points, each of the two multipliers in the upper bound for the approximation error grows to infinity with n. Although often used to explain the Runge phenomenon, the fact that the upper bound of the error goes to infinity does not necessarily imply, of course, that the error itself also diverges with n.

## Mitigations to the problem

### Change of interpolation points

The oscillation can be minimized by using nodes that are distributed more densely towards the edges of the interval, specifically, with asymptotic density (on the interval [−1,1]) given by the formula[2] $1/\sqrt{1-x^2}$. A standard example of such a set of nodes is Chebyshev nodes, for which the maximum error in approximating the Runge function is guaranteed to diminish with increasing polynomial order. The phenomenon demonstrates that high degree polynomials are generally unsuitable for interpolation with equidistant nodes.

### Use of piecewise polynomials

The problem can be avoided by using spline curves which are piecewise polynomials. When trying to decrease the interpolation error one can increase the number of polynomial pieces which are used to construct the spline instead of increasing the degree of the polynomials used.

### Constrained minimization

One can also fit a polynomial of higher degree (for instance $2n$ instead of $n+1$), and fit an interpolating polynomial whose first (or second) derivative has minimal $L^2$ norm.

### Least squares fitting

Another method is fitting a polynomial of lower degree using the method of least squares. Generally, when using m equidistant points, if $N<2\sqrt{m}$ then least squares approximation $P_N(x)$ is well-conditioned.[3]

## Related statements from the approximation theory

For every predefined table of interpolation nodes there is a continuous function for which the sequence of interpolation polynomials on those nodes diverges.[4] For every continuous function there is a table of nodes on which the interpolation process converges.[citation needed] Chebyshev interpolation (i.e., on Chebyshev nodes) converges uniformly for every absolutely continuous function.