Sec15.2dxdy.mws

Setting up multiple integrals

Worksheet by Mike May, S. J.- maymk@slu.edu

Section 15.2

The case of dxdy and dydx

> restart;

Overview

The first section of this worksheet provides a template for usiing 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 integration

This section provides a template for using Maple to check multiple integrals.

Much of this chapter deals with problems where you need to evaluate a multiple integral. It is worthwhile to note 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.

It is useful to note that the command Int (upper case i) only sets up the integral. If you repeat the integral command with both versions of the int you see that the integral is set up properly, as well as computing its value.

> 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);

Int(Int(x^2+y^2+x*y,x = 1 .. 3),y = 2 .. 5)

Int(26/3+2*y^2+4*y,y = 2 .. 5)

146

Sometimes the integral is easier to evaluate in one order or the other.

> 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);

Int(Int(exp(x^2),x = y .. 1),y = 0 .. 1)

Int(-1/2*I*erf(I)*sqrt(Pi)+1/2*I*sqrt(Pi)*erf(I*y),...

1/2*exp(1)-1/2

Int(Int(exp(x^2),y = 0 .. x),x = 0 .. 1)

Int(exp(x^2)*x,x = 0 .. 1)

1/2*exp(1)-1/2

Use the template as needed.

>

Visualizing the region of integration

The bigger problem in any section on multiple integration is not evaluating the integral. Rather it is to set the limits of integration correctly. This worksheet gives 2 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 inside

The 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)], thickness=3);

topcurve := proc (x) options operator, arrow; x^2 e...

bottomcurve := proc (x) options operator, arrow; x ...

leftend := 0

rightend := 2

`region for `, int(int(f(x,y),y = x .. x^2),x = 0 ....

[Maple Plot]

Notice that the code does not check to see which curve is on top.

The graph has the lines that correspond to a particular value of x. This should remind you of the volume of revolution problems where you cut an area into thin rectangles to justify using an integral.

Integrating with respect to x on the inside

The 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=blue)], thickness=3);

leftcurve := proc (y) options operator, arrow; y^2-...

rightcurve := proc (y) options operator, arrow; y+1...

bottomend := -1

topend := 2

`region for `, int(int(f(x,y),x = y^2-1 .. y+1),y =...

[Maple Plot]

The lines in this case correspond to integrating for a particular value of y,

>

Exercises:

1) Define the limits of integration to define the double integral over the regions defined below. Modify the code above and check your work on 2 of those 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) Int(Int(e^(x+y),y = 0 .. 4),x = 1 .. 3)

Int(Int(e^(x+y),y = 0 .. 4),x = 1 .. 3)

>

(b) Int(Int(e^(x^2),y = 0 .. x),x = 0 .. 2)

Int(Int(e^(x^2),y = 0 .. x),x = 0 .. 2)

>

(c) Int(Int(2*x*y,y = -sqrt(9-x^2) .. 0),x = -2 .. 0)

Int(Int(2*x*y,y = -sqrt(9-x^2) .. 0),x = -2 .. 0)

>

Changing the order of integration

The book also has several problems where you are asked to switch the order of integration. In the exercise, this 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, bouned 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=blue)], thickness=3);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=blue)], thickness=3);

topcurve := proc (x) options operator, arrow; 4*sqr...

bottomcurve := proc (x) options operator, arrow; 1/...

leftend := 0

rightend := 4

`region for `, int(int(f(x,y),y = 1/2*x^2 .. 4*sqrt...

[Maple Plot]

leftcurve := proc (y) options operator, arrow; sqrt...

rightcurve := proc (y) options operator, arrow; 1/1...

bottomend := 0

topend := 8

`region for `, int(int(f(x,y),x = sqrt(2)*sqrt(y) ....

[Maple Plot]

Notice that 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.

>

Exercise

3) For each of the integrals given below, reverse the order of integration and evaluate the integral. Use Maple to graph the region in both directions to check that you have the same region for both integrals.

(a) Int(Int(e^(x^2),x = y .. 1),x = 0 .. 1)

Int(Int(e^(x^2),x = y .. 1),x = 0 .. 1)

>

(b) Int(Int(y*sin(x^2),x = y^2 .. 9),y = 0 .. 3)

Int(Int(y*sin(x^2),x = y^2 .. 9),y = 0 .. 3)

>

(c) Int(Int(sqrt(2+x^3),x = sqrt(y) .. 1),y = 0 .. 1)

Int(Int(sqrt(2+x^3),x = sqrt(y) .. 1),y = 0 .. 1)

>

>