Why Average a Function Over a Rectangle?
A function can vary from point to point across a rectangle. A single value that represents the function over the whole region can still be useful: it describes the constant height that would give the same total integral over that rectangle.
This idea connects a double integral with an ordinary average. The integral accounts for the function’s values across the region, while dividing by the rectangle’s area puts the result on the scale of a function value. The definition works whether the function is positive, negative, or changes sign.
Definition
Let \(R=[a,b]\times[c,d]\) be a rectangle with \(a<b\) and \(c<d\). Its area is \((b-a)(d-c)\), which is positive. If \(f\) is continuous on \(R\), its double integral over \(R\) exists. The average value of \(f\) on \(R\) is defined as follows.
Here \(dA\) denotes area in the double integral. Since the domain is a rectangle, the integral can be evaluated as an iterated integral, for example by integrating with respect to \(x\) first and then \(y\). The rectangle must have positive area: if either side length is zero, the denominator vanishes and this definition does not apply.
The formula divides the total integral by the area, not by a side length and not by the number of variables. The result has the same units as \(f\). For instance, if \(f\) measures temperature in degrees, then its average value also measures temperature in degrees.
Why Divide by the Area?
One way to understand the definition is to ask what constant function would have the same double integral as \(f\) on \(R\). If the constant value is \(C\), then its integral over the rectangle is \(C\) times the area. To match the integral of \(f\), we require $$ C(b-a)(d-c)=\iint_R f(x,y)\,dA. $$
Because the area is positive, this equation has exactly one solution for \(C\): the integral divided by the area. Thus the average value is not an arbitrary summary; it is the unique constant that preserves the integral over the same rectangle.
The same idea is visible in rectangular sums. Divide \(R\) into \(N\) smaller rectangles of equal area \(\Delta A\), and choose a sample point \((x_i,y_i)\) in each small rectangle. The rectangular sum is $$ \sum_{i=1}^{N} f(x_i,y_i)\Delta A. $$
Since \(N\Delta A\) is the area of \(R\), dividing this sum by the area gives $$ \frac{1}{N}\sum_{i=1}^{N}f(x_i,y_i). $$ This is the ordinary arithmetic mean of the sampled function values. As the subdivisions become finer, the rectangular sums approach the double integral for a continuous function. Their normalized values therefore approach the integral divided by the area. This explains how the area-based definition extends the idea of an arithmetic mean to a function over a region.
Calculating an Average Value
Worked Example: An Affine Function on a Rectangle
Find the average value of \(f(x,y)=x+2y\) on \(R=[0,2]\times[1,3]\).
First find the area. The side lengths are \(2-0=2\) and \(3-1=2\), so $$ \operatorname{Area}(R)=2\cdot 2=4. $$
Now evaluate the double integral, integrating with respect to \(x\) first: $$ \begin{aligned} \iint_R (x+2y)\,dA &=\int_1^3\int_0^2(x+2y)\,dx\,dy\\ &=\int_1^3\left[\frac{x^2}{2}+2yx\right]_{0}^{2}\,dy\\ &=\int_1^3(2+4y)\,dy\\ &=\left[2y+2y^2\right]_{1}^{3}\\ &=(6+18)-(2+2)\\ &=20. \end{aligned} $$
Divide by the area: $$ f_{\mathrm{avg}}=\frac{20}{4}=5. $$ The average value is \(5\). As a check, the constant function with value \(5\) has integral \(5\cdot4=20\) on this rectangle, which matches the integral of \(f\).
This calculation shows the two separate roles in the formula: the double integral totals the function’s contribution across the rectangle, and the area converts that total into a representative value.
Worked Example: An Average of Zero with Positive and Negative Values
Find the average value of \(f(x,y)=xy\) on \(R=[-1,1]\times[0,2]\).
The side lengths are \(1-(-1)=2\) and \(2-0=2\), so the area is $$ \operatorname{Area}(R)=2\cdot2=4. $$
Evaluate the integral by integrating with respect to \(y\) first: $$ \begin{aligned} \iint_R xy\,dA &=\int_{-1}^{1}\int_0^2 xy\,dy\,dx\\ &=\int_{-1}^{1}\left[\frac{xy^2}{2}\right]_{0}^{2}\,dx\\ &=\int_{-1}^{1}2x\,dx\\ &=\left[x^2\right]_{-1}^{1}\\ &=1-1\\ &=0. \end{aligned} $$
Therefore, $$ f_{\mathrm{avg}}=\frac{0}{4}=0. $$ This does not mean \(f\) is zero throughout the rectangle. For \(x>0\) and \(y>0\), \(xy\) is positive; for \(x<0\) and \(y>0\), it is negative. The contributions cancel in the integral. As a check, the constant value \(0\) has integral \(0\cdot4=0\), as required.
How the Rectangle and the Function Affect the Result
The average depends on both the function and the region. Changing the rectangle can change the average even if the formula for \(f\) remains the same. Likewise, changing \(f\) while keeping the rectangle fixed can change the average.
For example, consider \(f(x,y)=x^2+y\) on \(R=[0,2]\times[1,2]\). The area is \((2-0)(2-1)=2\). The integral is $$ \begin{aligned} \iint_R(x^2+y)\,dA &=\int_1^2\int_0^2(x^2+y)\,dx\,dy\\ &=\int_1^2\left[\frac{x^3}{3}+yx\right]_0^2\,dy\\ &=\int_1^2\left(\frac{8}{3}+2y\right)\,dy\\ &=\left[\frac{8y}{3}+y^2\right]_1^2\\ &=\left(\frac{16}{3}+4\right)-\left(\frac{8}{3}+1\right)\\ &=\frac{17}{3}. \end{aligned} $$
Consequently, the average is $$ f_{\mathrm{avg}}=\frac{17/3}{2}=\frac{17}{6}. $$ The constant function \(17/6\) has integral \((17/6)\cdot2=17/3\) on this rectangle, confirming the result.
A Useful Formula for Affine Functions
For an affine function \(f(x,y)=\alpha x+\beta y+\gamma\), where \(\alpha\), \(\beta\), and \(\gamma\) are constants, the average over a rectangle equals the function’s value at the rectangle’s center. This fact follows directly from integration.
To justify the formula, separate the integral into the contributions from \(x\), \(y\), and the constant term: $$ \begin{aligned} \iint_R f(x,y)\,dA &=\alpha\int_c^d\int_a^b x\,dx\,dy +\beta\int_c^d\int_a^b y\,dx\,dy +\gamma(b-a)(d-c)\\ &=\alpha(d-c)\frac{b^2-a^2}{2} +\beta(b-a)\frac{d^2-c^2}{2} +\gamma(b-a)(d-c). \end{aligned} $$
Since \(b^2-a^2=(b-a)(a+b)\) and \(d^2-c^2=(d-c)(c+d)\), this becomes $$ (b-a)(d-c)\left( \alpha\frac{a+b}{2} +\beta\frac{c+d}{2} +\gamma \right). $$ Dividing by the area gives the stated formula. This is a special property of affine functions, not a general rule for finding averages.
Common Pitfall: Using the Midpoint for Every Function
A rectangle has a center, and for an affine function its value at that center is the average. It is tempting to use this shortcut for any function, but it can give the wrong result. For example, let \(f(x,y)=x^2\) on \(R=[0,2]\times[0,1]\). The center is \((1,1/2)\), and the function’s value there is \(1\). But the actual average is $$ \begin{aligned} f_{\mathrm{avg}} &=\frac{1}{2}\int_0^1\int_0^2x^2\,dx\,dy\\ &=\frac{1}{2}\int_0^1\frac{8}{3}\,dy\\ &=\frac{1}{2}\cdot\frac{8}{3}\\ &=\frac{4}{3}. \end{aligned} $$
The midpoint shortcut would incorrectly give \(1\), while the integral definition gives \(4/3\). A direct check confirms the correct value: the area is \(2\), and \((4/3)\cdot2=8/3\), the integral of \(x^2\) over the rectangle. For a general function, calculate the integral and divide by the area unless a justified special formula applies.
Properties and Interpretation
For a fixed rectangle \(R\), averages respect linear combinations. If \(f\) and \(g\) are continuous on \(R\), and \(\lambda\) and \(\mu\) are constants, then $$ (\lambda f+\mu g)_{\mathrm{avg}} =\lambda f_{\mathrm{avg}}+\mu g_{\mathrm{avg}}. $$
This follows from the linearity of the double integral: $$ \begin{aligned} (\lambda f+\mu g)_{\mathrm{avg}} &=\frac{1}{\operatorname{Area}(R)} \iint_R(\lambda f+\mu g)\,dA\\ &=\frac{\lambda\iint_R f\,dA+\mu\iint_R g\,dA} {\operatorname{Area}(R)}\\ &=\lambda f_{\mathrm{avg}}+\mu g_{\mathrm{avg}}. \end{aligned} $$
When \(f\) is nonnegative, its integral and average are nonnegative. If \(f\) takes both positive and negative values, the average reflects their net contribution after cancellation. Thus an average of zero does not, by itself, imply that the function is zero everywhere.
The average value is useful when a varying quantity needs to be represented by one constant value over a specified area. The region must be part of the interpretation: an average over one rectangle is not automatically the average over another. Always identify the domain, calculate its area, evaluate the integral over that same domain, and then form the quotient.
Check Your Understanding
Use the definition to answer each question. Keep the rectangle and its area explicit in your calculations.
- State the average-value formula for a continuous function on \(R=[a,b]\times[c,d]\), and explain why the rectangle must have positive area.
- A function has double integral \(18\) over a rectangle of area \(6\). What is its average value, and what integral should the corresponding constant function have?
- Why can a function have average value zero without being zero at every point?
- For which type of function does the rectangle-center shortcut apply? State the formula.
- For \(f(x,y)=x^2\) on \([0,2]\times[0,1]\), compare the value at the rectangle’s center with the average value.