maths2u
Tier
⌕ Search ⌘K
Theorem

Lagrange interpolation and its error

T-116Home MU-308Threads change
Statement

Let \(x_0, x_1, \ldots, x_n\) be \(n+1\) distinct real nodes lying in an interval \([a,b]\), and let \(y_0, y_1, \ldots, y_n \in \mathbb{R}\) be prescribed values (typically \(y_i = f(x_i)\) for some function \(f\)). Then there exists a unique polynomial \(p \in \mathbb{R}[x]\) of degree \(\le n\) such that \(p(x_i) = y_i\) for \(i = 0, 1, \ldots, n\); it is given explicitly by the Lagrange interpolation formula \(p(x) = \sum_{i=0}^{n} y_i L_i(x)\), where \(L_i(x) = \prod_{j=0, j \ne i}^{n} \frac{x - x_j}{x_i - x_j}\). If in addition \(y_i = f(x_i)\) for a function \(f\) that is \(n+1\) times differentiable on an interval \(I \supseteq \{x_0,\ldots,x_n,x\}\), then for every \(x \in I\) there exists \(\xi = \xi(x)\) lying strictly between the smallest and largest of \(x_0,\ldots,x_n,x\) such that \(f(x) - p(x) = \frac{f^{(n+1)}(\xi)}{(n+1)!} \prod_{i=0}^{n} (x - x_i)\).

Why it matters

Interpolation is the basic device by which numerical analysis replaces an inconvenient function (given only by samples, or expensive to evaluate) with a polynomial that can be differentiated, integrated, or evaluated cheaply. Lagrange's formula is the cleanest possible closed form for the interpolant and it settles existence and uniqueness in one stroke; almost every other interpolation scheme (Newton's divided differences, Hermite interpolation, spline theory, quadrature rule derivations) either derives from it or must reprove the same uniqueness fact.

The error formula is what turns interpolation from a bookkeeping exercise into a numerical tool: it tells you, in terms of a derivative bound and the geometry of the nodes, exactly how far the interpolant can be trusted. It is the ancestor of the error analysis behind Newton–Cotes quadrature, the trapezoidal and Simpson's rules, and finite-difference formulas for derivatives.

Hypotheses
The nodes \(x_0,\ldots,x_n\) are pairwise distinct. If two nodes coincide, say \(x_0 = x_1\) with \(y_0 \ne y_1\), no polynomial can satisfy both \(p(x_0)=y_0\) and \(p(x_1)=y_1\) simultaneously — existence fails outright. If \(y_0 = y_1\) the system becomes degenerate and uniqueness fails: e.g. with nodes \(0,0,1\) and values \(0,0,1\), both \(p(x)=x\) and \(p(x)=x^2\) interpolate.
The interpolant is restricted to degree \(\le n\) (i.e. at most \(n+1\) coefficients for \(n+1\) conditions). Without this cap, uniqueness is meaningless: given nodes \(0,1\) and values \(0,1\), both \(p(x)=x\) (degree 1) and \(p(x) = x + x(x-1)\) (degree 2) interpolate. Uniqueness is a statement about the smallest-dimensional polynomial space that can possibly work.
For the error formula: \(f\) is \(n+1\) times differentiable on an interval containing all the nodes and the evaluation point \(x\). If \(f^{(n+1)}\) fails to exist somewhere in that interval — e.g. \(f(x)=|x|^{3}\) sign-adjusted to be non-smooth, or more simply \(f(x) = |x|\) with \(n=0\) — the Rolle's-theorem chain in the proof cannot be run, and no such \(\xi\) need exist; the error can fail to have this closed form entirely (only a weaker, non-pointwise bound survives, or none at all).
The point \(x\) at which the error is evaluated, together with the nodes, lies in a single interval on which \(f\) is \(C^{n+1}\); no assumption is made that \(x\) itself is between the nodes. Students often assume \(\xi\) lies strictly inside the convex hull of the nodes only when \(x\) is an interpolation point (interpolation, not extrapolation); the theorem in fact allows \(x\) outside the node span (extrapolation), with \(\xi\) then lying in the interval spanned by \(\{x_0,\ldots,x_n,x\}\), which is larger. Extrapolation error bounds are consequently much less trustworthy because \(\xi\) ranges over a wider set and \(\prod(x-x_i)\) grows rapidly outside the node span.
Proof
1
\text{Define } L_i(x) = \prod_{j=0, j\ne i}^{n} \frac{x-x_j}{x_i - x_j}, \qquad i = 0,\ldots,n.
Well-defined because the nodes are distinct, so every denominator \(x_i - x_j \ne 0\) for \(j \ne i\); this uses the hypothesis directly. A
2
L_i(x_k) = \delta_{ik} = \begin{cases} 1 & k=i \\ 0 & k \ne i \end{cases}
If \(k \ne i\), the factor \((x-x_k)\) appears in the numerator product of \(L_i\), so \(L_i(x_k)=0\); if \(k=i\), every factor in the product is \(\frac{x_i-x_j}{x_i-x_j}=1\). Immediate from the definition in Step 1. A
3
p(x) := \sum_{i=0}^{n} y_i L_i(x) \quad \text{satisfies} \quad p(x_k) = \sum_{i=0}^n y_i \delta_{ik} = y_k \text{ for all } k.
Substitute Step 2 into the sum; only the \(i=k\) term survives. This proves existence of an interpolating polynomial of degree \(\le n\) (each \(L_i\) is a product of \(n\) linear factors, hence degree \(n\), so \(p\) has degree \(\le n\)). B
4
\text{Suppose } p, q \in \mathbb{R}[x], \deg p \le n, \deg q \le n, \text{ and } p(x_i)=q(x_i)=y_i \text{ for } i=0,\ldots,n. \text{ Let } r = p-q.
\(r\) is a well-defined polynomial since \(\mathbb{R}[x]\) is closed under subtraction, and \(\deg r \le \max(\deg p,\deg q) \le n\). A
5
r(x_0) = r(x_1) = \cdots = r(x_n) = 0, \text{ i.e. } r \text{ has } n+1 \text{ distinct roots, yet } \deg r \le n \implies r \equiv 0.
The Factor Theorem: a nonzero polynomial of degree \(m\) over a field has at most \(m\) roots (each root contributes an irreducible factor \((x-x_i)\), and \(\mathbb{R}[x]\) is a UFD, so \(n+1\) distinct linear factors would force \(\deg r \ge n+1\) unless \(r\equiv0\)). Hence \(p=q\): the interpolant of degree \(\le n\) is unique. This closes the Statement's existence-and-uniqueness claim. B
6
\text{Fix } x \in I \text{ with } x \notin \{x_0,\ldots,x_n\} \text{ (the case } x=x_k \text{ is trivial: both sides are } 0\text{). Let } w(t) = \prod_{i=0}^n (t-x_i), \text{ and define } K \text{ by } f(x) - p(x) = K\, w(x).
\(w(x) \ne 0\) since \(x\) is not a node, so \(K = \dfrac{f(x)-p(x)}{w(x)}\) is a well-defined real number; this is just solving one linear equation in the unknown \(K\). B
7
\text{Define } \varphi(t) = f(t) - p(t) - K\,w(t), \qquad t \in I.
\(\varphi\) is \((n+1)\)-times differentiable on \(I\) because \(f\) is (by hypothesis), and \(p, w\) are polynomials, hence \(C^\infty\); differentiability is preserved under finite linear combinations. B
8
\varphi(x_0) = \varphi(x_1) = \cdots = \varphi(x_n) = \varphi(x) = 0: \quad n+2 \text{ distinct zeros of } \varphi \text{ in } I.
At each node \(x_k\): \(f(x_k)-p(x_k)=0\) by the interpolation property (Step 3) and \(w(x_k)=0\) by definition of \(w\), so \(\varphi(x_k)=0-K\cdot 0=0\). At \(t=x\): \(\varphi(x)=f(x)-p(x)-K\,w(x)=0\) by the very choice of \(K\) in Step 6. B
9
\varphi' \text{ has at least } n+1 \text{ distinct zeros in the open interval spanned by these } n+2 \text{ points}.
Rolle's Theorem: if \(g\) is continuous on \([\alpha,\beta]\), differentiable on \((\alpha,\beta)\), and \(g(\alpha)=g(\beta)\), then \(g'(c)=0\) for some \(c\in(\alpha,\beta)\). Order the \(n+2\) zeros of \(\varphi\) from Step 8 and apply Rolle to each of the \(n+1\) consecutive pairs; this is legitimate since \(\varphi\) is differentiable on all of \(I\) by Step 7. C
10
\text{Iterating: } \varphi^{(n+1)} \text{ has at least one zero } \xi \text{ in the open interval spanned by } \{x_0,\ldots,x_n,x\}.
Induction on \(k=0,1,\ldots,n\): if \(\varphi^{(k)}\) has \(m\) distinct zeros in an interval, Rolle's Theorem applied to consecutive pairs gives \(\varphi^{(k+1)}\) at least \(m-1\) distinct zeros in the same span (each application requires \(\varphi^{(k)}\) differentiable, guaranteed by Step 7 since \(k\le n\)). Starting from \(m=n+2\) zeros of \(\varphi^{(0)}=\varphi\) and applying this \(n+1\) times leaves at least \(1\) zero of \(\varphi^{(n+1)}\). C
11
0 = \varphi^{(n+1)}(\xi) = f^{(n+1)}(\xi) - p^{(n+1)}(\xi) - K\, w^{(n+1)}(\xi) = f^{(n+1)}(\xi) - 0 - K\,(n+1)!
\(p\) has degree \(\le n\) so its \((n+1)\)-th derivative vanishes identically; \(w(t)=\prod_{i=0}^n(t-x_i)\) is monic of degree \(n+1\), and differentiating a monic degree-\((n+1)\) polynomial \(n+1\) times gives the constant \((n+1)!\) (leading term \(t^{n+1}\) differentiated \(n+1\) times is \((n+1)!\), all lower-degree terms vanish). Substitute \(t=\xi\) from Step 10. C
12
K = \frac{f^{(n+1)}(\xi)}{(n+1)!} \quad\Longrightarrow\quad f(x)-p(x) = \frac{f^{(n+1)}(\xi)}{(n+1)!}\, w(x) = \frac{f^{(n+1)}(\xi)}{(n+1)!}\prod_{i=0}^{n}(x-x_i).
Solve Step 11 for \(K\) (legal since \((n+1)!\ne 0\)) and substitute into the defining relation of Step 6, \(f(x)-p(x)=K\,w(x)\). This is exactly the claimed error formula, valid at the chosen \(x\); the case \(x=x_k\) noted in Step 6 makes both sides \(0\), so the formula holds for all \(x\in I\) with some (possibly node-dependent) \(\xi\). B
Result
f(x) - p(x) = \frac{f^{(n+1)}(\xi)}{(n+1)!}\prod_{i=0}^{n}(x-x_i), \qquad p(x)=\sum_{i=0}^n f(x_i)\prod_{j\ne i}\frac{x-x_j}{x_i-x_j}

Reading. The unique degree-\(\le n\) polynomial through \(n+1\) distinct data points can be written down explicitly as a weighted sum of the basis polynomials \(L_i\), each of which is \(1\) at its own node and \(0\) at every other node. The gap between the true function and this polynomial, at any point \(x\), is controlled by the \((n+1)\)-th derivative of \(f\) evaluated at some unknown but existent point \(\xi\), multiplied by the "node polynomial" \(\prod(x-x_i)\), which vanishes at the nodes and grows the further \(x\) is from them.

Scope. Existence and uniqueness require only that the nodes be distinct and hold over any field (in particular \(\mathbb{C}\), or a finite field, with no differentiability needed). The error formula requires \(f \in C^{n+1}\) on an interval containing all nodes and \(x\); it is a real-variable, Rolle-based result and does not extend verbatim to complex \(f\) (the complex analogue uses contour integration, e.g. via the Hermite/Cauchy integral remainder, and is a genuinely different proof).

Corollaries & converses
  • If \(f\) is itself a polynomial of degree \(\le n\), then \(f^{(n+1)}\equiv 0\), so the error formula gives \(f(x)-p(x)=0\) for all \(x\): Lagrange interpolation reproduces polynomials of degree \(\le n\) exactly. This is the standard sanity check on any interpolation-based numerical scheme (exactness degree).
  • If \(|f^{(n+1)}(t)| \le M\) for all \(t\) in the relevant interval, then \(|f(x)-p(x)| \le \dfrac{M}{(n+1)!}\left|\prod_{i=0}^n (x-x_i)\right|\), a genuinely usable a priori error bound not requiring knowledge of \(\xi\).
  • Converse direction: knowing only that \(p\) interpolates \(f\) at \(n+1\) points does not let you recover \(f^{(n+1)}\) or deduce smoothness of \(f\) beyond the nodes — the theorem is one-directional (smoothness \(\Rightarrow\) error formula), and no converse statement of the form "a small interpolation error at these nodes implies \(f\) is smooth" holds; one can build a wildly non-smooth \(f\) agreeing with a smooth \(p\) at finitely many points.
  • Taking \(n=0\) recovers the Mean Value Theorem in disguise: \(p(x)=f(x_0)\) (constant), and the formula reads \(f(x)-f(x_0) = f'(\xi)(x-x_0)\), which is exactly the MVT. The interpolation error theorem is thus a genuine generalisation of the MVT.
Fails without
  • Distinct nodes dropped: nodes \(x_0=x_1=0\), \(x_2=1\) with values \(y_0=0, y_1=1, y_2=2\). The two conditions at \(x=0\) are contradictory (\(p(0)\) cannot equal both \(0\) and \(1\)); no degree-\(\le 2\) interpolant exists at all, and the Lagrange formula's denominators \(x_i-x_j\) divide by zero.
  • Differentiability dropped (error formula): take \(n=1\), nodes \(x_0=-1,x_1=1\), and \(f(x)=|x|\), which is continuous but not differentiable at \(0\), so certainly not \(C^2\) on \([-1,1]\). The linear interpolant is \(p(x)=1\) (since \(f(-1)=f(1)=1\)); at \(x=0\), \(f(0)-p(0) = 0-1=-1\). The claimed formula would require \(-1 = \frac{f''(\xi)}{2}(0-(-1))(0-1) = -\frac{f''(\xi)}{2}\), i.e. \(f''(\xi)=2\) for some \(\xi\in(-1,1)\) — but \(f''(t)=0\) wherever it exists (\(t\ne0\)) and does not exist at \(t=0\); no such \(\xi\) exists, and the formula's guarantee simply fails, exactly as the hypothesis warns.
  • Degree bound dropped: nodes \(0,1\) with values \(0,1\). Both \(p_1(x)=x\) and \(p_2(x)=x+x(x-1)(x-2)\) agree with the data at \(x=0,1\), but \(p_1\ne p_2\) (they disagree at \(x=3\)); uniqueness is meaningless once the degree cap \(\le n\) is removed, since infinitely many higher-degree polynomials pass through any finite point set.
Common errors
  • Believing the error bound \(\frac{M}{(n+1)!}\max|\prod(x-x_i)|\) applies uniformly well as \(n\) grows — ignoring that \(M=\sup|f^{(n+1)}|\) can itself grow faster than \((n+1)!\) shrinks (Runge's phenomenon), so blindly adding more equally-spaced nodes can increase, not decrease, the actual error.
  • Quoting the error formula with a specific numerical value for \(\xi\) (e.g. "\(\xi\) is the midpoint") — \(\xi\) is merely known to exist somewhere in the spanning interval; its location is generally uncomputable without already knowing \(f(x)\) exactly.
  • Applying the formula for \(x\) outside the convex hull of the nodes (extrapolation) while still using a derivative bound \(M\) estimated only on the node interval — the theorem requires \(f\in C^{n+1}\) on an interval containing \(x\) too, and \(\prod(x-x_i)\) can be huge outside the node span.
  • Confusing the interpolating polynomial \(p\) with a Taylor polynomial of \(f\) — they coincide only in the degenerate limit where all nodes merge to a single point; for distinct nodes the two constructions and their error terms are different objects (compare the Lagrange remainder above with the Taylor/Lagrange remainder of a Taylor series, which uses only one base point).
  • Forgetting that the Lagrange basis polynomials \(L_i\) depend on the full node set, so recomputing them from scratch is required whenever a single node is added or moved — an efficiency error, not a correctness one, but a very common practical mistake motivating Newton's divided-difference form.
Discussion

The formula is named for Joseph-Louis Lagrange, who published it in 1795, though it was known earlier to Edward Waring (1779) and to Euler; the underlying idea — building a basis of "indicator" functions equal to \(1\) at one node and \(0\) at the rest — recurs throughout mathematics, from finite-element shape functions to the Chinese Remainder Theorem (which is the same construction over \(\mathbb{Z}/m\mathbb{Z}\) instead of \(\mathbb{R}[x]\)).

Practically, the Lagrange form is elegant for theory but poor for computation: adding one new node forces recomputation of every \(L_i\) from scratch, and the formula is numerically less stable than Newton's divided-difference representation of the very same unique polynomial. The theorem's true computational content is uniqueness — different algorithms (Lagrange, Newton, Neville) construct the identical polynomial by Step 4–5 of the proof, so a numerically better algorithm can always be substituted without changing the answer.

The error formula is the ancestor of an entire family of remainder theorems obtained by the same "insert an auxiliary function and apply Rolle repeatedly" technique: the Lagrange form of the Taylor remainder, the error term in linear/quadratic interpolation used to derive the trapezoidal and Simpson quadrature errors, and error bounds for finite-difference approximations to derivatives all reuse this exact proof skeleton with a different auxiliary function \(\varphi\).

A subtlety often missed at degree level: the existence of \(\xi\) is non-constructive and the map \(x\mapsto \xi(x)\) need not be continuous or even measurable in general; it is merely guaranteed to exist pointwise by Rolle's theorem for each fixed \(x\). This is why the error formula is used almost exclusively through the derived bound \(|f(x)-p(x)|\le \frac{M}{(n+1)!}|\prod(x-x_i)|\) rather than through \(\xi\) itself — the bound only needs the existence, not any regularity, of \(\xi\).

Common misconception: that Lagrange interpolation with more nodes is always more accurate. Runge's phenomenon (large oscillations for high-degree interpolation on equally spaced nodes, e.g. for \(f(x)=\frac{1}{1+25x^2}\) on \([-1,1]\)) shows the error can diverge as \(n\to\infty\) even for a smooth \(f\), because \(\sup|f^{(n+1)}|\) or the node polynomial's maximum can outpace \(\frac{1}{(n+1)!}\); the fix is node clustering (e.g. Chebyshev nodes), not merely more nodes.

Worked examples
1
\text{Interpolate } f \text{ at nodes } x_0=0, x_1=1, x_2=2 \text{ with values } f(0)=1, f(1)=2, f(2)=5.
Set-up: apply the Lagrange formula with \(n=2\). A
2
L_0(x)=\frac{(x-1)(x-2)}{(0-1)(0-2)}=\frac{(x-1)(x-2)}{2}, \quad L_1(x)=\frac{(x-0)(x-2)}{(1-0)(1-2)}=-x(x-2), \quad L_2(x)=\frac{x(x-1)}{(2-0)(2-1)}=\frac{x(x-1)}{2}
Direct substitution into \(L_i(x)=\prod_{j\ne i}\frac{x-x_j}{x_i-x_j}\) from Step 1 of the Proof. A
3
p(x) = 1\cdot L_0(x) + 2\cdot L_1(x) + 5\cdot L_2(x) = \frac{(x-1)(x-2)}{2} -2x(x-2) + \frac{5x(x-1)}{2}
Direct substitution into \(p=\sum y_i L_i\) from Step 3 of the Proof. A
4
p(x) = \tfrac12(x^2-3x+2) - 2(x^2-2x) + \tfrac52(x^2-x) = \left(\tfrac12-2+\tfrac52\right)x^2 + \left(-\tfrac32+4-\tfrac52\right)x + 1 = x^2 + 0\cdot x + 1 = x^2+1
Elementary algebraic expansion and collection of like powers of \(x\). A
p(x) = x^2+1

Reading. Check: \(p(0)=1,p(1)=2,p(2)=5\) — matches the data exactly, and indeed the data was generated by \(f(x)=x^2+1\), so the quadratic interpolant recovers \(f\) exactly, consistent with the exactness corollary (\(f^{(3)}\equiv0\) here).

1
\text{Bound the error of linear interpolation of } f(x)=\ln x \text{ at } x_0=1, x_1=2, \text{ evaluated at } x=1.5.
Set-up: \(n=1\), so the error formula involves \(f''\). A
2
p(x) = f(1)\frac{x-2}{1-2} + f(2)\frac{x-1}{2-1} = 0\cdot(2-x) + \ln 2\,(x-1)
Lagrange formula with \(y_0=\ln1=0, y_1=\ln2\). A
3
p(1.5) = \ln 2 \cdot 0.5 \approx 0.34657
Direct evaluation of the linear formula from Step 2 at \(x=1.5\). A
4
f''(t) = -\frac{1}{t^2}, \qquad \sup_{t\in[1,2]}|f''(t)| = |f''(1)| = 1 =: M
\(f(x)=\ln x\) is smooth (\(C^\infty\)) on \([1,2]\), satisfying the differentiability hypothesis; \(|f''(t)|=1/t^2\) is decreasing on \([1,2]\), so its supremum is attained at \(t=1\). B
5
|f(1.5)-p(1.5)| \le \frac{M}{2!}\,|(1.5-1)(1.5-2)| = \frac{1}{2}\cdot 0.25 = 0.125
Apply the a priori bound corollary \(|f(x)-p(x)|\le \frac{M}{(n+1)!}|\prod(x-x_i)|\), which follows from the Result by bounding \(|f^{(n+1)}(\xi)|\le M\). B
|\ln(1.5) - p(1.5)| \le 0.125

Reading. The true value is \(\ln 1.5 \approx 0.405465\), so the actual error is \(|0.405465-0.346574|\approx0.0589\), comfortably inside the guaranteed bound of \(0.125\) — the bound is an upper limit, not a tight estimate, exactly as the theorem promises.

Problems
  1. Find the Lagrange interpolating polynomial through \((0,1), (1,0), (2,1)\).
    Solution \(L_0(x)=\frac{(x-1)(x-2)}{2}\), \(L_1(x)=-x(x-2)\), \(L_2(x)=\frac{x(x-1)}{2}\) (same nodes as Worked Example 1). Then \(p(x) = 1\cdot L_0(x)+0\cdot L_1(x)+1\cdot L_2(x) = \frac{(x-1)(x-2)}{2}+\frac{x(x-1)}{2} = \frac{(x-1)}{2}\left[(x-2)+x\right] = \frac{(x-1)(2x-2)}{2}=(x-1)^2\). Check: \(p(0)=1,p(1)=0,p(2)=1\). Correct.
  2. Prove directly (without citing the general theorem) that two distinct polynomials of degree \(\le 1\) cannot both pass through two distinct given points.
    Solution Let \(p(x)=ax+b\), \(q(x)=cx+d\) both satisfy \(p(x_0)=q(x_0)=y_0\), \(p(x_1)=q(x_1)=y_1\) with \(x_0\ne x_1\). Then \(r=p-q=(a-c)x+(b-d)\) satisfies \(r(x_0)=r(x_1)=0\). If \(a\ne c\), \(r\) is a nonconstant linear function with a unique root, so it cannot vanish at two distinct points \(x_0\ne x_1\) — contradiction. Hence \(a=c\); substituting into \(r(x_0)=0\) gives \(b=d\). So \(p\equiv q\). This is the \(n=1\) case of Proof Steps 4–5.
  3. Let \(f(x)=e^x\) be interpolated at \(x_0=0,x_1=1\) by a linear polynomial \(p\). Give an upper bound for \(|f(x)-p(x)|\) on \([0,1]\), and state at which \(x\in[0,1]\) the bound \(\left|\frac{(x-0)(x-1)}{2}\right|\) is largest.
    Solution Here \(n=1\), \(f''(t)=e^t\), and on \([0,1]\), \(\sup|f''|=e^1=e\) (since \(e^t\) is increasing). The error bound is \(|f(x)-p(x)| \le \frac{e}{2}|x(x-1)|\). The function \(g(x)=|x(x-1)|=x-x^2\) on \([0,1]\) (nonnegative there since roots are \(0,1\)) is maximised where \(g'(x)=1-2x=0\), i.e. \(x=1/2\), giving \(g(1/2)=1/4\). So the bound is largest, \(\frac{e}{8}\approx0.340\), at the midpoint \(x=1/2\) — errors from linear interpolation are typically worst near the middle of the interval, not at the endpoints (where the bound is exactly \(0\)).
  4. Explain why, for \(n=0\) (a single node \(x_0\), constant interpolant \(p(x)=f(x_0)\)), the Lagrange error formula reduces exactly to the Mean Value Theorem, and verify this reduction algebraically.
    Solution With \(n=0\): \(p(x)=f(x_0)\) constant, \(w(x)=(x-x_0)\), and the error formula gives \(f(x)-f(x_0) = \frac{f'(\xi)}{1!}(x-x_0)=f'(\xi)(x-x_0)\) for some \(\xi\) strictly between \(x_0\) and \(x\). Rearranged, \(f'(\xi)=\frac{f(x)-f(x_0)}{x-x_0}\), which is precisely the conclusion of the Mean Value Theorem applied to \(f\) on the interval between \(x_0\) and \(x\). The general proof (Steps 6–12) with \(n=0\) collapses to: \(\varphi(t)=f(t)-f(x_0)-K(t-x_0)\), \(\varphi(x_0)=\varphi(x)=0\), one application of Rolle's theorem gives \(\varphi'(\xi)=0\), i.e. \(f'(\xi)=K\) — exactly the standard MVT proof.
  5. Nodes \(x_0=-1,x_1=0,x_2=1\) interpolate \(f(x)=\cos x\). Using the error formula, find a bound on \(|f(x)-p(x)|\) valid for all \(x\in[-1,1]\), and comment on whether the bound is small enough to be useful (compare to the trivial bound \(|f(x)-p(x)|\le|f(x)|+|p(x)|\), not asked to compute, just to reflect on order of magnitude).
    Solution Here \(n=2\), so we need \(f^{(3)}(t)=\sin t\), and \(\sup_{t\in[-1,1]}|\sin t| = \sin 1 \approx 0.8415 =: M\) (since \(|\sin t|\) is increasing on \([0,1]\) and odd, its max magnitude on \([-1,1]\) is at the endpoints). The node polynomial is \(w(x)=(x+1)x(x-1)=x^3-x\); on \([-1,1]\), \(\max|w(x)|\) occurs (by calculus, \(w'(x)=3x^2-1=0 \Rightarrow x=\pm1/\sqrt3\)) at \(x=1/\sqrt3\), giving \(|w(1/\sqrt3)| = \left|\frac{1}{3\sqrt3}-\frac{1}{\sqrt3}\right| = \frac{2}{3\sqrt3}\approx0.3849\). So the bound is \(|f(x)-p(x)| \le \frac{0.8415}{3!}\times0.3849 \approx \frac{0.8415}{6}\times0.3849\approx0.0540\). This is a useful bound (much smaller than \(|\cos x|\le1\) itself), showing quadratic interpolation of \(\cos x\) on three equally spaced points in \([-1,1]\) already achieves roughly two-decimal-place accuracy.