Approximating Accumulated Values Over a Rectangle
A function of two variables assigns a value to each point in a region. To approximate the total contribution of those values over a rectangle, divide the rectangle into smaller rectangles. In each small rectangle, use one function value to represent the values throughout that piece, then weight that value by the piece’s area.
This produces a Riemann sum for a function of two variables. The construction resembles an area-weighted sum: each sampled height contributes in proportion to the size of the subrectangle beneath it. The result is an approximation, and different sample-point choices can produce different answers even when the partition stays fixed.
Partitions, Areas, and Sample Points
Let \(R=[a,b]\times[c,d]\) be a rectangle in the plane. Choose partition points \(a=x_0<x_1<\cdots<x_m=b\) along the \(x\)-axis and \(c=y_0<y_1<\cdots<y_n=d\) along the \(y\)-axis. These points divide \(R\) into \(mn\) subrectangles.
The subrectangle in column \(i\) and row \(j\), for \(1\leq i\leq m\) and \(1\leq j\leq n\), is
Its side lengths are \(\Delta x_i=x_i-x_{i-1}\) and \(\Delta y_j=y_j-y_{j-1}\), so its area is \(\Delta A_{ij}=\Delta x_i\Delta y_j\). Choose a sample point \((x_{ij}^{*},y_{ij}^{*})\) in each subrectangle. The point can be chosen in different ways, but it must lie in the subrectangle whose contribution it represents.
The two factors in each term have distinct roles: \(f(x_{ij}^{*},y_{ij}^{*})\) is the representative function value, and \(\Delta A_{ij}\) is the area over which that value is used. If the partition is uniform, every subrectangle has the same area. For a nonuniform partition, the areas can differ and must be calculated separately.
Why the Formula Uses Function Value Times Area
Consider first a single subrectangle with area \(\Delta A_{ij}\). If the function had the constant value \(f(x_{ij}^{*},y_{ij}^{*})\) throughout that piece, its contribution would be that constant height multiplied by the base area. For a nonnegative height, this is the volume of a rectangular box; if the height is negative, the product represents a negative contribution. A Riemann sum uses this constant-height model on each subrectangle, then adds the contributions.
This explains both the formula and its limitation. The function may vary across a subrectangle, so a single sampled value cannot generally represent every point exactly. The sum is a model based on the chosen samples, not an assertion that the function is constant within each piece.
Partition the rectangle into subrectangles with known areas.
Select one point in each subrectangle and evaluate the function there.
Multiply each sampled value by its own subrectangle’s area, then sum all the products.
Common Sample-Point Choices
For a rectangular grid, familiar choices include the lower-left corner, the midpoint, and the upper-right corner of each subrectangle. “Lower-left” and “upper-right” refer to the corners’ coordinate positions, not to the size of the function value. A midpoint is found by averaging the two \(x\)-coordinates and, separately, the two \(y\)-coordinates of the subrectangle’s opposite sides.
None of these choices is automatically the best for every function. A sample-point rule specifies how the points are chosen; the partition, function, and areas still determine the actual sum. The examples show how the same partition can lead to different approximations.
Worked Example: Comparing Corner and Midpoint Sums
Approximate the accumulated values of \(f(x,y)=x+y\) over \(R=[0,2]\times[0,1]\), using two equal intervals in each coordinate. Calculate the lower-left, midpoint, and upper-right sums.
The partition points are \(x_0=0,x_1=1,x_2=2\) and \(y_0=0,y_1=\tfrac12,y_2=1\). Each subrectangle has area
For the lower-left rule, the sample points are \((0,0),(1,0),(0,\tfrac12),(1,\tfrac12)\). The corresponding function values are \(0,1,\tfrac12,\tfrac32\). Therefore,
For the midpoint rule, the sample points are \((\tfrac12,\tfrac14),(\tfrac32,\tfrac14),(\tfrac12,\tfrac34),(\tfrac32,\tfrac34)\). Their function values are \(\tfrac34,\tfrac74,\tfrac54,\tfrac94\). Thus,
For the upper-right rule, the sample points are \((1,\tfrac12),(2,\tfrac12),(1,1),(2,1)\), where \(f\) takes the values \(\tfrac32,\tfrac52,2,3\). Hence,
The three sums are \(\tfrac32\), \(3\), and \(\tfrac92\). They differ because the sampled function values differ. The area factor remains \(\tfrac12\) for every term, since all four subrectangles have equal area.
Worked Example: A Product Function with Three Sample Rules
Use a \(2\)-by-\(2\) equal partition to calculate lower-left, midpoint, and upper-right sums for \(f(x,y)=xy\) on \(R=[0,2]\times[0,2]\).
The partition points in each coordinate are \(0,1,2\). Every subrectangle has area \((1)(1)=1\), so each sampled value is multiplied by \(1\).
The lower-left sample points are \((0,0),(1,0),(0,1),(1,1)\). The function values are \(0,0,0,1\), giving
The midpoint sample points are \((\tfrac12,\tfrac12),(\tfrac32,\tfrac12),(\tfrac12,\tfrac32),(\tfrac32,\tfrac32)\). Their values are \(\tfrac14,\tfrac34,\tfrac34,\tfrac94\). Therefore,
The upper-right sample points are \((1,1),(2,1),(1,2),(2,2)\), with values \(1,2,2,4\). Thus,
Each calculation uses the same four subrectangle areas but a different set of points. Consequently, the resulting sums are \(1\), \(4\), and \(9\), respectively.
Unequal Subrectangles and Other Sample Points
A valid Riemann sum does not require a uniform grid or a corner-based sample rule. With unequal subrectangles, each contribution must use its own area. The following example tracks the area and sample value separately in every term.
Worked Example: A Nonuniform Partition with Arbitrary Samples
For \(f(x,y)=x^2+y\) on \(R=[0,2]\times[0,1]\), use \(x\)-partition points \(0,1,2\) and \(y\)-partition points \(0,\tfrac14,1\). Choose the sample points \((\tfrac12,\tfrac18)\), \((\tfrac14,\tfrac12)\), \((\tfrac32,\tfrac15)\), and \((\tfrac54,\tfrac34)\), one in each subrectangle, and calculate the sum.
The \(x\)-widths are \(1,1\), while the \(y\)-heights are \(\tfrac14,\tfrac34\). The four subrectangle areas, in order from left to right and bottom to top, are \(\tfrac14,\tfrac34,\tfrac14,\tfrac34\).
For the lower-left subrectangle, \(f(\tfrac12,\tfrac18)=\tfrac14+\tfrac18=\tfrac38\), so its contribution is \((\tfrac38)(\tfrac14)=\tfrac{3}{32}\).
For the upper-left subrectangle, \(f(\tfrac14,\tfrac12)=\tfrac{1}{16}+\tfrac12=\tfrac{9}{16}\), so its contribution is \((\tfrac{9}{16})(\tfrac34)=\tfrac{27}{64}\).
For the lower-right subrectangle, \(f(\tfrac32,\tfrac15)=\tfrac94+\tfrac15=\tfrac{49}{20}\), so its contribution is \((\tfrac{49}{20})(\tfrac14)=\tfrac{49}{80}\).
For the upper-right subrectangle, \(f(\tfrac54,\tfrac34)=\tfrac{25}{16}+\tfrac34=\tfrac{37}{16}\), so its contribution is \((\tfrac{37}{16})(\tfrac34)=\tfrac{111}{64}\).
Adding the four weighted values gives
The sample points were not required to be corners or midpoints. They were valid because each lies in its assigned subrectangle. The calculation also shows why using a single area for all terms would be incorrect: the lower and upper rows have different heights.
A Common Pitfall: Omitting the Area Factor
A frequent error is to add the sampled function values and report that total as the Riemann sum. The values alone do not account for how much area each sample represents. For example, let \(f(x,y)=1\) on \([0,2]\times[0,1]\), divided into two intervals along each axis. There are four subrectangles, each of area \(\tfrac12\), and every sample value is \(1\).
The correction is to include the area of the corresponding subrectangle in every term. Even when all the areas happen to be equal, that common area cannot be discarded. When areas differ, omitting them also gives the subrectangles unequal influence from what their sizes warrant.
Using Riemann Sums Carefully
A finite Riemann sum is determined by three pieces of information: the function, the partition, and the sample-point rule. To calculate one reliably, first record the widths and heights of the subrectangles, then find each area, evaluate the function at the corresponding point, and finally multiply and add. This order helps prevent a point from being paired with the wrong area.
Changing the partition changes the pieces being represented; changing the sample points changes the function values used on those pieces. A sum is therefore an approximation tied to its specific construction. It should not be described as an exact accumulated value merely because its arithmetic is exact. The exactness of the arithmetic establishes only the value of that finite sum.
Check Your Understanding
Use the definition and examples above to answer these questions.
- For a subrectangle of width \(\tfrac12\) and height \(\tfrac34\), what area multiplies the sampled function value?
- On \([0,2]\times[0,1]\), divide each coordinate interval into two equal parts. What is the area of each subrectangle?
- For \(f(x,y)=x+y\) on that partition, what lower-left sample points are used?
- Can a sample point outside its assigned subrectangle be used in the ordinary rectangular Riemann sum described here? Explain.
- Why is adding the sampled function values without their area factors generally incorrect?