Four-point Gaussian quadrature rule

In summary, the four-point Gaussian quadrature rule can be used for intense numerical calculations, particularly for single-integral calculations. It provides a (2n)th order approximation to the integral of any function and uses the fewest points with best accuracy. The method involves using the roots of the nth Legendre polynomial and calculating the coefficients, which can be easily found in extensive tables. The formula can also be applied to [a,b] intervals by using a transformation and the values can be improved by computing them using the given formula. Overall, this method provides an efficient way to calculate the kernel of an integro-differential equation.
  • #1
Heimisson
44
0
I need to use the four-point Gaussian quadrature rule to do some intense numerical calculations. Could anyone link to this page where it's written out explicitly over an [a,b] interval. I haven't been able to find it, I'm trying to derive it now but it's crucial that I'm 100% correct. I haven't used a Gaussian quadrature before so seeing clearly what it should look like would make me feel a lot better.

This isn't really homework but a part of a much larger project I'm working on for school so you will not be doing my homework for my or anything like that.

thanks
 
Physics news on Phys.org
  • #2
This is for single-integral calculations? Also, are you looking for the theoretical derivation or the pseudo-code?
 
  • #3
This book gives a decent derivation:

Numerical Analysis, 8th Edition, Burden and Faires, Brooks/Cole 2005, 978-0534382162

This book has a list of the coefficients and roots tabulated for general n-point quadratures:

Gaussian Quadrature Formulas, Stroud and Secrest, Prentice Hall 1966,
 
  • #4
Kreizhn said:
This is for single-integral calculations? Also, are you looking for the theoretical derivation or the pseudo-code?

I need to use this on a integral of two dimensions x and x'. But I figured that I would just use it first on x and then look at that result as a function of x' and use it again. I don't really care for a theoretical derivation I just want the formula. I'm trying to calculate the kernel of a integro-differential equation. This means heavy numerical calculations so my professor recommended this rule because it uses the fewest points with best accuracy. But I' very new to it.
 
  • #5
Suppose that [itex] x_1,\ldots, x_n [/itex] are the roots of the nth Legendre polynomial, and that for each [itex] i=1,2,\ldots, n [/itex] we define [itex] c_i [/itex] by
[tex] c_i = \int_{-1}^1 \prod_{j=1, j\neq i}^n \frac{ x- x_j}{x_i-x_j} dx [/tex]
If P(x) is any polynomial of degree less than 2n then
[tex] \int_{-1}^1 P(x) dx = \sum_{i=1}^n c_i P(x_i) [/tex].

This gives a (2n)th order approximation to the integral of any function. You can look up the roots of the nth Legendre polynomial (or calculate them computationally if you like). The c_i can then easily be calculated, but again, there are extensive tables with this information already computed. Hence

[tex] \int_{-1}^1 f(x) dx \approx \sum_{i=1}^n c_i f(x_i) [/tex]

To make the algorithm work between [a,b] rather than just [-1,1], apply the transformation
[tex] t = \frac{2x-a-b}{b-a}, \qquad x = \frac12[(b-a)t + a + b] [/tex]
and calculate
[tex] \int_a^b f(x) dx = \int_{-1}^1 f\left( \frac{(b-a)t + (b+a) }{2} \right) \frac{b-a}2 dt [/tex]

In the particular case when you want a 4 point approximation, the following is the table of the values (you can get better values by computing them using the formula I've given above)

[tex] \begin{array}{|r|r|} \hline
\text{Roots}, x_i & \text{Coefficients}, c_i \\ \hline
0.8611363116 & 0.3478548451 \\
0.339981436 & 0.6521451549 \\
-0.339981436 & 0.6521451549 \\
-0.8611363116 & 0.3478548451 \\ \hline
\end{array}[/tex]
 
  • #6
Kreizhn said:
Suppose that [itex] x_1,\ldots, x_n [/itex] are the roots of the nth Legendre polynomial, and that for each [itex] i=1,2,\ldots, n [/itex] we define [itex] c_i [/itex] by
[tex] c_i = \int_{-1}^1 \prod_{j=1, j\neq i}^n \frac{ x- x_j}{x_i-x_j} dx [/tex]
If P(x) is any polynomial of degree less than 2n then
[tex] \int_{-1}^1 P(x) dx = \sum_{i=1}^n c_i P(x_i) [/tex].

This gives a (2n)th order approximation to the integral of any function. You can look up the roots of the nth Legendre polynomial (or calculate them computationally if you like). The c_i can then easily be calculated, but again, there are extensive tables with this information already computed. Hence

[tex] \int_{-1}^1 f(x) dx \approx \sum_{i=1}^n c_i f(x_i) [/tex]

To make the algorithm work between [a,b] rather than just [-1,1], apply the transformation
[tex] t = \frac{2x-a-b}{b-a}, \qquad x = \frac12[(b-a)t + a + b] [/tex]
and calculate
[tex] \int_a^b f(x) dx = \int_{-1}^1 f\left( \frac{(b-a)t + (b+a) }{2} \right) \frac{b-a}2 dt [/tex]

In the particular case when you want a 4 point approximation, the following is the table of the values (you can get better values by computing them using the formula I've given above)

[tex] \begin{array}{|r|r|} \hline
\text{Roots}, x_i & \text{Coefficients}, c_i \\ \hline
0.8611363116 & 0.3478548451 \\
0.339981436 & 0.6521451549 \\
-0.339981436 & 0.6521451549 \\
-0.8611363116 & 0.3478548451 \\ \hline
\end{array}[/tex]
Thank you so much!

This is a cool method of doing numerical integrations, I wonder why they didn't teach this in my numerical analysis class.
 

1. What is the Four-point Gaussian quadrature rule?

The Four-point Gaussian quadrature rule is a numerical method used for approximating the definite integral of a given function. It is based on the concept of Gaussian quadrature, which uses a weighted sum of function values at specific points to approximate the integral.

2. How does the Four-point Gaussian quadrature rule work?

The Four-point Gaussian quadrature rule works by first selecting four specific points within the interval of integration and assigning corresponding weights to each point. These points and weights are chosen in a way that the resulting approximation is as accurate as possible. The function values at these points are then multiplied by their respective weights and summed up to give the final approximation of the integral.

3. What are the advantages of using the Four-point Gaussian quadrature rule?

The Four-point Gaussian quadrature rule has several advantages over other numerical integration methods. It is highly accurate, especially for smooth and well-behaved functions. It also requires fewer function evaluations compared to other methods, making it computationally efficient. Additionally, it is a closed-form method, meaning the weights and points are pre-determined and do not need to be recalculated for each new integral.

4. When should I use the Four-point Gaussian quadrature rule?

The Four-point Gaussian quadrature rule is best suited for integrating functions that have a smooth and continuous nature. It is particularly useful when the integral cannot be evaluated analytically or when other numerical methods do not provide accurate results. However, it may not be suitable for highly oscillatory or rapidly changing functions.

5. Are there any limitations to the Four-point Gaussian quadrature rule?

Like any numerical method, the Four-point Gaussian quadrature rule also has its limitations. It may not provide accurate results for functions with singularities or discontinuities. It also requires the function to be evaluated at specific points, which can be time-consuming for functions with complex expressions. Additionally, the accuracy of the approximation may decrease as the interval of integration becomes wider.

Similar threads

  • Calculus
Replies
2
Views
1K
Replies
3
Views
2K
Replies
2
Views
1K
  • Calculus and Beyond Homework Help
Replies
7
Views
3K
  • Advanced Physics Homework Help
Replies
4
Views
1K
  • Calculus and Beyond Homework Help
Replies
1
Views
3K
Replies
5
Views
1K
  • Special and General Relativity
Replies
2
Views
860
  • Biology and Medical
Replies
4
Views
2K
  • Advanced Physics Homework Help
Replies
2
Views
984
Back
Top