---
title: "Polynomial Interpolation and Its Error Term"
description: "Fit the unique polynomial of degree at most n through n + 1 points with distinct x values, build its Lagrange and Newton forms, and bound its error."
canonical: https://lightmysky.com/learn/mathematics/polynomial-interpolation-and-its-error-term-mt_NSnzY9Xodd
source: https://lightmysky.com/learn/mathematics/polynomial-interpolation-and-its-error-term-mt_NSnzY9Xodd.md
retrieved: 2026-11-12
---

> **Agent view.** This is the Markdown twin of the page, for tools and assistants.
> When to use this site, and the call that answers each job: https://lightmysky.com/agent-instructions.md
> API description (OpenAPI 3.1): https://lightmysky.com/openapi.json · Authentication: https://lightmysky.com/auth.md
> Pricing: https://lightmysky.com/pricing.md · Catalog: https://lightmysky.com/llms.txt · Full catalog: https://lightmysky.com/llms-full.txt
> Every machine-readable file on this domain: https://lightmysky.com/.well-known/ai-catalog.json
> Ask for Markdown with `Accept: text/markdown`, a `.md` address, or `?mode=agent`.

# Polynomial Interpolation and Its Error Term

Fit the unique polynomial of degree at most n through n + 1 points with distinct x values, build its Lagrange and Newton forms, and bound its error.

Subject: Mathematics · Area: Calculus & Analysis · Ages 20 to 21
Page: https://lightmysky.com/learn/mathematics/polynomial-interpolation-and-its-error-term-mt_NSnzY9Xodd

## Ready when they can

- Construct an interpolating polynomial in both Lagrange and divided-difference form
- State the error term and use it to bound the interpolation error on an interval
- Show with a worked example why more equally spaced points can make the fit worse

## Lesson: One polynomial through the points

For n+1 points with distinct x values, exactly one polynomial of degree at most n matches every value. Its degree may be smaller. Higher-degree polynomials can also match. To prove uniqueness within the limit, subtract two candidates. Their difference has n+1 distinct roots, more than a nonzero polynomial of degree at most n can have. The difference must be zero. Repeated inputs with different outputs cannot be matched by any function.

For data (a,u) and (b,v), where a differs from b, the interpolating line is p(x)=u+m(x-a), with slope m=(v-u)/(b-a). Equivalently, p(x)=u(b-x)/(b-a)+v(x-a)/(b-a). To check any proposed interpolant, substitute each node and compare with its recorded value. The residual is the polynomial's value minus the recorded value; it must be zero at every matched node.

*(drawing: The line matches both recorded values. Its slope gives the value 3 at x=1.)*

For nodes x_0,...,x_n and values y_0,...,y_n, form L_i(x) by multiplying (x-x_j)/(x_i-x_j) over all j other than i. Distinct nodes make the denominators nonzero. This basis polynomial is 1 at its own node and 0 at every other node. Lagrange form is p(x)=sum of y_i L_i(x). Evaluate each basis term, weight it by its data value and add. To find a coefficient, expand the weighted terms and collect the required power.

**Example.** For (-1,2), (0,1) and (1,2), the basis polynomials are x(x-1)/2, 1-x^2 and x(x+1)/2. Multiply them by 2, 1 and 2. Their sum is x(x-1)+(1-x^2)+x(x+1)=x^2+1. The x^2 coefficients add to 1-1+1=1. Substitution checks the data: p(-1)=2, p(0)=1 and p(1)=2.

*(drawing: A basis polynomial selects its own node. It need not be zero away from the nodes.)*

Write f[a] for the value at node a. Divided differences are f[a,b]=(f[b]-f[a])/(b-a) and f[a,b,c]=(f[b,c]-f[a,b])/(c-a). Newton's quadratic form is p(x)=f[a]+f[a,b](x-a)+f[a,b,c](x-a)(x-b). At each higher level, subtract adjacent differences and divide by the spacing of the outer nodes. Each new coefficient multiplies the product of factors for the preceding nodes.

**Example.** For (0,2), (2,6) and (4,18), the adjacent first differences are (6-2)/2=2 and (18-6)/2=6. The second difference is (6-2)/(4-0)=1. Newton form gives p(x)=2+2x+x(x-2)=x^2+2. Both Newton and Lagrange form give this polynomial because each matches the same data within the same degree limit.

To add a point (t,v), keep the old interpolant p_n and add K times product(x-x_i) over the old nodes. This product vanishes at every old node, preserving its value. Choose K=(v-p_n(t))/product(t-x_i) to match the new value. The new node t must differ from all old nodes. If the old polynomial already matches the new value, K is zero.

*(drawing: Add x(x-2)(x-4)/3. It is zero at the old nodes and equals the missing value 5 at x=5.)*

Let p_n be the polynomial of degree at most n matching f at n+1 distinct nodes x_i. Assume f has n+1 continuous derivatives on a closed interval containing the nodes and x. For a non-node x, f(x)-p_n(x)=f^(n+1)(c) times product(x-x_i)/(n+1)!, where c is inside the smallest interval containing the nodes and x. The superscript denotes derivative order. At a node the error is zero. The nodal product replaces the Taylor remainder's power.

If |f^(n+1)(t)| <= M throughout the interval, the absolute error is at most M/(n+1)! times |product(x-x_i)|. For a line through the values at endpoints a<b, use |f''| <= M and divide by 2. Inside [a,b], |(x-a)(x-b)| is at most h^2/4, where h=b-a. The uniform absolute-error bound is therefore M h^2/8. An upper bound on f'' alone does not bound absolute error.

*(drawing: For nodes 0 and 4, the absolute nodal product is largest at x=2: 2 times 2 equals 4.)*

Use Runge's function f(x)=1/(1+25x^2) on [-1,1]. Nodes -1,0,1 give p_2(x)=1-25x^2/26. Adding the equally spaced nodes -0.5 and 0.5 gives p_4(x)=1-(3225/754)x^2+(1250/377)x^4. Substitution verifies both fits at their nodes. Every sampled value is positive. At x=0.9, f(x)=4/85, p_2(x)=23/104 and p_4(x)=-109/377. Positive data do not force positive values between nodes.

**Example.** At x=0.9, the three-node absolute error is |4/85-23/104|, about 0.1741. The five-node error is |4/85+109/377|, about 0.3362. More nodes gave a less accurate fit here. This compares one point, not the worst error on the interval. High-degree equally spaced interpolation of Runge's function develops large errors near the ends. Chebyshev nodes cluster toward both ends and give convergence for this function, not an accuracy guarantee for every function.

*(drawing: These are errors at x=0.9, not the maximum errors over [-1,1].)*

**Recap.** Distinct nodes fix one polynomial within a degree limit. Lagrange and Newton give the same fit. Derivative bounds control error; more equally spaced nodes need not improve it.

*Lesson, practice questions and flashcards written for this dataset.*

## Practice

17 questions on this page, each with its working shown.

## Needs first

- [The Mean Value Theorem](https://lightmysky.com/learn/mathematics/the-mean-value-theorem-mt_09iApYVelx)
- [Taylor and Maclaurin Series](https://lightmysky.com/learn/mathematics/taylor-and-maclaurin-series-mt_SgI9Pn9RIO)

## Opens up

- [Numerical Quadrature: Newton-Cotes and Adaptive Rules](https://lightmysky.com/learn/mathematics/numerical-quadrature-newton-cotes-and-adaptive-rules-mt_fT5kRCUiD5)
