Is Gauss quadrature always a good option for know analytical functions?

Viewed 545

What are the limitations of Gauss quadratures? I know that if I'm integrating, for example, a data set a Gauss quadrature won't be the best option, but if I know the function analytically is there any big limitations? At WolframMathWorld says that for a know analytically function Gauss is always better than Newton-Cotes quadrature, is that always true even for more complex functions?

I was searching a lot in the last days. Since I mainly solve physical problems, I always know the analytical form of the function I'm integrating. At school, they focused more on Newton-Cotes formulas, but I think it's too slow. I tried Gauss-Legendre quadrature recently to integrate a function involving polynomials, exponential and some modified Bessel functions of second kind. I compared the results with some Newton-Cotes formulas and it seems nice, and a lot faster, but I still don't know if I can always trust on Gauss quadratures, especially for more complex functions, or is there going to be a time that it will big fail me?

And one more question, is there any advantage using a specific Gauss quadrature? Gauss-Laguerre for example, or am I going to get the same result with an integral limits change and using Gauss-Legendre quadrature?

1 Answers

The defining feature of Gaussian quadrature is that it integrates polynomials up to a given degree exactly. The idea then is that it probably does a good job, too, for functions which are "close" to a polynomial. The higher the degree, the better the method integrates functions with sharp features. Gaussian quadrature will fail, however, if your function has discontinuities, poles, is highly oscillatory, or behaves unlike polynomials in other ways.

If your function can be chopped up into pieces that look like polynomials -- good for you! You just apply Gaussian quadrature to those pieces. (That's what adaptive integrators do.)

Gauss-Laguerre for example, or am I going to get the same result with an integral limits change and using Gauss-Legendre quadrature?

Again, "Gauss" really only means "exactly up to certain polynomial degree". Legendre and Laguerre integrate different types of functions; Hermite is another type.

Related