# Degree of Precision Effect on Quadrature Accuracy

For an $n$ point Gaussian quadrature, one can show that it has degree of precision $2n - 1$ meaning it will exactly integrate polynomials of that degree or lower. Is it always true that a quadrature with a higher degree of precision will give better results for the integration of a non-polynomial function?

The answer to "is it always true" is always "no", especially in numerical methods. The issue is in how closely the integrand resembles a polynomial function. If the integrand is analytic in a large neighborhood of the interval of integration, then Gaussian quadrature converges extremely fast. But for integrals like $\int_{-1}^1\sqrt{1-x^4}\,dx$ or worse yet, $\int_{-1}^1 1/\sqrt{1-x^4}\,dx$, where the behavior is markedly non-polynomial, high degree of the method does not pay off. One is better off using a lower degree method on smaller subintervals. This is same story as with Legendre polynomial vs. polynomial splines.
We compare the convergence behavior of Gauss quadrature with that of its younger brother, Clenshaw–Curtis. Seven-line MATLAB codes are presented that implement both methods, and experiments show that the supposed factor-of-$2$ advantage of Gauss quadrature is rarely realized.
• @SamManzer Sure, but my example will not be very insightful. Take any weird function on $[-1,1]$ such that $f(0)=\frac12 \int_{-1}^1 f$. Then the one-point quadrature method, which amounts to $2f(0)$, gives the precise result, while other methods will have some error. – user147263 Jul 9 '14 at 18:53