Double integrals: iterated integrals, switching the order and polar coordinates
Ten double integrals worked by hand: iterated integrals over a rectangle in both orders, a product that splits into two single integrals, a triangle and the region between y = x² and y = x, switching the order to integrate e^(y²) and sin(y)/y, polar coordinates over a disk and a quarter disk, the Gaussian integral √π, and a joint density with a probability, two expectations and a covariance, with worked solutions and the mistakes of swapping limits without redrawing the region, dropping the r in r dr dθ and squaring an integral with one variable.
Before you start
A double integral adds up f(x,y) over a region of the plane: a volume under a surface, a total mass, or, when f is a joint density, a probability. It is computed as two single integrals, one inside the other, and nearly all the work is in the limits. The inner limits may depend on the outer variable, never the other way round; switching the order means redrawing the region and describing it again, not swapping symbols; and polar coordinates bring an extra factor r with the area element. These ten problems go from rectangles to curved regions, switch the order to integrate functions with no elementary antiderivative, and end with the Gaussian integral and a joint density, the two places machine learning needs double integrals most.
∬RfdA is the integral of f over the region ;R;dA is the area of a small piece of .R. When f≥0 it is the volume under the surface z=f(x,y) above ,R, and ∬R1dA is the area of .R.
Iterated integrals. If R is ,a≤x≤b,,g1(x)≤y≤g2(x), then .∬RfdA=∫ab∫g1(x)g2(x)f(x,y)dydx. Do the inner integral first, treating x as a constant; its limits may depend on .x. The outer limits are numbers.
Fubini. On a rectangle ,a≤x≤b,c≤y≤d the order does not matter, and if f(x,y)=g(x)h(y) the integral is .(∫abgdx)(∫cdhdy).
Switching the order. Sketch the region and describe it the other way: ,c≤y≤d,.h1(y)≤x≤h2(y). The new limits come from the picture, not from the old limits.
Polar coordinates.,x=rcosθ,,y=rsinθ,,x2+y2=r2, and :dA=rdrdθ: a small polar box has sides dr and .rdθ.
Joint densities. If f(x,y)≥0 is the joint density of X and ,Y, then ∬fdA=1 over the whole plane, ,P((X,Y)∈R)=∬RfdA, and .E[g(X,Y)]=∬gfdA..Cov(X,Y)=E[XY]−E[X]E[Y].
Evaluate ,∫02∫01(x+2y)dydx, then in the other order.
·
Evaluate ∬Rxy2dA over :R:,0≤x≤2,.1≤y≤3.
··
Evaluate ,∬T(x+y)dA, where T is the triangle with vertices ,(0,0),(1,0) and .(1,1).
··
Let R be the region between y=x2 and .y=x. Find its area and ,∬RxdA, in both orders.
··
Evaluate ∫01∫x1ey2dydx by switching the order of integration.
··
Evaluate .∫0π∫xπysinydydx.
··
Evaluate ∬D(x2+y2)dA over the disk .x2+y2≤4.
···
Evaluate ,∬QxydA, where Q is the quarter disk ,x≥0,,y≥0,.x2+y2≤1.
···
Show that I=∫−∞∞e−x2dx=π by computing I2 as a double integral, and deduce the normalizing constant of the normal density with variance .σ2.
···
X and Y have joint density f(x,y)=x+y on the unit square ,0≤x,y≤1, and 0 elsewhere. Check that it is a density, then find ,P(X+Y≤1),,E[X],E[XY] and .Cov(X,Y).
Answers
4
352
21
Area ;61;∬RxdA=121
2e−1≈0.859
∫0πsinydy=2
8π≈25.13
81
,∫−∞∞e−x2/(2σ2)dx=σ2π, so the density is σ2π1e−x2/(2σ2)
Density checks; ,P(X+Y≤1)=31,,E[X]=127,,E[XY]=31,Cov(X,Y)=31−14449=−1441
Worked solutions
Problem 1
Evaluate ,∫02∫01(x+2y)dydx, then in the other order.
∫01(x+2y)dy=[xy+y2]01=x+1Inner integral in ,y, with x held constant.
∫02(x+1)dx=[2x2+x]02=4Outer integral in .x.
Other order: ,∫02(x+2y)dx=2+4y, and ∫01(2+4y)dy=2+2=4On a rectangle the limits just trade places.
4Both orders agree, as Fubini says. The rectangle has area ,2, so the average of x+2y over it is ,2, its value at the center .(1,21).
Problem 2
Evaluate ∬Rxy2dA over :R:,0≤x≤2,.1≤y≤3.
∬Rxy2dA=(∫02xdx)(∫13y2dy)A product of a function of x and a function of y over a rectangle splits.
∫02xdx=2 and ∫13y2dy=327−1=326Two single integrals.
352Check by iterating: the inner ,∫02xy2dx=2y2, and .∫132y2dy=352.
Problem 3
Evaluate ,∬T(x+y)dA, where T is the triangle with vertices ,(0,0),(1,0) and .(1,1).
:T:,0≤x≤1,0≤y≤xThe triangle lies below the line y=x and above the x-axis. For each ,x,y runs from 0 up to .x.
∫0x(x+y)dy=x2+2x2=23x2The inner limit depends on ,x, so the result is a function of .x.
∫0123x2dx=21Outer integral with number limits.
21Check in the other order: T is also ,0≤y≤1,,y≤x≤1, and .∫01∫y1(x+y)dxdy=∫01(21+y−23y2)dy=21+21−21=21.
Problem 4
Let R be the region between y=x2 and .y=x. Find its area and ,∬RxdA, in both orders.
The curves meet where ,x2=x, at x=0 and ,x=1, and x≥x2 between themSo :R:,0≤x≤1,.x2≤y≤x.
Area =∫01(x−x2)dx=61The inner integral of 1 is the height of the strip.
∫01∫x2xxdydx=∫01(x2−x3)dx=31−41=121x is a constant in the inner integral, so it multiplies the height .x−x2.
Other order: R is ,0≤y≤1,,y≤x≤y, and ∫01∫yyxdxdy=∫012y−y2dy=21(21−31)=121Solve the curves for :x: the line gives x=y on the left and the parabola gives x=y on the right.
Area ;61;∬RxdA=121The average of x over R is :1/61/12=21: the centroid's x-coordinate.
Problem 5
Evaluate ∫01∫x1ey2dydx by switching the order of integration.
ey2 has no elementary antiderivative, so the inner integral cannot be done as writtenSwitching the order is the way out.
The region: ,0≤x≤1,,x≤y≤1, a triangle with vertices ,(0,0),(0,1) and (1,1)For each ,x,y runs from the line y=x up to .1.
Described the other way: ,0≤y≤1,0≤x≤yFor each ,y,x runs from the y-axis to the line .x=y.
∫01∫0yey2dxdy=∫01yey2dyThe inner integral of a constant in x is that constant times the length ,y, and the y is exactly what makes a substitution work.
2e−1≈0.859,u=y2,:du=2ydy:.∫01yey2dy=21[eu]01.
Problem 6
Evaluate .∫0π∫xπysinydydx.
The region: ,0≤x≤π,,x≤y≤π, which is also ,0≤y≤π,0≤x≤yThe same triangle shape as Problem 5, scaled to .π.
∫0π∫0yysinydxdy=∫0πysiny⋅ydyysiny has no elementary antiderivative either; the inner integral in x supplies the factor y that cancels the denominator.
∫0πsinydy=2.[−cosy]0π=1+1.
Problem 7
Evaluate ∬D(x2+y2)dA over the disk .x2+y2≤4.
:D:,0≤r≤2,,0≤θ≤2π, and x2+y2=r2A disk centered at the origin is a rectangle in r and .θ.
∬D(x2+y2)dA=∫02π∫02r2⋅rdrdθ.dA=rdrdθ.
,∫02r3dr=4, and ∫02π4dθ=8πThe integrand does not depend on .θ.
8π≈25.13In x and y this would need ,∫−22∫−4−x24−x2, with square roots in the limits.
Problem 8
Evaluate ,∬QxydA, where Q is the quarter disk ,x≥0,,y≥0,.x2+y2≤1.
:Q:,0≤r≤1,0≤θ≤2πThe first quadrant is θ from 0 to .2π.
,xy=r2cosθsinθ, so the integral is ∫0π/2∫01r3cosθsinθdrdθIncluding the r from .dA.
(∫01r3dr)(∫0π/2sinθcosθdθ)=41⋅21The integrand is a product and the limits are constants, so it splits; .∫0π/2sinθcosθdθ=[21sin2θ]0π/2=21.
81Check in x and :y:.∫01x∫01−x2ydydx=∫012x(1−x2)dx=21(21−41)=81.
Problem 9
Show that I=∫−∞∞e−x2dx=π by computing I2 as a double integral, and deduce the normalizing constant of the normal density with variance .σ2.
I2=∫−∞∞e−x2dx∫−∞∞e−y2dy=∬R2e−(x2+y2)dAGive the second copy its own variable; a product of single integrals over the whole line is a double integral over the whole plane.
∬R2e−(x2+y2)dA=∫02π∫0∞e−r2rdrdθThe whole plane is ,0≤r<∞,.0≤θ≤2π.
,∫0∞re−r2dr=[−21e−r2]0∞=21, so I2=2π⋅21=πThe r from dA is what makes this integral elementary.
I=πI>0 because the integrand is positive.
,∫−∞∞e−x2/(2σ2)dx=σ2π, so the density is σ2π1e−x2/(2σ2)Substitute ,x=σ2u,:dx=σ2du: the integral is .σ2⋅π.
Problem 10
X and Y have joint density f(x,y)=x+y on the unit square ,0≤x,y≤1, and 0 elsewhere. Check that it is a density, then find ,P(X+Y≤1),,E[X],E[XY] and .Cov(X,Y).
∫01∫01(x+y)dydx=∫01(x+21)dx=1It is nonnegative and integrates to .1.
P(X+Y≤1)=∫01∫01−x(x+y)dydx=∫01(x(1−x)+2(1−x)2)dx=61+61=31The region below the line :x+y=1: for each ,x,y runs from 0 to .1−x.
E[XY]=∫01∫01xy(x+y)dydx=∫01(2x2+3x)dx=61+61=31∬x2ydA=31⋅21 and ∬xy2dA is the same.
Density checks; ,P(X+Y≤1)=31,,E[X]=127,,E[XY]=31,Cov(X,Y)=31−14449=−1441Slightly negative: E[Y∣X=x]=x+1/2x/2+1/3 falls from 32 at x=0 to 95 at ,x=1, so a larger X comes with a slightly smaller Y on average. With ,VarX=125−14449=14411, the correlation is .−111.
Where this goes wrong
1. Switching the order by swapping the limits as written
The two pairs of limits are swapped along with dx and ,dy, as on a rectangle.
∬RxdA over :R:,0≤x≤1,x2≤y≤xRight so far: Problem 4, whose answer is .121.
“For ,dxdy,x runs between the same two curves, with x renamed .y.”The step that causes the mistake: the limits are rewritten without looking at the region.
∫01∫y2yxdxdy=∫012y2−y4dy=151That describes the reflection of R across ,y=x, a different region. Solve each boundary for :x:y=x gives x=y and y=x2 gives ,x=y, so the inner limits are y to ,y, and the integral is .121.
2. Integrating e^(y²) as if it had an antiderivative
The integral is attacked in the order it is written, with a guess for the antiderivative.
∫01∫x1ey2dydxRight so far: Problem 5.
“The antiderivative of ey2 is ey2 divided by the derivative of .y2.”The habit that causes the mistake: the chain rule run backwards, which only works when that derivative is already a factor.
∫ey2dy=2yey2Differentiate it: ,dyd2yey2=ey2−2y2ey2, which at y=1 is ,2e≈1.359, not .e≈2.718. No elementary antiderivative exists; switch the order, and the inner integral supplies the factor ,y, giving .2e−1.
3. Dropping the r in r dr dθ
x2+y2 is replaced by r2 and dA by ,drdθ, as if polar coordinates were a renaming.
∬D(x2+y2)dA over ,x2+y2≤4, with x2+y2=r2Right so far: Problem 7.
“dA becomes .drdθ.”The step that causes the mistake.
∫02π∫02r2drdθ=316πA polar box of sides dr and dθ has area ,rdrdθ, since the arc at radius r is rdθ long. Without it even the area comes out wrong: for the unit disk, ,∫02π∫01drdθ=2π, not .π. With the ,r, the answer is .8π.
4. The full circle of θ for a quarter disk
0≤θ≤2π is the polar range used most often, and it is used again.
∬QxydA with xy=r2cosθsinθ and dA=rdrdθRight so far: Problem 8.
“θ goes from 0 to .2π.”The step that causes the mistake: the limits describe the whole disk, not the first quadrant.
∫02π∫01r3cosθsinθdrdθ=0Over the whole disk, xy is negative in the second and fourth quadrants and cancels the first and third. A positive integrand on Q cannot give .0. The quarter disk is ,0≤θ≤2π, and the integral is .81.
5. Squaring the integral with one variable
,I2=I⋅I, and both copies are written with .x.
I=∫−∞∞e−x2dxRight so far: Problem 9.
“.I2=∫e−x2⋅e−x2dx.”The step that causes the mistake: the two integrals are merged into one.
I2=∫−∞∞e−2x2dx=π/2≈1.253A product of two integrals is not the integral of the product. Each copy needs its own dummy variable, ,I2=∫e−x2dx∫e−y2dy, and that is the double integral over the plane, equal to .π≈3.142.
Print this set: double-integrals.pdf (problems, answers, and worked solutions on separate pages).