You are on page 1of 17

Numer. Math.

41, 147-163 (1983) Numerische


MathemalJk
9 Springer-Verlag 1983

Calculation of Gauss Quadratures


with Multiple Free and Fixed Knots

G.H. Golub I and J. Kautsky 2


t Department of Computer Science, Stanford University, Stanford, CA 94305, USA
2 School of Mathematical Sciences, Flinders University, Bedford Park, S.A. 5042, Australia

Summary. Algorithms are derived for the evaluation of Gauss knots in the
presence of fixed knots by modification of the Jacobi matrix for the weight
function of the integral. Simple Gauss knots are obtained as eigenvalues of
symmetric tridiagonal matrices and a rapidly converging simple iterative
process, based on the merging of free and fixed knots, of quadratic con-
vergence is presented for multiple Gauss knots. The procedures also allow
for the evaluation of the weights of the quadrature corresponding to the
simple Gauss knots. A new characterization of simple Gauss knots as a
solution of a partial inverse eigenvalue problem is derived.
Snbject Classifications:AMS (MOS): 65F15, 65D30; CR: 5.14, 5.16.

1. Introduction

Let w be a real-valued function on some (finite, semi-infinite or infinite) real


a

interval (a, b) such that I(f),=Sfw exists


for any polynomial f. A quadrature
b
Q with distinct knots xj of multiplicities n~ and weights Cj~ (i= 1, 2, ..., n~, j
= 1, 2,..., n) is said to have polynomial order k if

I(f)=Q(f):= ~ ~ Cj,fo-t)(xj)
j=l i=1

for any polynomial f of degree less than k. Here f(~ denotes the value of
the i-th derivative of f at x. Given the knots and their multiplicities it is
possible to find the weights such that the quadrature has polynomial order at
least N.'= ~ n j . Such quadratures are called interpolatory; finding their
j=l

1 Supported in part by the United States Department of Energy contract DE-AT-03-ER71030


and in part by the National Science Foundation grant MCS-78-11985
148 G . H . G o l u b a n d J. K a u t s k y

weights is equivalent to solving a linear algebraic system of equations with


generalized Vandermonde matrices which, for large N, are strongly ill-con-
ditioned (we deal with this problem in another paper [7]).
Choosing the knots of the interpolatory quadrature to increase the poly-
nomial order leads to so-called Gauss quadratures. In this paper we wish to
consider the problem of finding some of the knots to increase the polynomial
order while other knots are prescribed. We shall therefore introduce a quadra-
ture with two sets of knots and weights, namely
nj mj

j=l
z
i=1 j=l
2
i=1

Given the fixed (or prescribed) knots vl, ..., v,. and the multiplicities m l ..... mm,
nl,..., n n the quadrature Q is called the Gauss quadrature if the free (or Gauss)
knots x 1.... ,x, are such that the corresponding interpolatory quadrature has
polynomial order N + n . Here, again, N is the number of weights (Cji and Djl)
H PTI

in the quadrature which is now N : = ~ nj q- ~ mj.


j=l j=l
Finding the Gauss knots is a nonlinear algebraic problem. The following
characterization and sufficient conditions for the existence of the Gauss knots
are well known (see, e.g. Tur/m [13] and Stancu [10]).

Theorem 1. Let qF(t): = (t--Vj)"J and q~(t): = rI (t-xj).J. The knots x 1.... , x n
j=l j=l
are the Gauss knots if and only if
b
S tk q6(t) qF(t) w(t) d t= 0 (1)
a
for k = 0 , 1 , . . . , n - 1.
Theorem 2. I f w>O on (a,b), if the multiplicities nj of the Gauss knots are odd
and if the multiplicities mj of the fixed knots vie(a, b) are even then there exist
real distinct Gauss knots xj~(a, b), j = 1, 2.... , n.
For general (odd) multiplicities n~ of the Gauss knots (1) is a system of
nonlinear algebraic equations which can be solved by some iterative method
(see e.g. [12] for a few special cases without prescribed knots). For simple
Gauss knots ( n j - 1 ) q6 is a polynomial of order n which, by (1) has to be
orthogonal (to lower degree polynomials) with respect to the function ~(t)
9.= Cqr(t)w(t) (where r is a suitable constant to achieve ff > 0 on (a, b)) in order
that its roots are the required Gauss knots. To find the coefficients of q~ from
(1) is then a linear algebraic problem; the Gauss knots can be found by a
suitable rootfinder. There is a vast literature on the calculation of such simple
Gauss quadratures based on this approach (see [11] for numerical results and
[3] for extensive reference list); a common aspect being that the function w,
which determines the integral approximated by the quadrature, enters the
b
calculations through the moments #j=Sp~w of the function w - here Po, P~. . . .
a
are some linearly independent polynomials. The resulting numerical procedures
may be unstable unless the polynomial basis Po, P~, -.. is chosen carefully.
Calculation of Gauss Quadratures 149

There is another way of finding simple Gauss quadratures (i.e. nj = 1, m = 0).


Associated with every function w > 0 is a symmetric tridiagonal matrix (called
the Jacobi matrix corresponding to w) whose elements are the coefficients
appearing in the three-term recurrence relation satisfied by the (suitably nor-
malized) polynomials orthogonal with respect to w. The eigenvalues of the
principal submatrices of this matrix are the roots of the polynomials (details in
w which in turn are the knots of simple Gauss quadratures. Golub and
Welsch [4-1 have shown how to evaluate the knots and weights of such Gauss
quadratures in a stable and efficient way. They use the implicit QL method
with shifts (procedure IMQLT in [9]) to find the eigenvalues of the Jacobi
matrices and exploit a simple relation (see also Will [14]) between the weights
of such Gauss quadrature and the eigenvectors of the Jacobi matrix. Golub [5]
further generalizes this approach to the case of one and two simple (mj= 1, m
= t, 2) prescribed knots. Gautschi [2] reports numerical results demonstrating
the superiority of this approach.
The aim of this paper is to extend the method used by Golub and Welsch
[4] to the general Gauss quadratures satisfying the assumptions of Theorem 2.
In w167and 3 we derive the basic properties of Jacobi matrices and show how
to obtain the Jacobi matrix for the function ~(t)= a(t-v)Sw(t), s = 1, 2 from the
Jacobi matrix for w. w contains an algorithm for evaluating the Jacobi matrix
for r In w we present a very simple iterative method for calculating
multiple Gauss knots and show why its convergence is comparable with that of
solving the nonlinear system (1) by Newton's method. In w we generalize the
Golub-Welsch method for calculating weights of simple Gauss knots in the
presence of other knots. In w we introduce a new characterization of simple
Gauss knots, when other knots are prescribed, as a partial inverse eigenvalue
problem for the Jacobi matrix. We use this result to analyse Golub's [5]
generalization for Radau and Lobatto quadratures and conclude that such an
approach cannot be used for more than two simple prescribed knots which,
moreover, must be separated by the interval of integration (a, b). In w8 we list
the results of some numerical experiments.
The applicability of the methods discussed here depends, of course, on the
availability of the Jacobi matrix for the function w. For some classical weight
functions and intervals the Jacobi matrices are known explicitly as are the
moments for the power bases. Indeed, the computation of classical Jacobi
matrices is in some cases more straight-forward than the computation of the
corresponding moments. For other than classical weight functions numerical
procedures which depend on the way the function w is given must be used to
evaluate either the moments or the Jacobi matrix. We discuss some methods
for evaluating Jacobi matrices in another paper [8].
Finally, we wish to add two comments regarding the Gauss quadratures
under consideration.
The prescribed knots, vl, ..., v~, are assumed to be distinct. If the conditions
of Theorem 2 are satisfied then the Gauss knots x 1, x2, ..., Xn will be distinct
as well. However, some of the Gauss knots may coincide with some of the
prescribed knots. In such cases the quadrature Q must be adjusted as follows:
if, say, x I = v l then v~ has to be removed from the list of fixed knots and the
150 G.H. Golub and J. Kautsky

multiplicity n~ of the Gauss knot xl changed to n l + m r Note that such


merging of knots will not change the value of N i.e. the number of weights in
the quadrature Q. There is an aesthetic reason to consider the resulting merged
knot a Gauss knot - it has odd multiplicity. However, there may be practical
advantages to do otherwise as we shall see later.
The conditions of Theorem 2 are not necessary for the existence of Gauss
quadratures. Of practical importance are the Kronrod schemes where we seek
Gauss knots when knots of odd multiplicity (usually 1) are prescribed inside
the interval (a, b). It would be interesting to know whether the methods of this
paper could be extended to such quadratures.

2. Orthonormal Polynomials and Jacobi Matrices

In this section we will establish some basic well-known relations for ortho-
gonal polynomials in matrix notation which we will then use throughout this
paper. We will deal with real functions of a real variable only.
Let k__>1 be an integer, Po, Pl, ..., Pk-1 be linearly independent polynomials
of degree less than k and let PR be a polynomial of degree exactly k. We denote
by p : = (Po, Pl . . . . , Pk-1) T the column vector of these polynomials. Given such a
set of polynomials there exists a unique constant matrix J and a unique
constant vector n such that

t p(t) = J p(t) + p~(t) u (2)

holds for all t. A further consequence of the linear independence of the


elements of p is that p ( t ) ~ 0 for all t. We have therefore immediately from (2)
the following result.
Lemma 1. The roots o f Pk are the eigenvalues o f J.
b
If the function w is such that the matrix D = S p p r w is non-singular (this
a
will be so for w>__0 such that w > 0 on a set of positive measure) then we also
have the following identity.
Lemma 2. The matrix J satisfies
J=MD-I-ngr D -1 (3)
b b
where g = ~ Pk P W and M = ~ t p(t) pT(t) w(t) dt is a symmetric matrix.
a a

These properties hold for any polynomial basis p. A particularly simple


and important class of polynomial bases are those where the polynomial p~ is
of exact degree j, j=O, 1, .... Such polynomials are always linearly inde-
pendent and, assuming from now on that p is such a basis, we have the
following consequence of (2).
Calculation of Gauss Quadratures 151

L e m m a 3. The matrix J is a lower Hessenberg matrix and the vector n is a


multiple of the unit vector e k. Also, flj =4=O, j = 1, 2, ..., k where we have denoted
_ r U and fli" =e]'Jei+ 1, J = 1, 2..... k - l , the super-diagonal elements of J.
flk :--ek
Furthermore, the matrix J is independent of k in the following sense: if we
extend the polynomial basis (increase k) without changing the lower degree
polynomials then the new matrix J will be an extension of the original matrix J
(including the off-diagonal element fig).
Of special importance is the case where the polynomials p, Pk are ortho-
gonal with respect to the function w. D is then a diagonal matrix and g = 0 .
Since (by (3)) M = J D is then symmetric and lower Hessenberg it, and J, must
be tridiagonal. The orthogonal polynomials thus satisfy a three-term recur-
rence relation. Furthermore, if the polynomials p, Pk are orthonormal, matrix D
is the identity matrix and matrix J itself is then symmetric. Such a symmetric
tridiagonal matrix is called the Jacobi matrix corresponding to the function w.
The orthonormal polynomials are unique up to a sign which may be chosen in
such a way that fli > 0. It is also obvious that multiplying the function w by a
(positive) scalar results in a scaling of the orthonormal polynomials such that
the corresponding J acobi matrix does not change. Finally, denoting ~tj:= e]'Je~,
j = 1 , 2 , ... the diagonal elements of J, the three-term recurrence relation
for the orthonormal polynomials is (equivalent to (2) and denoting flo:= 0)

flj+lpj+l(t)=(t--o~j+l)pj(t)--flipi_l(t), j = 0 , 1. . . . .
Note again that the elements of the Jacobi matrix are independent of its order
in the sense stated in Lemma 3 and that for orthonormal polynomials
b
D=Spprw=I
a

b (4)
J =S t p(t) pY(t) w(t) d t.
a

3. Modifying the Jacobi Matrix

Assuming the Jacobi matrix J for the function w is known we wish to find the
Jacobi matrix .7 for the modified function ~v=aqrw. In this section we will
consider the two special cases of qr(t)=(t-v)S, s = l , 2. For s = l we must
assume v ~ (a, b) and choose a > 0 if v < a and a < 0 if v > b to ensure ff > 0. For
s = 2 we choose a > 0 and v may be arbitrary.
The following result is due to Galant [1]. We present it using the matrix
notation introduced in w2, with a shorter and more instructive proof.
Theorem 3. In the case s= 1 the matrix a ( J - v I ) is positive definite; let L be a
lower triangular bidiagonal matrix such that
~ ( s - vI) = L L r (5)
152 G.H. Golub and J. Kautsky

( Cholesky decomposition, L nonsingular). Then the Jacobi matrix for the func-
tion ~v(t) = t r ( t - v) w(t) is
j=lLr L + v I + yek e[ (6)
O"
where 2
= tr flk/(ekT
Lek) 2 9
Proof. As the eigenvalues of J lie in (a, b) the positive definiteness of t r ( J - v I )
follows from the choice of a and v. Note that (by (4))
b
tr(J - v I) = ~ ~ (t - v) p(t) pr(t) w(t) d t
a

b
=L~L-lppTL-T~LT
a

which implies that q: = L - l p are polynomials orthonormal with respect to ~.


As (by (2))
(t - v) p (t) = (J - v I) p (t) + flk Pk (t)e k

we have similarly
b
J - v I = ~ (t - v) q(t) qr(t) ~(t) dt
a
b
=r 1 ~(t - v)2 p(t) pr(t) w(t) dt L - r
a

= aL-l((j_ VI) 2 +ilk2 ekek)


r L -r

from which (6) follows by substitution from (5). []


We observe that the matrix
J~: = J - 7e~e[ = 1 L -~ a ( J - v I ) L + v I
G

=L-1JL

is obtained from J by a similarity transformation corresponding to one step of


the symmetric L R algorithm with shift v ([15], Chap. 8, w167 55). As J1 and J
differ only in the last diagonal element the Theorem 3 (and Lemma 1) gives a
precise insight into the influence of such a similarity transformation. The
eigenvalues of the principal submatrices of J are the roots of polynomials (of
corresponding degree) which are orthogonal with respect to w. After such a
similarity transformation the eigenvalues of the whole matrix do not change, of
course. However, the eigenvalues of all (proper) principal submatrices change
to the roots of polynomials orthogonal with respect to the modified function
= t r ( . - v ) w where v is the shift in this symmetric L R transformation. More
importantly for our purpose, to obtain the modified Jacobi matrix .7 of a
certain order, say n, we can simply start with the Jacobi matrix J of order
k: = n + 1, perform the similarity transformation described above (symmetric L R
with shift v and suitable sign a) and discard the last row and column - the
evaluation of the correction V is not needed.
Calculation of Gauss Quadratures 153

Let us now consider two such similarity transformations, with two general-
ly different shifts v 1 and v 2. Starting with the Jacobi matrix J they may be
described as follows
al(J-vlI)=L1LT

JI-IL~L1 +vlI
--0-1 1
a 2 ( d l --/)2 I) = L 2L r (7)

J2 - - L L~ L 2 +1321.
-- 0. 2 2

Combining the second and third of these equations we obtain

L2LT2=0.2(1LTLI +(/)I-/)2)I). (8)

The following results are then obtained by simple calculation.


Lemma 4. I f /):=/)1=/)2 and 0-:=0-1--a2 then the matrix Q:=L-~T L2 is ortho-
normal and the matrix R: =LT2Lr1 is upper triangular. Furthermore, (7) simplifies to

0-(J - v I) = Q R
(9)
J2=I RQ+vI.

Corollary 1. In the case s = 2 the Jacobi matrix J for the function ~v(t)=a(t
- v ) 2 w(t) coincides up to the last two rows and columns with the matrix J2 in (9)
for any v and a > O.
It is now fairly obvious how to obtain the modified matrix J for general qr.
Starting with the Jacobi matrix J for w we perform [m/2] QR-type transfor-
mations (9) for each knot vs of multiplicity ms and one LR-type transformation
(5), (6) (no correction y) for each knot vs of odd multiplicity ms, discarding the
appropriate number of last rows and columns. The details of the algorithm are
given in the next section. We note that by (8) the shifts are in fact the
differences between the knots, i.e. only m nontrivial shifts are needed. Finally,
it is not surprising that for multiple knots we can replace each two symmetric
LR steps by one QR - see, for example, Wilkinson [15], Chap. 8, w

4. Algorithm 1 (Jacobi Matrix Modification)

Input
k required order of the resulting matrix J,
m number of fixed knots,
vs, ms, j = 1.... , m, fixed knots and their multiplicities,
154 G.H. Golub a n d J. Kautsky

a, b end points of the interval of integration,

J Jacobi matrix for w of order N.- = k + ~. m~.


j=l

Step I. Set kc..=N, set J c , = J - V l I (k~ is the order of the current modified
matrix J~ which may overwrite the storage for J).

Step 2. For j = 1, 2, ..., m do:


Step2.1. Set s..=vj, m~..=mj.
Step2.2. I f j < m set s:=vi-vi+ ~.
Step 2.3. If m c< 1 go to Step 2.6, if m~= 1 go to Step 2.5.
Step 2.4. (QR-transformation): Let J~=QR (Q orthonormal, R upper tri-
angular), set Jc" = RQ, set me."= m e - 2 , k~: = k~-2, go to Step 2.3.
Step 2.5. (LR-transformation): Set a:=sign(b-vj) and let crJ~=LLT (L
lower triangular). Set Jg=trLTL and kc."= k c - 1 .
Step 2.6. (shift): Set Jc:=J~+sI.

Step 3. exit.

Output. Jc contains the modified matrix J of order kc = k.

Remark. The interval of integration (a, b) is not really required in this algo-
rithm; all that is needed is to know whether the prescribed knots of odd
multiplicities are to the left or to the right of this interval so that a in Step 2.5
can be determined. Such Boolean information can be encoded, for example, in
the sign of the multiplicity of the knot in question and the input parameters
a, b may be discarded.

5. Evaluation of Simple and Multiple Gauss Knots

Algorithm 1 of w4 allows us to obtain the Jacobi matrix J of order N 1 = ~ nj


.i=1
corresponding to the modified weight function r If the prescribed
multiplicities of the Gauss knots are n 1 = n 2 = . . . = n, = 1 (i.e. the case of simple
Gauss knots) then by Theorem 1 and L e m m a 1 the knots x~ .... , x n (n=N~ in
this case) are the eigenvalues of ,7. As J is symmetric and tridiagonal the knots
may then be evaluated in a stable and efficient way by the procedure I M Q L T
of [9].
Before we turn our attention to the general case of odd multiplicities
n~, ..., n, let us recall the merging of the Gauss and fixed knots. In a numerical
algorithm we may decide to merge a Gauss knot x~, say, and a fixed knot v 1
not only when x~=v 1 but also when t x l - v l l < ~ , for some 5>0. It seems
natural then to not only remove vl from the list of fixed knots and to increase
the multiplicity of x 1 by m t but also to replace the value xt by a suitable
C a l c u l a t i o n of G a u s s Q u a d r a t u r e s 155

convex combination of x, and v, - for example their average weighted by their


multiplicities, i.e. by (n 1 x 1 + m 1 vl)/(n I + m O.
The following iterative process for the calculation of Gauss knots of arbi-
trary prescribed odd multiplicities comes from the above concept of merging
Gaussian and fLxed knots:
Scheme 1. Let x(~)=(x(( ).... , x~))r be the current approximation to the Gauss
knots. Find R(~)=(~]~), ..., ~(~))r as the simple Gauss knots with x (~) prescribed
as (additional) fixed knots with multiplicities n x - 1 , n z - 1 . . . . , n , - 1 . Define
the next iteration x (~+a) by

j + t) = (:~f) + (nj - 1) xf))/nj,


xt, j = 1, 2, ..., n.

The results of numerical experiments (see w with this scheme indicate


quadratic convergence. This is not surprising as the process is in fact closely
related to solving the system (1) by Newton's method. Indeed, denoting the
left-hand side of (1) by F(x), i.e.
b
Fk(X)."=~ t k f i (t-- Xj)": qv(t) W(t) dt,
a j=l

x=(x~ ..... x,) T, Newton's method for F(x)=0 defines the iterations as '~(~+~)
=~(')+~ where ~ solves

F('R(~))+ H (~,(~))~ = O.

Here H(x) is the first differential matrix given by

Hki:----.,aFk = - -
n iJ~t k.[ .t .- .- .X i ) -1 fi (t_xj),~qr(t)w(t)dt.
OXi a i,j= 1

Our iterations satisfy x {v+1)=x{~)+ z(,)where z f ) = (Sf)-xf))/nj. The ..,~(.~)are the


solutions of
b
O=~t k f i (t--Rf))(t-xf))"j-lqF(t)w(t)dt, k=O, 1.... , n - l ,
a j=l

which, using t - xi
^(*)= t - x f ) - ni z f ), we may rewrite as

0 = F (x<~))+ H (x(') z + 0 ((max Iz~')12).


J

Consequently, in the neighbourhood of the solution our iterations behave like


those of the Newton method.
The iterations of Scheme 1 are very simple to perform by the methods
already introduced. The modified matrix J is modified again for the, now even,
multiplicity n j : 1 knots ._jx(Y)(no modification if ni= 1) by the QR transfor-
mations of Algorithm 1. The eigenvalues of the Jacobi matrix of order n thus
obtained are ~') ..... s
There remains the question of the choice of an initial approximation x (~
One possibility is to find N, simple Gauss knots (i.e. eigenvalues of ]) and take
156 G.H. Golub and J. Kautsky

appropriate averages for the starting values. We should note here that the
prescribed multiplicities of the Gauss knots, if not all equal, have to be inter-
preted in some ordered way, e.g. implying x l < x 2 < .... < x , for the required
knots. In this case if 2 1 < 2 2 < . . . , <2Nl are eigenvalues of J we define x(~~
=(P121q-P2'~2 "[-"'" +PnI2n~)/(Pl+ "'" +P,)' X(2~ + ""+Pn~+n2"En.+,2)/
( P , ~ + l + " . + P , l + , 2 ) , etc. Our numerical tests (see w indicate that taking
py'=w(2j) gives better starting values than the ordinary average p j = l . How-
ever, this would be the only explicit use of the weight function w in our algo-
rithms.
We may now summarise the steps in evaluating the Gauss knots.

Algorithm 2

Input
m number of fixed knots,
vj, m~, j = 1.... , m fixed knots and their multiplicities,
a, b end points of the interval of integration,
n number of Gauss knots,
nj, j = 1.... , n multiplicities of Gauss knots,
J JacobimatrixoforderN:=Nl+N2, ( N I : = ~ n~,N2".=~mj) forw,
e 1 tolerance for merging knots, j= 1 j= 1
e2 tolerance for convergence of multiple Gauss knots,
w the weight function.

Step 1. Apply Algorithm 1 to J and fixed knots to obtain J, the Jacobi matrix
of order N 1 for the weight function Cv=aqFw, q~):= f i (t-vj) m.
j=l
Step 2. Calculate eigenvalues 21 ..... 2N1 of J.
Step3. If N~=m (all Gauss knots simple) set x~..=2j, j = l .... ,n and go to
Step 5.
Step 4. (Multiple Gauss knots; the eigenvalues 2j are assumed ordered):
Step 4.1. (Initial approximation): Set i.. = 0.
Step 4.2. For j = 1, 2, ..., n do:
Step 4.2.1. Set
yj"= Y', ~(2i§ ~(;~i+k),
k=l k I

Step 4.2.2. Set i."= i + n~.


Step 4.3. (Iteration): Apply Algorithm 1 to J and knots yj with multiplicities
nj j = 1,2 .... , n to obtain Jacobi matrix J of order n.
Calculation of Gauss Quadratures 157

Step 4.4. Calculate the eigenvalues o f f denoting them ~1 ..... ~n consis-


tently with the ordering and set x j:= (~cj+ (nj - 1 ) y i ) / n j , j = 1, 2 .... , n.
Step 4.5. If max Ixj-yjl--<~2 go to Step 5.
J
Step 4.6. Set yj.. =x~, j = 1, 2 ..... n and go to Step 4.3.

Step 5. (Merging knots): For every j and k such that Ixj--Vkl < e l , do:
Step 5.1. Set xj: = (nj xj + m RVk)/(n j -1-ink) and ny -- nj + m k.
Step 5.2. Remove Vk, m k from the list of fixed knots.

Output
x j, nj Gauss knots and their multiplicities j = 1, 2 .... , n,
m number of fixed knots,
v j, mj, j = 1, 2 .... , m fixed knots and their multiplicities.

In Algorithm 2 the list of fixed knots, their number and multiplicities as


well as the multiplicities of the Gauss knots are not only input parameters but
also output parameters as they might be changed by the merging of knots.
Also, the same comment about the parameters a, b as for Algorithm 1 (w4) ap-
plies and # in Step 4.2.1 may be replaced by a constant function.

6. Evaluation of the Weights of the Gauss Quadratures

Once all the knots of the quadrature are known the weights are uniquely
determined by the requirement that quadrature is interpolatory (i.e. of poly-
nomial order at least N, N number of weights). The algorithms described in
[7] may then be used as they exploit the same information as Algorithm 2, i.e.
the Jacobi matrix J for the weight function w rather than its moments. In fact,
as we show in this section, some of the weights can be more efficiently
calculated by a suitable modification of the approach used in I-4] and [5-1. The
other weights can then be calculated by the algorithms of [7] which allow for
the independent evaluation of the weights corresponding to selected knots.
The advantage of the approach used in I-4], 1"5] is that we can, with rather
minimal computational effort, evaluate selected elements of the normalized
eigenvectors simultaneously with the eigenvalues of a Jacobi matrix (this is
achieved by a slight change in the procedure I M Q L T I of 1"9-1which evaluates
all elements of these eigenvectors). We now have the following result.
Theorem 4. Let qk 6Tzk, qR be polynomials such that the knots of the quadrature
are the roots of their product. Let q." =(qo, ql .... , qk-1) r be linearly independent
polynomials of order k such that, for some vector u and some symmetric matrix
K,
t q ( t ) = K q ( t ) + q k ( t ) u , Vt. (10)
158 G.H. Golub and J. Kautsky

Let v be a root of qk which is a simple knot of the quadrature. Then the weight
C corresponding to this knot is
C= qr(v) y
qR (v) qT(v) q(v) (11)
where
b

Y=S q(t) qR(t) W(t) dt.


a

Proof. By integrating the Lagrange form of the interpolating polynomial we


know that
b

C = ~ w(t)qk(t) qR(t)(t-- V)-1 dt/q'k(V) qR(V). (12)


a

As K is symmetric we have the Christoffel-Darboux formulae

( t - v) qr(t) q(v) = qk(t) qr(v) U -- qk(V)qr(t) U


qr(v) q(v) = q'k(V)qr(v) U-- qk(V)q' r (V) U
(any t, v).
Since v is a simple root of qk and qR(V)~O, formula (11) is then obtained by
a simple calculation from (12). []
Identity (10) holds for any polynomial base q, qk" Note that the symmetry
of K is essential for the Christoffel-Darboux formulae. For nonsymmetric K
we would have to employ right and left principal vectors of K for (11), as in
[6], to eliminate the terms of the form q r ( v ) ( K - K r) q(t)/(t- v).
The [41, [5] approach is based on the following result.
Corollary 2. Let qo be a constant and let q be orthogonal with respect to qR w.
Then
C = u 2 fio/qR (v) (13)
where
b

rio =S qR(t) w(t) dt


a

and u 1 is the first element of the normalized eigenvector of K corresponding to


the eigenvalue v.
To use (13) we do two things:
(i) use a suitably modified version of IMQLT1 in Step 2 and in Step 4.4 of
the Algorithm 2 to obtain the first elements of the normalized eigenvectors,
(ii) evaluate /i o whenever Algorithm 1 is applied. Inspection of (4) shows
that if p = L q and q are orthonormal with respect to w and #, respectively, and
b b
# = S w then the modified moment/~o: =I#=~'~i/~o where ~'11 = e r L e l (L lower
a a

triangular). Algorithm 1 can easily be modified to save this quantity.


Summarizing, the weights of simple Gauss knots can be explicitly evaluated
during the determination of Gauss knots; however the weights of other knots
(including those simple Gauss knots which have become multiple by merging
Calculation of Gauss Quadratures 159

with fixed knots) have to be determined by the other means mentioned earlier.
The possibility to evaluate the weights of simple prescribed knots exists but is
rather limited as we will point out in the next section.
For the evaluation of weights it would be thus advantageous to keep the
simple Gauss knots in a separate list. An abbreviated version of Algorithm 2
for the calculation of Gauss quadratures with simple free knots only (no
Step 4) should therefore merge (Step 5) Gauss knots to fixed knots to produce
such a list automatically.

7. Partial Inverse Eigenvalue Problem

In this section we will consider the problem of Gauss quadrature with N 1 , = n


simple Gauss knots and N z fixed knots (counting their multiplicities) from a
different viewpoint. Recall identity (2) for some polynomials p and Pk of exact
degree with k , = N : = N I + N 2 (the total number of knots of the quadrature),
viz.
t p(t) = J p(t) +//N PN (t) e N.

If we define K . . = J + e N u r for some vector u then

t p(t) = K p(t) + q (t) e N (14)


where
q=flNpN--urp~zN. (15)

In [73 we discuss (as by-products) methods of evaluating u when all knots of q


are prescribed (an inverse eigenvalue problem or a special case of the pole
assignment problem in algebraic control theory). In this context we now have
the following result.
Theorem 5. Let p be orthonormal with respect to w. I f e~'u=0, j = 1, 2, ..., n and
the other N 2 elements of u are chosen in such a way that the N 2 fixed knots of
the quadrature are roots of q then the n other roots of q (and thus the
eigenvalues of K ) are the simple Gauss knots of the quadrature.
Proof. For j = 1, 2 ..... N and p orthonormal we have from (15)
b
uTej= -~qp~_lw.
a

The proof now follows directly from the Theorem 1 as q is required to be


qrq~. []
This is a partial inverse eigenvalue problem which we have solved in the
previous sections indirectly. Its direct solution does not seem attractive as it
would lead to an eigenvalue problem for non-symmetric matrices.
Theorems 4 and 5 allow us to comment on the algorithms for Gauss-
Radau and Gauss-Lobatto quadratures derived in [5]. In the former case we
have just one prescribed knot, say v, and the matrix K differs from J only in
160 G.H. Golub and J. Kautsky

the last diagonal element (the last element of u) by Theorem 5. Thus K is


symmetric and Theorem 4 applies to the calculation of all weights. The equa-
tion determining the correction obtained from (15) is

/~N PN (v) = e r u P N - 1 (v)

so the process may be applied for any v which is not a root of PN- 1. Of course,
there is nothing to be gained when v is a Gauss knot and the quadrature is
without fixed knots (Pn(V)=e~u=0).
However, the situation is more interesting when we prescribe two knots,
say v l , v 2. By T h e o r e m 5 the matrix K will differ from J in the last two
elements in the last row - thus K is tridiagonal but not necessarily symmetric.
If we wish to employ Theorem 4 so that the weights can be evaluated from the
eigenvectors we must symmetrize K by a similarity transformation which must
be by a diagonal matrix only to preserve the orthogonality of the polynomial
basis. A simple calculation shows that the corrected last two coefficients
~ , fl*- t of the symmetrized matrix K satisfy

e* = (v 1 g(v2)- v 2 g(vl))/(g(v2)- g(vi) )


(16)
]~.2_ 1 =]?N- t(v2 - vl)/(g(v2)- g(v 1))
where
g(t) = PN-- 2 (t)/PN-1 (t).
Note that by the Christoffel-Darboux second formula

g, = _ (pr p _ p~_ ~)//~N-~ P ~ - i

so that fl*2_i<0 whenever v i and v2 are not separated by a zero of PN-1.


Therefore the approach [5] can never be extended to a double prescribed knot
v 1 = v 2 or to the case where both v 1 and v 2 are on the same side of the interval
of integration. However, it will always work when v 1 and v 2 are on opposite
sides of the interval (the end points a, b are just a special case). Finally, the
value g(v) may be obtained as a ratio of the last two elements of the vector x
solving
(J--vI) x=eN;

this is a slight simplification of the process suggested in I-5].

8. Numerical Experiments

We wish to report two numerical experiments - one regarding the performance


of the transformations involved in Algorithm 1 and the other dealing with the
convergence of the iterative process (Scheme 1) for the multiple Gauss knots.
Jacobi matrices are explicitly known for some weight functions, for example
the Jacobi weight function Ws(t; ~,fl)=(1-t)~(1 + t ) ~ on the interval ( - 1 , 1)
and the generalized Laguerre weight function wL(t; ~ ) = t ' e -t on the interval
(0, oe), ~, f l > - 1. If we prescribe the end point(s) of some multiplicity(ies) and
Calculation of Gauss Quadratures 161

Table 1. Some Gauss quadratures with multiple knots


Chebyshev weight function w(t)=(1-t2) -~ on ( - 1 , 1),
5 Gauss knots with multiplicities 3, 5, 3, 5, 3 required.

Mult. Knot Weights

3 • 0.549229076
~0.004226880
0.000301108
5 • 0.606158895 898 ~741606103
0.008112798
0.008211978
T0.000087186
0.000014942
3 0 0.559922297
0
0.004379507

Hermite weight function w(t)=e -'~ on ( - ~ , ~),


5 Gauss knots with multiplicities 3, 5, 3, 5, 3 required.

Mult. Knot Weights

3 • ~000104814
T0.000025414
0.000001997
5 • 1.566166131749 0.280394646
~0.116085974
0.029938594
~0.003627300
0.000304690
3 0 1.211454931
0
0.058092165

Generalized Laguerre weight function w(t)=t'e -', ~= -0.8,


4 Gauss knots with multiplicities 5, 5, 3, 3, required.

Mult. Knot Weights

5 0.377 440305976 4.536913308


- 0.963763 323
0.317805881
- 0.001526206
0.005 737 276
5 4.493861670035 0.053913333
- 0.072946 278
0.056114715
-0.021 117609
0.005958 867
3 1Z154890690163 0.170703 (--4)
-0.221652 (--4)
0.112258 ( - 4 )
3 23.220809836312 0.578184 ( - 9 )
-0.997551 (--9)
0.517319 ( - 9 )
162 G.H. Golub and J. Kautsky

Table 2. Relative errors (x~v~- xj)/x I of the iterations in evaluating multiple Gauss knots
Chebyshev weight function

Knot 0.963..(mult. 3) Knot 0.606..(mult. 5)

v Error v Error

0 0.17 (-1) 0 0.43 (-1)


1 -0.25 (-2) 1 -0.83 (-2)
2 -0.99 (-4) 2 -0.24 (-3)
3 -0.17 (-6) 3 -0.33 (-6)
4 -0.49 (-12) 4 -0.87 (-12)

Hermite wei.ght function

Knot 3.320..(mult. 3) Knot 1.566..(mult. 5)

v Error v Error

0 0.13 0 -0.26
I 0.55 (-1) 1 -0.13
2 0.20 ( - 1 ) 2 -0.26 (-1)
3 0.11. (-2) 3 -0.66 (-3)
4 0.77 (-6) 4 -0.25 (-5)
5 0.75 ( - 12) 5 0.43 ( - 12)

Table 3. Relative errors of initial approximations of representative knots

Weight function Choice p-=l Choice p=&(2)


(multiplicities of
knots) Error Iter. Error Iter.

Chebyshev 0.0026 0 -0.017 0


(3, 5, 3, 5, 3) 0.0142 -0.043
Hermite -0.34 3 -0.13 2
(3, 5, 3, 5, 3) 0.32 -0.26
Laguerre ~t=3.0 0.28 4 0.50 3
(5, 5, 3, 3) 0.62 0.33
Laguerre ~t=0.0 0.98 5 -0.26 3
(5, 5, 3, 3) 0.74 0.40
Laguerre ~t=-0.8 2.07 6 -0.87 3
(5, 5, 3, 3) 0.78 0.43

p e r f o r m A l g o r i t h m 1 we can c o m p a r e the resulting m a t r i x with the explicitly


k n o w n m a t r i x for the m o d i f i e d weight function. We h a v e p e r f o r m e d tests o n
matrices of o r d e r n up to 90 a n d m o d i f y i n g p o l y n o m i a l s of degree s u p to 40
with a loss o f a c c u r a c y not exceeding 1 d e c i m a l digit in d o u b l e precision
a r i t h m e t i c (15 digits). T h e o p e r a t i o n c o u n t for this p r o c e d u r e is of o r d e r O ( n s
+ 89 2) a s the similarity t r a n s f o r m s used in A l g o r i t h m 1 are O ( k ) for t r i a n g u l a r
m a t r i c e s o f o r d e r k. This was confirmed by t i m i n g the calculations.
Calculation of Gauss Quadratures 163

In Table 1 we list some examples of Gauss quadratures with multiple knots


(for brevity with no prescribed knot, i.e. m---0) for various classical weight
functions. The weights were obtained by the methods discussed in [7] - we list
them here (in the order C ~ , Cj2 .... , C~n~ for the knot xj of multiplicity nj) for
information only. The quadratures were checked by calculating the standard
(power) m o m e n t s ; details of such checks will be discussed in a future paper.
In Table 2 we present the iterations defined by Scheme 1. We observe that
after a few iterations, during which the position of the multiple Gauss knots is
approximately located to about 1 digit accuracy), quadratic convergence is
indicated. In Table 3 we compare the two strategies for choosing the initial
approximation (see w5). We note that the weighted average gives a better initial
approximation, particularly for the more singular weight functions. The num-
ber of iterations quoted in this Table is the n u m b e r of iterations needed to
approximately locate multiple Gauss knots.
It is interesting that for the generalized Laguerre weight function w(t)
= t ~ e -t this number seems independent of the parameter ct demonstrating the
suitability of the weighted average initial approximation.

References

1. Galant, D.: An implementation of Christoffel's theorem in the theory of orthogonal poly-


nomials. Math. Comput. 25, 111-113 (1971)
2. Gautschi, W.: On generating Gaussian quadrature rules. In: Numerische Integration, ISNM
45, H~immerlin, G. (ed.), Birkh~iuser, Basel, pp. 147-154, 1979
3. Gautschi, W.: A survey of Gauss-Christoffel quadrature formulae. In: Christoffel, E.B.: The
Influence of his work on Mathematics and the Physical Sciences, Butzer, P.L., Feh6r, F. (eds.),
Birkh~iuser, Basel, pp. 72-147, 1981
4. Golub, G.H., Wetsch, J.H.: Calculation of Gauss Quadrature Rules. Math. Comput. 23, 221-
230 (1969)
5. Golub, G.H.: Some modified matrix eigenvalue problems. SIAM Rev. 15, 318-334 (1973)
6. Kautsky, J.: Matrices related to interpolatory quadratures. Numer. Math. 36, 309-318 (1981)
7. Kautsky, J., Elhay, S.: Calculation of the weights of interpolatory quadratures. Numer. Math.
40, 407-422 (1982)
8. Kautsky, J., Golub, G.H.: Evaluation of Jacobi matrices. Report, School of Mathematical
Sciences, Flinders University of South Australia, 1982
9. Martin, R.S., Wilkinson, J.H.: The Implicit QL Algorithm. Numer. Math. 12, 277-383 (1968)
10. Stancu, D.D.: Sur quelques formules generales de quadrature du type Gauss-Christoffel.
Mathematica (Cluj) 1 (24), 167-182 (1959)
11. Stancu, D.D., Stroud, A.H.: Quadrature formulas with simple Gaussian nodes and multiple
fixed nodes. Math. Comput. 17, 384-394 (1963)
12. Stroud, A.H., Stancu, D.D.: Quadrature formulas with multiple Gaussian nodes. SIAM J.
Numer. Anal. Series B2, 129-143 (1965)
13. Tur~m, P.: On the theory of the mechanical quadrature. Acta Sci. Math. (Szeged) 12, 30-37
(1950)
14. Wilf, H.S.: Mathematics for the Physical Sciences. (Chapter 2). New York: Wiley, 1962
15. Wilkinson, J.H.: The Algebraic Eigenvalue Problem. Oxford: Clarendon Press, 1965

Received February 20, 1982/June 30, 1982

You might also like