In the previous section 2.4.2, we had a demo showing how we can find the volume under a 2D function graph, that is to say, the volume the function graph encloses with the xy-plane using upper and lower sums. This demo shows how the same method can be employed to find volumes between two function graphs `f(x,y)` and `g(x,y)`.

For the purple "Upper Prisms", each rectangular prism U_{ij} gets assigned a base height, which is equal to the lowest value `f` and `g` take on over the given rectangular base `a`_{i}≤x_{i}≤b_{i}, `c`_{j}≤y_{j}≤d_{j}:

`z`_{base}=min{f(x,y),g(x,y): a_{i}≤x≤b_{i}, `c`_{j}≤y≤d_{j}}.

The top height of the prism is accordingly given by `z`_{top}=max{f(x,y),g(x,y): a_{i}≤x≤b_{i}, `c`_{j}≤y≤d_{j}}, so that we get a prism with overall height equal to z_{top}-z_{base}.

We also want to introduce the green "Lower Prisms" L_{ij}, which give a lower bound on the volume between the two function graphs. If the two functions don't intersect over a given rectangle, then we can define the base height of the corresponding lower prism as the maximal value that the lower function takes on over the given rectangle, and their top height is given by the minimal value of the upper function.

It's easy to see that the combined volume of all the Upper Prisms is an upper bound on the volume between the two function graphs (if it exists), and that the combined volume of the Lower Prisms constitutes a Lower Bound.

It is also easy to see that if these new upper and lower sums converge to the same value, the volume between the two function graphs of `f(x,y)` and `g(x,y)` is defined, and equal to the limit.

If you go to the "Field of 3 Plots" item of the plot menu in the `Function Graph: f(x,y)` window, click on "Lower Prisms" and check the box "Plot is visible". You will see what I have called the "Difference Prisms", and increasing the resolution gradually will show that the volume of the Difference Prisms, the "Difference Volume", will decrease rapidly and go to zero for most functions.