The Strips Under the Curve
f(x)All Methods Side by Side
| Method | Approximation | Error | Error % |
|---|
Make n Bigger: the Error
| n | Left | Right | Midpoint | Trapezoid | Simpson |
|---|
The Terms of the Sum
| i | x | f(x) | Weight | Term |
|---|
Frequently Asked Questions
What is a Riemann sum?
An approximation of the area under a curve by rectangles. Split [a, b] into n strips of width Δx = (b − a)/n, take the height f(x) at one point in each strip, and add up the areas f(x)·Δx. As n grows, the sum gets closer to the integral; the definite integral is defined as the limit of these sums. Rectangles below the x-axis count as negative.
How do I calculate a left Riemann sum?
Example: f(x) = x² on [0, 2] with n = 4 rectangles.
1. Δx = (2 − 0)/4 = 0.5, so the strips start at x = 0, 0.5, 1 and 1.5 (the left ends).
2. The heights are f(0) = 0, f(0.5) = 0.25, f(1) = 1 and f(1.5) = 2.25.
3. L₄ = 0.5 × (0 + 0.25 + 1 + 2.25) = 1.75. The exact integral is 8/3 ≈ 2.667, so the left sum is too low here, because x² is increasing. The calculator shows every term in the table The Terms of the Sum.
What is the difference between left, right and midpoint sums?
Only where the height of each rectangle is taken: at the left end, the right end or the middle of the strip. For an increasing function the left sum is too low and the right sum too high; for a decreasing function it is the other way round. The midpoint sum is usually much closer: for x² on [0, 2] with n = 4 the sums are 1.75 (left), 3.75 (right) and 2.625 (midpoint), against the exact 2.667.
How does the trapezoidal rule work?
It joins the points on the curve with straight lines, so every strip becomes a trapezoid: T = (Δx/2)·[f(x₀) + 2f(x₁) + … + 2f(xₙ₋₁) + f(xₙ)]. That is exactly the average of the left and right sums: for x² on [0, 2] with n = 4, (1.75 + 3.75)/2 = 2.75.
How does Simpson’s rule work?
It fits a parabola through every three neighbouring points, which needs an even n: S = (Δx/3)·[f(x₀) + 4f(x₁) + 2f(x₂) + 4f(x₃) + … + 4f(xₙ₋₁) + f(xₙ)]. It is exact for polynomials up to degree 3 (x³ − x on [−1, 2] gives exactly 2.25 with n = 6) and very accurate for smooth functions: 1/x on [1, 2] with n = 8 gives 0.6931545, only 0.0000074 away from ln 2.
Which method is the most accurate?
For smooth functions, Simpson’s rule by far. When you double n, the error of the left and right sums roughly halves, that of the midpoint and trapezoidal rules becomes four times smaller, and that of Simpson’s rule sixteen times smaller. The table Make n Bigger shows this for your function. But it depends on the function: for √x on [0, 4], which is infinitely steep at 0, the midpoint rule with n = 50 (error 0.0013) beats Simpson’s rule (error 0.0018).
What is the error bound of the midpoint, trapezoidal and Simpson’s rule?
|E_M| ≤ K(b − a)³/(24n²) and |E_T| ≤ K(b − a)³/(12n²), with K the largest value of |f″| on [a, b]; for Simpson’s rule |E_S| ≤ K(b − a)⁵/(180n⁴) with K the largest |f⁽⁴⁾|. The bound is a guaranteed maximum, not the actual error: for sin x on [0, π] with the midpoint rule and n = 6 the bound is 0.0359, while the real error is 0.0230. The calculator gives both.
What is the difference with the integral calculator?
The Single integral tab gives the exact value of the integral, with the antiderivative and a step-by-step solution. This tab shows how the integral is built up from strips, and how good each approximation is for a given n. Approximations are also what you use when a function has no antiderivative that can be written down, such as e^(−x²).