Four-point Gaussian quadrature rule

Click For Summary

Homework Help Overview

The discussion revolves around the four-point Gaussian quadrature rule, which is a numerical integration technique used for calculating integrals, particularly in the context of single-integral and two-dimensional integral calculations. Participants are exploring its application and theoretical underpinnings as part of a larger project rather than a traditional homework assignment.

Discussion Character

  • Exploratory, Conceptual clarification, Mathematical reasoning

Approaches and Questions Raised

  • Participants inquire about the theoretical derivation versus practical implementation, including pseudo-code. There is a focus on understanding the roots of the Legendre polynomial and the coefficients used in the quadrature rule. Some express a desire for clarity on the formula and its application to integrals of two dimensions.

Discussion Status

Several participants have provided references to books that contain derivations and tables of coefficients and roots. There is an ongoing exploration of how to adapt the method for different integral bounds, and some participants are sharing their understanding of the transformation needed to apply the quadrature rule beyond the standard interval.

Contextual Notes

Participants mention the need for accuracy in numerical calculations and express uncertainty about the theoretical aspects of the Gaussian quadrature rule. There is a recognition of the complexity involved in applying the method to integro-differential equations, and some participants are new to the concept, seeking foundational understanding.

Heimisson
Messages
42
Reaction score
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
This is for single-integral calculations? Also, are you looking for the theoretical derivation or the pseudo-code?
 
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,
 
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.
 
Suppose that x_1,\ldots, x_n are the roots of the nth Legendre polynomial, and that for each i=1,2,\ldots, n we define c_i by
c_i = \int_{-1}^1 \prod_{j=1, j\neq i}^n \frac{ x- x_j}{x_i-x_j} dx
If P(x) is any polynomial of degree less than 2n then
\int_{-1}^1 P(x) dx = \sum_{i=1}^n c_i P(x_i).

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

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

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

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)

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

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

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

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

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)

\begin{array}{|r|r|} \hline<br /> \text{Roots}, x_i &amp; \text{Coefficients}, c_i \\ \hline<br /> 0.8611363116 &amp; 0.3478548451 \\<br /> 0.339981436 &amp; 0.6521451549 \\<br /> -0.339981436 &amp; 0.6521451549 \\<br /> -0.8611363116 &amp; 0.3478548451 \\ \hline<br /> \end{array}
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.
 

Similar threads

Replies
2
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
Replies
7
Views
4K
  • · Replies 1 ·
Replies
1
Views
3K
Replies
4
Views
2K
  • · Replies 5 ·
Replies
5
Views
7K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 6 ·
Replies
6
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K