Gauss-Legendre Nodes and Weights
Enter a degree n to compute the Gauss-Legendre quadrature nodes x_i and weights w_i on the standard interval [-1, 1] and list them in a table.
Last updated:
Input
Enter a degree n to compute the Gauss-Legendre quadrature nodes x_i and weights w_i on the standard interval [-1, 1].
Number of nodes (1โ256)
Result
Degree n
5
Nodes and weights on the standard interval [-1, 1]
Number of nodes
5
Sum of weights
2
Interval
[-1, 1]
Nodes and weights
Shows the nodes x_i (roots of the Legendre polynomial) and weights w_i on the standard interval [-1, 1].
| # | Node x_i | Weight w_i |
|---|---|---|
| 1 | -0.9061798459 | 0.2369268851 |
| 2 | -0.5384693101 | 0.4786286705 |
| 3 | 0 | 0.5688888889 |
| 4 | 0.5384693101 | 0.4786286705 |
| 5 | 0.9061798459 | 0.2369268851 |
How it works
- The nodes x_i are the roots of the degree-n Legendre polynomial P_n(x), computed on the standard interval [-1, 1].
- Roots are found by Newton's method using the asymptotic initial guess cos(ฯ(i+3/4)/(n+1/2)), with derivative P_n'(x)=n(xP_n(x)โP_{n-1}(x))/(xยฒโ1).
- Weights are computed as w_i = 2 / ((1 โ x_iยฒ) (P_n'(x_i))ยฒ). Nodes are assembled using the even/odd symmetry of P_n.
- The sum of the weights equals 2 in theory (the length of [-1, 1]), which serves as an accuracy check.
- To use an arbitrary interval [a, b], map x = (bโa)/2ยทt + (a+b)/2 and scale weights by (bโa)/2.
Reviews
Tell us what you think of this calculator.
Write a review
Found an incorrect result or a problem? Turn this on to report it.
Rating