-
Notifications
You must be signed in to change notification settings - Fork 70
8. Numerical Integration
The basic idea behind the numerical integration is calculating the approximate area between the curve of the function and the x-axis by using the shapes that we know how to calculate their area.
Using rectangles to calculate the area under the function's curve is called the midpoint rule. The name arises from taking the midpoint instead of begin or end points. For integrating a function
Using trapezoids instead of rectangles is called trapezoidal rule. While the bottom of the trapezoids is on the x-axis, the top side connects the starting and the ending point of the step. The area of the trapezoids can be easily calculated as
A more advanced approach can be connecting the steps with polynomials instead of lines. If the sequential 3 points connected with a second-order interpolating polynomial gives the Simpson's 1/3 rule:
The number of the points connected with an interpolating polynomial can be increased. For instance if we use a third-order polynomial for sequential 4 points, we get the Simpson's 3/8 rule: