MathGroup Archive 1996

[Date Index] [Thread Index] [Author Index]

Search the Archive

Simpson's Rule

  • To: mathgroup at
  • Subject: [mg3334] Simpson's Rule
  • From: gt8301c at (M. Dean Charbonnet, Jr.)
  • Date: Wed, 28 Feb 1996 03:35:22 -0500
  • Organization: Georgia Institute of Technology
  • Sender: owner-wri-mathgroup at

I have programmed into Mathematica a way for it to evaluate a definite
integral using Simpson's Rule. This works fine for any integral which
adheres to the Fundamental theorem of calculus. When given an integral
which does not work with the fundamental theorem of calculus, how do I get
Mathematica to compute this integral using my formula for simpson's rule?

This is my formula:

simp[f_,{x_,a_,b_,n_Integer}]  := Module[{s=0,ne,k, j},
ne = n + If[IntegerQ[n/2],0,1];k:=2 (b-a)/ne;
Do[s=s+N[(f/.x->(a + j k))] +
N[(f/.x->(a + (j-1) k))] +
N[4 (f/.x->(a + (j-(1/2)) k))],{j,1,ne/2}];

Thank you,


*  M. Dean Charbonnet, Jr. *
* gt8301c at *


  • Prev by Date: Q: How to force an Equal[]
  • Next by Date: Simpson's Rule
  • Previous by thread: Re: Q: How to force an Equal[]
  • Next by thread: Simpson's Rule