Signed rectangle area
Each contribution is f(xᵢ*)Δx. Heights below the horizontal axis are negative. Reversing the bounds also reverses the sign because Δx becomes negative.
Approximate a definite integral with left-endpoint, right-endpoint, or midpoint rectangles. Compare all three rules, inspect the chosen sample points, and see the rectangles on a graph. Everything runs locally in your browser.
Calculated approximations will appear here.
Calculate a sum to graph the function and its rectangles.
x^2, sin(x), or exp(-x^2).Each contribution is f(xᵢ*)Δx. Heights below the horizontal axis are negative. Reversing the bounds also reverses the sign because Δx becomes negative.
For an increasing nonnegative function with a<b, the left rule typically underestimates and the right rule overestimates. This shortcut does not apply to every function.
For sufficiently smooth functions, midpoint error often decreases faster than left- or right-endpoint error as n grows. It is not guaranteed to be best for every finite example.
If a bounded function is Riemann-integrable, refining the partition drives valid sample-based sums toward the definite integral. A discontinuity at a selected sample can make that particular finite sum undefined.
Δx=(2−0)/4=0.5.
0.5[f(0)+f(0.5)+f(1)+f(1.5)]=1.75.
0.5[f(0.5)+f(1)+f(1.5)+f(2)]=3.75.
0.5[f(0.25)+f(0.75)+f(1.25)+f(1.75)]=2.625. The exact integral is 8/3 ≈ 2.666667.
For n equal subintervals on [a,b], let Δx=(b−a)/n and xᵢ=a+iΔx.
| Rule | Sample in subinterval i | Sum |
|---|---|---|
| Left | xᵢ | Lₙ=Δx Σᵢ₌₀ⁿ⁻¹ f(a+iΔx) |
| Right | xᵢ₊₁ | Rₙ=Δx Σᵢ₌₁ⁿ f(a+iΔx) |
| Midpoint | (xᵢ+xᵢ₊₁)/2 | Mₙ=Δx Σᵢ₌₀ⁿ⁻¹ f(a+(i+1/2)Δx) |
These are uniform-partition sums. The calculator does not choose unequal widths, upper/lower sums, trapezoids, or Simpson’s rule as the displayed approximation.
It approximates a definite integral by partitioning an interval, choosing one sample point in each part, multiplying the function value by that part’s width, and adding the signed rectangle areas.
The left rule samples the start of each subinterval, the right rule samples the end, and the midpoint rule samples halfway between. All three use the same Δx.
For a sufficiently smooth function, midpoint rectangles balance some first-order error across each interval. Its overall error is commonly proportional to 1/n², while basic endpoint rules commonly have error proportional to 1/n. Particular functions can behave differently.
Yes. Then Δx is negative, so the oriented sum approximates the negative of the integral with the bounds reversed.
A selected endpoint may land where the function is undefined or non-real even when another rule’s samples do not. The calculator reports that rule separately; this does not by itself prove that the improper integral exists.
No. Convergence describes long-run behavior for integrable functions, not a guarantee that every successive finite n improves every rule monotonically.
Yes. As in standard calculus formulas, trigonometric function arguments are measured in radians.
No. The expression is parsed and evaluated locally. Copying or downloading happens only when you select the corresponding control.