Riemann Sums for Double Integrals
Math 211  Prof. Leise

Email completed labs to tleise@amherst.edu by noon Monday.

Let's begin with using Riemann sums to approximate the area under a curve, for example, y=4-x^2 on [0,2].

We can get a lower bound m (meaning m≤(∫_0^2)(4-x^2)dx) by using the right hand rule to generate rectangles with a smaller area than the area under the curve.  To find m, sum the areas of these rectangles, which have width 1/2 and height 4-(k/2)^2.  Note that each rectangle corresponds to a subinterval [(k-1)/2,k/2] for k=1,2,3,4.

Show[Plot[4-x^2,{x,0,2}],Graphics[Table[Rectangle[{(k-1)/2,0},{k/2,4-(k/2)^2}],{k,1,4}]],AspectRatio->1/2]

m=Sum[(1/2)(4-(k/2)^2),{k,1,4}] (* sums the areas of the 4 rectangles *)

We can get an upper bound M (meaning (∫_0^2)(4-x^2)dx≤M) by using the left hand rule to generate rectangles with a larger area than the area under the curve:

Show[Graphics[Table[Rectangle[{(k-1)/2,0},{k/2,4-((k-1)/2)^2}],{k,1,4}]],Plot[4-x^2,{x,0,2},PlotStyle->White],AspectRatio->1/2]

M=Sum[(1/2)(4-((k-1)/2)^2),{k,1,4}] (* sums the areas of the 4 rectangles *)

We can conclude that 4.25 ≤ (∫_0^2)(4-x^2)dx ≤ 6.25.  The actual value is 5(1/3):

Integrate[4-x^2,{x,0,2}]

Exercise 1.  Find upper and lower bounds for (∫_0^5)(x^3)dx using 5 subintervals of [0,5]. Compare to the actual value of the integral. (You may use the Integrate command if you wish.)

Now let's extend this idea to double integrals, for example, f(x,y)=x*y on [0,3]x[0,3].  Double integrals find the volume below the surface z=f(x,y) over a region of the xy-plane.

Plot3D[x y,{x,0,3},{y,0,3},PlotRange->All,AspectRatio->1]

Here's the Riemann sum idea for estimating (∫_0^3)(∫_0^3)x ydydx: Break the region into, say, 36 subrectangles (squares of side length 1/2). We do this by dividing each interval [0,3] into 6 subintervals along the x and y axes. Plug a point from each square into f(x,y) to get the height of the surface over that square, then multiply this height by the area of the square (1/2*1/2) to find the volume of the box on that square. Add up the volumes of the boxes over the 36 squares to estimate the total volume under the surface z=f(x,y).

Use the following applet to see what using different number of boxes looks like:

We can get a lower bound m (meaning m≤(∫_0^3)(∫_0^3)x ydydx) by using the lower left corner of each subrectangle to generate boxes with a smaller volume than the volume under the surface z=f(x,y). To find m, sum the volumes of these boxes, which have base area 1/4 and height x*y, where x and y are the coordinates of the lower left corner of each subrectangle. We need a formula for each of these corners. The jth x-subinterval is [(j-1)/2,j/2] and kth y-subinteral is [(k-1)/2,k/2] (sketch a picture and check that these formulas give the right values).

The lower bound for the double integral using 36 boxes is

m=N[Sum[Sum[1/4 ((j-1)/2)((k-1)/2),{j,1,6}],{k,1,6}]] (* lower bound for double integral *)

Exercise 2. Find an upper bound M for (∫_0^3)(∫_0^3)x ydydx by using 36 boxes.

Exercise 3. Find better upper and lower bounds for (∫_0^3)(∫_0^3)x ydydx by using 900 boxes.

Exercise 4. Find much better upper and lower bounds for (∫_0^3)(∫_0^3)x ydydx by using 90,000 boxes.

Exercise 5. Find the actual value of the integral. In Mathematica, evaluate the double integral (∫_a^b)(∫_c^d)f(x,y)dydx using Integrate[f(x,y),{x,a,b},{y,c,d}].

Exercise 6. Find the volume under the surface z=9-x^2-y^2 on [0,2]x[0,1] by evaluating double integral (∫_0^2)(∫_0^1)(9-(x^2)-(y^2))dydx in Mathematica. Note that [0,2] corresponds to the x-axis and [0,1] corresponds to the y-axis here.