QUADRATURE_WEIGHTS_VANDERMONDE is a FORTRAN77 library which illustrates a method for computing the weights of a quadrature rule, assuming that the points have been specified, by setting up a linear system involving the Vandermonde matrix.

We assume that the abscissas (quadrature points) have been chosen, that the interval [A,B] is known, and that the integrals of polynomials of degree 0 through N-1 can be computed. The examples here use a finite interval and a unit weight function, but the method can easily be extended to non-finite intervals and non-unit weight functions.

### The Vandermonde Matrix

We assume that the quadrature formula approximates integrals of the form:

```        I(F) = Integral ( A <= X <= B ) F(X) dX
```
by specifying N points X and weights W such that
```        Q(F) = Sum ( 1 <= I <= N ) W(I) * F(X(I))
```

Now let us assume that the points X have been specified, but that the corresponding values W remain to be determined.

If we require that the quadrature rule with N points integrates the first N monomials exactly, then we have N conditions on the weights W.

The I-th condition, for the monomial X^(I-1), has the form:

```        W(1)*X(1)^(I-1) + W(2)*X(2)^(I-1)+...+W(N)*X(N)^(I-1) = (B^I-A^I)/I.
```

The corresponding matrix is known as the Vandermonde matrix. It is theoretically guaranteed to be nonsingular as long as the X's are distinct, but its condition number grows quickly with N. Therefore, this simple, direct approach is often abandoned when more accuracy or high order rules are needed.

### Languages:

QUADRATURE_WEIGHTS_VANDERMONDE is available in a C version and a C++ version and a FORTRAN77 version and a FORTRAN90 version and a MATLAB version.

### Related Data and Programs:

CLENSHAW_CURTIS_RULE, a FORTRAN77 program which defines a Clenshaw Curtis quadrature rule.

QUADRATURE_LEAST_SQUARES, a FORTRAN77 library which computes weights for "sub-interpolatory" quadrature rules, that is, it estimates integrals by integrating a polynomial that approximates the function data in a least squares sense.

QUADRATURE_GOLUB_WELSCH, a FORTRAN77 library which computes the points and weights of a Gaussian quadrature rule using the Golub-Welsch procedure, assuming that the points have been specified.

QUADRATURE_WEIGHTS_VANDERMONDE_2D, a FORTRAN77 library which computes the weights of a 2D quadrature rule using the Vandermonde matrix, assuming that the points have been specified.

TOMS655, a FORTRAN77library which computes the weights for interpolatory quadrature rule;
this library is commonly called IQPACK;
this is a FORTRAN90 version of ACM TOMS algorithm 655.

### Reference:

1. Philip Davis, Philip Rabinowitz,
Methods of Numerical Integration,
Second Edition,
Dover, 2007,
ISBN: 0486453391,
LC: QA299.3.D28.
2. Sylvan Elhay, Jaroslav Kautsky,
Algorithm 655: IQPACK, FORTRAN Subroutines for the Weights of Interpolatory Quadrature,
ACM Transactions on Mathematical Software,
Volume 13, Number 4, December 1987, pages 399-415.
3. Jaroslav Kautsky, Sylvan Elhay,
Calculation of the Weights of Interpolatory Quadratures,
Numerische Mathematik,
Volume 40, 1982, pages 407-422.

### Source Code:

• qwv.f, the source code.
• qwv.sh, BASH commands to compile the source code.

### List of Routines:

• QWV computes quadrature weights using the Vandermonde matrix.
• R8MAT_PRINT prints an R8MAT.
• R8MAT_PRINT_SOME prints some of an R8MAT.
• R8MAT_SOLVE2 computes the solution of an N by N linear system.
• R8VEC_EVEN returns an R8VEC of evenly spaced values.
• R8VEC_PRINT prints an R8VEC.
• TIMESTAMP prints the current YMDHMS date as a time stamp.

You can go up one level to the FORTRAN77 source codes.

Last revised on 20 February 2014.