Problem 24    Due 4/2/01

In this problem we examine the error of
Gaussian quadrature for integration of
the function f(x)=sin(x)/x over the interval
[0,pi]. You can actually do this problem
most easily with pencil, paper, and a
calculator.

a). Derive the weights and nodes for a
three point gaussian quadrature routine.
You can simplify this to three equations
in three unknowns by making use of sym-
metry.

b). Apply this rule to the integral of f(x)
= sin(x)/x over [0,pi] and compare the result
to the exact value. You can look this up in
an integral table, or take the series representation
of sin(x), divide by x, and integrate to get
a series representation of the integral. The
series converges very fast - a dozen terms 
gets the integral to double precision accuracy.

c). Do the same for Simpson's rule (3 points 
only) and for the trapezoidal rule with two 
panels (again 3 points).  Which has the smallest 
error?