# How do I set up Simpson's rule in Excel?

I know there are example spreadsheets online, but I look at the formulas and don't quite understand what is going on.

I know the formula for Simpson's Rule but I don't know how to implement it in Excel. Can someone explain how to do this?

I believe I would only need 3 columns (x, y, area). However, perhaps I need to include two more columns (n, h). I'm just not sure at the moment.

What I've tried.

Equation: y = 100x * sqrt(125-x^3) from 0 to 5

I create a spread-sheet with the following columns

x | y | area

I then have 6 rows for all values and a 7th row for the summation.

• First row for x = 0, second row increments by 1 all the way up to 5.
• First row for y is the x value plugged into the equation
• First row for area = the first row in y
• Second row for area = 4 * second row in y
• Third row for area = 2 * third row in y
• Fourth row for area = 4 * fourth row in y
• Fifth row for area = 4 * fifth row in y
• Sixth row for area = sixth row in y
• Seventh row adds all the areas above and multiplies it by (1/3) and also by the change in x which is (b-a)/6 or numerically 5/6
• Can you tell us what you've already tried? SuperUser is a place where we try to help those who themselves have tried to resolve something, but get stuck or run into a problem. You improve your chances of getting a response if you provide details of what you've already tried. This does two things; 1) lets us know you are willing to put in an effort and not expect someone else to just do it for you, and 2) helps us to not suggest what you've already tried. – CharlieRB Mar 7 '13 at 20:52
• @CharlieRB I updated my question with what I've tried. I'm not sure how to insert a table of any sort otherwise I would have provided that. – Quick-Qs Mar 7 '13 at 21:34

When the boundaries are fixed to 0 and 5 it's easy because f(0)= 0 and f(5)=0. Then

f(2.5) = 2614.5625...

Simpsons Integral = 5/6*4*f(2.5) = 8715.2086...

When you want to work with flexible boundaries then it's better to create first a user defined function, for example

``````Function myFunction(x As Double) As Double
myFunction = 100 * x * Sqr(125 - x ^ 3)
End Function
``````

Then put the values for a, b and (a+b)/2 in one column and calculate the function values in the other column. Calculate the integral in another cell according to Simpsons formula.