You are on page 1of 4

www.numerical-methods.

com

Gauss-Legendre Quadrature
In general numerical integration or quadrature1 the aim is to approximate a definite integral I by a summation of weights and function evaluations: ( ) ( ) (1) The simplest methods of quadrature, such as the mid-point2, trapezoidal3 or Simpsons rule4, the initial concept arises from a piecewise polynomial5 approximation of ( ), usually with equidistant abscissae (unless the nature of the function ( ) requires a more detailed approximation in certain areas or an adaptive method is used, which automatically varies the widths of the intervals, based on the local nature of ( )). The concept of Gaussian quadrature is to select the values of and that in a sense minimises the error in the approximation (1). Polynomials are the most simple general form of approximation to smooth functions and since there are 2n variables in the quadrature method (1) it is possible to the integral of polynomials to a degree of 2n-1, exactly through careful choice of and for i=1,2,n. The abscissae and weights for Gaussian quadrature are usually stated for the standard interval , which can then be translated on to any interval [a,b] using the following relationships: ( ( where the and ) )( )

are weights and abscissae on the standard interval.

Example: 1 point Gaussian quadrature For example let us consider the simplest case with n=1. In order to find the value of and ( ) ( )

we consider polynomials up to degree 1.

Numerical Integration or Quadrature Mid-point Integration Rule 3 Trapezoidal Integration Rule 4 Simpsons Integration Rule 5 Piecewise Polynomial Interpolation
1 2

www.numerical-methods.com

Hence the 1-point Gaussian quadrature rule is as follows: ( ) ( )

which is identical to the mid-point integration rule. Example: 2 point Gaussian quadrature For example let us consider the simplest case with n=1. In order to find the value of ( ) and ( ) ( )

we consider polynomials up to degree 3.

It can be seen that the evaluation of points and weights by this method is quite complex, even for n=2. For now let us appeal to the symmetry of the formula, which dictates that the two weights must be equal ( ) and ( ). From the integral of , it then follows that .

Hence the 2-point Gaussian quadrature rule is ( ) ( ) ( )

The rule is given in decimal format in the following table i Wi Xi 1 1.000000000000000 -0.577350269189626 2 1.000000000000000 0.577350269189626

www.numerical-methods.com

Example of a 2 point Gaussian quadrature Let us use the 2 point Gaussian quadrature rule to find Given the domain of [0,1], the weights are to 6 decimal places. The exact solution to the integral is 1.71828281828459050 and the error is 0.000386. Higher Order Rules Computer codes have been developed to derive the higher order Gaussian quadrature rules and they have been recorded in books and on websites. For example the webpage6 contains lists of points and weights and a program to find them written in Mathematica7. There is also a contributed code8 to compute the weights and abcissae in Matlab9. In Fortran10 there are a number of options, for example the functions library11 contains a code for this purpose. The Gauss-Legendre abscissae also coincide with the roots of the Legendre polynomial12 of the appropriate degree. The 3 and 4 point rules are given below and applied to the test problem of finding using the Spreadsheet13. ,

The 3-point rule is shown in the following table. i wi xi

1 0.888888888888889 0.000000000000000 2 0.555555555555556 -0.774596669241483 3 0.555555555555556 0.774596669241483 The approximation to the integral using this method is 1.718281004372520 and the error is 8.2410-7.

http://pomax.github.io/bezierinfo/legendre-gauss.html Mathematica 8 Legendre-Gauss Quadrature Weighs and Nodes by Greg von Winckel 9 www.freemat.info 10 www.fortran.computing.me.uk 11 http://jin.ece.illinois.edu/routines/routines.html 12 Legendre Polynomials 13 Gauss3 and 4 pt.xls
6 7

www.numerical-methods.com

The 4-point rule is given below. i wi xi

1 0.652145154862546 -0.339981043584856 2 0.652145154862546 0.339981043584856 3 0.347854845137454 -0.861136311594053 4 0.347854845137454 0.861136311594053 The approximation to the integral using this method is 1.718281827526080 and the error is 9.329610-10.

You might also like