Numerical Integration and Computing π
This interactive course presentation explores numerical integration methods and the famous computation of √(π/2) from MIT's Single Variable Calculus course (18.01, Lecture 25).
Introduction
Numerical integration is a fundamental technique in calculus that allows us to approximate definite integrals when analytical solutions are difficult or impossible to find. This presentation covers two primary numerical methods—the Trapezoidal Rule and Simpson's Rule—and demonstrates their application through practical examples.
We'll also explore one of the most elegant computations in mathematics: finding the value of √(π/2) through multiple integration techniques and visualizations.
Numerical Integration Methods
The Trapezoidal Rule
The Trapezoidal Rule approximates the area under a curve by dividing it into trapezoids. For a function f(x) on the interval [a,b] divided into n subintervals, the formula is:
Where Δx = (b-a)/n and the pattern of coefficients is (1/2, 1, 1, ..., 1, 1/2).
Simpson's Rule
Simpson's Rule provides a more accurate approximation by fitting parabolas through sets of three points. For a function f(x) on the interval [a,b] divided into n subintervals (where n is even), the formula is:
The pattern of coefficients is (1, 4, 2, 4, 2, ..., 4, 1).
Example: Integrating 1/x from 1 to 2
Let's examine a practical example of numerical integration, using the integral:
This integral has a known analytical solution:
Applying the Trapezoidal Rule
For this example, we'll divide the interval [1,2] into just 2 sub-intervals, giving 3 points: x = 1, x = 3/2, and x = 2.
The function values at these points are:
- f(1) = 1
- f(3/2) = 2/3
- f(2) = 1/2
Applying the Trapezoidal Rule formula:
This approximation gives about 0.96, which is quite far from the exact value of 0.693147.
Applying Simpson's Rule
Using the same points and applying Simpson's Rule:
This gives approximately 0.6944444, which is remarkably close to the exact value of 0.693147.
Error Analysis for Simpson's Rule
The error in Simpson's Rule is proportional to (Δx)⁴:
This means:
- If Δx = 0.1 (dividing into 10 intervals), the error would be approximately 10⁻⁴
- This provides about 4 digits of accuracy with a reasonable number of calculations
Simpson's Rule works so well because:
- It gives exact results for polynomials up to degree 3 (constants, lines, parabolas, and cubics)
- This explains the fourth-order accuracy
Computing √(π/2)
One of the most famous computations in calculus is finding the value of √(π/2), which appears in probability theory and statistics as part of the normal distribution.
The Bell Curve and Its Area
The Gaussian function (bell curve) is defined as:
The area under this curve from negative infinity to positive infinity is:
Through a clever mathematical technique involving double integrals and polar coordinates, we can show that:
Therefore:
And the half-integral:
Three-Dimensional Visualization
The key insight comes from considering the double integral:
This can be evaluated in two ways:
-
As the product of two single integrals:
-
Using polar coordinates:
Therefore, Q² = π, which means Q = √π.
Applications in Mathematics and Science
The numerical integration methods and special integrals discussed have numerous applications:
-
Scientific Computing: When analytical solutions are not available, numerical methods provide approximations for complex physical systems.
-
Statistics and Probability: The Gaussian integral is fundamental to probability theory, particularly in defining the normal distribution.
-
Engineering: For solving complex problems in fluid dynamics, heat transfer, and structural analysis.
-
Physics: For calculating quantities like work, energy, and momentum in complex systems.
Practice Problems
To reinforce your understanding of numerical integration methods, try these practice problems:
- Use the Trapezoidal Rule with n = 4 to approximate ∫₀¹ x² dx.
- Use Simpson's Rule with n = 4 to approximate the same integral and compare with the exact answer.
- Estimate the error in each approximation based on the error formulas discussed.
Conclusion
Numerical integration methods provide powerful tools for approximating definite integrals. Simpson's Rule, in particular, offers remarkable accuracy with relatively little computational effort. The computation of √(π/2) demonstrates how integration techniques can reveal profound mathematical truths and connections.
These methods form a comprehensive toolkit for solving integration problems, both analytically and numerically, with applications across mathematics, science, and engineering.