Numeric Integration

Attached is a Microsoft Excel spreadsheet file that performs numeric integration using:

 

The Trapezoidal rule

Value of area; AT = h / 2 (y0 + 2y1 + 2y2 + . . . + 2yn-1 + yn)

Simpson's rule

Value of area; As= h / 3 ( y0 + 4y1 + 2y2 + 4y3 + 2y4 + . . . + 2yn-2 + 4yn-1 + yn )

 

Where h is the range of integration divided by the number segments (n) or:  h = (b- a)/n

 

 

To use the Simpson's integration worksheet, follow these steps:

  1. In the x column, insert your x values, insert at least two x values (in two different rows) so that excel would know the spacing between them
  2. In the Y column, define your function, the default equation that I defined when creating this worksheet is: f(x)=x^2 .
  3. Drag down the rows till you reach a value of x that would satisfy your separation. 
  4. partial areas are displayed besides each x point

 

 

Please note that:

  1. You must have the IsEven() and IsOdd() functions for this worksheet to work, If you don't have them, you should install the Analysis ToolPak by choosing the "Add-Ins" command in the Tools menu
  2. By definition, In  Simpson's Integration  method, you must have an even number of segments (n), therefore, if the number of segments you choose when dragging and dropping is odd, the results will display an error message (Divide by zero message, #DIV/0!), to fix that, just increase or decrease your segments by a factor of 1.
  3. This spreadsheet only computes definite integrals
  4. The worksheet is designed to handle up to 5000 point, inserting more points would require that you'd re-edit the formulas.

 

 

Click here to Download