From: hanson@math.uic.edu Date: 21 Nov 2002 18:40:38 -0600 To: ylai2@uic.edu Subject: Re: computer problem 4 Hello Yuan, You asked: >I implemented the method as you described in Maple and it gives very >close result as that from int() function. Now I wonder how the weights >and nodes are determined so that a satisfying result can be achieved? >What's the logic inside it? Thanks for your reply. The explanation is kind of complicated and I used to explain it when the class had mostly graduate students in it. There are several ways to explain it, one relying on polynomial special functions that requires a lot of background on the polynomials and the other is just relying on the main idea that Gaussian quadrature has "maximal polynomial precision". For the m-point Gaussian rule, GR_m, for integrals on [-1,+1] (recall that any finite interval, [a,b], can be transformed to this interval), then int(f(x),x=a..b) = int(F(t),t=-1..+1) ~ GR_m[F] = sum(w_i*F(t_i),i=1..m), in pseudo-Maple notation. The polynomial of maximal precision has degree n = 2*m-1, which is due to the fact that there are a total of 2*m unknown weights, w_i, and nodes, t_i, for i=1:m. Since the rule GR_m has to be exact for polynomials of degree n = 2*m-1, then it has to be exact for the monomial set {1, t, t^2, ..., t^n=t^(2*m-1)} which leads to a set of 2*m nonlinear equations for the w_i and t_i, GR_m[t^j] = sum(w_i*(t_i)^j,i=1..m = int(t^j,t=-1..+1) = (1-(-1)^(j+1))/(j+1), for j=0:2m-1. About half those integrals are zero due to symmetry or anti-symmetry, so use of these facts can be used to simplify the complexity of the nonlinear equations. In class, I demonstrated the exactness for m = 1 and 2. You could use Maple solve to work out the values for GR_3, for instance. HopeThatHelps, ProfHanson BCC: Class