Double IntegralsCalculus IV LabKaren E. Donnelly Saint Joseph's CollegeAll Rights Reservedrestart; with(plots): with(Student[MultivariateCalculus]);Computing Double Integrals with MapleWe can compute double integrals as iterated integrals in Maple just as we would by hand: int(int(x^3*y^2,y=x^2..4),x=0..2);With the MultiInt command in the Student[MultivariateCalculus] package we can cut down on the typing and number of parentheses required:MultiInt(x^3*y^2,y=x^2..4,x=0..2);An Example of When Reversing Order of Integration HelpsEven Maple can struggle with double integrals!Sometimes Maple has the same problem we do when trying to perform the integration in a particular "given" order. For example, consider the iterated integral of the function NiMqJiUieEciIiQtJSRzaW5HNiMqJCUieUdGJSIiIw==over the region lying in the first quadrant bounded below by the parabola NiMvJSJ5RyokJSJ4RyIiIw==, and above by the horizontal line NiMvJSJ5RyIiJQ==. When we try to have Maple compute this integral, we have to wait a long time to find out that Maple can't do it.int(int(x^3*(sin(y^3))^2,y=x^2..4),x=0..2);However, reversing the order of integration works: NiMtSSRpbnRHNiRJKnByb3RlY3RlZEdGJkkoX3N5c2xpYkc2IjYkLUYkNiQqJkkieEdGKCIiJC1JJHNpbkdGJTYjKiRJInlHRihGLiIiIy9GLTsiIiEtSSVzcXJ0R0YlNiNGMy9GMztGNyIiJQ==. We can see why things get better by computing the inside integral first: insideint:=int(x^3*(sin(y^3))^2,x=0..sqrt(y));This has a computable antiderivative with respect to y:indefiniteintegral := int(insideint,y);Thus the final answer is now computatble by Maple: ANS := int(insideint,y=0..4);If we wish to have a 10 digit approximation to this exact value, thenevalf(ANS);The combined command would just be:int(int(x^3*(sin(y^3))^2,x=0..sqrt(y)),y=0..4) ; evalf(%);There are times when reversing the order of integration will not enable you or Maple to solve a particular double integral problem. When this happens, you must use numerical approximation method such as approximating Riemann sums. Example of Calculating Volume with Double Polar Integral The iterated integral in rectangular coordinates NiMtSSRJbnRHNiRJKnByb3RlY3RlZEdGJkkoX3N5c2xpYkc2IjYkLUYkNiQtSSJmR0YoNiRJInhHRihJInlHRigvRjA7L0YwLUkiZ0dGKDYjRi8vRjAtSSJoR0YoRjYvRi87L0YvSSJhR0YoL0YvSSJiR0Yobecomes the following iterated integral in polar coordianates:NiMtSSRJbnRHNiRJKnByb3RlY3RlZEdGJkkoX3N5c2xpYkc2IjYkLUYkNiQqJi1JImZHRig2JComSSJyR0YoIiIiLUkkY29zR0YlNiNJJnRoZXRhR0YoRjIqJkYxRjItSSRzaW5HRiVGNUYyRjJGMUYyL0YxOy9GMS1JInVHRihGNS9GMS1JInZHRihGNS9GNjsvRjYmRjY2I0YyL0Y2JkY2NiMiIiM=
As an example of using Maple to solve integration problems using polar coordinates: NiMvJSJ4RyomJSJyRyIiIi0lJGNvc0c2IyUmdGhldGFHRic=, NiMvJSJ5RyomJSJyRyIiIi0lJHNpbkc2IyUmdGhldGFHRic=, consider the following problem: Integrate the functionNiMvLSUiZkc2JCUieEclInlHLSUlc3FydEc2IywoIiIlIiIiKiRGJyIiIyEiIiokRihGMEYuover the region R which lies in the first quadrant bounded between the two circles:NiMvLCYqJCUieEciIiMiIiIqJCUieUdGJ0YoRig= and NiMvLCYqJCUieEciIiMiIiIqJCUieUdGJ0YoIiIl. and the lines NiMvJSJ5RyIiIQ== and NiMvJSJ5RyUieEc=. First we plot the function with slices to help visualize the portion of the surface we are considering for the volume under the surface over the region. f := (x,y) -> sqrt(4-x^2+y^2);Surf1 := plot3d(f(x,y),x=0..2, y = 0..2,axes=boxed):%;Slices := plot3d({1,2}, theta = 0..Pi/4,z=-1..2.5,coords=cylindrical,style=PATCHNOGRID,axes=boxed):%;display({Surf1, Slices},axes = BOXED);To visualize the region R of integration, we plot it using Maple and rectangular coordinates:P1 :=plot(sqrt(1-x^2),x=1/sqrt(2)..1):P2 :=plot(sqrt(4-x^2),x=sqrt(2)..2):P3 := plot(x,x=1/sqrt(2)..sqrt(2)): # The line y = xdisplay({P1,P2,P3},view = [0..2,0..2],scaling=constrained);Setting up this double iterated integral in Cartesian coodindates would be difficult because you would have to break the region R up into simpler subregions. It is very simple in polar coordinates. In polar coordinates the integral is the following:NiMtSSRpbnRHNiRJKnByb3RlY3RlZEdGJkkoX3N5c2xpYkc2IjYkLUYkNiQqJi1JJXNxcnRHRiU2IywmIiIlIiIiKiRJInJHRigiIiMhIiJGMkY0RjIvRjQ7RjJGNS9JJnRoZXRhR0YoOyIiISomSSNQaUdGJkYyRjFGNg==int(int(sqrt(4-r^2)*r,r=1..2),theta=0..Pi/4); simplify(%);or, in stages it would be: IndefiniteInner := int(sqrt(4-r^2)*r,r);
Inner := int(sqrt(4-r^2)*r,r=1..2);
Inner := simplify(Inner);IndefiniteOuter := int(Inner, theta); Outer:= int(Inner, theta = 0..Pi/4);The MultiInt command verifies our work. Note if we use the output = integral option -- the integral is shown unevaluated (this is called the inert form in Maple) -- to evaluate we would then use the value command. MultiInt(sqrt(4-r^2)*r,r=1..2,theta=0..Pi/4,output=integral);value(%);simplify(%);Leaving the output = integral options out we just get our answer which we simplify:MultiInt(sqrt(4-r^2)*r,r=1..2,theta=0..Pi/4); simplify(%); Exercises1. Evaluate the double integral of NiMqJCUieUciIiM= over the region R in the first quadrant that is outside the circle NiMvJSJyRyIiIw== and inside the cardiod NiMvJSJyRyomIiIjIiIiLCZGJ0YnLSUkY29zRzYjJSZ0aGV0YUdGJ0Yn. Plot of the region R for this exercise: Portion in first quadrant outside the circle and inside the cartiod. polarplot({2, 2*(1+cos(theta))}, theta = 0..2*Pi);2. Find the volume V of the solid above the region R = {(NiQlInJHJSZ0aGV0YUc=)| NiMxIiIiJSJyRw== , NiMxJSJyRyIiJA==, NiQxIiIhJSZ0aGV0YUcxRiUqJiUjcGlHIiIiIiIlISIi } and under the surface NiMvJSJ6Ry0lJGV4cEc2IyomLCYqJCUieEciIiMiIiIqJCUieUdGLEYtRi0lI1BpRyEiIg==. Plot of the region R for this exercise -- portion of disk in first quadrant colored blue:P1 := polarplot({1, 3}, theta = 0..Pi/4, scaling=constrained, color = BLUE): P2 := polarplot({1, 3}, theta = Pi/4..2*Pi, scaling=constrained,color = RED): display({P1,P2});