Gauss Quadrature
Gauss Quadrature
1 GAUSS QUADRATURE
The Gauss integration scheme is a very efficient method to perform numerical integration over
intervals. In fact, if the function to be integrated is a polynomial of an appropriate degree, then the
Gauss integration scheme produces exact results. The Gauss integration scheme has been
implemented in almost every finite element analysis software due to its simplicity and computational
efficiency. This section outlines the basic principles behind the Gauss integration scheme. For its
application to the finite element analysis method, please visit this section.
INTRODUCTION
Gauss quadrature aims to find the “least” number of fixed points to approximate the integral of a
function such that:
where and . Also, is called an integration point and is
called the associated weight. The number of integration points and the associated weights are chosen
according to the complexity of the function to be integrated. Since a general polynomial of
degree has coefficients, it is possible to find a Gauss integration scheme with number of
integration points and number of associated weights to exactly integrate that polynomial function on
the interval . The following figure illustrates the concept of using the Gauss integration points to
calculate the area under the curve for polynomials. In the following sections, the required number of
integration points for particular polynomials are presented.
Gauss Integration for Polynomials of the 1st, 3rd and 5th Degrees
AFFINE FUNCTIONS (FIRST-DEGREE POLYNOMIALS): ONE INTEGRATION POINT
So, for functions that are very close to being affine, a numerical integration scheme with 1 integration
point that is with an associated weight of 2 can be employed. In other words, a one-point
numerical integration scheme has the form:
THIRD-DEGREE POLYNOMIALS: TWO INTEGRATION POINTS
Assuming 2 integration points in the Gauss integration scheme yields:
For the Gauss integration scheme to yield accurate results, the right-hand sides of the two equations
above need to be equal for any choice of a cubic function. Therefore the multipliers of , , ,
and should be the same. So, four equations in four unknowns can be written as follows:
The solution to the above four equations yields , , . The Mathematica
code below forms the above equations and solves them:
FIFTH-DEGREE POLYNOMIALS: THREE INTEGRATION POINTS
For a fifth-degree polynomial, , therefore, , so, 3 integration points are sufficient to
exactly integrate a fifth-degree polynomial.
Consider , then:
Assuming 3 integration points in the Gauss integration scheme yields:
For the Gauss integration scheme to yield accurate results, the right-hand sides of the two equations
above need to be equal for any choice of a fifth-order polynomial function. Therefore the multipliers
of , , , , , and should be the same. So, six equations in six unknowns can be written as
follows:
SEVENTH-DEGREE POLYNOMIAL: FOUR INTEGRATION POINTS
The following is the Mathematica code used to find the above integration points and corresponding
weights.
So, for functions that are very close to being ninth-order polynomials, the following numerical
integration scheme with 5 integration points can be employed:
The following is the Mathematica code used to find the above integration points and corresponding
weights.
The following is the Mathematica code used to find the above integration points and corresponding
weights. Note that symmetry was employed to reduce the number of equations.
Gauss quadrature is very easy to implement and provides very accurate results with very few
computations. However, one drawback is that it is not applicable to data obtained experimentally as
the values of the function at the specific integration points would not be necessarily available. In order
to implement the Gauss integration scheme in Mathematica, first, the following table is created which
contains the integration points and the corresponding weights. Row number contains the Gauss
integration scheme with integration points. Then, a procedure is created in Mathematica whose
input is a function , and the requested number of integration points. The procedure then calls the
appropriate row in the “GaussTable” and calculates the weighted sum of the function evaluated at the
appropriate integration points.
Calculate the exact integral of on the interval and find the relative error if a Gauss 1, 2,
3, and 4 integration points scheme is used. Also, calculate the number of rectangles required by the
midpoint rule of the rectangle method to produce an error similar to that produced by the 3 point
integration scheme, then evaluate the integral using the midpoint rule of the rectangle method with the
obtained number of rectangles.
SOLUTION
The exact integral is given by:
Employing a Gauss integration scheme with one integration point yields:
Employing a Gauss integration scheme with two integration points yields:
Employing a Gauss integration scheme with three integration points yields:
Using a three point integration scheme yielded an error of:
Equating the upper bound for the error in the midpoint rule to the error produced by a three-point
Gauss integration scheme yields:
With , and . Therefore:
Therefore, the required number of rectangles is:
With 75 rectangles the rectangle method yields an integral of . It is important
to note how accurate the Gauss integration scheme is compared to the rectangle method. For this
example, it would take 75 divisions (equivalent to 75 integration points) to reach an accuracy similar to
the Gauss integration scheme with only 3 points!
The Gauss integration scheme presented above applies to functions that are integrated over the
interval . A simple change of variables can be used to allow integrating a function
where . In this case, the linear relationship between and can be expressed as:
Therefore:
Which means the integration can be converted from integrating over to integrating over as
follows:
where
Therefore:
The integration can then proceed as per the weights and values of the integration points with
given by:
EXAMPLE
Calculate the exact integral of on the interval and find the absolute relative error if a Gauss
1, 2, 3, and 4 integration points scheme is used.
SOLUTION
First, to differentiate between the given function limits, and the limits after changing variables, we will
assume that the function is given in terms of as follows:
The exact integral is given by:
Using a linear change of variables we have:
Therefore:
Employing a Gauss integration scheme with one integration point yields:
Employing a Gauss integration scheme with two integration points yields:
In the following Mathematica code, the procedure IGAL applies the Gauss integration scheme with
integration points to a function on the interval