Simpson's rule is a method of approximating a solution to a definite integral, similar to the trapezoid rule. Simpson's Rule uses the symbol Sn, where n represents the number of divisions the segment has been divided into. Note: The number of segments must be an even integer! As n increases, there are more segments used to approximate the curve, thus the approximation gets closer to the exact solution. However, this can increase the time needed to calculate since the formula for Sn is as follows:
Sn=(Δx/3)(y0+4y1+2y2+4y3+2y4+ . . + yn-1+yn)
Sn=(Δx/3)(y0+4∑yodds+2∑yevens+yn)
Δx=(b-a)/n (where b and a are the bounds of the definite integral, and n is the number of subdivisions)
So for example, if you only had n = 4, you would only require 5 terms (y0 ,y1,y2,y3,yn) within the parenthetical expression, however with n=6, there are 7 terms, and so on an so forth. An infinite number of terms would get you to the exact solution, however since your problem specifies the error allowed, you can adjust for n to meet this. Then, you know that value for n or any value greater than it will meet the required precision.