13.3 Numerical Analysis: Error, Root Finding, Interpolation, and Quadrature

Key Takeaways

  • Absolute error measures |x - x-hat|, relative error divides by a nonzero reference magnitude, and conditioning describes how input error is amplified by the mathematical problem.
  • Bisection is slow but guaranteed for a continuous sign-changing bracket; Newton's method is usually fast near a simple root but requires derivative and convergence checks.
  • A unique polynomial of degree at most n interpolates n+1 distinct data points, but high-degree interpolation and clustered nodes can amplify error.
  • Composite trapezoidal and Simpson rules trade function evaluations for predictable error orders; Simpson's rule requires an even number of equal subintervals.
Last updated: September 2026

13.3 Numerical Analysis: Error, Root Finding, Interpolation, and Quadrature

Numerical analysis replaces an exact symbolic answer with a controlled approximation. A complete numerical result includes a method, a stopping rule, and an error statement.


Error, stability, and conditioning

If $x$ is exact and $\hat x$ is approximate, absolute error is $|x-\hat x|$ and relative error is $|x-\hat x|/|x|$ when $x\ne0$. Decimal rounding to $p$ places produces absolute error at most half a unit in the last retained place.

Conditioning belongs to the problem: it measures how sensitively the exact output responds to small input changes. For differentiable $f$, a local relative condition number is approximately κf(x)=∣xf′(x)f(x)∣.\kappa_f(x)=\left|\frac{x f'(x)}{f(x)}\right|. Stability belongs to an algorithm: a stable method does not introduce much more error than the underlying data uncertainty. Subtracting nearly equal floating-point numbers can cause catastrophic cancellation because leading significant digits disappear.


Bracketing and root-finding methods

If $f$ is continuous on $[a,b]$ and $f(a)f(b)<0$, the Intermediate Value Theorem guarantees a root in $(a,b)$. Bisection replaces the endpoint having the same sign as midpoint $m=(a+b)/2$. After $n$ bisections, the bracket width is $(b-a)/2^n$, and the midpoint error is at most $(b-a)/2^{n+1}$. Bisection converges linearly but cannot lose a valid sign-changing bracket.

Newton's method uses the tangent-line approximation: xn+1=xn−f(xn)f′(xn).x_{n+1}=x_n-\frac{f(x_n)}{f'(x_n)}. Near a simple root and under standard smoothness assumptions, convergence is quadratic: roughly speaking, the number of correct digits doubles. It can fail when $f'(x_n)=0$, when an iterate leaves the useful region, or when the initial guess is poor. For a root of multiplicity $m>1$, ordinary Newton convergence drops to linear; the modified step xn+1=xn−mf(xn)f′(xn)x_{n+1}=x_n-m\frac{f(x_n)}{f'(x_n)} restores quadratic local convergence when $m$ is known.

The secant method replaces the derivative by a difference quotient: xn+1=xn−f(xn)xn−xn−1f(xn)−f(xn−1).x_{n+1}=x_n-f(x_n)\frac{x_n-x_{n-1}}{f(x_n)-f(x_{n-1})}. It uses no derivative and is typically faster than bisection, but it lacks bisection's bracket guarantee.

Worked root example

To approximate $\sqrt2$, apply Newton to $f(x)=x^2-2$: xn+1=12(xn+2xn).x_{n+1}=\frac12\left(x_n+\frac{2}{x_n}\right). Starting with $x_0=1.5$ gives $x_1=17/12\approx1.416667$ and $x_2\approx1.414216$, already accurate to about five decimal places.


Polynomial interpolation and finite differences

Given distinct nodes $x_0,\ldots,x_n$ and values $y_i$, there is a unique polynomial of degree at most $n$ satisfying $p(x_i)=y_i$. Lagrange form is

L_i(x)=\prod_{j\ne i}\frac{x-x_j}{x_i-x_j}.$$ If $f$ has $n+1$ derivatives, interpolation error is $$f(x)-p(x)=\frac{f^{(n+1)}(\xi)}{(n+1)!}\prod_{i=0}^n(x-x_i)$$ for some $\xi$ in the interval containing the nodes and $x$. For equally spaced nodes with spacing $h$, forward difference $$f'(x)\approx\frac{f(x+h)-f(x)}{h}$$ has first-order truncation error, while the centered difference $$f'(x)\approx\frac{f(x+h)-f(x-h)}{2h}$$ has second-order truncation error. Making $h$ extremely small is not always better: rounding and cancellation eventually dominate truncation error. --- ## Numerical quadrature For $n$ equal subintervals of width $h=(b-a)/n$, the composite trapezoidal rule is $$T_n=h\left[\frac{f(a)+f(b)}2+\sum_{i=1}^{n-1}f(a+ih)\right].$$ For twice continuously differentiable $f$, its global error is order $h^2$. Composite Simpson's rule requires even $n$: $$S_n=\frac h3\left[f(x_0)+f(x_n)+4\sum_{i\text{ odd}}f(x_i)+2\sum_{i\text{ even},\,0<i<n}f(x_i)\right].$$ For four-times continuously differentiable $f$, its global error is order $h^4$. Simpson's rule is exact for every polynomial of degree at most 3; the trapezoidal rule is exact for every polynomial of degree at most 1. ### Worked quadrature example Approximate $\int_0^2 x^2\,dx$ using Simpson's rule with $n=2$, so $h=1$: $$S_2=\frac13[f(0)+4f(1)+f(2)] =\frac13(0+4+4)=\frac83.$$ This equals the exact integral because $x^2$ has degree below 4. --- ## Common traps A small residual $|f(\hat x)|$ does not always mean a small root error when the problem is ill-conditioned. Newton's formula is undefined at a zero derivative and is not globally guaranteed. Interpolation nodes must be distinct. Composite Simpson's rule needs equal spacing and even $n$. Finally, reducing a step size lowers truncation error only until floating-point rounding begins to dominate.
Loading diagram...
Root-Finding Method Selection
Test Your Knowledge

A bisection method starts with a sign-changing interval of width 8. After 5 bisections, what is the maximum error of the midpoint approximation?

A
B
C
D
Test Your Knowledge

Starting from x_0 = 2, what is the first Newton iterate for solving x^2 - 3 = 0?

A
B
C
D
Test Your Knowledge

Which statement about the composite Simpson rule is correct?

A
B
C
D