Estimating values between the entries of an equally spaced table: Newton's forward formula from Ep=(1+Δ)p, the backward formula from (1−∇)−p, how to choose between them, how big the error is, and when interpolation goes wrong.
Md Mahbub E Noor · Assistant Professor CSE-3107 Numerical Methods · B.Sc. 3rd Year 1st Semester Department of CSE, University of Barishal
Why this lecture
The problem: the census is every ten years
A town's population (thousands) was counted every ten years. A planner needs the values for 1895 and 1925, when no count was taken.
The data are equally spaced (h=10 years) but there is no formula
1895 is near the start of the table; 1925 is near the end
Straight-line interpolation ignores the curvature that the differences show
We need a formula that uses the whole table, and an idea of its error
year x
population y
1891
46
1901
66
1911
81
1921
93
1931
101
Md Mahbub E Noor
Lecture 16: Newton's Forward and Backward Interpolation
University of Barishal
2 / 21
Today's goals
Derive Newton's forward formula from Ep=(1+Δ)p and the backward formula from (1−∇)−p
Compute p and evaluate the formulas from a difference table
Choose forward or backward according to where x lies
Estimate the interpolation error and recognise the danger of extrapolation
Compare Newton's formulas with linear interpolation and with Lagrange
Last time
Difference tables, operators, E=1+Δ=ehD.
Today
Expand Ep to get values between the table entries.
Finite differences and interpolation · you are here
Lecture 16: Newton's Forward and Backward Interpolation
University of Barishal
3 / 21
Start here
The idea in one picture
We measured y only at five equally spaced x values.What is y between the dots, for example at x = 0.5?Draw one smooth polynomial through all five dots.Read the value off the curve. That is interpolation.Near the top of the table, build the curve from the first row of differences.Near the bottom, build it from the last row. Same curve, smaller error.
In plain words
We know a function only at a few points and need it in between
Pass one polynomial through all the points and read off the value
Newton's formulas build that polynomial from the difference table
New words today
interpolation
estimating between known points
extrapolation
estimating outside them (risky)
p = (x − x₀)/h
position measured in steps
forward / backward
start from the top or the bottom of the table
Md Mahbub E Noor
Lecture 16: Newton's Forward and Backward Interpolation
University of Barishal
4 / 21
Deriving Newton's forward formula
Write x in steps from x₀x=x0+ph⟹p=hx−x0,y(x)=Epy0=(1+Δ)py0
Binomial series (any real p)y(x0+ph)=y0+pΔy0+2!p(p−1)Δ2y0+3!p(p−1)(p−2)Δ3y0+⋯
Uses the top diagonaly0,Δy0,Δ2y0,…
For integer p it reproduces the table exactly
With n+1 points: stops after Δn; it is the degree-n polynomial through all of them
Best when x is near the start (0<p<1)
Md Mahbub E Noor
Lecture 16: Newton's Forward and Backward Interpolation
University of Barishal
5 / 21
The method, step by step
Newton's forward interpolation, step by step
Check the x values are equally spaced; note h
Build the forward difference table
Take x0 as the table entry just below x (near the start); compute p=(x−x0)/h
Add terms k!p(p−1)⋯(p−k+1)Δky0 for k=0,1,2,…
Stop when the terms become negligible (or the table ends); the last term used estimates the error
Pseudocode
input x[0..n], y[0..n] (equal steps), X
h ← x[1] − x[0]; p ← (X − x[0]) / h
d ← copy of y # top diagonal
sum ← d[0]; c ← 1
for k = 1 … n:
for i = 0 … n−k:
d[i] ← d[i+1] − d[i]
c ← c·(p − k + 1) / k
sum ← sum + c·d[0]
return sum
Each pass makes the next column of differences in place; only d0 is used.
Md Mahbub E Noor
Lecture 16: Newton's Forward and Backward Interpolation
University of Barishal
6 / 21
Problem 1: the population in 1895 (forward)
Use the census table to estimate the population in 1895.
Lecture 16: Newton's Forward and Backward Interpolation
University of Barishal
9 / 21
How accurate? The interpolation error
Remainder after the term in Δⁿ (forward form); ξ lies in the data rangey(x)−Pn(x)=(n+1)!p(p−1)⋯(p−n)hn+1f(n+1)(ξ)
Practical estimate: the first neglected termerror≈(n+1)!p(p−1)⋯(p−n)Δn+1y0
Small when p is small: x close to x0
The product p(p−1)⋯(p−n) grows quickly outside the table: extrapolation is risky
Smooth data (small high differences) interpolate well
Same structure as the Taylor remainder (Lecture 3)
Md Mahbub E Noor
Lecture 16: Newton's Forward and Backward Interpolation
University of Barishal
10 / 21
Explore: forward, backward and the danger zone
Each table row is one term of the formula
Blue band: the data range
Try 1960: the polynomial bends away; the estimate is meaningless
The sin x preset compares with the true function
Md Mahbub E Noor
Lecture 16: Newton's Forward and Backward Interpolation
University of Barishal
11 / 21
Classical vs numerical
Same question, two approaches: population in 1895
Algebra
Classical (fit a formula)
Assume y=a+bx+cx2+dx3+ex4
Solve a 5×5 Vandermonde system with entries up to 19314≈1.4×1013
Badly conditioned: digits are lost before we start
vs
Algorithm
Numerical (Newton forward)
Difference table: subtractions only
p=0.4, five short terms
54.8528 thousand, with a built-in error estimate
When the classical approach cannot work
Data from experiments and records
Population, rainfall or sensor logs have no formula to find. Even fitting one through the points with x as large as 1931 makes a severely ill-conditioned system (Lecture 11). Newton's formula works in the shifted variable p, where all numbers are small.
Md Mahbub E Noor
Lecture 16: Newton's Forward and Backward Interpolation
University of Barishal
12 / 21
Newton forward and backward in Python and C
Builds the difference table once
Forward: top diagonal, p=(x−x0)/h
Backward: bottom diagonal, p=(x−xn)/h
Prints every term, as in a written solution
Md Mahbub E Noor
Lecture 16: Newton's Forward and Backward Interpolation
University of Barishal
13 / 21
When interpolation goes wrong
Limitations shown failing
High degree on equal spacing: 11 points of 1/(1+25x2); near the ends the degree-10 polynomial swings far from the data
Extrapolation: outside the table the error term grows without control
Unequal spacing: the formulas do not apply at all
Noisy data: high differences are mostly noise, so extra terms add error
Md Mahbub E Noor
Lecture 16: Newton's Forward and Backward Interpolation
University of Barishal
14 / 21
Practice
Practice problem
Problem 3"From the table x: 1, 2, 3, 4, 5 and y: 1, 8, 27, 64, 125, find y(1.5) by Newton's forward formula and y(4.5) by Newton's backward formula."
Lecture 16: Newton's Forward and Backward Interpolation
University of Barishal
18 / 21
Applications
Where this method runs in the real world
Click a card to see table interpolation in use.
🌡️ Engineering property tables
Where exactly: thermodynamics and materials engineering. Properties such as saturation pressure are published at equal temperature steps; values in between are interpolated.
T (°C)
100
110
120
130
p (kPa)
101.42
143.38
198.67
270.28
At 105 °C the forward formula gives about 120.9 kPa; straight-line interpolation gives 122.4 kPa (too high, because the curve bends upward).
📟 Look-up tables in embedded systems
Where exactly: firmware for sensors. Evaluating ln or ex on a tiny chip is slow, so the curve is stored as a table at equal steps and the firmware interpolates between entries.
Measure the voltage, compute the table index i=⌊(V−V0)/h⌋ and p=(V−V0)/h−i
Use the first two or three terms of Newton's forward formula from entry i
Only a few multiplications: fast enough for every reading
Accuracy is set by the table spacing h and the number of terms
The same trick evaluates sine and cosine in older graphics hardware and in audio synthesisers (wavetables).
🔭 Astronomical tables
Where exactly: ephemerides (tables of planet and moon positions), published at equal time steps. Navigators interpolated them for the time of their observation, and Newton developed his formulas largely for this purpose.
Positions are tabulated once a day
A navigator's observation is at, say, 14:24, so p=0.6 of a day
Second differences correct for the curvature of the orbit
Modern ephemerides store Chebyshev polynomial pieces, a refinement of the same idea
Newton's interpolation work (1670s) came from exactly these tables.
🎞️ Frames, pixels and samples
Where exactly: image zoom, video frame-rate conversion and audio resampling. Pixels and samples are equally spaced; new ones are interpolated from their neighbours.
Linear (bilinear in 2-D): first two terms of Newton's formula
Quadratic or cubic: two or three more terms, sharper images
Cubic convolution (bicubic) in Photoshop and OpenCV is a local cubic interpolant
Speech and music resampling (e.g. 44.1 kHz → 16 kHz) uses interpolation filters built on the same principle
Higher degree looks sharper but can create overshoot ("ringing") near edges, a cousin of the Runge effect.
Md Mahbub E Noor
Lecture 16: Newton's Forward and Backward Interpolation
University of Barishal
19 / 21
Checkpoint
Checkpoint · think, then discuss with your neighbourNewton's forward formula with x0=2, h=0.5. What is p for x=2.3?
A0.6
B0.3
C1.15
D4.6
A. p=(x−x0)/h=(2.3−2)/0.5=0.6.
Md Mahbub E Noor
Lecture 16: Newton's Forward and Backward Interpolation
Forward near the start, backward near the end; the first neglected term estimates the error
Only for equal spacing; extrapolation and high degree are dangerous
Opening problem: solved
Forward with p=0.4: 54.85 thousand in 1895. Backward with p=−0.6: 96.84 thousand in 1925. Linear interpolation would have said 54.0 and 96.2.
Homework
From x: 0, 1, 2, 3, 4 and y: 1, 7, 23, 55, 109, find y(0.5) and y(3.5).
The values of sinx at x=0.1,0.2,0.3,0.4,0.5 are 0.09983, 0.19867, 0.29552, 0.38942, 0.47943. Find sin0.15 and sin0.45 and compare with a calculator.
Derive Newton's backward formula from E=(1−∇)−1.
Use the lab tool to extrapolate the census to 1941 and 1951. Comment.
Next lecture
Lagrange and divided-difference interpolation. The same polynomial when the data are not equally spaced.
Md Mahbub E Noor
Lecture 16: Newton's Forward and Backward Interpolation
University of Barishal
21 / 21
Keys →Space next step · ← back A reveal the whole slide number + Enter jump to slide S slide list · F full screen · N notes [] previous / next lecture · L lab In a code box: Ctrl+Enter runs the code