2.05 2D Integrals and the Gauss-Green Formula
 LITERACY

Off[General::spell1]; Off[General::spell]; Off[ParametricPlot3D::plnr]; Off[ParametricPlot3D::ppcom]; Off[ParametricPlot::ppcom]; Off[Plot::plnr]; \(Needs["Graphics`Colors`"]; 

    Graphics`Colors`GosiaGreen = RGBColor[0, \ 0.392187, \ 0]; 

    CMView\  = \ {2.7, \ 1.6, \ 1.2}; \)

What you should be able to handle away from the machine.

L.1)

Here's a plot of a certain surface 
       z = f[x, y] 
over the rectangle R in the xy-plane consisting of all points {x, y, 0} with 
       -2 ≤ x ≤ 2 and -1 ≤ y ≤ 3:

\(Clear[f, x, y]; 
f[x_, y_] = 3 + 0.7\ x + Sin[x - 2\ y]; 

    \({{a, b}, {c, d}} = {{\(-2\), 2}, {\(-1\), 3}}; \)\)surfaceplot = 
      Plot3D[f[x, y], {x, a, b}, {y, c, d}, 
        DisplayFunction -> Identity]; spacer = 0.2; threedims = 
      Graphics3D[{{Line[{{a, 0, 0}, {b, 0, 0}}]}, 
          Text["x", {b + spacer, 0, 0}], {Line[{{0, c, 0}, {0, d, 0}}]}, 
          Text["y", {0, d + spacer, 0}], {
            Line[{{0, 0, 0}, {0, 0, 5.0}}]}, 
          Text["z", {0, 0, 5.0 + spacer}]}]; CMView = {2.7, 1.6, 1.2}; fplot = 
      Show[surfaceplot, threedims, ViewPoint -> CMView, 
        PlotRange -> All, DisplayFunction -> $DisplayFunction];

Here's an embellishment of the same plot:

xjump = ((b - a)/8); yjump = ((d - c)/8); poles = 
      Show[fplot, 
        Table[{Graphics3D[{PointSize[0.01], Point[{x, y, 0}]}], 
            Graphics3D[Line[{{x, y, 0}, {x, y, f[x, y]}}]], 
            Graphics3D[
              Polygon[{{a, c, 0}, {a, d, 0}, {b, d, 0}, {b, c, 0}}]]}, {x, a, 
            b, xjump}, {y, c, d, yjump}]];

Each of the vertical plotted poles has its base at a point {x, y, 0} in the rectangle R. What does the length of each plotted pole measure?

L.2)

Given a specific function f[x, y], how do you expect the output from the Mathematica instructions
       Plot3D[f[x,y], {x,0,4}, {y, -3, 5}]
and  
  ParametricPlot3D[{x, y, f[x,y]}, {x, 0, 4}, {y, -3, 5}]
to be related?

L.3)

Here's a plot of a certain surface z = f[x, y] over (or under) the rectangle R in the xy-plane consisting of all points {x, y, 0} with -1 ≤ x ≤ 2 amd -1 ≤ y ≤ 3 shown with a plot of R:

\(Clear[f, x, y]; 
f[x_, y_] = 3 - 0.7\ x + Cos[x - 3\ y]; 

    \({{a, b}, {c, d}} = {{\(-1\), 2}, {\(-1\), 3}}; \)\)surfaceplot = 
      Plot3D[f[x, y], {x, a, b}, {y, c, d}, PlotPoints -> {20, 30}, 
        DisplayFunction -> Identity]; spacer = 0.2; threedims = 
      Graphics3D[{{Line[{{a, 0, 0}, {b, 0, 0}}]}, 
          Text["x", {b + spacer, 0, 0}], {Line[{{0, c, 0}, {0, d, 0}}]}, 
          Text["y", {0, d + spacer, 0}], {Line[{{0, 0, 0}, {0, 0, 6}}]}, 
          Text["z", {0, 0, 6 + 2 spacer}]}]; base = 
      Graphics3D[Polygon[{{a, c, 0}, {a, d, 0}, {b, d, 0}, {b, c, 0}}]]; 
    label = Graphics3D[Text["R", {-0.5, 2.7, 0}]]; CMView = {2.7, 1.6, 1.2}; fplot = 
      Show[surfaceplot, base, label, threedims, ViewPoint -> CMView, 
        PlotRange -> All, DisplayFunction -> $DisplayFunction];

Why does the plot signal that 
      ∫(∫_R) f[x, y] dx dy > 0?

L.4)

Here's a plot of a certain surface z = f[x, y] over (or under) the rectangle R in the xy-plane consisting of all points {x, y, 0} with 
        -1 ≤ x ≤ 1 and -1 ≤ y ≤ 2 
shown with a plot of R:

\(Clear[f, x, y]; 
f[x_, y_] = \(-5\)\ E\^\(-\((x - 0.3\ y)\)\^2\); 

    \({{a, b}, {c, d}} = {{\(-1\), 1}, {\(-1\), 2}}; \)\)surfaceplot = 
      Plot3D[f[x, y], {x, a, b}, {y, c, d}, PlotPoints -> {20, 30}, 
        DisplayFunction -> Identity]; spacer = 0.2; threedims = 
      Graphics3D[{{Line[{{a, 0, 0}, {b + 0.5, 0, 0}}]}, 
          Text["x", {b + 0.5 + spacer, 0, 0}], {
            Line[{{0, c, 0}, {0, d + 0.4, 0}}]}, 
          Text["y", {0, d + 0.4 + spacer, 0}], {
            Line[{{0, 0, 0}, {0, 0, 1.0}}]}, 
          Text["z", {0, 0, 1.2 + spacer}]}]; base = 
      Graphics3D[Polygon[{{a, c, 0}, {a, d, 0}, {b, d, 0}, {b, c, 0}}]]; 
    label = Graphics3D[Text["R", {-0.5, 1.5, 0}]]; CMView = {2.7, 1.6, 1.2}; fplot = 
      Show[surfaceplot, base, label, threedims, ViewPoint -> CMView, 
        PlotRange -> All, DisplayFunction -> $DisplayFunction];

Why does the plot signal that 
          ∫(∫_R) f[x, y] dx dy < 0?

L.5)

Here's a plot of a certain surface z = f[x, y] over (and under) the rectangle R in the xy-plane consisting of all points {x, y, 0} with 
        -1 ≤ x ≤ 2 and -1 ≤ y ≤ 3 
shown with a plot of R:

\(Clear[f, x, y]; 
f[x_, y_] = 1 - 0.7\ x + Cos[3\ x + y]; 

    \({{a, b}, {c, d}} = {{\(-1\), 2}, {\(-1\), 3}}; \)\)surfaceplot = 
      Plot3D[f[x, y], {x, a, b}, {y, c, d}, PlotPoints -> {20, 30}, 
        DisplayFunction -> Identity]; spacer = 0.2; threedims = 
      Graphics3D[{{Line[{{a, 0, 0}, {b + 0.3, 0, 0}}]}, 
          Text["x", {b + 0.3 + spacer, 0, 0}], {
            Line[{{0, c, 0}, {0, d + 0.3, 0}}]}, 
          Text["y", {0, d + 0.3 + spacer, 0}], {
            Line[{{0, 0, 0}, {0, 0, 4.0}}]}, 
          Text["z", {0, 0, 4.0 + 2 spacer}]}]; base = 
      Graphics3D[Polygon[{{a, c, 0}, {a, d, 0}, {b, d, 0}, {b, c, 0}}]]; 
    label = Graphics3D[Text["R", {0.9, 0.5, 0}]]; CMView = {2.7, 1.6, 1.2}; fplot = 
      Show[surfaceplot, base, label, threedims, ViewPoint -> CMView, 
        PlotRange -> All, DisplayFunction -> $DisplayFunction];

Why does the plot strongly suggest that 
        ∫(∫_R) f[x, y] dx dy > 0?
How does the sign of f[x, y] tell you whether the surface plots out over R or under R?

L.6)

Here's a plot of the surface 
         z = (x^2) (e^(-(y/2)))
over the rectangle R in the xy-plane consisting of all points {x, y, 0} with 
        -3 ≤ x ≤ 4 and 0 ≤ y ≤ 5 
shown with a plot of R:

\(Clear[f, x, y]; 
f[x_, y_] = \((x\^2 + 3)\)\ E\^\(-\(y\/2\)\); 

    \({{a, b}, {c, d}} = {{\(-3\), 4}, {0, 3}}; \)\)surfaceplot = 
      Plot3D[f[x, y], {x, a, b}, {y, c, d}, 
        DisplayFunction -> Identity]; spacer = 0.2; threedims = 
      Graphics3D[{{Line[{{a, 0, 0}, {b + 0.3, 0, 0}}]}, 
          Text["x", {b + 0.3 + spacer, 0, 0}], {
            Line[{{0, c, 0}, {0, d + 0.3, 0}}]}, 
          Text["y", {0, d + 0.3 + spacer, 0}], {
            Line[{{0, 0, 0}, {0, 0, 10.0}}]}, 
          Text["z", {0, 0, 10.0 + 2 spacer}]}]; base = 
      Graphics3D[Polygon[{{a, c, 0}, {a, d, 0}, {b, d, 0}, {b, c, 0}}]]; 
    label = Graphics3D[Text["R", {3, 1, 0}]]; CMView = {2.7, 1.6, 1.2}; fplot = 
      Show[surfaceplot, base, label, threedims, ViewPoint -> CMView, 
        PlotRange -> All, DisplayFunction -> $DisplayFunction];

Measure by hand calculation the volume of the solid whose top skin is the plotted surface and whose bottom skin is the rectangle R.

L.7)

Here's a plot of the surface 
         z = 3 + Sin[2  x] + Cos[3  y] 
over the rectangle R in the xy-plane consisting of all points {x, y, 0} with 
        -π ≤ x ≤ 2  π and -π ≤ y ≤ 2  π
shown with a plot of R:

\(Clear[f, x, y]; 
f[x_, y_] = 3 + Sin[2\ x] + Cos[3\ y]; 

    \({{a, b}, {c, d}} = {{\(-π\), 2\ π}, {\(-π\), 2\ π}}; 
    \)\)surfaceplot = 
      Plot3D[f[x, y], {x, a, b}, {y, c, d}, PlotPoints -> {40, 40}, 
        DisplayFunction -> Identity]; spacer = 0.2; threedims = 
      Graphics3D[{{Line[{{a, 0, 0}, {b + 0.3, 0, 0}}]}, 
          Text["x", {b + 0.3 + spacer, 0, 0}], {
            Line[{{0, c, 0}, {0, d + 0.3, 0}}]}, 
          Text["y", {0, d + 0.3 + spacer, 0}], {
            Line[{{0, 0, 0}, {0, 0, 8.0}}]}, 
          Text["z", {0, 0, 8.0 + 2 spacer}]}]; base = 
      Graphics3D[Polygon[{{a, c, 0}, {a, d, 0}, {b, d, 0}, {b, c, 0}}]]; 
    label = Graphics3D[Text["R", {5.8, 4.5, 0}]]; CMView = {2.7, 1.6, 1.2}; fplot = 
      Show[surfaceplot, base, label, threedims, ViewPoint -> CMView, 
        PlotRange -> All, DisplayFunction -> $DisplayFunction];

Measure by hand calculation the volume of the solid whose top skin is the plotted surface and whose bottom skin is the rectangle R.

\(Clear[x]; 

    Table[{x, Sin[x], Cos[x]}, {x, \(-π\), 2\ π, π\/2}]\)

L.8)

Here's a plot of the surface 
         z = 3 - ((y^2)/4) - (x/2)
over the region R in the xy-plane consisting of all points {x, y, 0} with {x, y} inside the 2D circle 
        (x^2) + (y^2) = 4 
shown with a plot of R:

\(Clear[x, y, z, f, t, r]; 
f[x_, y_] = 3 - y\^2\/4 - x\/2; 

    \({x[r_, t_], y[r_, t_], z[r_, t_]} = r\ {2\ Cos[t], 2\ Sin[t], 0}; 
    \)\)Rplot = 
      ParametricPlot3D[{x[r, t], y[r, t], z[r, t]}, {r, 0, 1}, {t, 0, 
          2 π}, PlotPoints -> {2, Automatic}, 
        DisplayFunction -> Identity]; \(surfaceplot = 
      ParametricPlot3D[{x[r, t], y[r, t], f[x[r, t], y[r, t]]}, {r, 0, 1}, {
          t, 0, 2\ π}, DisplayFunction -> Identity]; 
spacer = 0.2; 
    
\(threedims = 
      Graphics3D[{{Line[{{\(-2\), 0, 0}, {2.4, 0, 0}}]}, 
          Text["x", {2.4 + spacer, 0, 0}], {
            Line[{{0, \(-2\), 0}, {0, 2.4, 0}}]}, 
          Text["y", {0, 2.4 + spacer, 0}], {
            Line[{{0, 0, 0}, {0, 0, 5}}]}, 
          Text["z", {0, 0, 5 + spacer}]}]; \)\)CMView = {2.7, 1.6, 1.2}; label = Graphics3D[Text["R", {1, 1, 0}]]; threeDplot = 
      Show[surfaceplot, Rplot, threedims, label, BoxRatios -> Automatic, 
        ViewPoint -> CMView, PlotRange -> All, 
        DisplayFunction -> $DisplayFunction];

Come up with a counterclockwise parameterization {x[t], y[t]} of the circle
         (x^2) + (y^2) = 4. 
Use your parameterization and the Gauss-Green formula to measure by hand calculation the volume of the solid whose top skin is the plotted surface and whose bottom skin is the rectangle R.
Don't forget that
       \(∫\_\(\ a\)\%b\( Sin[t]\^\(\ k\)\ Cos[t]\) 
            dt = 
        Sin[b]\^\(\ k\  + \ 1\)\/\(k\  + \ 1\)\  - \ 
          Sin[a]\^\(\ k\  + \ 1\)\/\(k\  + \ 1\)\)
and
       (∫_( a)^b) Cos[t]^( k) Sin[t] dt=\(\(-Cos[b]\^\(\ k\  + \ 1\)\)\/\(k\  + \ 1\)\  + \ 
            Cos[a]\^\(\ k\  + \ 1\)\/\(k\  + \ 1\)\).

L.9)

Go with 
         f[x] = Sin[2  x].
Give a clean formula for the function h[x] defined by
         h[x] = (∫_( 0)^x) f[s] ds.
How are f[x] and D[h[x], x] related? 
Is the outcome an accident? Why or why not?

L.10)

Go with 
         f[x, y] = 2  x + 5  Sin[y].
Give a clean formula for the function n[x, y] defined by
         n[x, y] = (∫_( 0)^x) f[s, y] ds.
How are f[x, y] and D[n[x, y], x] related?
Is the outcome an accident? Why or why not?

L.11)

Go with 
         f[x, y] = 2 (e^(-(x^2))) Cos[y].
Give a clean formula for the function m[x, y] defined by
         m[x, y] = (∫_( 0)^( y))f[x, s] ds.
How are f[x, y] and D[m[x, y], y] related?
Is the outcome an accident? Why or why not?

L.12)

Write down the Gauss-Green formula and say how to use it to calculate
            ∫(∫_R) (x^2)(y^3) dx dy
in the case that you have your hands on a convenient counterclockwise 2D parameterization 
         {x[t], y[t]}, a ≤ t ≤ b 
of the boundary of R.

L.13)

Here is a 2D region R with bottom boundary curve
        low[x] = x (x - 1) 
and with top boundary curve 
        high[x] = 2  x (1 - x):

\(Clear[low, high, x]; 

    Rplot = Plot[{x\ \((x - 1)\), 2\ x\ \((1 - x)\)}, {x, 0, 1}, 
        PlotStyle -> {{Thickness[0.01]}}, 
        AxesLabel -> {"x", "y"}, 
        Epilog -> {Text["R", {0.2, 0.2}], 
            Text["y = 2 x ( 1 - x)", {0.6, 0.35}], 
            Text["y = x ( x - 1)", {0.5, \(-0.2\)}]}]; \)

Say why it's natural to calculate 
            ∫(∫_R) (x + y) dx dy
by integrating with respect to y first. 
Next, calculate 
         ∫(∫_R) (x + y) dx dy
by hand.

L.14)

Here is a 2D region R whose left boundary is the curve
        left[y] = Sin[3  y] 
and whose right boundary is the curve 
        right[y] = 4  Sin[y]:

\(Clear[y]; 

    Rplot = ParametricPlot[{{Sin[3\ y], y}, {4\ Sin[y], y}}, {y, 0, π}, 
        PlotStyle -> {{Thickness[0.01]}}, 
        AxesLabel -> {"x", "y"}, 
        Epilog -> {Text["R", {2, 1.5}], 
            Text["x = Sin[3 y]", {0.75, 2}], 
            Text["x = 4 Sin[y]", {3.3, 0.6}]}]; \)

Say why it's natural to calculate 
        ∫(∫_R) 
          1 dx dy
by integrating with respect to x first. 
Next, calculate 
        ∫(∫_R) 
          1 dx dy
by hand and say what
        ∫(∫_R) 
          1 dx dy
measures.

L.15)

When you want to plot the ellipse
            ((((x/4)))^2) + ((((y/3)))^2) = 1 
in two dimensions with a counterclockwise parameterization, you can go with:

\(Clear[x2D, y2D, t]; 
{x2D[t_], y2D[t_]} = {4\ Cos[t], 3\ Sin[t]}; 


    ParametricPlot[{x2D[t], y2D[t]}, {t, 0, 2\ π}, 
	
      PlotStyle -> Thickness[0.01], AspectRatio -> Automatic, 
      AxesLabel -> {"x", "y"}]; \)

When you want to plot the same ellipse
             ((((x/4)))^2) + ((((y/3)))^2) = 1
and everything inside it on the xy-plane in three dimensions with a counterclockwise parameterization, you can go with:

\(Clear[x, y, z, t, r]; 
    
{x[r_, t_], y[r_, t_], z[r_, t_]} = r\ {5\ Cos[t], 3\ Sin[t], 0}; 


    Rplot = ParametricPlot3D[{x[r, t], y[r, t], z[r, t]}, {r, 0, 1}, {t, 0, 
          2\ π}, PlotPoints -> {2, Automatic}, 
        DisplayFunction -> Identity]; 
\(spacer = 0.2; \)\)threedims = 
      Graphics3D[{{Line[{{-5, 0, 0}, {5.5, 0, 0}}]}, 
          Text["x", {5.5 + spacer, 0, 0}], {
            Line[{{0, -3, 0}, {0, 3.5, 0}}]}, 
          Text["y", {0, 3.5 + spacer, 0}], {
            Line[{{0, 0, 0}, {0, 0, 2}}]}, 
          Text["z", {0, 0, 2 + spacer}]}]; \(CMView = {2.7, 1.6, 1.2}; 


    all = Show[Rplot, threedims, 
		BoxRatios -> Automatic, 
        ViewPoint -> CMView, PlotRange -> All, 
        DisplayFunction -> $DisplayFunction]; \)

Now look at this:

{{x2D[t], y2D[t]}, {x[r, t], y[r, t], z[r, t]}}

Where do the points 
           {x[r, t], y[r, t], z[r, t]} 
land when you go with r = 0?
Where do the points 
           {x[r, t], y[r, t], z[r, t]} 
land when you go with 0 < r < 1?
Where do the points 
           {x[r, t], y[r, t], z[r, t]} 
land when you go with r = 1?

L.16)

Here's the surface 
          z = f[x, y] = (e^(((((x/5)))^2) + ((((y/3)))^2)))
plotted above the ellipse in L.15):

(E^(((((x/5)))^2) + ((((y/3)))^2)))

\(Clear[f, r, t]; 
f[x_, y_] = E\^\(\((x\/5)\)\^2 + \((y\/3)\)\^2\); 


    surfaceplot = 
      ParametricPlot3D[{x[r, t], y[r, t], f[x[r, t], y[r, t]]}, {r, 0, 1}, {
          t, 0, 2\ π}, DisplayFunction -> Identity]; 


    Show[surfaceplot, all, ViewPoint -> CMView, 
      DisplayFunction -> $DisplayFunction]; \)

Where do the points 
           {x[r, t], y[r, t], f[x[r, t], y[r, t]]} 
land when you go with r = 0?
Where do the points 
           {x[r, t], y[r, t], f[x[r, t], y[r, t]]} 
land when you go with 0 < r < 1?
Where do the points 
           {x[r, t], y[r, t], f[x[r, t], y[r, t]]}  
land when you go with r = 1?