From the handbook: Several Variables, double integrals §451–458, line integrals and Green's formula §471–475, pages 663–703
A total over a region can be found by adding up tiny squares inside it, or by walking once around its edge.
Idea 6 added up thin strips under a curve. The same trick works over a whole region of a map: cut it into small squares, work out the quantity on each square, and add them all. With smaller and smaller squares the sum becomes exact. This is the double integral (§451):
∬D f(x, y) dx dy
Read it as “the double integral over the region D of f of x and y, d x d y”. D is the region. f(x, y) is the quantity at each point, for example the height of a terrain (idea 8). dx dy is the area of one tiny square, dx wide and dy tall. Two integral signs because the squares run in two directions.
If f is the height of the ground, the double integral is the volume of earth under the terrain (§452). If f is just 1 everywhere, every square counts as its own area and the total is the area of the region. That simplest case is the left-hand picture: count the squares.
Here is the surprise. You can get the same area without ever looking inside: walk once around the edge, counterclockwise, and at each straight step note the triangle swept out between the step and a fixed center point (the center of the grid). Steps that swing counterclockwise around the center add their triangle; steps that swing back clockwise take theirs away. What is left is exactly the area of the shape. For a polygon with corners (x₁, y₁), (x₂, y₂) and so on, each step from one corner to the next adds
½ (x₁ y₂ − x₂ y₁)
Read it as “one half of: first x times second y, minus second x times first y”. This is the cross product of idea 2 (the signed area of the parallelogram the two corners make with the center), halved to give the triangle.
Worked example. The triangle with corners (1, 1), (5, 1) and (5, 4) has base 4 and height 3, so its area is ½ × 4 × 3 = 6. Walking round it: from (1, 1) to (5, 1) gives ½(1 × 1 − 5 × 1) = −2; from (5, 1) to (5, 4) gives ½(5 × 4 − 5 × 1) = 7.5; from (5, 4) back to (1, 1) gives ½(5 × 1 − 1 × 4) = 0.5. Total: −2 + 7.5 + 0.5 = 6. The first step swings clockwise around the center, so its blue triangle is taken away again.
This is a special case of Green's formula (§474), which says that adding up a certain kind of “swirl” over the inside of a region gives the same answer as adding up a matching quantity along its edge, the line integral (§471). Written out:
∮ P dx + Q dy = ∬ (∂Q/∂x − ∂P/∂y) dx dy
Read it as “walking round the edge and adding P times each step across plus Q times each step up, equals the double integral over the inside of: the east slope of Q minus the north slope of P”. P and Q are any two rules of x and y; the curly ∂ slopes are the partial derivatives of idea 8. The circle on the ∮ means the path closes on itself.
Choose P = −½y and Q = ½x: the inside quantity becomes ½ + ½ = 1, so the right side is the area, and the left side becomes the edge sum above. The book's own example (§473) walks round the triangle with corners (0, 0), (1, 0), (1, 1) adding (x − y²) dx + 2xy dy, and gets ½ + 1 − ⅚ = ⅔. Green's formula says the double integral of 2y + 2y = 4y over the same triangle must also be ⅔, and it is.
This is how a GIS program finds the area of a watershed or a country from nothing but the list of points on its outline. It is also the first taste of a deep pattern in mathematics and physics: what happens inside a region is recorded on its boundary.
Vygodsky, Mathematical Handbook: Higher Mathematics, chapter on functions of several variables.
With height as the quantity, the left-hand picture is the volume of earth under the landscape of idea 8.