Integrals from Scratch
Every rectangle gets the area wrong. Infinitely many rectangles get the area exactly right.
Here is a strange way to measure a curved shape: fill the shape with rectangles. A rectangle has a flat top and a curve does not, so every rectangle gets the area a little wrong, however many you use. Yet calculus uses rectangles to find areas exactly. How can a pile of wrong answers add up to a right one?
Start with a shape that no school geometry formula covers: the region under the curve \(y = x^2\), from \(x = 0\) to \(x = 1\).
The triangle under the dashed diagonal has area \(\tfrac12\), and the shaded region fits inside that triangle. So the shaded area is less than \(\tfrac12\). How much less?
Guess the area
Your move: guess the area under each of three curves, then watch rectangles score your guess.
On every curve, the rectangle total crept toward one number, yet even 1,024 rectangles missed that number by a little.
For \(y = x^2\), the rectangle totals close in on about 0.333. What is the true area?
- Exactly \(\tfrac13\)
- About 0.333, with no exact value
- A tiny bit more than \(\tfrac13\)
- No one can know for sure
Show answer
A. Exactly \(\tfrac13\)
Exactly \(\tfrac13\), not just close. The proof comes further down, and the proof is built from the same wrong rectangles.
How can wrong rectangles prove an exact answer? Slow the rectangles down and count the rectangles yourself.
Count the rectangles
Cut the stretch from 0 to 1 into equal strips. In each strip, stand a rectangle as tall as the curve at the strip's left edge. Add up the rectangles' areas, height times width.
Your move: drag the slider to add rectangles, or press Play, and watch the error fall toward zero.
The gap between a total and the true area is called the error. The error is 34% with 4 rectangles, and only 1.5% with 100.
Go from 10 rectangles to 20. What happens to the error?
- The error stays about the same
- The error halves
- The error drops to a quarter
- The error drops to zero
Show answer
B. The error halves
The error halves, from 14.5% to 7.4%. Double the rectangles again, to 40, and the error halves again, to 3.7%.
Why does the error halve? The answer hides in the thin slivers that the rectangles miss.
Where the error hides
Zoom in on one strip. The curve keeps rising across the strip, so the left rectangle falls short of the curve. A right rectangle, as tall as the curve at the strip's right edge, pokes above the curve.
So the true area sits between two totals: all the left rectangles and all the right rectangles. How far apart are the two totals? Each right rectangle is a left rectangle plus an extra piece on top.
Your move: add strips with the slider and watch the column of extra pieces on the right: does the column get taller, or only thinner?
The column is one strip wide, a width written \(\Delta x\). The column is as tall as the curve's total climb, \(f(b) - f(a)\), where \(a\) and \(b\) are the two ends of the region:
For \(y = x^2\), the column is 1 tall and \(\tfrac1n\) wide, where \(n\) is the number of strips. The true area sits between the two totals, so the left total misses by less than \(\tfrac1n\). Double the strips, and the column's area halves, and so does the error.
Now try the sine arch, \(y = \sin x\) from 0 to \(\pi\). The arch rises, then falls. Which total is bigger: the left total or the right total?
- The left total
- The right total
- Neither: the two totals are equal
Show answer
C. Neither: the two totals are equal
Equal, for any number of strips. The arch starts and ends at height zero, so the column has no height: every piece gained on the way up is lost on the way down. Pick Sine arch in the widget above to watch.
Halving is slow, though. For six correct digits of \(\tfrac13\), left rectangles need about a million strips. Is there a smarter height to pick for each rectangle?
Measure at the middle
Try the height of the curve at the middle of each strip. On a rising curve, a middle rectangle sticks up above the curve on the strip's left half and falls short on the right half. The extra piece and the missing piece almost cancel.
In the rectangle widget, pick Middle and go from 10 rectangles to 20. What happens to the error now?
- The error halves, like before
- The error drops to a quarter
- The error drops to a tenth
- The error grows
Show answer
B. The error drops to a quarter
The error drops to a quarter, from 0.25% to 0.062%. With middle rectangles, each doubling of the strips cuts the error by four, not by two.
| Number of rectangles | Left edge | Middle |
|---|---|---|
| n=1 | 0.477 | 1.079 |
| n=2 | 0.681 | 1.681 |
| n=4 | 0.941 | 2.283 |
| n=8 | 1.223 | 2.885 |
| n=16 | 1.514 | 3.487 |
| n=32 | 1.811 | 4.089 |
| n=64 | 2.109 | 4.692 |
| n=128 | 2.409 | 5.294 |
| n=256 | 2.71 | 5.896 |
| n=512 | 3.011 | 6.498 |
| n=1024 | 3.311 | 7.1 |
For six correct digits, about 400 middle rectangles do the work of a million left rectangles. Still, every middle total is a little wrong too. So how can anyone say the area is exactly \(\tfrac13\)?
From close to exact
Stop looking at any single total. Ask instead which number the totals close in on as the strips get thinner, with no end. First, name the parts: number the strips from 1 to \(n\), each \(\Delta x\) wide, and make strip \(i\) as tall as the curve at a chosen point \(x_i\) (the left edge, the right edge or the middle).
Adding up height times width for every strip gives a Riemann sum:
The number the Riemann sums close in on, as \(n\) grows without end, is the definite integral:
For a curve with no breaks or jumps, the left, right and middle sums all close in on that same number. Each sum is wrong; the limit is exact.
The proof: the area under \(y = x^2\) is exactly \(\tfrac13\)
Use right edges. With \(n\) strips between 0 and 1, each strip is \(\Delta x = \tfrac1n\) wide, and strip \(i\) ends at \(x_i = \tfrac in\).
The right sum is \(S_n = \sum_{i=1}^{n} \left(\tfrac in\right)^2 \cdot \tfrac1n = \tfrac{1}{n^3} \sum_{i=1}^{n} i^2\).
The first \(n\) square numbers add up to \(\tfrac{n(n+1)(2n+1)}{6}\). (Check with \(n = 3\): \(1 + 4 + 9 = 14\), and \(\tfrac{3 \cdot 4 \cdot 7}{6} = 14\).)
So \(S_n = \tfrac{(n+1)(2n+1)}{6n^2} = \tfrac13 + \tfrac{1}{2n} + \tfrac{1}{6n^2}\).
As \(n\) grows without end, \(\tfrac{1}{2n}\) and \(\tfrac{1}{6n^2}\) both shrink to 0. So \(\int_0^1 x^2\,dx = \tfrac13\), exactly.
The leftover, \(\tfrac{1}{2n} + \tfrac{1}{6n^2}\), is the right sum's error. The error is never zero for any \(n\), but the error's limit is zero.
The proof leaned on a formula for adding up square numbers, and most curves have no such formula. Is there another road to the exact area?
The plot twist
In the late 1600s, Isaac Newton and Gottfried Leibniz each found another road, one that links area to slope, the steepness of a curve. To see the link, let the region grow. Fix the left end at \(a\), let the right end \(x\) move, and call the area from \(a\) to \(x\) by the name \(A(x)\).
Picture sliding the right end \(x\) a little to the right. How fast does the area \(A(x)\) grow?
- As fast as the curve is tall at \(x\)
- As fast as the curve is steep at \(x\)
- At the same speed everywhere
Show answer
A. As fast as the curve is tall at \(x\)
As fast as the curve is tall. A small step \(h\) to the right adds one thin strip, \(h\) wide and about \(f(x)\) tall, so the area grows at the rate \(f(x)\).
The rate at which \(A(x)\) grows is the slope of \(A\). So the slope of the area is the height of the curve:
Your move: find the x where the shaded area peaks, and check that the two numbers under the plots always match. Area below the axis counts as negative.
The link hands over a shortcut. Find any function \(F\) whose slope is \(f\), called an antiderivative of \(f\). The area from \(a\) to \(b\) is then one subtraction:
For \(y = x^2\), the function \(F(x) = \tfrac{x^3}{3}\) has slope \(x^2\). So the area from 0 to 1 is \(\tfrac{1^3}{3} - \tfrac{0^3}{3} = \tfrac13\): one line instead of a limit of sums.
Your turn. Use the shortcut to find the area under \(y = x^3\) from 0 to 2. Hint: \(F(x) = \tfrac{x^4}{4}\) has slope \(x^3\).
- 2
- 4
- 8
- 16
Show answer
B. 4
\(F(2) - F(0) = \tfrac{2^4}{4} - 0 = 4\), exactly. Rectangles would need thousands of strips just to get close to 4.
flowchart LR I["Integral<br>area under a curve"] <----> D["Derivative<br>slope of a curve"]
So here is the answer to the opening puzzle. Every rectangle total is wrong, but the integral is not any one total. The integral is the one number all the totals close in on: for \(y = x^2\), exactly \(\tfrac13\), by the proof or by one subtraction.
For the AP exam
Ask Phy
- Why does the middle-rectangle error shrink like \(1/n^2\) instead of \(1/n\)?
- Why does \(F(b) - F(a)\) still work when part of the curve is below the axis?
- How do I turn \(\lim_{n\to\infty} \sum_{i=1}^{n} \frac{3}{n}\left(1 + \frac{3i}{n}\right)^2\) back into an integral?