# How should I determine the number of quadrature points when using Gaussian quadrature integration?

For integration of polynomials, the number of qradrature points can be determined easily according to the $(2N-1)$ rule. While in most cases, it's not necessary to use Gaussian quadrature for simple polynomials since they can be calculated analytically, what we encounter in reality are generally complex integrands, such as rational functions.

In this case, how can we determin an appropriate number of quadrature points so that we can get a somewhat acceptible solution, and at the same time will not lead to a waste of computational efforts?

• Possible duplicate of Method selection for numeric quadrature – GertVdE Nov 14 '15 at 17:30
• Quadrature is used for integrating simple polynomials in finite element codes since it is easier than symbolically evaluating them. – James Nov 14 '15 at 19:53

## 1 Answer

There is a formula for the error term in Gaussian quadrature, so if you bound the derivatives of your integrand, you can bound the error.

If you can't bound the derivatives of your integrand you can use a Gauss- Kronrod rule in which you first use n points to estimate the integral and then reuse those points with n+1 additional points to get a better estimate. The difference of the two estimates is an estimate of the error.

This technique of reusing points in a higher order approximation is also used in Clenshaw-Curtis integration.

This is standard material in introductory courses in numerical analysis that you can find in many textbooks.