6.6 KB · commit a9602da
We consider the numerical evaluation of the integral
I=∫abf(x)dx(6.71)
In the preceding sections, we derived some integration formulae which require values of the function at equally-spaced points of the interval. Gauss derived a formula which uses the same number of function values but with different spacing and gives better accuracy.
Gauss' formula is expressed in the form
∫−11F(u)du=W1F(u1)+W2F(u2)+⋯+WnF(un)=i=1∑nWiF(ui)(6.72)
where Wi and ui are called the weights and abscissae, respectively.
In Eq. (6.72), there are altogether 2n arbitrary parameters and therefore the weights and abscissae can be determined such that the formula is exact when F(u) is a polynomial of degree not exceeding (2n−1). Hence, we start with
F(u)=c0+c1u+c2u2+c3u3+⋯+c2n−1u2n−1.(6.73)
We then obtain from Eq. (6.72)
∫−11F(u)du=∫−11(c0+c1u+c2u2+c3u3+⋯+c2n−1u2n−1)du=2c0+32c2+52c4+…(6.74)Substituting these values on the right-hand side of Eq. (6.72), we obtain
∫−11F(u)du=W1(c0+c1u1+c2u12+⋯+c2n−1u12n−1)+W2(c0+c1u2+c2u22+⋯+c2n−1u22n−1)+W3(c0+c1u3+c2u32+⋯+c2n−1u32n−1)+…+Wn(c0+c1un+c2un2+⋯+c2n−1un2n−1),which can be written as
∫−11F(u)du=c0(W1+W2+⋯+Wn)+c1(W1u1+W2u2+W3u3+⋯+Wnun)+c2(W1u12+W2u22+W3u32+⋯+Wnun2)+…+c2n−1(W1u12n−1+W2u22n−1+W3u32n−1+⋯+Wnun2n−1).(6.75)Now, Eqs. (6.74) and (6.75) are identical for all values of ci and hence comparing the coefficients of ci, we obtain the 2n equations
W1+W2+W3+⋯+WnW1u1+W2u2+W3u3+⋯+WnunW1u12+W2u22+W3u32+⋯+Wnun2W1u12n−1+W2u22n−1+W3u32n−1+⋯+Wnun2n−1=2=0=2/3⋮=0⎭⎬⎫(6.76)in 2n unknowns Wi and ui (i=1,2,…,n).
As an illustration, we consider the case n=2. Then the formula is
∫−11F(u)du=W1F(u1)+W2F(u2).(6.77)
Since this formula is exact when F(u) is a polynomial of degree not exceeding 3, we put successively F(u)=1,u,u2 and u3. Then Eq. (6.77) gives the four equations:
W1+W2W1u1+W2u2W1u12+W2u22W1u13+W2u23=2=0=2/3=0.⎭⎬⎫(6.78)The solution of these equations is
W1=W2=1,u2=−u1=31.(6.79)
This method, when applied to the general system given in Eq. (6.76) above, will be extremely complicated and difficult, and an alternate method must be chosen to solve the nonlinear system (6.76).
It can be shown that the ui are the zeros of the (n+1)th Legendre polynomial Pn+1(u) which can be generated using the recurrence relation
(n+1)Pn+1(u)=(2n+1)uPn(u)−nPn−1(u),(6.80)
where P0(u)=1 and P1(u)=u. The first-five Legendre polynomials are given by
P0(u)P1(u)P2(u)P3(u)P4(u)=1=u=(1/2)(3u2−1)=(1/2)(5u3−3u)=(1/8)(35u4−30u2+3).⎭⎬⎫(6.81)It can also be shown that the corresponding weights Wi are given by
Wi=∫−11j=0,j=i∏nui−uju−ujdu,(6.82)
where the ui are the abscissae.
As an example, when n=1 we solve P2(u)=0, i.e.
21(3u2−1)=0,
which gives the two abscissae:
u0=−31=−33andu1=31=33.
The corresponding weights are given by
W0=∫−11u0−u1u−u1du=u0−u11[2u2−u1u]−11=1
and
W1=∫−11u1−u0u−u0du=u1−u01[2u2−u0u]−11=1.
Similarly, for n=3 we solve P4(u)=0. That is,
81(35u4−30u2+3)=0,
which gives the four abscissae:
ui=±(3515±230)1/2.
The weights Wi can then be obtained from Eq. (6.82). It should be noted, however, that the abscissae ui and the weights Wi are extensively tabulated for different values of n. We list below, in Table 6.1, the abscissae and weights for values of n up to n=6.
Table 6.1 Abscissae and Weights for Gaussian Integration
| n | ±ui | Wi |
|---|---|---|
| 2 | 0.57735 02692 | 1.0 |
| 3 | 0.0 | 0.88888 88889 |
| 0.77459 66692 | 0.55555 55556 | |
| 4 | 0.33998 10436 | 0.65214 51549 |
| 0.86113 63116 | 0.34785 48451 | |
| 5 | 0.0 | 0.56888 88889 |
| 0.53846 93101 | 0.47862 86705 | |
| 0.90617 98459 | 0.23692 68851 | |
| 6 | 0.23861 91861 | 0.46791 39346 |
| 0.66120 93865 | 0.36076 15730 | |
| 0.93246 95142 | 0.17132 44924 |
In the general case, the limits of the integral in Eq. (6.71) have to be changed to those in Eq. (6.72) by means of the transformation
x=21u(b−a)+21(a+b).(6.83)
The use of Table 6.1 is illustrated by the following example: