← Back to calculus 3

Double Integrals over Rectangles

Double Integrals over Rectangles

The single-variable definite integral measures the area under a curve. The double integral extends that idea to two dimensions: it measures the volume under a surface.


1. Warm-up: Riemann sums in one dimension

Recall that the definite integral abf(x)dx\int_a^b f(x)\,dx is built by slicing the interval [a,b][a,b] into nn sub-intervals of width Δx=(ba)/n\Delta x = (b-a)/n, picking a sample point xix_i^* in each sub-interval, and summing up rectangle areas:

i=1nf(xi)Δx.\sum_{i=1}^{n} f(x_i^*)\,\Delta x.

As nn \to \infty (i.e.\ Δx0\Delta x \to 0), this sum converges to the exact area:

abf(x)dx=limni=1nf(xi)Δx.\int_a^b f(x)\,dx = \lim_{n \to \infty} \sum_{i=1}^{n} f(x_i^*)\,\Delta x.

The graph below shows y=x2y = x^2 on [1,2][1, 2]. Use the slider to increase nn and watch the Riemann rectangles fill the area more and more accurately. Try all three sampling rules (left, right, midpoint) and observe how the error shrinks as Δx0\Delta x \to 0.

Riemann Sum: y = x² on [1, 2]

Riemann sum (right): 2.58796
Exact ∫₁² x² dx = 7/3 ≈ 2.33333
Error: 0.25463

Key formula for reference:

abf(x)dx=limni=1nf(xi)Δx.\boxed{\int_a^b f(x)\,dx = \lim_{n \to \infty} \sum_{i=1}^{n} f(x_i^*)\,\Delta x.}


2. Definition of the definite integral

Let ff be a bounded function on [a,b][a,b]. Partition [a,b][a,b] into nn equal sub-intervals [xi1,xi][x_{i-1}, x_i] where xi=a+iΔxx_i = a + i\,\Delta x and Δx=(ba)/n\Delta x = (b-a)/n. Choose any sample point xi[xi1,xi]x_i^* \in [x_{i-1},x_i].

The definite integral is defined as

abf(x)dx=limni=1nf(xi)Δx,\int_a^b f(x)\,dx = \lim_{n \to \infty} \sum_{i=1}^{n} f(x_i^*)\,\Delta x,

provided this limit exists and is independent of the choice of sample points. When f0f \geq 0, this limit equals the area of the region between the graph of ff and the xx-axis.


3. From one dimension to two: volume under a surface

Now suppose f(x,y)0f(x,y) \geq 0 is a function of two variables and RR is a rectangle in the xyxy-plane. We want to find the volume of the solid that lies above RR and below the surface z=f(x,y)z = f(x,y).

The 2D construction. Partition RR into an m×nm \times n grid of small sub-rectangles RijR_{ij}, each with area ΔA=ΔxΔy\Delta A = \Delta x\,\Delta y. Pick a sample point (xij,yij)(x_{ij}^*, y_{ij}^*) in each RijR_{ij}. The column above RijR_{ij} with height f(xij,yij)f(x_{ij}^*, y_{ij}^*) has volume

f(xij,yij)ΔA.f(x_{ij}^*, y_{ij}^*)\,\Delta A.

Adding up all columns gives the double Riemann sum

i=1mj=1nf(xij,yij)ΔA.\sum_{i=1}^{m}\sum_{j=1}^{n} f(x_{ij}^*, y_{ij}^*)\,\Delta A.

The interactive graph below shows the surface z=6x2y2z = 6 - x^2 - y^2 on the rectangle R=[1.5,1.5]×[1.5,1.5]R = [-1.5, 1.5] \times [-1.5, 1.5]. The blue columns approximate the volume under the surface. Increase nn to see the approximation improve.

Double Integral: z = 6 − x² − y² on R = [−1.5, 1.5] × [−1.5, 1.5]

Riemann sum: 42.0000
Exact ∬_R f dA = 40.5000
Error: 1.5000

4. Definition of the double integral

Let ff be a bounded function on a rectangle R=[a,b]×[c,d]R = [a,b] \times [c,d]. Partition RR into an m×nm \times n grid of sub-rectangles Rij=[xi1,xi]×[yj1,yj]R_{ij} = [x_{i-1},x_i] \times [y_{j-1},y_j], each of area ΔA=ΔxΔy\Delta A = \Delta x\,\Delta y.

The double integral of ff over RR is

Rf(x,y)dA=limm,ni=1mj=1nf(xij,yij)ΔA,\boxed{\iint_R f(x,y)\,dA = \lim_{m,n \to \infty} \sum_{i=1}^{m}\sum_{j=1}^{n} f(x_{ij}^*, y_{ij}^*)\,\Delta A,}

provided the limit exists independently of the choice of sample points. When f(x,y)0f(x,y) \geq 0, the double integral equals the volume of the solid below z=f(x,y)z = f(x,y) and above RR.

Existence. If ff is continuous on RR (or has only finitely many jump discontinuities), the double integral exists.


5. Iterated integrals on a rectangle

For a rectangle R=[a,b]×[c,d]R = [a,b] \times [c,d] we almost never compute double integrals directly from the limit definition. Instead, we reduce them to two ordinary one-variable integrals done one at a time — called iterated integrals.

The inner integral (holding xx fixed) integrates f(x,y)f(x,y) with respect to yy over [c,d][c,d]:

A(x)=cdf(x,y)dy.A(x) = \int_c^d f(x,y)\,dy.

A(x)A(x) is the area of a cross-sectional slice of the solid at a fixed value of xx.

The outer integral then integrates A(x)A(x) over [a,b][a,b]:

abA(x)dx=ab ⁣[cdf(x,y)dy] ⁣dx.\int_a^b A(x)\,dx = \int_a^b \!\left[\int_c^d f(x,y)\,dy\right]\!dx.

Fubini's Theorem. If ff is continuous on R=[a,b]×[c,d]R = [a,b]\times[c,d], then

Rf(x,y)dA=ab ⁣cdf(x,y)dydx=cd ⁣abf(x,y)dxdy.\boxed{\iint_R f(x,y)\,dA = \int_a^b \!\int_c^d f(x,y)\,dy\,dx = \int_c^d \!\int_a^b f(x,y)\,dx\,dy.}

Both iterated integrals give the same value as the double integral.

Example. Compute R(x+2y)dA\displaystyle\iint_R (x + 2y)\,dA where R=[1,3]×[0,2]R = [1,3] \times [0,2].

13 ⁣02(x+2y)dydx=13[xy+y2]02dx=13(2x+4)dx=[x2+4x]13=205=15.\int_1^3 \!\int_0^2 (x + 2y)\,dy\,dx = \int_1^3 \bigl[xy + y^2\bigr]_0^2\,dx = \int_1^3 (2x + 4)\,dx = \bigl[x^2 + 4x\bigr]_1^3 = 20 - 5 = 15.


6. Switching the order of integration

Fubini's theorem says the two orders are equal for continuous ff:

abcdf(x,y)dydx=cdabf(x,y)dxdy.\int_a^b \int_c^d f(x,y)\,dy\,dx = \int_c^d \int_a^b f(x,y)\,dx\,dy.

For rectangles this is automatic. The order can always be reversed without changing the answer.


7. When one order is easy and the other is not

Switching order of integration can make a hard integral easy. Consider

Rxsin(xy)dA,R=[0,1]×[0,π].\iint_R x\sin(xy)\,dA, \qquad R = [0,1]\times[0,\pi].

Order dydxdy\,dx (integrate yy first):

01 ⁣0πxsin(xy)dydx=01[cos(xy)]0πdx=01(1cos(πx))dx=[xsin(πx)π]01=1.\int_0^1 \!\int_0^{\pi} x\sin(xy)\,dy\,dx = \int_0^1 \bigl[-\cos(xy)\bigr]_0^{\pi}\,dx = \int_0^1 \bigl(1 - \cos(\pi x)\bigr)\,dx = \Bigl[x - \tfrac{\sin(\pi x)}{\pi}\Bigr]_0^1 = 1.

Order dxdydx\,dy (integrate xx first):

0π ⁣01xsin(xy)dxdy.\int_0^{\pi} \!\int_0^1 x\sin(xy)\,dx\,dy.

Integrating xsin(xy)x\sin(xy) with respect to xx by parts gives sin(xy)xycos(xy)y2\dfrac{\sin(xy) - xy\cos(xy)}{y^2}, and the outer integral 0π\int_0^{\pi} of that expression involves the sine integral Si(y)\operatorname{Si}(y), which has no elementary closed form.

Lesson. Always check both orders. When the "natural" order is difficult, try the other — Fubini guarantees the same answer.


8. Exercises

Compute R(3x2+y)dA\displaystyle\iint_R (3x^2 + y)\,dA where R=[0,1]×[1,1]R = [0,1]\times[-1,1].

Solution.

01 ⁣11(3x2+y)dydx=01[3x2y+y22]11dx=016x2dx=[2x3]01=2.\int_0^1 \!\int_{-1}^{1} (3x^2 + y)\,dy\,dx = \int_0^1 \bigl[3x^2 y + \tfrac{y^2}{2}\bigr]_{-1}^{1}\,dx = \int_0^1 6x^2\,dx = \bigl[2x^3\bigr]_0^1 = 2.

Compute RxexydA\displaystyle\iint_R xe^{xy}\,dA where R=[0,1]×[0,1]R = [0,1]\times[0,1].

Solution.

Integrate xx first:

01 ⁣01xexydxdy.\int_0^1 \!\int_0^1 xe^{xy}\,dx\,dy.

For fixed yy: 01xexydx\displaystyle\int_0^1 xe^{xy}\,dx. Integration by parts with u=xu=x, dv=exydxdv=e^{xy}dx:

=[xexyy]0101exyydx=eyyey1y2.= \Bigl[\frac{x e^{xy}}{y}\Bigr]_0^1 - \int_0^1 \frac{e^{xy}}{y}\,dx = \frac{e^y}{y} - \frac{e^y - 1}{y^2}.

Then:

01 ⁣(eyyey1y2)dy.\int_0^1 \!\Bigl(\frac{e^y}{y} - \frac{e^y - 1}{y^2}\Bigr)\,dy.

Switching to the order dydxdy\,dx:

01 ⁣01xexydydx=01[exy]01dx=01(ex1)dx=[exx]01=e20.718.\int_0^1 \!\int_0^1 xe^{xy}\,dy\,dx = \int_0^1 \bigl[e^{xy}\bigr]_0^1\,dx = \int_0^1 (e^x - 1)\,dx = \bigl[e^x - x\bigr]_0^1 = e - 2 \approx 0.718.

This second order is much easier.

Find the volume of the solid bounded above by z=6x2y2z = 6 - x^2 - y^2 and below by the rectangle R=[1.5,1.5]×[1.5,1.5]R = [-1.5, 1.5] \times [-1.5, 1.5].

Solution.

V=R(6x2y2)dA=1.51.5 ⁣1.51.5(6x2y2)dydx.V = \iint_R (6 - x^2 - y^2)\,dA = \int_{-1.5}^{1.5}\!\int_{-1.5}^{1.5}(6 - x^2 - y^2)\,dy\,dx.

Inner integral:

1.51.5(6x2y2)dy=[(6x2)yy33]1.51.5=2(6x2)(1.5)2(1.5)33=183x22.25.\int_{-1.5}^{1.5}(6 - x^2 - y^2)\,dy = \bigl[(6-x^2)y - \tfrac{y^3}{3}\bigr]_{-1.5}^{1.5} = 2(6-x^2)(1.5) - 2\tfrac{(1.5)^3}{3} = 18 - 3x^2 - 2.25.

Outer integral:

1.51.5(15.753x2)dx=[15.75xx3]1.51.5=2(15.751.51.53)=2(23.6253.375)=40.5.\int_{-1.5}^{1.5}(15.75 - 3x^2)\,dx = \bigl[15.75x - x^3\bigr]_{-1.5}^{1.5} = 2(15.75 \cdot 1.5 - 1.5^3) = 2(23.625 - 3.375) = \mathbf{40.5}.

This matches the value shown in the interactive graph.

Evaluate 01 ⁣x1ey2dydx\displaystyle\int_0^1\!\int_x^1 e^{y^2}\,dy\,dx.

Hint: The integrand ey2e^{y^2} has no elementary antiderivative with respect to yy directly, so switch the order.

Solution.

The region is {(x,y):0x1,xy1}\{(x,y): 0 \le x \le 1,\, x \le y \le 1\}, which is the triangle with 0xy10 \le x \le y \le 1. Switching order: 0y10 \le y \le 1, 0xy0 \le x \le y:

01 ⁣0yey2dxdy=01yey2dy=[ey22]01=e120.859.\int_0^1\!\int_0^y e^{y^2}\,dx\,dy = \int_0^1 y\,e^{y^2}\,dy = \bigl[\tfrac{e^{y^2}}{2}\bigr]_0^1 = \tfrac{e-1}{2} \approx 0.859.

Find RsinxcosydA\displaystyle\iint_R \sin x \cos y\,dA where R=[0,π/2]×[0,π/2]R = [0, \pi/2] \times [0, \pi/2].

Solution.

Since the integrand factors as (sinx)(cosy)(\sin x)(\cos y):

RsinxcosydA=(0π/2 ⁣sinxdx) ⁣(0π/2 ⁣cosydy)=[cosx]0π/2[siny]0π/2=11=1.\iint_R \sin x \cos y\,dA = \Bigl(\int_0^{\pi/2}\!\sin x\,dx\Bigr)\!\Bigl(\int_0^{\pi/2}\!\cos y\,dy\Bigr) = [-\cos x]_0^{\pi/2} \cdot [\sin y]_0^{\pi/2} = 1 \cdot 1 = 1.

Factoring trick. If f(x,y)=g(x)h(y)f(x,y) = g(x)\,h(y) and R=[a,b]×[c,d]R = [a,b]\times[c,d], then RfdA=(abgdx)(cdhdy)\iint_R f\,dA = \bigl(\int_a^b g\,dx\bigr)\bigl(\int_c^d h\,dy\bigr).