Computational Physics - Department of Physics

(Axel Boer) #1

5.3 Gaussian Quadrature 123


∫ 1
− 1

P 2 N− 1 (x)dx=

∫ 1
− 1

QN− 1 (x)dx= 2 α 0 = 2

N− 1

i= 0

(L−^1 ) 0 iP 2 N− 1 (xi).

If we identify the weights with 2 (L−^1 ) 0 i, where the pointsxiare the zeros ofLN, we have an
integration formula of the type


∫ 1
− 1
P 2 N− 1 (x)dx=

N− 1

i= 0

ωiP 2 N− 1 (xi)

and if our function f(x)can be approximated by a polynomialPof degree 2 N− 1 , we have
finally that
∫ 1
− 1


f(x)dx≈

∫ 1
− 1

P 2 N− 1 (x)dx=

N− 1

i= 0

ωiP 2 N− 1 (xi).

In summary, the mesh pointsxiare defined by the zeros of an orthogonal polynomial of degree
N, that isLN, while the weights are given by 2 (L−^1 ) 0 i.


5.3.3 Application to the caseN= 2


Let us apply the above formal results to the caseN= 2. This means that we can approximate
a functionf(x)with a polynomialP 3 (x)of order 2 N− 1 = 3.
The mesh points are the zeros ofL 2 (x) = 1 / 2 ( 3 x^2 − 1 ). These points arex 0 =− 1 /



3 and
x 1 = 1 /



3.

Specializing Eq. (5.16)

QN− 1 (xk) =

N− 1

i= 0

αiLi(xk) k= 0 , 1 ,...,N− 1.

toN= 2 yields


Q 1 (x 0 ) =α 0 −α 1 √^1
3

,

and
Q 1 (x 1 ) =α 0 +α 1


1


3

,

sinceL 0 (x=± 1 /



3 ) = 1 andL 1 (x=± 1 /


3 ) =± 1 /


3.

The matrixLikdefined in Eq. (5.16) is then

Lˆ=

(

1 −√^13

1 √^13

)

,

with an inverse given by


Lˆ−^1 =


3

2

( 1

√ 3 √^13
−1 1

)

.

The weights are given by the matrix elements 2 (L 0 k)−^1. We have thenceω 0 = 1 andω 1 = 1.
Obviously, there is no problem in changing the numbering of the matrix elementsi,k=
0 , 1 , 2 ,...,N− 1 toi,k= 1 , 2 ,...,N. We have chosen to start from zero, since we deal with poly-
nomials of degreeN− 1.
Summarizing, for Legendre polynomials withN= 2 we have weights


ω:{ 1 , 1 },
Free download pdf