Nf2 - Lagrange's interpolating polynomial
Nf2 constructs an interpolating polynomial from distinct data nodes, including unequally spaced nodes. You will build Lagrange's basis factors, combine three or four values, evaluate an interpolant efficiently, and explain when Newton and Lagrange give the same result.
Build one selector polynomial for each data value
Can Lagrange's method give a more accurate interpolating quadratic than Newton's method from exactly the same three points? No: there is only one polynomial of degree at most through three distinct input nodes. The methods write that polynomial differently.
You already know
Newton's forward formula requires equal input spacing. An interpolating polynomial passes through the selected nodes; it need not equal an unknown function between them. distinct nodes determine a polynomial of degree at most .
Lagrange's construction does not require equal spacing. Consider nodes . The polynomial
is at node and at the other two nodes. Multiplying it by the value at node adds exactly that value there, without changing the other nodes.
Lagrange basis polynomial
For distinct nodes , the basis polynomial equals at its own node and at every other node. It has a factor for each , and a denominator that makes its own-node value equal to .
Add one such selector for each data value. Distinct input nodes are essential: repeated inputs would make a denominator zero, and two different outputs at the same input cannot be values of one function.
[DIAGRAM: asset_name: Three Lagrange selector polynomials; asset_slug: h645_b135_basis; caption: Each basis polynomial is one at its own node and zero at the other nodes; description: Three coordinate panels show L0 equals (x minus one)(x minus three) divided by three, L1 equals x(x minus three) divided by minus two, and L2 equals x(x minus one) divided by six. Each panel marks the nodes zero, one and three, with its own-node point at height one and other-node points at height zero. Equal spacing is not assumed.]

Lagrange's interpolating polynomial
Given pairs with distinct ,
where
The polynomial has degree at most and satisfies at every selected node. Equal spacing is allowed but not required.
In the formula booklet.
For three nodes, each basis has two numerator factors. Keep the input values in these factors and denominators; the output values belong as multiplying coefficients.
Worked example 1: three unequally spaced nodes
Question. Find the interpolating quadratic through .
Plan. Construct the three basis factors, multiply by the corresponding outputs and collect powers of .
Why this step? A term's denominator uses its own node minus each other node. The signs are part of the formula, not optional adjustments.
Answer. .
Check. , , .
Change only the middle output from to . The nodes, and therefore all three basis polynomials, stay unchanged.
Worked example 2: changing one observed value
Question. Find the interpolant through .
Plan. Change the coefficient of while retaining the same basis factors.
Why this step? Basis factors depend only on the input nodes. Changing one output changes only its weight.
Answer. .
Check. The new value at is , while the values at and remain and .
Three nodes permit degree , but do not force it: the quadratic coefficient can cancel. This is why “degree at most ” matters.
Watch out
Wrong: put the function values into the numerator factors in place of the input nodes .
Right: factors locate the input nodes; the tabulated outputs multiply those factors.
Change only the middle output once more, watching the degree.
Four distinct nodes allow a cubic
With four nodes, each basis polynomial contains three factors, so the combined interpolant has degree at most . The spacing can change from one pair of nodes to the next.
For nodes , the denominator for the node is . The missing node at does not need to be invented.
Worked example 3: a cubic from four nodes
Question. Construct the interpolating cubic through .
Plan. Use all four distinct nodes, with one cubic basis term per output.
Why this step? There are four data values, so omitting one basis term generally fails to interpolate one of the nodes.
Answer. .
Check. Substitution at gives .
Change only the last output from to . The first three outputs and every input node stay fixed.
Continue this lesson.
You’re previewing NovaLearn without an account. Create a free account to read the rest.
Create free account