Setting up double integralsWorksheet by Mike May, S. J.- maymk@slu.eduRevised by Russell Blyth - blythrd@slu.edurestart;OverviewThe first section of this worksheet provides a template for using Maple to set up and check double integrals symbolically.The next section provides code for visualizing the region of integration. (Experience shows that students are more likely to have problems connecting a region of integration with limits of integration rather than with evaluating integrals.)The third section deals with the problem of changing the order of integration.Using Maple to check integrationThis section provides a template for using Maple to check multiple integrals.Evaluation of multiple integrals is an important skill to master in multivariable calculus. It is worth knowing the Maple syntax used for multiple integrals, so that you can use Maple to check your work.We do multiple integrals in Maple by nesting the integration commands. The command Int (upper case i) only sets up the integral. If you repeat the integral command with both versions of Int/int you see that the integral is set up properly, as well as compute its value. Note the differences:Int(Int(x^2+y^2+x*y,x = 1..3), y=2..5);
Int(int(x^2+y^2+x*y,x = 1..3), y=2..5);
int(int(x^2+y^2+x*y,x = 1..3), y=2..5);Sometimes an integral is easier to evaluate in one order or the other (convince yourself that the region of integration is the same for the two integrals below).Int(Int(exp(x^2),x=y..1),y=0..1);
Int(int(exp(x^2),x=y..1),y=0..1);
int(int(exp(x^2),x=y..1),y=0..1);
Int(Int(exp(x^2),y=0..x),x=0..1);
Int(int(exp(x^2),y=0..x),x=0..1);
int(int(exp(x^2),y=0..x),x=0..1);
Use the template as needed.Visualizing the region of integrationThe bigger problem in multiple integration is often not in evaluating the integral, but rather is in setting the limits of integration correctly. This worksheet gives two blocks of code that can be used to see the region that goes with a set of limits of integration.Integrating with respect to y on the insideThe first block of code considers the case when we integrate with respect to y on the inside. Thus x ranges from the left end of the region to the right end of the region, and for a particular x, the value of y ranges from a bottom curve to a top curve. The integral should end with dydx.topcurve := x -> x^2;
bottomcurve:= x -> x;
leftend := 0; rightend := 2;
print(`region for `, int(int(f(x,y),
y=bottomcurve(x)..topcurve(x)), x=leftend..rightend));
lines := {}:
for i from 0 to 10 do
tempx := leftend + i/10*(rightend - leftend):
lines := lines union
{[[tempx,topcurve(tempx)], [tempx, bottomcurve(tempx)]]};
od:
plots[display]
([plot({[x, topcurve(x),x=leftend..rightend],
[x, bottomcurve(x),x=leftend..rightend]}),
plot(lines, color=BLACK)]); Notice that the code does not check to see which curve is on top and which is on the bottom - that is your responsibility to determine.The graph shows some lines that correspond to particular values of x. This should remind you of the volume of revolution problems in single variable calculus, where you cut an area into thin rectangles to justify using an appropriate integral. Integrating with respect to x on the insideThe second block of code considers the case when we integrate with respect to x on the inside. Thus y ranges from the bottom end of the region to the top end of the region, and for a particular y, the value of x ranges from a left curve to a right curve. The integral should end with dxdy.leftcurve := y -> y^2 - 1;
rightcurve:= y -> y + 1;
bottomend := -1; topend := 2;
print(`region for `,
int(int(f(x,y),x=leftcurve(y)..rightcurve(y)), y=bottomend..topend));
lines := {}:
for i from 0 to 10 do
tempy := bottomend + i/10*(topend - bottomend):
lines := lines union
{[[leftcurve(tempy), tempy], [rightcurve(tempy),tempy]]};
od:
plots[display]([plot({[leftcurve(y),y,y=bottomend..topend],
[rightcurve(y),y,y=bottomend..topend]}),
plot(lines, color=BLACK)]); The lines in this case correspond to integrating over x for particular values of y.Exercises1. Find the limits of integration for the double integrals over the regions defined below. Modify the code used above and check your work by hand on two of these problems.(a) A triangle with vertices at (-1, 1), (-1, -2), and (3, -2).(b) A triangle with vertices at (0, 1), (2, 1), and (1, 3).(c) A quadrilateral with vertices at (1, 0), (4, 1), (4, 2), and (1, 2).2. For the integrals given below, sketch the region of integration and evaluate the integrals.(a) NiMtSSRpbnRHNiI2JC1GJDYkLUkkZXhwR0YlNiMsJkkieEdGJSIiIkkieUdGJUYuL0YvOyIiISIiJS9GLTtGLiIiJA==;(b) NiMtSSRpbnRHNiI2JC1GJDYkLUkkZXhwR0YlNiMqJClJInhHRiUiIiMiIiIvSSJ5R0YlOyIiIUYuL0YuO0Y0Ri8= ;(c) NiMtSSRpbnRHNiI2JC1GJDYkKigiIiMiIiJJInhHRiVGK0kieUdGJUYrL0YtOywkLUklc3FydEdGJTYjLCYiIipGKyokKUYsRipGKyEiIkY4IiIhL0YsOywkRipGOEY5;Changing the order of integrationSwitching the order of integration sometimes turns impossible integrals into simple ones. To switch from dydx to dxdy, the boundary curves start in the form y = f(x), and need to be converted to the form x = g(y).Consider, for example, the region with x between 0 and 4 bounded by y=2*x^2 and y = 4*sqrt(x). It is also the region with y between 0 and 8, bounded by the curves x=sqrt(y/2) and x= (y/4)^2. topcurve := x -> 4*sqrt(x);
bottomcurve:= x -> x^2/2;
leftend := 0; rightend := 4;
print(`region for `, int(int(f(x,y),
y=bottomcurve(x)..topcurve(x)), x=leftend..rightend));
lines := {}:
for i from 0 to 10 do
tempx := leftend + i/10*(rightend - leftend):
lines := lines union
{[[tempx,topcurve(tempx)], [tempx, bottomcurve(tempx)]]};
od:
plots[display]
([plot({[x, topcurve(x),x=leftend..rightend],
[x, bottomcurve(x),x=leftend..rightend]}),
plot(lines, color=BLACK)]);numlines := 10:
leftcurve := y -> sqrt(2*y);
rightcurve:= y -> (y/4)^2;
bottomend := 0; topend := 8;
print(`region for `,
int(int(f(x,y),x=leftcurve(y)..rightcurve(y)), y=bottomend..topend));
lines := {}:
for i from 0 to 10 do
tempy := bottomend + i/10*(topend - bottomend):
lines := lines union
{[[leftcurve(tempy), tempy], [rightcurve(tempy),tempy]]};
od:
plots[display]([plot({[leftcurve(y),y,y=bottomend..topend],
[rightcurve(y),y,y=bottomend..topend]}),
plot(lines, color=BLACK)]); There is no easy formula for changing the limits on the region of integration. You need to look at the region, decide which curves are top and bottom, left and right, and solve for the appropriate variable.Exercise3. For each of the integrals given below reverse the order of integration and evaluate the integral. Use Maple to graph each region in both dxdy and dydx orders to check that you have the same region for both integrals. (If you attempt to evaluate the integrals in the initial order of integration you will not get satisfactory answers.)(a) NiMtSSRpbnRHNiI2JC1GJDYkLUkkZXhwR0YlNiMqJClJInhHRiUiIiMiIiIvRi47SSJ5R0YlRjAvRjM7IiIhRjA=;(b) NiMtSSRpbnRHNiI2JC1GJDYkKiZJInlHRiUiIiItSSRzaW5HRiU2IyokKUkieEdGJSIiJ0YrRisvRjE7KiQpRioiIiNGKyIiKi9GKjsiIiEiIiQ=;(c) NiMtSSRpbnRHNiI2JC1GJDYkLUklc3FydEdGJTYjLCYiIiMiIiIqJClJInhHRiUiIiRGLkYuL0YxOy1GKjYjSSJ5R0YlRi4vRjc7IiIhRi4=;