Lagrange’s interpolation

At a Glance

Why This Chapter Matters

Lagrange interpolation appears in 5 of the last 14 years and always in Section B with high mark values (15–20 marks). The questions span five distinct patterns — from a straightforward computation to a confluent (Hermite-type) formula derived by a limiting argument — so this is one of the most varied numerical-analysis chapters in the corpus. The two 20-mark questions (2015, 2016) are the clearest tests of the core formula and its error bound; the three 15-mark questions (2017, 2020, 2025) require deeper structural understanding. The divided-difference route to Newton’s form (2025) and the confluent-limit derivation (2020) are the two patterns most likely to catch candidates who only practised the basic formula.

Minimum Theory

Lagrange interpolating polynomial. Given n+1n+1 distinct nodes x0,x1,…,xnx_0,x_1,\ldots,x_n and values fi=f(xi)f_i=f(x_i), the unique polynomial PnP_n of degree ≤n\le n satisfying Pn(xi)=fiP_n(x_i)=f_i is Pn(x)=∑i=0nfi Li(x),Li(x)=∏j≠ix−xjxi−xj.P_n(x)=\sum_{i=0}^n f_i\,L_i(x),\qquad L_i(x)=\prod_{j\ne i}\frac{x-x_j}{x_i-x_j}. The basis polynomials LiL_i satisfy Li(xj)=δijL_i(x_j)=\delta_{ij} and ∑iLi(x)≡1\sum_i L_i(x)\equiv1 (partition of unity, useful check).

Interpolation error. If ff has (n+1)(n+1) continuous derivatives, the error at xx is f(x)−Pn(x)=f(n+1)(ξ)(n+1)! ω(x),ω(x)=∏i=0n(x−xi),f(x)-P_n(x)=\frac{f^{(n+1)}(\xi)}{(n+1)!}\,\omega(x),\qquad \omega(x)=\prod_{i=0}^n(x-x_i), for some ξ\xi in the smallest interval containing {x0,…,xn,x}\{x_0,\ldots,x_n,x\}. Hence ∣f(x)−Pn(x)∣≤Mn+1(n+1)! ∣ω(x)∣,Mn+1=max⁡∣f(n+1)∣|f(x)-P_n(x)|\le\frac{M_{n+1}}{(n+1)!}\,|\omega(x)|,\qquad M_{n+1}=\max|f^{(n+1)}| over that interval.

Newton’s divided-difference form. An equivalent representation (especially efficient for unequally spaced nodes): Pn(x)=f[x0]+f[x0,x1](x−x0)+f[x0,x1,x2](x−x0)(x−x1)+⋯P_n(x)=f[x_0]+f[x_0,x_1](x-x_0)+f[x_0,x_1,x_2](x-x_0)(x-x_1)+\cdots where the divided differences are built recursively: f[xk]=fk,f[xi,…,xk]=f[xi+1,…,xk]−f[xi,…,xk−1]xk−xi.f[x_k]=f_k,\qquad f[x_i,\ldots,x_k]=\frac{f[x_{i+1},\ldots,x_k]-f[x_i,\ldots,x_{k-1}]}{x_k-x_i}.

Confluent (osculatory) interpolation. When two nodes x0x_0 and x0+ϵx_0+\epsilon coalesce (ϵ→0\epsilon\to0), the Lagrange polynomial on {x0,x0+ϵ,x1}\{x_0,x_0+\epsilon,x_1\} converges to a formula matching f(x0)f(x_0), f′(x0)f'(x_0), and f(x1)f(x_1) — the simplest Hermite interpolant. The error term picks up a double root at x0x_0: E(x)=16(x−x0)2(x−x1)f′′′(ξ)E(x)=\tfrac{1}{6}(x-x_0)^2(x-x_1)f'''(\xi).

Question Archetypes

Five patterns cover every Lagrange interpolation question in the corpus.

ArchetypeYou are seeing this when…
lagrange-interpolationBuild the Lagrange polynomial and evaluate at a given point
lagrange-with-errorBuild the polynomial and compute an error bound and the actual error
lagrange-form-proofRewrite/prove the Lagrange formula in a stated equivalent form (difference form, CRT, etc.)
confluent-interpolationDerive a Hermite-type formula by letting two nodes coalesce (ϵ→0\epsilon\to0)
divided-difference-interpolationFind the interpolating polynomial via Newton’s divided differences with an error term

lagrange-interpolation (1 question(s); 2015)

Recognition Cues

Solution Template

  1. Write down the four Lagrange basis polynomials Li(x)L_i(x) using the node values.
  2. Evaluate each LiL_i at the target point.
  3. Multiply by fif_i and sum.
  4. Optional: guess a low-degree polynomial fitting the data — if ff values are integers, often the data lies on an exact polynomial of manageable degree.

Worked Example(s)

2015 Paper 2, 2015-P2-Q6c (20 marks)

Find the Lagrange interpolating polynomial fitting the data below. Find f(1.5)f(1.5).

xx−1-1223344
ff−1-1111131316969

Lagrange basis at x=1.5x=1.5 (nodes x0=−1,x1=2,x2=3,x3=4x_0=-1,x_1=2,x_2=3,x_3=4):

L0(x)=(x−2)(x−3)(x−4)(−3)(−4)(−5)=(x−2)(x−3)(x−4)−60,L_0(x)=\frac{(x-2)(x-3)(x-4)}{(-3)(-4)(-5)}=\frac{(x-2)(x-3)(x-4)}{-60}, L1(x)=(x+1)(x−3)(x−4)(3)(−1)(−2)=(x+1)(x−3)(x−4)6,L_1(x)=\frac{(x+1)(x-3)(x-4)}{(3)(-1)(-2)}=\frac{(x+1)(x-3)(x-4)}{6}, L2(x)=(x+1)(x−2)(x−4)(4)(1)(−1)=(x+1)(x−2)(x−4)−4,L_2(x)=\frac{(x+1)(x-2)(x-4)}{(4)(1)(-1)}=\frac{(x+1)(x-2)(x-4)}{-4}, L3(x)=(x+1)(x−2)(x−3)(5)(2)(1)=(x+1)(x−2)(x−3)10.L_3(x)=\frac{(x+1)(x-2)(x-3)}{(5)(2)(1)}=\frac{(x+1)(x-2)(x-3)}{10}.

At x=1.5x=1.5: L0=0.03125L_0=0.03125, L1=1.5625L_1=1.5625, L2=−0.78125L_2=-0.78125, L3=0.1875L_3=0.1875. (Sum =1=1 ✓.)

P(1.5)=(−1)(0.03125)+(11)(1.5625)+(31)(−0.78125)+(69)(0.1875)P(1.5)=(-1)(0.03125)+(11)(1.5625)+(31)(-0.78125)+(69)(0.1875) =−0.03125+17.1875−24.21875+12.9375=5.875.=-0.03125+17.1875-24.21875+12.9375=\boxed{5.875.}

Shortcut: check whether the data fits a low-degree exact polynomial. Test f(x)=x3+x+1f(x)=x^3+x+1: f(−1)=−1f(-1)=-1 ✓, f(2)=11f(2)=11 ✓, f(3)=31f(3)=31 ✓, f(4)=69f(4)=69 ✓. So P(x)=x3+x+1P(x)=x^3+x+1 and P(1.5)=3.375+1.5+1=5.875P(1.5)=3.375+1.5+1=5.875 ✓ — much faster once the guess works.

Common Traps


lagrange-with-error (1 question(s); 2016)

Recognition Cues

Solution Template

  1. Compute node values f(xi)f(x_i) numerically.
  2. Evaluate basis polynomials LiL_i at the target point; check ∑Li=1\sum L_i=1.
  3. Compute Pn=∑f(xi)LiP_n = \sum f(x_i)L_i.
  4. Derive f(n+1)(x)f^{(n+1)}(x) and find (or bound) Mn+1=max⁡∣f(n+1)∣M_{n+1}=\max|f^{(n+1)}|. Look for amplitude form A⋅g(x)A\cdot g(x) with known max⁡∣g∣\max|g|.
  5. Evaluate ∣ω(x)∣|\omega(x)| at the target point and over the interval.
  6. State the bound and compute E=∣f(target)−Pn(target)∣E=|f(\text{target})-P_n(\text{target})|.

Worked Example(s)

2016 Paper 2, 2016-P2-Q6c (20 marks)

f(x)=e2xcos⁡3xf(x)=e^{2x}\cos3x on [0,1][0,1]. Estimate f(0.5)f(0.5) using degree-3 Lagrange interpolation over nodes 0, 0.3, 0.6, 10,\ 0.3,\ 0.6,\ 1. Give the error bound over [0,1][0,1] and the actual error E(0.5)E(0.5).

Node values (xx in radians throughout):

xix_if(xi)f(x_i)
0.00.01.0000001.000000
0.30.31.1326431.132643
0.60.6−0.754338-0.754338
1.01.0−7.315129-7.315129

Basis values at x=0.5x=0.5 (check ∑Li=1\sum L_i=1 ✓):

iiLi(0.5)L_i(0.5)
0−0.055556-0.055556
1+0.396825+0.396825
2+0.694444+0.694444
3−0.035714-0.035714

P3(0.5)=(1)(−0.055556)+(1.132643)(0.396825)+(−0.754338)(0.694444)+(−7.315129)(−0.035714)P_3(0.5)=(1)(-0.055556)+(1.132643)(0.396825)+(-0.754338)(0.694444)+(-7.315129)(-0.035714) ≈0.1313.\approx\boxed{0.1313.}

Error bound. Differentiate f=e2xcos⁡3xf=e^{2x}\cos3x four times: f(4)(x)=e2x(120sin⁡3x−119cos⁡3x).f^{(4)}(x)=e^{2x}(120\sin3x-119\cos3x). Recognise this as e2x⋅Asin⁡(3x+δ)e^{2x}\cdot A\sin(3x+\delta) with amplitude A=1202+1192=28561=169A=\sqrt{120^2+119^2}=\sqrt{28561}=169. So ∣f(4)(x)∣≤169 e2x≤169e2≈1248.75on [0,1].|f^{(4)}(x)|\le169\,e^{2x}\le169e^2\approx1248.75\quad\text{on }[0,1]. At x=0.5x=0.5: ∣ω(0.5)∣=(0.5)(0.2)(0.1)(0.5)=0.005=1/200|\omega(0.5)|=(0.5)(0.2)(0.1)(0.5)=0.005=1/200.

∣E(0.5)∣≤169e24!⋅1200=169e24800≈0.260.|E(0.5)|\le\frac{169e^2}{4!}\cdot\frac{1}{200}=\frac{169e^2}{4800}\approx\boxed{0.260.}

Actual error. f(0.5)=e1cos⁡1.5≈2.71828×0.07074≈0.1923.f(0.5)=e^1\cos1.5\approx2.71828\times0.07074\approx0.1923. E(0.5)=0.1923−0.1313≈0.061,E(0.5)=0.1923-0.1313\approx\boxed{0.061,} well inside the bound 0.2600.260 ✓.

Common Traps


lagrange-form-proof (1 question(s); 2017)

Recognition Cues

Solution Template

  1. Write the four Lagrange basis polynomials explicitly for nodes −1,0,1,2-1,0,1,2.
  2. Express Δ2u−1=u1−2u0+u−1\Delta^2u_{-1}=u_1-2u_0+u_{-1} and Δ2u0=u2−2u1+u0\Delta^2u_0=u_2-2u_1+u_0.
  3. Expand the right-hand side of the claimed formula, substituting y=1−xy=1-x.
  4. Match the coefficient of each uiu_i on both sides against Li(x)L_i(x).

Worked Example(s)

2017 Paper 2, 2017-P2-Q6b (15 marks)

For equidistant values u−1,u0,u1,u2u_{-1},u_0,u_1,u_2, show the Lagrange interpolant satisfies ux=yu0+xu1+y(y2−1)3!Δ2u−1+x(x2−1)3!Δ2u0u_x=yu_0+xu_1+\frac{y(y^2-1)}{3!}\Delta^2u_{-1}+\frac{x(x^2-1)}{3!}\Delta^2u_0 with x+y=1x+y=1.

Four equidistant nodes at −1,0,1,2-1,0,1,2; interpolate at argument xx (measured in spacing units from u0u_0); write y=1−xy=1-x.

Lagrange basis polynomials: L−1=−x(x−1)(x−2)6,L0=(x+1)(x−1)(x−2)2,L_{-1}=-\frac{x(x-1)(x-2)}{6},\quad L_0=\frac{(x+1)(x-1)(x-2)}{2}, L1=−(x+1)x(x−2)2,L2=(x+1)x(x−1)6.L_1=-\frac{(x+1)x(x-2)}{2},\quad L_2=\frac{(x+1)x(x-1)}{6}.

Coefficient of u−1u_{-1} in the claimed formula: y(y2−1)6=(1−x)(1−x2)6=(1−x)(−x)(2−x)6=−x(1−x)(x−2)6=L−1.  ✓\frac{y(y^2-1)}{6}=\frac{(1-x)(1-x^2)}{6}=\frac{(1-x)(-x)(2-x)}{6}=-\frac{x(1-x)(x-2)}{6}=L_{-1}.\;\checkmark

Coefficient of u2u_2: x(x2−1)6=x(x−1)(x+1)6=L2.  ✓\frac{x(x^2-1)}{6}=\frac{x(x-1)(x+1)}{6}=L_2.\;\checkmark

Coefficient of u0u_0: collect contributions from yy, the −2-2 in Δ2u−1\Delta^2u_{-1}, and the +1+1 in Δ2u0\Delta^2u_0: y−2y(y2−1)6+x(x2−1)6  →y=1−x  (x+1)(x−1)(x−2)2=L0.  ✓y-\frac{2y(y^2-1)}{6}+\frac{x(x^2-1)}{6}\;\xrightarrow[y=1-x]{}\;\frac{(x+1)(x-1)(x-2)}{2}=L_0.\;\checkmark

Coefficient of u1u_1: similarly equals L1L_1. ✓

Since all four coefficients match, the formula is the Lagrange polynomial. ■\blacksquare

Common Traps


confluent-interpolation (1 question(s); 2020)

Recognition Cues

Solution Template

  1. Write the three-node Lagrange basis polynomials on x0, x0+ϵ, x1x_0,\,x_0+\epsilon,\,x_1.
  2. Taylor-expand f(x0+ϵ)=f(x0)+ϵf′(x0)+O(ϵ2)f(x_0+\epsilon)=f(x_0)+\epsilon f'(x_0)+O(\epsilon^2).
  3. Group terms: the 1/ϵ1/\epsilon singularities from ℓ0\ell_0 and ℓ1\ell_1 cancel (they both multiply f(x0)f(x_0)); the ϵf′(x0)\epsilon f'(x_0) piece of ℓ1\ell_1 survives as a finite limit.
  4. Take ϵ→0\epsilon\to0 in each coefficient and in the node factor of the error term (x−x0)(x−x0−ϵ)(x−x1)→(x−x0)2(x−x1)(x-x_0)(x-x_0-\epsilon)(x-x_1)\to(x-x_0)^2(x-x_1).

Worked Example(s)

2020 Paper 2, 2020-P2-Q8b (15 marks)

Three-point Lagrange on x0x_0, x0+ϵx_0+\epsilon, x1x_1; take ϵ→0\epsilon\to0 to derive the stated formula with error E(x)=16(x−x0)2(x−x1)f′′′(ξ)E(x)=\tfrac16(x-x_0)^2(x-x_1)f'''(\xi).

Step 1 (three-node Lagrange). Basis: ℓ0=(x−x0−ϵ)(x−x1)(−ϵ)(x0−x1),ℓ1=(x−x0)(x−x1)ϵ(x0+ϵ−x1),ℓ2=(x−x0)(x−x0−ϵ)(x1−x0)(x1−x0−ϵ).\ell_0=\frac{(x-x_0-\epsilon)(x-x_1)}{(-\epsilon)(x_0-x_1)},\quad \ell_1=\frac{(x-x_0)(x-x_1)}{\epsilon(x_0+\epsilon-x_1)},\quad \ell_2=\frac{(x-x_0)(x-x_0-\epsilon)}{(x_1-x_0)(x_1-x_0-\epsilon)}.

Step 2 (Taylor expand). f(x0+ϵ)=f(x0)+ϵf′(x0)+O(ϵ2)f(x_0+\epsilon)=f(x_0)+\epsilon f'(x_0)+O(\epsilon^2).

Step 3 (group and limit). The f(x0)f(x_0) contributions from ℓ0\ell_0 and ℓ1\ell_1 are ℓ0f(x0)+ℓ1f(x0)\ell_0 f(x_0)+\ell_1 f(x_0); the 1/ϵ1/\epsilon pieces cancel. The surviving derivative term gives coefficient (x−x0)(x−x1)x0−x1\tfrac{(x-x_0)(x-x_1)}{x_0-x_1} for f′(x0)f'(x_0). The ℓ2\ell_2 coefficient converges to (x−x0)2(x1−x0)2\tfrac{(x-x_0)^2}{(x_1-x_0)^2}.

Taking ϵ→0\epsilon\to0: f(x)=(x1−x)(x+x1−2x0)(x1−x0)2f(x0)+(x−x0)(x−x1)x0−x1f′(x0)+(x−x0)2(x1−x0)2f(x1)+E(x).f(x)=\frac{(x_1-x)(x+x_1-2x_0)}{(x_1-x_0)^2}f(x_0)+\frac{(x-x_0)(x-x_1)}{x_0-x_1}f'(x_0)+\frac{(x-x_0)^2}{(x_1-x_0)^2}f(x_1)+E(x).

Step 4 (error). The three-node error is f′′′(ξ)6(x−x0)(x−x0−ϵ)(x−x1)\tfrac{f'''(\xi)}{6}(x-x_0)(x-x_0-\epsilon)(x-x_1); as ϵ→0\epsilon\to0 the node product becomes (x−x0)2(x−x1)(x-x_0)^2(x-x_1):   E(x)=16(x−x0)2(x−x1) f′′′(ξ).  \boxed{\;E(x)=\frac{1}{6}(x-x_0)^2(x-x_1)\,f'''(\xi).\;}

Verification: substituting f(t)=t2f(t)=t^2 (so f′′′=0f'''=0) should give exact reproduction — it does when the f′(x0)f'(x_0) coefficient carries the sign (x−x0)(x−x1)x0−x1\tfrac{(x-x_0)(x-x_1)}{x_0-x_1} (negative of what the printed paper states). The corrected sign has been verified.

Common Traps


divided-difference-interpolation (1 question(s); 2025)

Recognition Cues

Solution Template

  1. Build the divided-difference table: first-order f[xi,xi+1]=(fi+1−fi)/(xi+1−xi)f[x_i,x_{i+1}]=(f_{i+1}-f_i)/(x_{i+1}-x_i), then second-order f[x0,x1,x2]=(f[x1,x2]−f[x0,x1])/(x2−x0)f[x_0,x_1,x_2]=(f[x_1,x_2]-f[x_0,x_1])/(x_2-x_0), etc.
  2. Write Newton’s form: Pn(x)=f[x0]+f[x0,x1](x−x0)+f[x0,x1,x2](x−x0)(x−x1)+⋯P_n(x)=f[x_0]+f[x_0,x_1](x-x_0)+f[x_0,x_1,x_2](x-x_0)(x-x_1)+\cdots
  3. Expand and verify at all nodes.
  4. Error bound: ∣E(x)∣≤Mn+1(n+1)!∣ω(x)∣|E(x)|\le\tfrac{M_{n+1}}{(n+1)!}|\omega(x)|. Find max⁡∣ω∣\max|\omega| on the interval by setting ω′=0\omega'=0.

Worked Example(s)

2025 Paper 2, 2025-P2-Q7b (15 marks)

Find the unique polynomial of degree ≤2\le2 fitting x:0,1,3x:0,1,3; f:1,3,55f:1,3,55. Obtain the truncation-error bound.

Divided-difference table:

OrderValue
f[0]=1f[0]=1, f[1]=3f[1]=3, f[3]=55f[3]=55—
f[0,1]=(3−1)/1=2f[0,1]=(3-1)/1=2f[1,3]=(55−3)/2=26f[1,3]=(55-3)/2=26
f[0,1,3]=(26−2)/3=8f[0,1,3]=(26-2)/3=8—

Newton’s form: P2(x)=1+2(x−0)+8(x−0)(x−1)=1+2x+8x(x−1)=8x2−6x+1.P_2(x)=1+2(x-0)+8(x-0)(x-1)=1+2x+8x(x-1)=\boxed{8x^2-6x+1.}

Check: P2(0)=1P_2(0)=1 ✓, P2(1)=3P_2(1)=3 ✓, P2(3)=72−18+1=55P_2(3)=72-18+1=55 ✓.

Error bound. For 3-node interpolation: E(x)=f′′′(ξ)6 ω(x),ω(x)=x(x−1)(x−3).E(x)=\frac{f'''(\xi)}{6}\,\omega(x),\qquad \omega(x)=x(x-1)(x-3). Find max⁡∣ω∣\max|\omega| on [0,3][0,3]: set ω′(x)=3x2−8x+3=0\omega'(x)=3x^2-8x+3=0, giving x=(4±7)/3x=(4\pm\sqrt7)/3. At the interior critical points: max⁡[0,3]∣ω∣=∣ω ⁣(4+73)∣≈2.1126.\max_{[0,3]}|\omega|=\left|\omega\!\left(\tfrac{4+\sqrt7}{3}\right)\right|\approx2.1126.

∣E(x)∣≤M36⋅2.1126≈0.3521 M3,M3=max⁡[0,3]∣f′′′∣.|E(x)|\le\frac{M_3}{6}\cdot2.1126\approx0.3521\,M_3,\qquad M_3=\max_{[0,3]}|f'''|.

Common Traps


Marks-Aware Writing

20-mark questions (2015, 2016): Expect to write out all four basis polynomials explicitly, evaluate each at the target point, and assemble the sum. For the error question (2016): derive f(4)f^{(4)} symbolically, bound it by recognising the amplitude form A⋅e2xA\cdot e^{2x}, then give both the pointwise and interval bounds.

15-mark questions (2017, 2020, 2025): Structure matters more than computation. For the form-proof (2017): verify each coefficient in sequence — that is the whole proof. For the confluent limit (2020): a clear description of the ϵ→0\epsilon\to0 mechanism (singularities cancel because both multiply f(x0)f(x_0)) is worth as many marks as the final formula. For divided differences (2025): write the difference table explicitly; the Newton polynomial and error bound follow mechanically.

Practice Set

YearPaper/QMarksArchetypeOne-line hint
2016P2-Q6c20lagrange-with-error1202+1192=169\sqrt{120^2+119^2}=169 gives the amplitude of f(4)f^{(4)}; bound ≤169e2\le169e^2 on [0,1][0,1]; pointwise $
2020P2-Q8b15confluent-interpolation1/ϵ1/\epsilon terms from ℓ0,ℓ1\ell_0,\ell_1 cancel; the surviving limit is the f′(x0)f'(x_0) coefficient

Ready to drill what you just read?

Daily Practice turns these patterns into one adaptive set a day — practised daily until they're automatic, free for everyone.

See Daily Practice →

This chapter is part of the Maths Coverage Map — 14 years, mapped. Get the take-away PDF free.