Sign in

Libre University uses your GitHub account. Signing in is only needed to sit a final test, so the score is kept on your profile.

Double integrals

A surface z=f(x,y) standing over a region of the plane encloses a volume, and nothing in the calculus of one variable says what that volume is or how to compute it.

The previous lesson finished the differential half of the subject: partial derivatives, gradients, tangent planes and extrema, with and without constraints. The other half of calculus is summing. In one variable the integral ∫abf(x)dx was defined as the limit of sums of thin rectangles, height times width, as the widths shrink to zero, and the Fundamental Theorem then evaluated it with an antiderivative. This lesson builds the two variable integral the same way, from sums of thin boxes, and then shows that it can be evaluated with nothing more than two single integrals, one inside the other. It assumes the single integral with its substitution rule, and the partial derivative's habit of holding one variable fixed while the other moves.

Volume as a limit of sums

Take a function f(x,y) on the rectangle R where a≤x≤b and c≤y≤d, written R=[a,b]×[c,d], and suppose for the moment that f is positive. Cut [a,b] into m equal pieces of width Δx and [c,d] into n pieces of width Δy. The grid lines divide R into mn small rectangles, each of area ΔA=ΔxΔy. Over the small rectangle Rij pick a sample point (xij*,yij*) and erect a box of that base and height f(xij*,yij*). The boxes together approximate the solid under the surface, and their total volume is the double Riemann sum

Smn=∑i=1m∑j=1nf(xij*,yij*)ΔA

The double integral of f over R is the limit of these sums as the grid is refined in both directions, provided the limit exists and is the same for every choice of sample points:

∬RfdA=limm,n→∞∑i=1m∑j=1nf(xij*,yij*)ΔA

When f≥0 this is the volume under the surface and above R. When f takes both signs, the boxes below the plane count negatively, exactly as area below the axis did in one variable. As there, every continuous function on a closed rectangle has a double integral; the proof uses the same uniform continuity argument and is not repeated here.

Take the paraboloid f(x,y)=16-x2-2y2 over the square [0,2]×[0,2], and use an n by n grid. Two sample points are natural. The upper right corner of each small square gives the lowest value of f on it, because f falls as x and y grow, so that sum underestimates. The centre of each square gives the midpoint sum. A few lines of code produce these:

GridRectanglesCorner sumMidpoint sum
2×2434.00049.000
4×41641.50048.250
8×86444.87548.0625
16×1625646.46948.0156
100×10010,00047.75948.0004
1000×10001,000,00047.97648.000004

Both columns close on 48. The corner sums creep up slowly, their error falling roughly like 1n, and even a million boxes leave them wrong in the second decimal place. The midpoint sums miss by exactly 4n2, so doubling the grid quarters the error. What the table cannot do is prove the answer is 48, and a million evaluations for three figures is poor value. The next section finds the exact value with two ordinary antiderivatives.

Slicing: the iterated integral

Freeze x at some value between 0 and 2 and cut the solid with the vertical plane at that x. The cut face is the region under the curve y↦16-x2-2y2 for 0≤y≤2, an ordinary area under a curve, with x acting as a constant. Its area is

A(x)=∫02(16-x2-2y2)dy=[16y-x2y-2y33]02=32-2x2-163

This is partial integration, the reverse of the partial derivative: integrate in y as if x were a number. The result is a function of x alone.

Now stack the slices. A slab of thickness Δx at position x has volume close to A(x)Δx, and adding the slabs and letting Δx shrink is a single integral:

∫02A(x)dx=∫02(803-2x2)dx=1603-163=48

The table's 48 is exact. The integral just computed is written with both steps visible,

∫02∫02(16-x2-2y2)dydx

and called an iterated integral. It is read from the inside out: the inner integral and the inner differential dy belong together, so y runs from 0 to 2 first, and the outer pair, dx with its limits, is done last. Slicing the other way, at fixed y, gives ∫02(16-x2-2y2)dx=883-4y2, and then ∫02(883-4y2)dy=1763-323=48 again.

The slicing argument is the method of Bonaventura Cavalieri, who in 1635 compared solids by comparing their cross sections. It is persuasive, but it quietly assumes that the volume defined by boxes and the volume assembled from slices are the same number. That needs a theorem.

Fubini's theorem

The theorem is named after Guido Fubini, who proved a general form of it in 1907. For continuous functions on a rectangle it says:

If f is continuous on R=[a,b]×[c,d], then ∬RfdA=∫ab∫cdf(x,y)dydx=∫cd∫abf(x,y)dxdy

The reason is visible in the Riemann sum. Choose the sample points on a grid, (xi,yj), and add the boxes column by column rather than all at once. The i-th column contributes (∑jf(xi,yj)Δy)Δx, and the bracket is a Riemann sum for the slice area A(xi)=∫cdf(xi,y)dy. Adding the columns then gives a Riemann sum for ∫abA(x)dx. Adding row by row instead gives the other order. A finite sum can be added in any order, so the only work in the proof is showing that both approximations become good at the same time as the grid is refined, and for a continuous function uniform continuity supplies exactly that.

The hypothesis is not decoration. On the square [0,1]×[0,1] take f(x,y)=x2-y2(x2+y2)2, which is continuous everywhere except the corner (0,0), where it blows up. Because ∂∂yyx2+y2=x2-y2(x2+y2)2, the inner integral in y is 11+x2, and then ∫0111+x2dx=arctan1=π4. Swapping the roles of x and y changes the sign of f, so the other order gives -π4. Two orders, two answers, and neither is the double integral, which does not exist: the function is unbounded, and the Riemann sums near the corner can be made as large as desired of either sign.

For continuous functions, the practical content of the theorem is freedom. The order of integration can be chosen to make the antiderivatives easy.

Example. Evaluate ∬RxexydA over R=[0,1]×[0,2].

Integrating first in x needs integration by parts and leaves a function of y with 1y2 terms that is awkward to integrate next. Integrating first in y is immediate, because x is exactly the factor the chain rule produces: ∂∂yexy=xexy. So

∫02xexydy=[exy]y=0y=2=e2x-1

and then

∫01(e2x-1)dx=e2-12-1=e2-32≈2.19453

A midpoint sum on a 1000×1000 grid gives 2.194527, agreeing to six figures.

Now you. Evaluate ∬RyexydA over R=[0,3]×[0,1], to three decimal places. Choose the order first.

Answer

Integrate in x first, since y is the factor ∂∂xexy produces: ∫03yexydx=e3y-1. Then ∫01(e3y-1)dy=e3-13-1=e3-43≈5.362. A midpoint sum on a 1000×1000 grid gives 5.36184.

Regions between two curves

Few regions of interest are rectangles. For a bounded region D, enclose it in a rectangle R and define F to equal f on D and 0 outside it. Then ∬DfdA is defined as ∬RFdA: the boxes outside D contribute nothing. F jumps at the edge of D, so it is not continuous, but when the edge is made of graphs of continuous functions the jump does no harm. The double integral still exists, and a stronger form of Fubini's theorem still turns it into an iterated integral.

Two shapes of region cover most cases. A region of the first type lies between two curves in x: it is described by a≤x≤b and g1(x)≤y≤g2(x). On the vertical line at a fixed x, F is zero except between g1(x) and g2(x), so the inner integral only runs over that stretch:

∬DfdA=∫ab∫g1(x)g2(x)f(x,y)dydx

A region of the second type lies between two curves in y, described by c≤y≤d and h1(y)≤x≤h2(y), and its integral is ∫cd∫h1(y)h2(y)fdxdy. In both, the outer limits are constants and the inner limits may depend on the outer variable, never the other way round, because the outer variable is the one held fixed while the inner one sweeps.

The limits come from a description of the region, which is usually given in words. Take "the region enclosed by the parabola y=x2 and the line y=2x". The curves meet where x2=2x, at x=0 and x=2, so x runs from 0 to 2. Between those values one curve lies above the other throughout, and testing x=1 shows which: the line gives 2, the parabola 1. So the region is 0≤x≤2, x2≤y≤2x. It is also of the second type: solving each curve for x gives x=y2 on the line and x=y on the parabola, and at a height y between 0 and 4 the line is on the left, so y2≤x≤y.

Example. Evaluate ∬DxydA over the region enclosed by y=x2 and y=2x.

As a region of the first type, the inner integral holds x fixed:

∫x22xxydy=x[y22]x22x=2x3-x52

and then ∫02(2x3-x52)dx=8-6412=83. As a check, the second type gives ∫04y⋅12(y-y24)dy=646-25632=83 as well. A midpoint sum with 1000 columns, each cut into 1000 pieces between the curves, gives 2.666669.

Now you. Evaluate ∬DydA over the region enclosed by the parabola x=y2 and the line x=y+2. Which type makes it one integral rather than two?

Answer

The curves meet where y2=y+2, at y=-1 and y=2, and at y=0 the line (x=2) is to the right of the parabola (x=0). So the region is -1≤y≤2, y2≤x≤y+2, of the second type, and ∫-12y(y+2-y2)dy=[y33+y2-y44]-12=83-512=94. As the first type the lower edge changes formula at x=1, from y=-x to y=x-2, forcing two integrals.

Reversing the order

Sometimes the order a problem arrives in cannot be done at all. Consider

∫01∫y1ex2dxdy

The inner integral asks for an antiderivative of ex2, and there is none among the elementary functions: Joseph Liouville's theory of integration in finite terms, developed in the 1830s, proves that no combination of powers, exponentials, logarithms and trigonometric functions differentiates to it.

Reversing the order means reading the region off the limits and describing it the other way. The limits say 0≤y≤1 and y≤x≤1: at each height y, x runs from the diagonal x=y to the vertical line x=1. That is the triangle with corners (0,0), (1,0) and (1,1). Described as a region of the first type, x runs from 0 to 1, and on the vertical line at x the triangle stretches from the bottom edge y=0 up to the diagonal y=x. So

∫01∫y1ex2dxdy=∫01∫0xex2dydx=∫01xex2dx

because ex2 is constant in y and the inner integral just multiplies it by the length x. That factor x is exactly what the substitution u=x2 needs, and

∫01xex2dx=[ex22]01=e-12≈0.859141

The original order can still be computed numerically, since only the antiderivative is missing, not the integral. A midpoint sum in the order given, 2000 values of y and for each one 2000 points from x=y to x=1, gives 0.8591409, against the exact 0.8591409. Fubini's theorem turned an integral that has no formula in one order into a substitution in the other.

Area, average value and mass

Integrating the constant 1 over D builds boxes of height 1, whose volume equals the area of their base, so

area ofD=∬D1dA

For the region between x=y2 and x=y+2 this is ∫-12(y+2-y2)dy=92, the familiar area between two curves recovered as a special case.

The average value of f over D is defined as in one variable, the total divided by the size: f‾=1area ofD∬DfdA. It is the height of the flat-topped solid on the same base with the same volume. For the paraboloid over [0,2]×[0,2] it is 484=12, between the value 16 at the corner (0,0) and 4 at the corner (2,2).

A thin plate whose density ρ(x,y), in kilograms per square metre, varies from point to point has mass by the same summing: a small rectangle near (x,y) has mass about ρ(x,y)ΔA, and in the limit m=∬DρdA. Its average density is the mass divided by the area.

Example. A plate occupies the region between the parabola y=x2 and the line y=1, with lengths in metres and density ρ=1+y kilograms per square metre. Find its area, mass and average density.

The curves meet at x=±1, and the line is on top, so -1≤x≤1, x2≤y≤1. The area is ∫-11(1-x2)dx=43 square metres. For the mass, ∫x21(1+y)dy=32-x2-x42, and ∫-11(32-x2-x42)dx=3-23-15=3215, about 2.1333 kg. The average density is 3215÷43=1.6 kilograms per square metre, above the plain average of 1+y over 0≤y≤1 (which is 1.5) because the plate is wider near the top, where it is denser. A midpoint sum on 1000 columns of 1000 pieces gives 2.13333.

Now you. A plate occupies the region under y=sinx and above the x-axis for 0≤x≤π, with density ρ=y kilograms per square metre. Find the mass to four decimal places, and the average density.

Answer

The inner integral is ∫0sinxydy=sin2x2, and ∫0πsin2x2dx=π4≈0.7854 kg, using sin2x=1-cos2x2. The area is ∫0πsinxdx=2, so the average density is π8≈0.3927 kilograms per square metre.

A disc in the wrong coordinates

Every region so far has had edges that were easy to write as y in terms of x or x in terms of y. The unit disc, x2+y2≤1, is of both types, and in both it is awkward: -1≤x≤1 and -1-x2≤y≤1-x2. Even its area, ∫-1121-x2dx, needs a trigonometric substitution to reach π. For ∬e-(x2+y2)dA over the disc, the inner integral is ∫e-y2dy between square roots, which has no elementary antiderivative, and here reversing the order does not help, since the disc looks the same either way.

The problem is not the function but the grid. Rectangles in x and y are the wrong pieces for a round region; a disc is naturally described by a distance from the centre and an angle. The next lesson cuts the plane along circles and rays instead, works out the area of the small pieces those cuts produce, and with them evaluates this integral and one that single variable calculus could not reach.