Gaussian quadrature
Gaussian quadrature
Wiki: Gaussian quadrature indicates that the integral of a function can be replaced as a weight sum of function values at some points.
The Gauss-Legendre quadrature has the integral domain \([-1,1]\) and is stated as:
Here \(f(x)\) must be a polynomial of degree \(2n-1\) (totally \(2n\) terms) or less, which is approximate by \(2n\) parameters \((w_i,x_i)\).
When the interval is not \([-1,1]\), it should be changed in the following way:
We can choose the corresponding \((w_i, \xi_i)\) pairs in the below table to calculate the integral.
Let's consider a two-point Gauss-Legendre quadrature to determine the \((w_i, x_i)\) pair. Reference Video
Since \(f(x)\) is a part of the Legendre polynomial, suppose in the following case the degree is 3. That means \(f(x)\) is composed of \(1,x,x^2,x^3\). Here the coefficent before each term can be neglacted since it can be cancelled from two sides of the equation:
Therefore, we have:
From the above 4 equations, we can obtain the parameters:
There are other forms of Gaussian quadrature with varied choices of intervals and weight functions: