Rectangular Rule Integration: How to Approximate a Definite Integral with Rectangles
The area under a curve is one of the central ideas in calculus, but many real-world functions cannot be integrated with a neat formula. When the algebra runs out, numerical integration takes over — and the simplest method of all is to cover the region under the curve with rectangles and add up their areas. This is the rectangular rule. It trades a little accuracy for enormous flexibility: give it any function, a starting point, an ending point, and a height, and it returns an estimate of the integral. This guide shows you how the rectangular rule works, how to calculate it step by step, and how to make it as accurate as you need.
What the Rectangular Rule Is and Why It Matters
A definite integral measures the signed area between a curve and the horizontal axis over an interval from a lower bound to an upper bound. The rectangular rule approximates that area by slicing the interval into equal-width strips and treating each strip as a rectangle. The width of every rectangle is the same — call it Δx — and the height is the value of the function somewhere within that strip.
It matters because most functions you meet outside a textbook have no closed-form antiderivative. The integral of something like e^(−x²), which underpins all of statistics, simply cannot be written with elementary functions. Numerical methods are the only way through, and computers, calculators, and simulations rely on them constantly. The rectangular rule is the foundation of that whole family of techniques. It is the first method students learn precisely because it makes the abstract idea of "area under a curve" concrete: the integral is just a sum of rectangle areas, and the more rectangles you use, the closer the sum gets to the true value.
How to Calculate with the Rectangular Rule
The core building block is the area of a single representative rectangle:
Rectangle Area = Δx × f(x), where Δx = (Upper Bound − Lower Bound) ÷ Number of Intervals
The width Δx comes from dividing the total interval into equal pieces, and the height f(x) is a representative function value for that piece. In the midpoint version of the rule — usually the most accurate of the simple choices — you evaluate the function at the center of each strip. The full integral estimate is the sum of all such rectangle areas across the interval.
Worked example. Suppose you want to approximate the area under f(x) = x² from x = 0 to x = 4 using 4 intervals.
1. Compute the width: Δx = (4 − 0) ÷ 4 = 1
2. The four strips span [0,1], [1,2], [2,3], [3,4], with midpoints 0.5, 1.5, 2.5, and 3.5
3. Evaluate the function at each midpoint: f(0.5) = 0.25, f(1.5) = 2.25, f(2.5) = 6.25, f(3.5) = 12.25
4. Multiply each height by the width and sum: 1 × (0.25 + 2.25 + 6.25 + 12.25) = 21
The exact answer is 4³ ÷ 3 ≈ 21.33, so four midpoint rectangles already land within about 1.5% of the truth. To see the area of a single representative strip of width Δx for your own function, use the Rectangular Rule Integration calculator by entering your bounds, the number of intervals, and a representative function value.
The lesson of the worked example is that even a crude rectangle scheme gets impressively close, and the gap shrinks fast as you add strips.
Using the Rule Well: Accuracy and Variants
The single biggest control you have over accuracy is the number of intervals. Because the rectangular rule's error shrinks as you narrow each strip, doubling the number of intervals roughly halves the error of the midpoint rule (and even faster for smooth curves). If an estimate is not precise enough, the first move is almost always to use more, thinner rectangles.
Where you take the height matters too. Using the left endpoint of each strip, the right endpoint, or the midpoint gives three different estimates. For a function that is increasing, left endpoints systematically undershoot the true area and right endpoints overshoot it, while the midpoint tends to split the difference and is markedly more accurate. When precision matters, prefer the midpoint.
It also helps to know where the rectangular rule struggles. Sharp peaks, rapid oscillations, and discontinuities all defeat a coarse grid, because a single rectangle cannot follow detail finer than its own width. There, you either pack in many more intervals or step up to a method that fits the curve better. The numerical integration calculator makes it easy to test how changing the interval count moves your estimate toward the true value.
Common Mistakes and How to Avoid Them
Miscomputing Δx. The width is the total interval length divided by the number of intervals, not by the number of points. With 4 intervals over [0, 4], Δx is 1, not 0.8.
Mixing up endpoints and midpoints. Decide which evaluation point you are using and apply it consistently to every strip. Silently switching between left endpoints and midpoints corrupts the sum.
Using too few rectangles on a curvy function. A handful of strips is fine for a gentle curve but wildly off for a wiggly one. When in doubt, increase the interval count and watch whether the estimate stabilizes.
Forgetting that area can be negative. Where the function dips below the axis, its rectangles contribute negative area. The rule returns signed area, which is correct for an integral but not the same as total geometric area.
Expecting an exact answer. The rectangular rule is an approximation by design. Treat its output as an estimate whose accuracy you control through the number of intervals, not as the exact integral.
Conclusion
The rectangular rule reduces the imposing idea of integration to something you can picture and compute by hand: slice the interval, build a rectangle on each slice, and add up the areas. It will not match the elegance of an exact antiderivative, but it works on any function you can evaluate, and its accuracy is entirely in your hands — narrow the strips and the estimate marches toward the truth. Master it and you understand not just one technique but the core idea behind every numerical integration method that follows.
Key Takeaways
• Know the building block: Rectangle Area = Δx × f(x), where Δx = (Upper Bound − Lower Bound) ÷ Number of Intervals, summed across all strips
• Add intervals for accuracy: Error shrinks as strips get thinner — doubling the interval count roughly halves the midpoint rule's error
• Prefer the midpoint: Midpoint heights are usually far more accurate than left- or right-endpoint heights for the same number of rectangles
• Treat it as an estimate: Use the Rectangular Rule Integration calculator to test interval counts, and remember the result is signed, approximate area