Skip to content

Numerical Integration

When we need to evaluate ∫abf(x) dx\int_a^b f(x)\,dx, an exact antiderivative is not always available. The function may be known only at a discrete set of measured data points, or its antiderivative may be too complicated to express in closed form. Numerical integration (also called quadrature) solves this by approximating f(x)f(x) with a polynomial Pn(x)P_n(x) that passes through selected nodes on the interval and integrating that polynomial instead.

This chapter develops the two most widely used Newton-Cotes rules: the Trapezoidal Rule (which fits a straight line through two nodes) and Simpson’s Rule (which fits a parabola through three nodes). Both rules are derived rigorously from Lagrange interpolation, so their weights fall out naturally rather than being stated without justification. We also study the Composite Trapezoidal Rule, which subdivides the interval and applies the basic rule on each sub-interval to achieve better accuracy.


Learning Objectives

By the end of this chapter you should be able to:

  1. Explain how replacing f(x)f(x) with a Lagrange polynomial Pn(x)P_n(x) converts a definite integral into a weighted sum of function values.
  2. Define the Newton-Cotes weights σk=∫ablk(x) dx\sigma_k = \int_a^b l_k(x)\,dx and state what they represent geometrically.
  3. Distinguish between the closed Newton-Cotes formulas (which include the endpoints aa and bb) and the open forms (which exclude them), and state the step size formula for each.
  4. Derive the Trapezoidal Rule by computing σ0\sigma_0 and σ1\sigma_1 directly and arrive at I1=b−a2[f(a)+f(b)]I_1 = \frac{b-a}{2}\left[f(a)+f(b)\right].
  5. Construct the Composite Trapezoidal Rule C1,mC_{1,m} by partitioning [a,b][a,b] into mm equal sub-intervals and explain why interior nodes appear with coefficient 2.
  6. Derive Simpson’s Rule by computing all three weights σ0\sigma_0, σ1\sigma_1, σ2\sigma_2 and arrive at I2=b−a6[f(a)+4f ⁣(a+b2)+f(b)]I_2 = \frac{b-a}{6}\left[f(a)+4f\!\left(\tfrac{a+b}{2}\right)+f(b)\right].
  7. Recognize the 1-4-11\text{-}4\text{-}1 coefficient pattern in Simpson’s Rule and explain why the midpoint carries four times the weight of each endpoint.
  8. State the general error bound I(f)−In(f)≤f(n+1)(ξ)(n+1)!∫ab∏k=0n(x−xk) dxI(f) - I_n(f) \leq \frac{f^{(n+1)}(\xi)}{(n+1)!}\int_a^b \prod_{k=0}^n (x-x_k)\,dx and apply the specialization for n=1n=1.
  9. Apply the Trapezoidal Rule, Composite Trapezoidal Rule, and Simpson’s Rule to a given function, compute relative errors, and compare the accuracy of each method.

Chapter Sections

#SectionKey Concepts
1Newton-Cotes FrameworkLagrange interpolant, weights σk\sigma_k, closed vs. open forms
2Trapezoidal RuleDerivation of σ0\sigma_0 and σ1\sigma_1, final formula, geometric interpretation
3Composite Trapezoidal RuleSubdividing the interval, assembling sub-trapezoids, C1,mC_{1,m} formula
4Simpson’s RuleDerivation of all three weights, 1-4-11\text{-}4\text{-}1 pattern, final formula
5Error AnalysisGeneral upper bound, specialization to n=1n=1, effect of higher-degree rules
6Worked ExamplesComparing all methods on exe^x over [0,2][0,2]; relative error analysis