Mathematical Tools for Physics

(coco) #1
11—Numerical Analysis 329

the Legendre polynomial of second order.
This approach to integration, known as Gaussian integration, can be extended to more points, as for example
∫h


−h

f(x)dx≈αf(−β) +γf(0) +αf(β).

The same expansion procedure leads to the result


h
9

[


5 f

(


−h


3


5


)


+ 8f(0) +f

(


h


3


5


)]


, (27)


with an error proportional toh^7 f(6)(0). The polynomial with roots 0 ,±



3 / 5 is
5
2

x^3 −

3


2


x=P 3 (x), (28)

the third order Legendre polynomial.
Many other properties of Gaussian integration are discussed in the two books by C. Lanczos, “Linear
Differential Operators,” “Applied Analysis,” both available in Dover reprints. The general expressions for the
integration points as roots of Legendre polynomials and expressions for the coefficients are there. The important
technical distinction he points out between the Gaussian method and generalizations of Simpson’s rule involving
more points is in the divergences for large numbers of points. Gauss’s method does not suffer from this defect.
In practice, there is rarely any problem with using the ordinary Simpson rule as indicated above, though it will
require more points than the more elegant Gauss’s method. When problems do arise with Gaussian integration,
they often occur because the function is ill-behaved, and the high derivatives are very large. In this case it can
be more accurate to use a method with a lower order derivative for the truncation error.


11.5 Differential Equations
To solve the first order differential equation


y′=f(x,y) y(x 0 ) =y 0 , (29)

the simplest algorithm is Euler’s method. The initial conditions arey(x 0 ) =y 0 , andy′(x 0 ) =f(x 0 ,y 0 ), and a
straight line extrapolation is
y(x 0 +h) =y 0 +hf(x 0 ,y 0 ). (30)

Free download pdf