The previous lesson froze the rate at the left end of each piece. Freezing it at the right end is equally defensible, and the two give different numbers. Using the same four pieces on the square rate t² over the interval from 0 to 1, the width is 1/4, the left rates are 0, 1/16, 4/16, 9/16, and the right rates are 1/16, 4/16, 9/16, 16/16.
Definition · The right sum and the gapWith the pieces of the previous lesson, the right sum uses the rate at each right end: Rₙ = h·(f(a + h) + … + f(b)). The gap is Rₙ − Lₙ.
A rate is rising if f never decreases from a to b, and falling if it never increases. Monotone means one or the other.
t² on [0, 1], n = 4, h = 1/4
L₄ = (1/4)·(0 + 1/16 + 4/16 + 9/16) = (1/4)·(14/16) = 7/32
R₄ = (1/4)·(1/16 + 4/16 + 9/16 + 16/16) = (1/4)·(30/16) = 15/32
R₄ − L₄ = 8/32 = 1/4
h·(f(1) − f(0)) = (1/4)·(1 − 0) = 1/4
Theorem · The gap between the right and left sumsFor any rate f on the interval from a to b cut into n equal pieces of width h, Rₙ − Lₙ = h·(f(b) − f(a)).
Write the left ends as t₀ = a, t₁, …, tₙ₋₁ and the right ends as t₁, …, tₙ = b. Then Lₙ = h·(f(t₀) + f(t₁) + … + f(tₙ₋₁)) and Rₙ = h·(f(t₁) + … + f(tₙ₋₁) + f(tₙ)).
The terms f(t₁), …, f(tₙ₋₁) appear in both, so they cancel in the difference. What remains is h·(f(tₙ) − f(t₀)), which is h·(f(b) − f(a)). Nothing was assumed about f: this holds for a rate that wanders as much as you like.
□
The proof has no condition on the rate, and the bracket does. Suppose the rate rises. On any one piece the rate is at least its left-end value and at most its right-end value, so the true change over that piece is at least rate-at-left times width and at most rate-at-right times width. Adding over the pieces, Lₙ ≤ total ≤ Rₙ. For a falling rate every inequality reverses.
Which sum is the larger
The right sum is not always the overestimate. The falling preset is 4 − t on the interval from 0 to 2, with four pieces. Its left-end rates are 4, 7/2, 3, 5/2, giving Lₙ = 13/2, and its right-end rates are 7/2, 3, 5/2, 2, giving Rₙ = 11/2. The gap Rₙ − Lₙ is −1, which is (1/2)·(2 − 4), the formula applied without change. The lab's exact total is 6, between the two with the larger sum on the left.
Example · A rate that is not monotoneType t - t^2 as the rate, with the interval from 0 to 1 and one piece. The rate is 0 at both ends, so both sums are 0, and the lab's exact total is 1/6.
The total is outside the pair. The bracket needed the rate to move one way only; this rate rises and then falls, and the two end values say nothing about the middle. The gap formula still holds, and gives 0.
Every number the lab prints for the gap is an exact fraction, and so is the bracket. On the square preset the total 1/3 lies between 7/32 and 15/32, a window of width 1/4. That is a statement the page can prove by arithmetic rather than assert, and doubling the pieces halves the window.