Defining double integrals - Riemann Sums Worksheet by Mike May, S. J.- maymk@slu.edu Riemann sums in two variables restart;with(Student[Calculus1]): This worksheet uses commands from the Student[Calculus1] package. The line above loads this package and has to be run before the examples will work. Following our pattern in this course we approach a topic in multivariable calculus by reviewing the topic in single variable calculus.
<Text-field style="Heading 2" layout="Heading 2">Reviewing Riemann sums for functions of one variable</Text-field> Recall that for a function f(x) of one variable, the integral from x=a to x=b is defined as the limit as n approaches infinity of the sum obtained by cutting the region from a to b into n subintervals, then approximating the function on each subinterval by a constant function. In loose terms we approximated the region by rectangles and take the limit as we used more and more rectangles.
<Text-field style="_cstyle257" layout="Heading 3"><Font bold="true">Example 1:</Font></Text-field> We would like to use Riemann sums to approximate LUklbXJvd0c2Iy9JK21vZHVsZW5hbWVHNiJJLFR5cGVzZXR0aW5nR0koX3N5c2xpYkdGJzYlLUkjbWlHRiQ2I1EhRictRiM2KC1JKG1zdWJzdXBHRiQ2Jy1JI21vR0YkNi1RJiZpbnQ7RicvJSxtYXRodmFyaWFudEdRJ25vcm1hbEYnLyUmZmVuY2VHUSZmYWxzZUYnLyUqc2VwYXJhdG9yR0Y9LyUpc3RyZXRjaHlHRj0vJSpzeW1tZXRyaWNHRj0vJShsYXJnZW9wR0Y9LyUubW92YWJsZWxpbWl0c0dGPS8lJ2FjY2VudEdGPS8lJ2xzcGFjZUdRJjAuMGVtRicvJSdyc3BhY2VHRkwtRiM2JC1GNTYtUSomdW1pbnVzMDtGJ0Y4RjtGPkZARkJGREZGRkgvRktRLDAuMjIyMjIyMmVtRicvRk5GVS1JI21uR0YkNiRRIjFGJ0Y4LUZYNiRRIjNGJ0Y4LyUxc3VwZXJzY3JpcHRzaGlmdEdRIjJGJy8lL3N1YnNjcmlwdHNoaWZ0R1EiMEYnLUkobWZlbmNlZEdGJDYkLUYjNiZGKy1GIzYjLUklbXN1cEdGJDYlLUYsNiVRInhGJy8lJ2l0YWxpY0dRJXRydWVGJy9GOVEnaXRhbGljRidGZW4vRmluRl1vLUY1Ni1RKCZtaW51cztGJ0Y4RjtGPkZARkJGREZGRkhGVEZWRmhvRjhGKy1JJ21zcGFjZUdGJDYmLyUnaGVpZ2h0R1EmMC4wZXhGJy8lJndpZHRoR1EmMC4zZW1GJy8lJmRlcHRoR0ZpcC8lKmxpbmVicmVha0dRJWF1dG9GJy1GNTYtUTAmRGlmZmVyZW50aWFsRDtGJ0Y4RjtGPkZARkJGREZGRkhGSkZNRmhvRis= .
<Text-field style="_cstyle256" layout="Heading 3"><Font bold="true" italic="true">The visual approach:</Font></Text-field> We plot the curve and the approximating rectangles. We start with 7 subintervals. lowx := -1: highx :=2: xdivs :=7: f := x -> x^3-x: ApproximateInt(f(x),x=lowx..highx,partition=xdivs,output=plot,method=right); If we increase the number of subintervals we get a very good approximation. JSFH
<Text-field style="Heading 3" layout="Heading 3">The numeric approach:</Text-field> The picture above uses a right hand rule for evaluating the sum. We can have Maple compute this sum for us. It serves our interests to first formally compute the sum, then to evaluate it, and finally to convert to a decimal value. lowx := -1: highx :=2: xdivs :=7: f := x -> x^3-x: sum1 := ApproximateInt(f(x),x=lowx..highx,partition=xdivs, output=sum,method=right); sum2 := value(sum1); sum3 := evalf(sum2); If we want a better approximation, we can look at the value we obtain this way with a large number of subintervals. sum500 = evalf(ApproximateInt(f(x),x=lowx..highx,partition=500, output=value,method=right)); We can also set up the sum for an arbitrary number of subintervals and then take the limit as the number of subintervals approaches infinity. sum1arbn := ApproximateInt(f(x),x=lowx..highx,partition='n', output=sum,method=right); sum2arbn := value(sum1arbn); sum3inf := limit(sum2arbn,n=infinity); evalf(sum3inf); We compare this with the result obtained through symbolic integration and see that they are the same. Int(f(x),x) = int(f(x),x); Int(f(x), x=-1..2) = int(f(x), x=-1..2); Int(f(x), x=-1..2) = evalf(int(f(x), x=-1..2));
<Text-field style="Heading 3" layout="Heading 3">Exercise:</Text-field> 1) The Riemann sum definition of integral is most useful when we are either trying to decide which interval is appropriate in a problem or when we are trying to evaluate an integral that we cannot do symbolically. Approximate Int(sin(x^4)/x^2, x=0..1) by using Riemann sums with 100 subintervals.
<Text-field style="Heading 2" layout="Heading 2">Generalizing to functions of 2 variables:</Text-field> To make computations and the Maple programming easier, we will restrict to the case where the region of integration is a rectangle. When we try to take subintervals we now want to break up both the x interval and the y interval. That means we will be adding little boxes with rectangular bases and the height determined by evaluating the function at some point in the subregions. We would like to be able to visualize how the boxes approximate the region and also be able to find the value of the approximation.
<Text-field style="_cstyle258" layout="Heading 3"><Font bold="true">Example 2:</Font></Text-field> We will look at example 3 from the text and consider the approximations to the volume under the surface obtained by graphing g(x,y) = 2-x^2-y^2 with x and y between -1 and 1. Symbolical we are looking to evaluate LUklbXJvd0c2Iy9JK21vZHVsZW5hbWVHNiJJLFR5cGVzZXR0aW5nR0koX3N5c2xpYkdGJzYlLUkjbWlHRiQ2I1EhRictRiM2KS1JKG1zdWJzdXBHRiQ2Jy1JI21vR0YkNi1RJiZpbnQ7RicvJSxtYXRodmFyaWFudEdRJ25vcm1hbEYnLyUmZmVuY2VHUSZmYWxzZUYnLyUqc2VwYXJhdG9yR0Y9LyUpc3RyZXRjaHlHRj0vJSpzeW1tZXRyaWNHRj0vJShsYXJnZW9wR0Y9LyUubW92YWJsZWxpbWl0c0dGPS8lJ2FjY2VudEdGPS8lJ2xzcGFjZUdRJjAuMGVtRicvJSdyc3BhY2VHRkwtRiM2JC1GNTYtUSomdW1pbnVzMDtGJ0Y4RjtGPkZARkJGREZGRkgvRktRLDAuMjIyMjIyMmVtRicvRk5GVS1JI21uR0YkNiRRIjFGJ0Y4RlcvJTFzdXBlcnNjcmlwdHNoaWZ0R1EiMkYnLyUvc3Vic2NyaXB0c2hpZnRHUSIwRidGKy1GIzYoRjEtSShtZmVuY2VkR0YkNiQtRiM2KC1GWDYkUSIyRidGOC1GNTYtUSgmbWludXM7RidGOEY7Rj5GQEZCRkRGRkZIRlRGVi1GIzYjLUklbXN1cEdGJDYlLUYsNiVRInhGJy8lJ2l0YWxpY0dRJXRydWVGJy9GOVEnaXRhbGljRidGYm8vRmZuRmpuRmVvLUYjNiMtRltwNiUtRiw2JVEieUYnRmBwRmNwRmJvRmVwRitGOEYrLUknbXNwYWNlR0YkNiYvJSdoZWlnaHRHUSYwLjBleEYnLyUmd2lkdGhHUSYwLjNlbUYnLyUmZGVwdGhHRmJxLyUqbGluZWJyZWFrR1ElYXV0b0YnLUY1Ni1RMCZEaWZmZXJlbnRpYWxEO0YnRjhGO0Y+RkBGQkZERkZGSEZKRk1GanBGK0ZdcUZbckZdcEYr.
<Text-field style="Heading 3" layout="Heading 3">The Visual Approach:</Text-field> We start with 7 subintervals in x and 5 intervals in y. We want to see a plot of the surface, a plot of the approximating Riemann sum, and a plot of the two together. lowx := -1: highx :=1: lowy := -1: highy :=1: xdivs :=7: ydivs :=5: g := (x,y) -> 2 - x^2 - y^2: Student[MultivariateCalculus][ApproximateInt] (g(x,y),x=lowx..highx,y=lowy..highy,partition=[xdivs,ydivs], output=plot,axes=boxed); lowx := -1: highx :=1: lowy := -1: highy :=1: xdivs :=25: ydivs :=20: g := (x,y) -> 2 - x^2 - y^2: Student[MultivariateCalculus][ApproximateInt] (g(x,y),x=lowx..highx,y=lowy..highy,partition=[xdivs,ydivs], output=plot,axes=boxed); Once again we get a better approximation by increasing the number of subintervals. It should be noted however that if we use 100 subintervals for x and for y, then we have to compute 10,000 boxes.
<Text-field style="Heading 3" layout="Heading 3">The Numeric Approach:</Text-field> Once again we mimic what we did with a function of one variable. We start by evaluating with a small number of subintervals. lowx := -1: highx :=1: lowy := -1: highy :=1: xdivs :=7: ydivs :=5: g := (x,y) -> 2 - x^2 - y^2: sum1 := ApproximateInt(ApproximateInt(g(x,y),x=lowx..highx, partition=xdivs,output=sum,method=right), y=lowy..highy,partition=ydivs, output=sum, method=right); sum2 := value(sum1); sum3 := evalf(sum2); Next we look at the value we obtain this way with a large number of subintervals. We also take the limit as the number of subintervals approaches infinity. approx100 := ApproximateInt(ApproximateInt(g(x,y),x=lowx..highx, partition=100,output=sum,method=right), y=lowy..highy, partition=100, output=sum, method=right); sum1arbmn :=ApproximateInt(ApproximateInt(g(x,y),x=lowx..highx, partition='n',output=sum,method=right), y=lowy..highy,partition='m', output=sum, method=right); sum2arbmn := value(sum1arbmn); sum3a := limit(limit(sum2arbmn,n=infinity),m=infinity); limitinfinity = evalf(sum3a); Finally we compare with the result of symbolic integration and see that they are the same. Int(Int(g(x,y),y=-1..1),x=-1..1) = int(int(g(x,y),y=-1..1),x=-1..1); Int(Int(g(x,y),y=-1..1),x=-1..1) = evalf(int(int(g(x,y),y=-1..1),x=-1..1));
<Text-field style="Heading 3" layout="Heading 3">Exercises:</Text-field> 2) Let R be the region with x in LUklbXJvd0c2Iy9JK21vZHVsZW5hbWVHNiJJLFR5cGVzZXR0aW5nR0koX3N5c2xpYkdGJzYjLUkobWZlbmNlZEdGJDYmLUYjNiUtSSNtbkdGJDYkUSIxRicvJSxtYXRodmFyaWFudEdRJ25vcm1hbEYnLUkjbW9HRiQ2LVEiLEYnRjQvJSZmZW5jZUdRJmZhbHNlRicvJSpzZXBhcmF0b3JHUSV0cnVlRicvJSlzdHJldGNoeUdGPS8lKnN5bW1ldHJpY0dGPS8lKGxhcmdlb3BHRj0vJS5tb3ZhYmxlbGltaXRzR0Y9LyUnYWNjZW50R0Y9LyUnbHNwYWNlR1EmMC4wZW1GJy8lJ3JzcGFjZUdRLDAuMzMzMzMzM2VtRictRjE2JFEiMkYnRjRGNC8lJW9wZW5HUSJbRicvJSZjbG9zZUdRIl1GJw== and y in LUklbXJvd0c2Iy9JK21vZHVsZW5hbWVHNiJJLFR5cGVzZXR0aW5nR0koX3N5c2xpYkdGJzYjLUkobWZlbmNlZEdGJDYmLUYjNiUtSSNtbkdGJDYkUSIxRicvJSxtYXRodmFyaWFudEdRJ25vcm1hbEYnLUkjbW9HRiQ2LVEiLEYnRjQvJSZmZW5jZUdRJmZhbHNlRicvJSpzZXBhcmF0b3JHUSV0cnVlRicvJSlzdHJldGNoeUdGPS8lKnN5bW1ldHJpY0dGPS8lKGxhcmdlb3BHRj0vJS5tb3ZhYmxlbGltaXRzR0Y9LyUnYWNjZW50R0Y9LyUnbHNwYWNlR1EmMC4wZW1GJy8lJ3JzcGFjZUdRLDAuMzMzMzMzM2VtRictRjE2JFEiM0YnRjRGNC8lJW9wZW5HUSJbRicvJSZjbG9zZUdRIl1GJw==. Estimate the integral of LUklbXJvd0c2Iy9JK21vZHVsZW5hbWVHNiJJLFR5cGVzZXR0aW5nR0koX3N5c2xpYkdGJzYlLUkjbWlHRiQ2I1EhRictRiM2J0YrLUYjNiMtSSVtc3VwR0YkNiUtRiw2JVEieEYnLyUnaXRhbGljR1EldHJ1ZUYnLyUsbWF0aHZhcmlhbnRHUSdpdGFsaWNGJy1JI21uR0YkNiRRIjJGJy9GPVEnbm9ybWFsRicvJTFzdXBlcnNjcmlwdHNoaWZ0R1EiMEYnLUkjbW9HRiQ2LVEiK0YnRkMvJSZmZW5jZUdRJmZhbHNlRicvJSpzZXBhcmF0b3JHRk4vJSlzdHJldGNoeUdGTi8lKnN5bW1ldHJpY0dGTi8lKGxhcmdlb3BHRk4vJS5tb3ZhYmxlbGltaXRzR0ZOLyUnYWNjZW50R0ZOLyUnbHNwYWNlR1EsMC4yMjIyMjIyZW1GJy8lJ3JzcGFjZUdGZ24tRiM2Iy1GNDYlLUYsNiVRInlGJ0Y5RjxGP0ZFRitGKw== over R by evaluating a Riemann sum with 10 subintervals in each of x and y. (This is problem 7 in section 16.1.) 3) Let R be the region with x inLUklbXJvd0c2Iy9JK21vZHVsZW5hbWVHNiJJLFR5cGVzZXR0aW5nR0koX3N5c2xpYkdGJzYjLUkobWZlbmNlZEdGJDYmLUYjNiYtSSNtaUdGJDYjUSFGJy1GIzYkLUkjbW9HRiQ2LVEqJnVtaW51czA7RicvJSxtYXRodmFyaWFudEdRJ25vcm1hbEYnLyUmZmVuY2VHUSZmYWxzZUYnLyUqc2VwYXJhdG9yR0Y/LyUpc3RyZXRjaHlHRj8vJSpzeW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