Defining Simpson's rule

Define a similar function for Simpson's rule, calling it simpsonsRule[n].  

Hint:  The tricky part here is deciding how to get the coefficients to alternate 1, 4, 2, 4, ... , 2, 4, 1.  You can take care of the endpoints like we did above with the Trapezoid rule.  Also notice that 3 + (-1)^even = 4 and 3 + (-1)^odd = 2.

Use a table to show the values of Simpson's rule for at least one order of magnitude of n (i.e., 100 to 1000, for example).  


Created by Mathematica  (April 22, 2004)