Connect via MCP →

Enter Calculation

Formula

Advertisement

Results

Gauss-Lobatto rule, n = 20
20
points on the interval [-1, 1] · sum of weights = 2
i Node x_i Weight w_i
1 -1 0.005263157894737
2 -0.980743704893914 0.032237123188489
3 -0.935934498812665 0.057181802127567
4 -0.86687797808995 0.08063176399612
5 -0.775368260952056 0.101991499699451
6 -0.663776402290311 0.120709227628675
7 -0.534992864031886 0.136300482358724
8 -0.392353183713909 0.148361554070917
9 -0.239551705922986 0.156580102647475
10 -0.080545937238822 0.160743286387846
11 0.080545937238822 0.160743286387846
12 0.239551705922986 0.156580102647475
13 0.392353183713909 0.148361554070917
14 0.534992864031886 0.136300482358724
15 0.663776402290311 0.120709227628675
16 0.775368260952056 0.101991499699451
17 0.86687797808995 0.08063176399612
18 0.935934498812665 0.057181802127567
19 0.980743704893914 0.032237123188489
20 1 0.005263157894737

What this calculator does

This tool computes the nodes (abscissas) \(x_i\) and weights \(w_i\) of the n-point Gauss-Lobatto quadrature rule on the reference interval \([-1, 1]\) with weight function \(w(x) = 1\). Unlike standard Gauss-Legendre quadrature, the Gauss-Lobatto rule always forces the two endpoints \(x = -1\) and \(x = +1\) to be quadrature nodes, which is valuable when boundary values matter (for example in spectral element methods). This is pure numerical analysis and applies identically everywhere; it is not region-specific.

Number line from -1 to 1 with quadrature nodes including both endpoints, each marked by a vertical weight bar
Gauss-Lobatto nodes on [-1, 1] include both endpoints; bar heights suggest the associated weights.

How to use it

Pick the number of points \(n\) (between 2 and 100) and optionally a display precision. The calculator returns a table of \(n\) rows, each giving the node \(x_i\) and its weight \(w_i\). The nodes are symmetric about 0 and the weights are symmetric too, so \(x_i\) and \(-x_i\) share the same weight. As a built-in sanity check, the sum of all weights equals 2, the length of the interval.

The formula explained

The rule approximates the integral as the sum \(w_1 f(x_1) + \ldots + w_n f(x_n)\) and is exact for polynomials up to degree \(2n-3\). The interior nodes \(x_2, \ldots, x_{n-1}\) are the \(n-2\) zeros of \(P'_{n-1}(x)\), the derivative of the Legendre polynomial of degree \(n-1\). $$\int_{-1}^{1} f(x)\,dx \approx \sum_{i=1}^{n} w_i\, f(x_i)$$ $$\text{where}\quad \left\{ \begin{aligned} x_1 &= -1,\quad x_{n} = 1 \\ x_i &: P_{n-1}^{\prime}(x_i) = 0 \quad(\text{interior}) \\ w_{1} &= w_{n} = \frac{2}{n\,(n-1)} \\ w_i &= \frac{2}{n\,(n-1)\,\left[P_{n-1}(x_i)\right]^{2}} \end{aligned} \right.$$ The endpoints take weight \(2 / (n(n-1))\), while each interior node \(x_i\) takes weight \(2 / (n(n-1)[P_{n-1}(x_i)]^2)\). The calculator finds the interior roots by Newton iteration starting from Chebyshev-Gauss-Lobatto guesses \(\cos(\pi j / (n-1))\), giving full double precision (about 15-16 significant digits).

Curve f(x) over [-1,1] approximated by weighted samples at Gauss-Lobatto nodes including the endpoints
The integral is approximated by a weighted sum of function values at the nodes, with the two endpoints always included.

Worked example (n = 4)

The interior nodes solve \(P'_3(x) = (15x^2 - 3)/2 = 0\), so \(x = \pm 1/\sqrt{5} = \pm 0.4472135955\). The endpoint weight is \(2/(4\cdot 3) = 1/6 = 0.1666666667\). For the interior nodes \(P_3(1/\sqrt{5}) = -0.4472135955\), whose square is \(0.2\), giving weight \(2/(4\cdot 3\cdot 0.2) = 5/6 = 0.8333333333\). The sum \(1/6 + 5/6 + 5/6 + 1/6 = 2\), confirming the rule.

FAQ

How does this differ from Gauss-Legendre? Gauss-Legendre places all nodes strictly inside \((-1, 1)\) and is exact to degree \(2n-1\). Gauss-Lobatto fixes both endpoints as nodes and is exact to degree \(2n-3\), trading two degrees of precision for boundary inclusion.

How do I use these on a general interval [a, b]? Map each node with \(x \to (b-a)/2 \cdot x + (a+b)/2\) and multiply every weight by \((b-a)/2\). This page only outputs the \([-1, 1]\) values.

Why must the weights sum to 2? Integrating \(f(x) = 1\) over \([-1, 1]\) gives 2, and the rule is exact for constants, so the weights must add up to the interval length.

Last updated: