The integral of a function fx between the points a and b is denoted by
and can be roughly described as the area below the graph of y=fx and above the x-axis, minus any area above the graph and below the x-axis, and all taken between the points a and b.
The integral is important because it is an antiderivative for the original function, that is, if
A Riemann sum is an approximation to the integral, that is, an approximation using rectangles to the area mentioned above. The line segment from x=a to x=b is split into n subsegments which form the bases of these rectangles, and the corresponding heights are determined by the value of fxi at some point xi between the endpoints of the subsegment. The division of the segment a,b into subsegments is called a partition. For the sake of convenience we will assume here that the subsegments are of equal width, although this is not strictly necessary.
The Riemann Sum is then given by the general formula:
∑i=1n fxi ⋅b−an
There are five main types of Riemann Sums, depending on which point xi is chosen to determine the height:
Right Sum: the right endpoint of the subsegment
Left Sum: the left endpoint of the subsegment
Middle Sum: the point half way between the left and right endpoints
Lower Sum: any point xi such that fxi is minimal
Upper Sum: any point xi such that fxi is maximal
Instead of approximating the area under a curve using rectangles or trapezoids, parabolas can be used to approximate each part of a curve.
Let us compute the area under a parabola of the equation y = a⋅x2 + b⋅x + c passing through the three points −h,y0,0,y1, h,y2:
∫−hha⋅x2+ b⋅x+c dx
a⋅x33 + b⋅x22+c⋅x|x = −h ..h
2⋅a⋅h33 + 2⋅c⋅h
As the points −h,y0,0,y1, h,y2 are on the parabola, we have:
a⋅h2 −b⋅h + c
a⋅h2 + b⋅h +c
y0 +4⋅y1 + y2 =
a⋅h2 −b⋅h + c+ 4⋅c + a⋅h2 + b⋅h +c
2⋅a⋅h2 + 6 c
Therefore, the area under a parabola can be written as:
h3y0 +4⋅y1 + y2
Δx 3y0 +4⋅y1 + y2
Hence by adding all the areas under each parabolic arc using three points we can derive:
∫abfxdx = Δx 3y0 +4⋅y1 + y2 + Δx 3y2+4⋅y3 + y4 +...+Δx 3yn−2+4⋅yn−1 + yn
The above equation can be simplified into Simpson's rule:
∫abfxdx ≈ Δx3 y0+ 4⋅ y1 +2⋅ y2+4⋅ y3+2⋅ y4+4⋅ y5+..+4⋅ yn−1+yn
Adjust the size (n) of the partition used to approximate the area under the curve. Since two subsegments of the partition are used for each parabola, there will be n2 parabolas used.
Example = Example1Example2Example3Example4
Download Help Document