Docsity

Integration & Numerical Quadrature: Riemann Integ., Condition Number, & Quadrature Rules, Study notes of Mathematical Methods for Numerical Analysis and Optimization

Toggle sidebar
bg1
Jim Lambers
Math 105A
Summer Session I 2003-04
Lecture 12 Notes
These notes correspond to Sections 4.3 and 4.4 in the text.
Integration
Numerous applications call for the computation of the integral of some function f:R→Rover an
interval [a,b],
I(f) = Zb
a
f(x)dx.
In some cases, I(f) can be computed by applying the Fundamental Theorem of Calculus and
computing
I(f) = F(b)−F(a),
where F(x) is an antiderivative of f. Unfortunately, this is not practical if an antiderivative of fis
not available. In such cases, numerical techniques must be employed instead.
Well-Posedness
The integral I(f) is defined using sequences of Riemann sums
Rn=
n
X
i=1
f(ξi)(xi+1 −xi), xi≤ξi≤xi+1,
where a=x1< x2<· · · < xn=b. If any such sequence {Rn}∞
n=1 converges to the same finite
value Ras n→ ∞, then fis said to be Riemann integrable on [a, b], and I(f) = R. A function
is Riemann integrable if and only if it is bounded and continuous except on a set of measure zero.
For such functions, the problem of computing I(f) has a unique solution, by the definition of I(f).
To determine the sensitivity of I(f), we define the ∞-norm of a function f(x) by
kfk∞= max
x∈[a,b]|f(x)|
and let ˆ
fbe a perturbation of fthat is also Riemann integrable. Then the condition number of
the problem of computing I(f) can be approximated by
|I(ˆ
f)−I(f)|/|I(f)|
kˆ
f−fk∞/kfk∞
=|I(ˆ
f−f)|/|I(f)|
kˆ
f−fk∞/kfk∞
1
pf3
pf4
pf5

Partial preview of the text

Download Integration & Numerical Quadrature: Riemann Integ., Condition Number, & Quadrature Rules and more Study notes Mathematical Methods for Numerical Analysis and Optimization in PDF only on Docsity!

Jim Lambers Math 105A Summer Session I 2003- Lecture 12 Notes

These notes correspond to Sections 4.3 and 4.4 in the text.

Integration

Numerous applications call for the computation of the integral of some function f : R → R over an interval [a, b],

I(f ) =

∫ (^) b

a

f (x) dx.

In some cases, I(f ) can be computed by applying the Fundamental Theorem of Calculus and computing I(f ) = F (b) − F (a),

where F (x) is an antiderivative of f. Unfortunately, this is not practical if an antiderivative of f is not available. In such cases, numerical techniques must be employed instead.

Well-Posedness

The integral I(f ) is defined using sequences of Riemann sums

Rn =

∑^ n

i=

f (ξi)(xi+1 − xi), xi ≤ ξi ≤ xi+1,

where a = x 1 < x 2 < · · · < xn = b. If any such sequence {Rn}∞ n=1 converges to the same finite value R as n → ∞, then f is said to be Riemann integrable on [a, b], and I(f ) = R. A function is Riemann integrable if and only if it is bounded and continuous except on a set of measure zero. For such functions, the problem of computing I(f ) has a unique solution, by the definition of I(f ). To determine the sensitivity of I(f ), we define the ∞-norm of a function f (x) by

‖f ‖∞ = max x∈[a,b] |f (x)|

and let fˆ be a perturbation of f that is also Riemann integrable. Then the condition number of the problem of computing I(f ) can be approximated by

|I( fˆ ) − I(f )|/|I(f )| ‖ fˆ − f ‖∞/‖f ‖∞

|I( fˆ − f )|/|I(f )| ‖ fˆ − f ‖∞/‖f ‖∞

I(| fˆ − f |)/|I(f )| ‖ fˆ − f ‖∞/‖f ‖∞

≤

(b − a)‖ fˆ − f ‖∞/|I(f )| ‖ fˆ − f ‖∞/‖f ‖∞

≤ (b − a) ‖f ‖∞ |I(f )|

from which it follows that the problem is fairly well-conditioned in most cases, since, if I(f ) is small, we should then use the absolute condition number, which is bounded by (b − a). Similarly, perturbations of the endpoints a and b do not lead to large perturbations in I(f ), in most cases.

Numerical Quadrature

Clearly, if f is a Riemann integrable function and {Rn}∞ n=1 is any sequence of Riemann sums that converges to I(f ), then any particular Riemann sum Rn can be viewed as an approximation of I(f ). However, such an approximation is usually not practical since a large value of n may be necessary to achieve sufficient accuracy. Instead, we use a quadrature rule to approximate I(f ). A quadrature rule is a sum of the form

Qn(f ) =

∑^ n

i=

f (xi)wi,

where the points xi, i = 1,... , n, are called the nodes of the quadrature rule, and the numbers wi, i = 1,... , n, are the weights. We say that a quadrature rule is open if the nodes do not include the endpoints a and b, and closed if they do. The objective in designing quadrature rules is to achieve sufficient accuracy in approximating I(f ), for any Riemann integrable function f , while using as few nodes as possible in order to maximize efficiency. In order to determine suitable nodes and weights, we consider the following questions:

  • For what functions f is I(f ) easy to compute?
  • Given a general Riemann integrable function f , can I(f ) be approximated by the integral of a function g for which I(g) is easy to compute?

One class of functions for which integrals are easily evaluated is the class of polynomial functions. If we choose n nodes x 1 ,... , xn, then any polynomial pn− 1 (x) of degree n − 1 can be written in the form

pn− 1 (x) =

∑^ n

i=

pn− 1 (xi)Ln− 1 ,i(x),

It is of degree one, and it is based on the principle that the area under f (x) can be approxi- mated by the area of a rectangle with width b − a and height f (m), where m = (a + b)/2 is the midpoint of the interval [a, b].

  • The Trapezoidal Rule, which is a closed rule with two nodes, is defined by ∫ (^) b

a

f (x) dx ≈

b − a 2 [f (a) + f (b)].

It is of degree one, and it is based on the principle that the area under f (x) from x = a to x = b can be approximated by the area of a trapezoid with heights f (a) and f (b) and width b − a.

  • Simpson’s Rule, which is a closed rule with three nodes, is defined by ∫ (^) b

a

f (x) dx ≈ b − a 6

[

f (a) + 4f

a + b 2

  • f (b)

]

It is of degree two, and it is derived by computing the integral of the quadratic polynomial that interpolates f (x) at the points a, (a + b)/2, and b.

In general, the degree of accuracy of Newton-Cotes rules can easily be determined by expanding the integrand f (x) in a Taylor series. This technique can be used to show that n-point Newton- Cotes rules with an odd number of nodes have degree n, which is surprising since, in general, interpolatory n-point quadrature rules have degree n − 1. This extra degree of accuracy is due to the cancellation of the high-order error terms in the Taylor expansion used to determine the error. Such cancellation does not occur with Newton-Cotes rules that have an even number of nodes. Unfortunately, Newton-Cotes rules are not practical when the number of nodes is large, due to the inaccuracy of high-degree polynomial interpolation using equally spaced points. Furthermore, for n ≥ 11, n-point Newton-Cotes rules have at least one negative weight, and therefore such rules can be ill-conditioned.

Clenshaw-Curtis Quadrature

An alternative to Newton-Cotes rules are Clenshaw-Curtis rules, whose nodes are determined by Chebyshev polynomials. The roots of the nth Chebyshev polynomial yield the n-point classical Clenshaw-Curtis rule, while the interior extrema of the nth Chebyshev polynomial yields the (n−1)- point practical Clenshaw-Curtis rule. The latter rule is called practical because it has the property that the nodes of the (2n − 1)-point rule include the nodes of the n-point rule. Such a sequence of quadrature rules that reuses nodes is said to be progressive. The Clenshaw-Curtis rules have several advantages over Newton-Cotes rules:

  • Their weights are always positive, making them much more stable than Newton-Cotes rules.
  • Unlike Newton-Cotes rules, approximate integrals computed using n-point Clenshaw-Curtis rules converge to the exact integral as n → ∞, from which it follows that such rules are much more accurate than n-point Newton-Cotes rules for sufficiently large n.
  • The weights can be computed very efficiently by taking advantage of the three-term recurrence relation satisfied by Chebyshev polynomials.

The main drawback of Clenshaw-Curtis rules is that n-point rules always have degree n − 1.

Composite Quadrature

When using a quadrature rule to approximate I(f ) on some interval [a, b], the error is proportional to hr, where h = b − a and r is some positive integer. Therefore, if the interval [a, b] is large, it is advisable to divide [a, b] into smaller intervals, use a quadrature rule to compute the integral of f on each subinterval, and add the results to approximate I(f ). Such a scheme is called a composite quadrature rule. It can be shown that the approximate integral obtained using a composite rule that divides [a, b] into n subintervals will converge to I(f ) as n → ∞, provided that the maximum width of the n subintervals approaches zero, and the quadrature rule used on each subinterval has a degree of at least zero. It should be noted that using closed quadrature rules on each subinterval improves efficiency, because the nodes on the endpoints of each subinterval, except for a and b, are shared by two quadrature rules. As a result, fewer function evaluations are necessary, compared to a composite rule that uses open rules with the same number of nodes. We will now state some of the most well-known composite quadrature rules. In the following discussion, we assume that the interval [a, b] is divided into n subintervals of equal width h = (b−a)/n, and that these subintervals have endpoints [xi− 1 , xi], where xi = a+ih, for i = 1, 2 ,... , n. Given such a partition of [a, b], we can compute I(f ) using the Composite Midpoint Rule

∫ (^) b

a

f (x) dx = 2h[f (x 1 ) + f (x 3 ) + · · · + f (xn− 1 )] + O(h^2 ), n is even,

the Composite Trapezoidal Rule

∫ (^) b

a

f (x) dx = h 2

[f (x 0 ) + 2f (x 1 ) + 2f (x 2 ) + · · · + 2f (xn− 1 ) + f (xn)] + O(h^2 ),

or the Composite Simpson’s Rule

∫ (^) b

a

f (x) dx = h 3

[f (x 0 ) + 4f (x 1 ) + 2f (x 2 ) + 4f (x 3 ) + · · · + 2f (xn− 2 ) + 4f (xn− 1 ) + f (xn)] + O(h^4 ),

for which n is required to be even, as in the Composite Midpoint Rule.