Last modified: October 26, 2024
This article is written in: πΊπΈ
Midpoint Rule
The Midpoint Rule is a robust numerical method for approximating definite integrals. It seeks to estimate the area under a curve by partitioning it into a collection of rectangles and then summing the areas of these rectangles. This method is particularly useful when an antiderivative of the function is difficult or impossible to find analytically. By breaking the interval of integration into smaller segments, the Midpoint Rule allows for a piecewise approximation that can closely match the behavior of the actual function.
Unique to this method, the height of each rectangle is determined by the function's value at the midpoint of the corresponding subinterval. This approach often leads to a more accurate estimate of the area than other methods like the Trapezoidal Rule. By sampling the function at the midpoint, the Midpoint Rule effectively captures the average behavior of the function over each subinterval, reducing the potential for overestimation or underestimation that can occur when using endpoints or other sampling points.
Mathematical Formulation
For a function f(x) defined over an interval [a,b], the Midpoint Rule provides an approximation for the integral by evaluating the function at specific points within each subinterval. The basic formula for a single subinterval is:
(bβa)f(a+b2)
This formula calculates the area of a single rectangle whose width is the length of the interval (bβa) and whose height is the function value at the midpoint a+b2. To achieve a better approximation, the interval [a,b] is divided into n subintervals of equal width. The width of each subinterval, denoted by h, is given by:
h=bβan
Within each subinterval, defined by xi and xi+1, the function f(x) is evaluated at the midpoint xi+xi+12. This gives rise to the coordinates of the rectangle:
- ** (xi,f(xi+xi+12))
- ** (xi+1,f(xi+xi+12))
- ** (xi+1,0)
- ** (xi,0)
The area of each rectangle is then computed by multiplying the height f(xi+xi+12) by the width h. The integral approximation is obtained by summing these areas across all subintervals:
I=nβ1βi=0f(xi+xi+12)h
This summation provides an estimate of the total area under the curve f(x) over the interval [a,b]. The graphical representation of this method helps visualize how the Midpoint Rule approximates the integral by stacking these rectangles side by side.
Algorithm Steps
- Begin by dividing the interval [a,b] into n equal subintervals. The choice of n determines the number of rectangles used in the approximation and affects the accuracy of the result.
- For each subinterval, calculate the midpoint xi+xi+12. Evaluate the function f(x) at this midpoint to determine the height of the corresponding rectangle.
- For each subinterval, multiply the function value at the midpoint by the width h of the subinterval. This gives the area of the rectangle for that subinterval.
- Sum the areas of all rectangles obtained from each subinterval. This total sum provides the approximate value of the definite integral over [a,b].
Example
Consider the function f(x)=x2.
I. Choose Interval and Subdivisions:
Let a=0 and b=2, and partition this interval into n=2 equal subintervals. This results in subintervals [0,1] and [1,2], each with a width h=1.
II. Evaluate at Midpoints:
- For the first subinterval [0,1], the midpoint is x=0.5. Evaluating the function gives f(0.5)=(0.5)2=0.25.
- For the second subinterval [1,2], the midpoint is x=1.5. Evaluating the function gives f(1.5)=(1.5)2=2.25.
III. Apply the Midpoint Rule Formula:
- (1β0)Γf(0.5)=1Γ0.25=0.25.
- (2β1)Γf(1.5)=1Γ2.25=2.25.
IV. Sum the Areas:
The total integral approximation is 0.25+2.25=2.5.
The exact value of the integral β«20x2dx=83β2.6667. The Midpoint Rule provides an approximation of 2.5, which is reasonably close to the exact value, especially considering the simplicity of the method and the small number of subintervals used.
Advantages
- The Midpoint Rule is straightforward and efficient to implement, making it a popular choice for numerical integration, especially in educational settings and for simple applications.
- For functions that are reasonably smooth, the Midpoint Rule often provides a more accurate approximation than the Trapezoidal Rule when using the same number of subintervals.
- The Midpoint Rule can better handle certain function behaviors, such as oscillations or variations within subintervals, by averaging out fluctuations through midpoint evaluations.
Limitations
- The Midpoint Rule can introduce errors when dealing with functions that exhibit high curvature or rapid changes within subintervals, as a single midpoint evaluation may not capture the function's behavior adequately.
- Achieving high accuracy with the Midpoint Rule often requires a large number of subintervals, increasing computational effort due to the necessity of more function evaluations and calculations.
- The Midpoint Rule is less effective for discontinuous functions, as the method assumes continuity over the interval of integration and may fail to provide meaningful approximations for functions with discontinuities or sharp corners.