Graduate

GraduateNumerical AnalysisNumerical Integration and Differentiation


Quadrature Methods


Quadrature methods, commonly referred to as numerical integration, are a set of algorithms for approximately computing the definite integral of a function. Definite integrals are fundamental in mathematics, particularly calculus, and they are essential for finding areas, volumes, central points, among many other things. Numerical methods are necessary when a function is complicated or not analytically integrable.

The aim of quadrature methods is to estimate the definite integral of a function over an interval. For a given function f(x), the definite integral between the limits a and b is expressed as:

a b f(x) dx

A simple visual illustration of this concept can be understood by considering the graph of the function f(x):

f(x) A B

The shaded area under the curve f(x) between a and b represents the definite integral. In many cases, it is challenging or impossible to find the area analytically, so numerical methods come into play.

1. Midpoint rule

The midpoint rule estimates the integral by taking the value of the function at the midpoint of the interval and multiplying it by the width of the interval. It is represented as:

I ≈ f((a + b) / 2) × (b – a)

Suppose we want to approximate the integral of f(x) = x^2 over the interval [1, 3]. Using the midpoint rule:

Midpoint: ((1 + 3) / 2) = 2
f(2) = 2^2 = 4

Thus, the approximate integral is:

≈ 4 × (3 – 1) = 8

2. Trapezoidal rule

The trapezoid rule approximates the area under the curve as a trapezoid and calculates its area. The formula is:

I ≈ (B – A) × (F(A) + F(B)) / 2

Suppose we want to find the integral of the function f(x) = x^3 on [1, 2]:

f(1) = 1^3 = 1
f(2) = 2^3 = 8

Therefore, the integral is estimated as follows:

I ≈ (2 – 1) × (1 + 8) / 2 = 4.5

3. Simpson's rule

Simpson's rule is more accurate and uses a parabola to approximate the curve. Simpson's rule assumes that the function is quadratic. It is expressed as:

I ≈ (B – A) / 6 × [f(A) + 4f((A + B) / 2) + f(B)]

Let's try this for f(x) = x^2 over [0, 2]:

f(0) = 0^2 = 0
Midpoint: ((0 + 2) / 2) = 1; f(1) = 1^2 = 1
f(2) = 2^2 = 4

The approximate integral using Simpson's rule is:

I ≈ (2 – 0) / 6 × [0 + 4 × 1 + 4] = 2.67

4. Gaussian quadrature

Gaussian quadrature improves accuracy by choosing optimal sample points and their weights within the interval. These points and weights are obtained from the roots of orthogonal polynomials, such as Legendre polynomials. The general formula with n points is:

I ≈ ∑ wi × f( xi )

where w i are weights and x i are roots (nodes).

For example, using a 2-point Gaussian quadrature for -1 1 x^2 dx:

Roots: x 1 = -1/√3, x 2 = 1/√3
Weights: w 1 = w 2 = 1

So the integral can be approximated as:

I ≈ 1 × ((-1/√3)^2) + 1 × ((1/√3)^2) = 0.6667

Text example

Here are simple examples to show the application of each method:

Example 1: Midpoint rule

Let f(x) = e^x over [1, 2]. Approximate using the midpoint rule.

Midpoint: ((1 + 2) / 2) = 1.5
f(1.5) = e^1.5 ≈ 4.4817
Approximation: 4.4817 × (2 - 1) = 4.4817

Example 2: Trapezoidal rule

Find 0 π sin(x) dx using the Trapezoid Rule.

f(0) = sin(0) = 0
f(π) = sin(π) = 0
Approximation: π × (0 + 0) / 2 = 0

Example 3: Simpson's rule

Apply Simpson's rule to estimate 0 2 ln(x + 1) dx.

f(0) = ln(1) = 0
Midpoint f(1) = ln(2) ≈ 0.6931
f(2) = ln(3) ≈ 1.0986
Approximation: (2/6) × (0 + 4×0.6931 + 1.0986) ≈ 1.7627

Example 4: Gaussian quadrature

Estimate -1 1 x^4 dx using 2-point Gaussian quadrature.

Roots: x 1 = -1/√3, x 2 = 1/√3
Weights: w 1 = w 2 = 1
f(x 1 ) = ((-1/√3)^4), f(x 2 ) = ((1/√3)^4)
Approximation: 1 × f(x 1 ) + 1 × f(x 2 ) = 1/9 + 1/9 = 0.2222

Conclusion

Quadrature methods are an essential cornerstone of numerical analysis. They are widely used in a variety of fields, from physics to finance, wherever integral calculations are necessary but not possible to perform analytically. These methods make it possible to tackle problems involving complex functions and limit the analysis to numerical results that still provide important insights into the underlying phenomena. Each method has its own advantages and limitations, often depending on the nature of the function being integrated. Selecting the appropriate method can lead to more efficient and accurate calculations.


Graduate → 6.3.1


U
username
0%
completed in Graduate


Comments