VC.10 3D Surface Measurements
GIVE IT A TRY!

\(Off[General::spell]; 
Off[General::spell1]; 

    \(Off[ParametricPlot3D::ppcom]; \)\)Off[ParametricPlot::ppcom]; Off[Plot::plnr]; SetOptions[Limit, Analytic -> True];

\(CMView = {2.7, 1.6, 1.2}; 
$Pre = Chop; \)

Vector Drawer

BeginPackage["Vector3D`", "Graphics`Colors`"];

\(Axes3D::"usage" = 
      "Axes3D[a, b] creates a Graphics3D object of cartesian axes with x, y, and z running from -a/3 to a, and with axes labels b units beyond the tips of the axes.  Axes3D[a] is Axes3D[a, a/8]."; 

    \(Perpend::"usage" = 
      "Perpend[a] returns a unit vector which is perpendicular to the vector a."; \)\)Arrow::"usage" = 
      "Arrow[a] produces a 2 or 3 dimensional vector from the origin to a. \
Arrow[a, Tail -> tail] gives a vector from tail to a."; Vector::"usage" = 
      "Vector[a, b] gives a 2D or 3D vector from a to b."; ArrowHead::"usage" = 
      "ArrowHead[a, vec] produces an arrowhead with its tip placed at the \
point a, pointing in the direction of the vector vec."; Tail::"usage" = 
      "Tail -> point puts the tail of the vector at point."; Norm::"usage" = 
      "Norm[vec] returns the Euclidean length of vec."; Normalize::"usage" = 
      "Normalize[vec] returns a unit vector in the direction of vec, \
provided vec is nonzero."; Aperture::"usage" = 
      "Aperture is the ratio of the radius of the base to the length of the \
head of a vector."; TipSize::"usage" = 
      "TipSize specifies an absolute size for the inner tip length of the \
head of a vector."; TipRatio::"usage" = 
      "TipRatio is the ratio of the inner length of the arrowhead to the \
length of the shaft of a vector."; HeadRatio::"usage" = 
      "HeadRatio is the ratio of the outer length of the arrowhead to the \
length of the shaft of a vector."; HeadSize::"usage" = 
      "HeadSize specifies an absolute size for the head of a vector."; 
    ScaleFactor::"usage" = 
      "ScaleFactor specifies the amount to scale a vector in length and may \
be either a number or a pure function."; ZeroVectorPointSize::"usage" = 
      "ZeroVectorPointSize is the size of the point used to represent a \
zero vector."; Options[Vector] = 
      Options[Arrow] = 
        Options[ArrowHead] = {HeadRatio -> 0.18, 
            TipRatio -> 0.14, Aperture -> 0.3, 
            ScaleFactor -> 1, HeadType -> Polygon, 
            ShaftQ -> True, EdgesQ -> True, 
            VectorColor -> RGBColor[0, 0, 1], ShaftWidth -> 0.005, 
            ZeroVectorPointSize -> 0.01}; Begin["`Private`"]; SetOptions[ParametricPlot, AspectRatio -> Automatic]; SetOptions[Plot, AspectRatio -> Automatic]; SetOptions[Graphics, AspectRatio -> Automatic]; Axes3D[u_, v_] := 
      Graphics3D[{{Blue, Line[{{-(u/3), 0, 0}, {u, 0, 0}}]}, 
          Text["x", {u + v, 0, 0}], {Blue, 
            Line[{{0, -(u/3), 0}, {0, u, 0}}]}, 
          Text["y", {0, u + v, 0}], {Blue, 
            Line[{{0, 0, -(u/3)}, {0, 0, u}}]}, 
          Text["z", {0, 0, u + v}]}]; Axes3D[u_] := Axes3D[u, (u/8)]; Norm[a_?VectorQ] := N[(Sqrt[a . a])]; Normalize[a_?VectorQ] := If[a . a == 0, a, (a/Norm)[a]]; Perpend[a_?VectorQ] := 
      Normalize[{a[[2]], 
            -a[[1]]}] /; 
        Length[a] == 2Perpend[a_?VectorQ] := 
      Normalize[
          If[a[[1]] == 0, {1, 0, 0}, {0, 
              a[[3]], 
              -a[[2]]}]] /; 
        Length[a] == 3Base3D = 
      Table[{Cos[((2 k π)/8.) ], Sin[((2 k π)/8.) ]}, {k, 0, 
          8}]; Vector[from_?VectorQ, to_?VectorQ, opts___] := 
      Module[{sq, sw, ht, hs, hr, tr, ap, sf, vc, zvps, diff = to - from, 
            tip}, {sq, sw, ht, hs, hr, ts, tr, ap, sf, vc, zvps} = 
            {ShaftQ, ShaftWidth, HeadType, HeadSize, HeadRatio, TipSize, 
                  TipRatio, Aperture, ScaleFactor, VectorColor, 
                  ZeroVectorPointSize} /. {opts} /. Options[Vector]; 
          If[from == to, 
            Return[Graphics[{PointSize[zvps], vc, Point[from]}]]]; 
          diff = If[NumberQ[N[sf]], sf diff, sf[diff]]; tip = from + diff; 
          If[NumberQ[hs], hr = (hs/Norm)[diff]; tr = 0.75 hr]; 
          If[NumberQ[ts], tr = (ts/Norm)[diff]]; 
          Graphics[{
              If[sq, {vc, Thickness[sw], Line[{from, tip - tr diff}]}, {}], 
              With[{trans = ap hr Norm[diff] Perpend[diff]}, {vc, 
                  Thickness[sw], 
                  ht[{tip, tip - hr diff + trans, tip - tr diff, 
                      tip - hr diff - trans, tip}]}]}]] /; 
        Length[from] == Length[to] == 2Vector[from_?VectorQ, to_?VectorQ, opts___] := 
      Module[{sq, eq, sw, hs, hr, tr, ap, sf, vc, zvps, diff = to - from, 
            tip}, {sq, eq, sw, hs, hr, ap, sf, vc, zvps} = 
            {ShaftQ, EdgesQ, ShaftWidth, HeadSize, HeadRatio, Aperture, 
                  ScaleFactor, VectorColor, ZeroVectorPointSize} /. {opts}
                   /. Options[Vector]; 
          If[from == to, 
            Return[Graphics3D[{PointSize[zvps], vc, Point[from]}]]]; 
          diff = If[NumberQ[N[sf]], sf diff, sf[diff]]; tip = from + diff; 
          If[NumberQ[hs], hr = (hs/Norm)[diff]]; tr = (hr/2); 
          Graphics3D[{
              If[sq, {vc, Thickness[sw], Line[{from, tip - tr diff}]}, {}], 
              If[eq, {}, EdgeForm[]], {SurfaceColor[vc], 
                With[{temp = Perpend[diff]}, 
                  (Polygon[Append[#1, tip]]&)/@
                    Partition[
                      (tip - hr diff + #1&)/@
                        ((ap hr Norm[diff] Base3D) . {temp, 
                              Normalize[temp\[Cross]diff]}), 2, 1]]}}]] /; 
        Length[from] == Length[to] == 3Arrow[a_, Tail -> b_, opts___] := Vector[b, a + b, opts]Arrow[a_, opts___] := Vector[Table[0, {Length[a]}], a, opts]\(ArrowHead[a_, b_, opts___] := 
      Vector[a - b, a, ShaftQ -> False, opts]; 

End[]; 

    \(EndPackage[]; \)\)

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

Spherical Setup

\(Clear[polar]; 

    polar[{x_, y_, z_}] := {\@\(x\^2 + y\^2 + z\^2\), ArcTan[y\/x], 
        ArcCos[z\/\@\(x\^2 + y\^2 + z\^2\)]}; 
Clear[X, length]; 

    length[X_] := \@\(X . X\); 
\(rr = 3; \)\)R = 5; scale = 0.8; red = RGBColor[1, 0, 0]; blue = RGBColor[0, 0, 1]; color1 = RGBColor[0.8, 0.2, 0.8]; color2 = RGBColor[0.2, 0.8, 0.2]; black = RGBColor[0, 0, 0]; \(Clear[axes]; 

    axes := Graphics3D[{Line[{X, {1.5\ rr, 0, 0}}], 
          Line[{X, {0, 1.5\ rr, 0}}], Line[{X, {0, 0, 2\ rr}}]}]; 

    Clear[xyplane]; 

    xyplane := 
      Graphics3D[
        Polygon[{{\(-2\)\ rr, \(-2\)\ rr, 0}, {\(-2\)\ rr, 2\ rr, 0}, {2\ rr, 
              2\ rr, 0}, {2\ rr, \(-2\)\ rr, 0}}]]; 
\(X = {0, 0, 0}; \)\)origin = Graphics3D[{black, Point[X]}]; Z = {2, 3, 5}; \(Clear[point]; 

    point := Graphics3D[{red, PointSize[0.03], Point[scale\ Z]}]; 

    \(Z0 = {0, 0, length[0.8\ Z]}; \)\)\(Clear[zpoint]; 
zpoint = Graphics3D[{black, Point[Z0]}]; 

    \(XY = scale\ Z\ {1, 1, 0}; \)\)\(Clear[xypoint]; 
xypoint := Graphics3D[{black, Point[XY]}]; 

    \(X0 = {length[scale\ Z\ {1, 1, 0}], 0, 0}; \)\)xpoint = Graphics3D[{black, Point[X0]}]; Y0 = {0, length[scale Z {1, 1, 0}], 0}; ypoint = Graphics3D[{black, Point[Y0]}]; \(Clear[ray]; 
ray := Graphics3D[{blue, Line[{X, scale\ Z}]}]; 

    Clear[ray1]; 
ray1 := Graphics3D[{color1, Line[{scale\ Z, Z}]}]; 

    Clear[xyray]; 
xyray := Graphics3D[{red, Line[{X, Z\ {1, 1, 0}}]}]; 

    \(rays := {ray, xyray}; \)\)xyaux = 
      (length[0.8 Z] (0.8 Z {1, 1, 0}))/
        length[0.8 Z {1, 1, 0}]; \(Clear[zarc]; 

    zarc = Graphics3D[{blue, 
          Line[Table[
              \(Cos[t]\ \) {0, 0, length[0.8\ Z]} + Sin[t]\ xyaux, {t, 0, 
                \(polar[0.8\ Z]\)[[3
                  ]],  .1}]]}]; 
Clear[zarc1]; 

    zarc1 = Graphics3D[{color1, 
          Line[Table[
              \(Cos[t]\ \) {0, 0, length[0.8\ Z]} + Sin[t]\ xyaux, {t, 
                \(polar[0.8\ Z]\)[[3]], 
                1,  .1}]]}]; 
Clear[zarc2]; 

    zarc2 = Graphics3D[{color1, 
          Line[Table[
              \(Cos[t]\ \) {0, 0, length[0.8\ Z]} + Sin[t]\ xyaux, {t, 
                \(-0.8\), 0,  .1}]]}]; 
Clear[xyarc]; 

    xyarc = Graphics3D[{blue, 
          Line[Table[
              Cos[t]\ X0 + Sin[t]\ Y0, {t, 0, 
                \(polar[XY]\)[[2
                  ]],  .1}]]}]; 
Clear[xyarc1]; 

    xyarc1 = Graphics3D[{color1, 
          Line[Table[Cos[t]\ X0 + Sin[t]\ Y0, {t, \(- .5\), 0,  .1}]]}]; 

    Clear[xyarc2]; 

    xyarc2 = Graphics3D[{color1, 
          Line[Table[
              Cos[t]\ X0 + Sin[t]\ Y0, {t, 
                \(polar[XY]\)[[2]], 
                \(polar[XY]\)[[2]] + 
                  0.3,  .1}]]}]; 
Clear[stick]; 

    stick = Graphics3D[{red, Line[{scale\ Z, XY}]}]; 

    \(xaxislabel = Text["x", {0.363, 0.26}]; \)\)yaxislabel = Text["y", {0.73, 0.3}]; zaxislabel = Text["z", { .5, 0.67}]; stickplot = 
      Show[xyplane, axes, ray, point, Boxed -> False, 
        ViewPoint -> {2.747, 1.594, 1.168}, 
        Epilog -> {xaxislabel, yaxislabel, zaxislabel}, 
        DisplayFunction -> Identity]; rho = Text["r", {0.53, 0.45}]; rlabel = 
      Show[xyplane, axes, ray, point, Boxed -> False, 
        ViewPoint -> {2.747, 1.594, 1.168}, 
        Epilog -> {rho, xaxislabel, yaxislabel, zaxislabel}, 
        DisplayFunction -> Identity]; phi = Text["s", {0.55, 0.57}]; slabel = 
      Show[xyplane, zpoint, axes, ray, point, zarc, zarc1, zarc2, 
        Boxed -> False, ViewPoint -> {2.747, 1.594, 1.168}, 
        Epilog -> {phi, xaxislabel, yaxislabel, zaxislabel}, 
        DisplayFunction -> Identity]; theta = Text["t", { .5, 0.3}]; tlabel = 
      Show[xyplane, axes, xypoint, xpoint, ray, stick, point, xyarc, xyarc1, 
        xyarc2, Boxed -> False, ViewPoint -> {2.747, 1.594, 1.168}, 
        Epilog -> {theta, xaxislabel, yaxislabel, zaxislabel}, 
        DisplayFunction -> Identity]; all = 
      Show[xyplane, axes, ray, stick, point, zpoint, xpoint, xypoint, xyarc, 
        xyarc1, xyarc2, zarc, zarc1, zarc2, Boxed -> False, 
        ViewPoint -> {2.747, 1.594, 1.168}, 
        Epilog -> {theta, phi, rho, xaxislabel, yaxislabel, zaxislabel}, 
        DisplayFunction -> Identity];

Crisscross

\(Clear[x]; 

    crisscross = 
      Plot[{Cos[x], Sin[x]}, {x, π\/8, \(3\ π\)\/8}, 
        PlotStyle -> {{RGBColor[1, 0, 0], Thickness[0.02]}}, 
        Axes -> None, AspectRatio -> 1\/3, 
        DisplayFunction -> Identity]; \)

G.1)  How do you know?*

G.1.a)

Here's a 3D vector field:

\(Clear[x, y, z, m, n, p, Field]; 
    
{m[x_, y_, z_], n[x_, y_, z_], p[x_, y_, z_]} = {
        \(-6\)\ x + 3\ x\ Cos[z], 4\ y + 5\ E\^\(\(-0.2\)\ \((x + z)\)\), 
        5\ z - 3\ Sin[z]}; 

    Field[x_, y_, z_] = {m[x, y, z], n[x, y, z], p[x, y, z]}\)

How do you know that the net flow of this vector field across any surface that is the whole skin of a solid region is from inside to outside?

G.1.b)

Here's another 3D vector field:

\(Clear[x, y, z, m, n, p, Field]; 
    
{m[x_, y_, z_], n[x_, y_, z_], p[x_, y_, z_]} = {
        \(-6\)\ x + 3\ x\ Cos[z], 2\ y + x\/\(1 + x\^2\), z - 3\ Sin[z]}; 

    Field[x_, y_, z_] = {m[x, y, z], n[x, y, z], p[x, y, z]}\)

How do you know that the net flow of this vector field across any surface that is the whole skin of a solid region is from outside to inside?

G.1.c)

Here's another 3D vector field involving a parameter b:

\(Clear[b, x, y, z, m, n, p, Field]; 
    
{m[x_, y_, z_], n[x_, y_, z_], p[x_, y_, z_]} = {
        \(-6\)\ x + 3\ x\ E\^z, b\ y + 12\ z, 8\ x + 4\ z - 3\ E\^z}; 

    Field[x_, y_, z_] = {m[x, y, z], n[x, y, z], p[x, y, z]}\)

How do you know that if b > 2, then the net flow of this vector field across any surface that is the whole skin of a solid region is from inside to outside?
How do you know that if b < 2, then the net flow of this vector field across any surface that is the whole skin of a solid region is from outside to inside?
How do you know that if b = 2, then the net flow of this vector field across any surface that is the whole skin of a solid region is 0?

G.1.d)

Here's another 3D vector field:

\(Clear[b, x, y, z, m, n, p, Field]; 
    
{m[x_, y_, z_], n[x_, y_, z_], p[x_, y_, z_]} = {6\ x\^2 + 3\ x\ E\^z, 
        9\ y + 12\ z, 8\ x + 3\ z - 3\ E\^z}; 

    Field[x_, y_, z_] = {m[x, y, z], n[x, y, z], p[x, y, z]}\)

How do you know that any point 
       {x, y, z} with x > -1 
is a source for this vector field?
How do you know that any point 
       {x, y, z} with x < -1 
is a sink for this vector field?
How do you know that the net flow of this vector field across the sphere of radius = 1 centered at {1, 0, 0} is from inside to outside, but the net flow of this vector field across the sphere of radius = 1 centered at {-3, 0, 0} is from outside to inside?

G.1.e)

Here's another 3D vector field involving cleared functions f[x, y], g[y, z], and h[x, z]:

\(Clear[f, g, h, x, y, z, m, n, p, Field]; 
    
{m[x_, y_, z_], n[x_, y_, z_], p[x_, y_, z_]} = {g[y, z], h[x, z], 
        f[x, y]}; 

    Field[x_, y_, z_] = {m[x, y, z], n[x, y, z], p[x, y, z]}\)

This tells you that 
-> m[x, y, z] = g[y, z] does not change as x changes;
-> n[x, y, z] = h[x, z] does not change as y changes and
-> p[x, y, z] = f[x, y] does not change as z changes.
Give a concrete example of this kind of vector field.
How do you know in advance that this kind of vector field has no sources or sinks?

G.1.f)

Look at this plot:

\(Clear[x, y, z, s, t]; 

    x[s_, t_] = \(5\ Sin[s]\ Cos[t]\)\/\(1 + \((s - π\/2)\)\^2\); 

    \(y[s_, t_] = \((4 - Sin[t])\)\ Sin[s]\ Sin[t]; \)\)z[s_, t_] = 4 Cos[s]; {{slow, shigh}, {tlow, thigh}} = {{0, (π/2)}, {0, π}}; surface = 
      ParametricPlot3D[
        Evaluate[{x[s, t], y[s, t], z[s, t]}], {s, slow, shigh}, {t, tlow, 
          thigh}, DisplayFunction -> Identity]; \(Clear[normal]; 

    normal[s_, t_] = 
      D[{x[s, t], y[s, t], z[s, t]}, s]\[Cross]D[{x[s, t], y[s, t], z[s, t]}, 
          t]; 
jump = π\/8; 
\(scalefactor = 0.2; \)\)\(normals = 
      Table[Arrow[normal[s, t], Tail -> {x[s, t], y[s, t], z[s, t]}, 
          ScaleFactor -> scalefactor], {s, slow + jump, shigh - jump, 
          jump}, {t, tlow + jump, thigh - jump, jump}]; 


    Show[surface, normals, ViewPoint -> CMView, Boxed -> False, 
      AxesLabel -> {"x", "y", "z"}, 
      BoxRatios -> Automatic, DisplayFunction -> $DisplayFunction]; 
    \)

This plot shows a surface together with some of the normal vectors whose lengths measure the area conversion factor 
       (Subscript[SA, xyz])[s, t], 
which converts st-paper area measurements into xyz-area measurements on the surface.
Notice this:
The longer normal vectors have their tails on the larger plates on the Mathematica plot, and the shorter normal vectors have their tails on the smaller plates on the Mathematica plot.
How do you know that this is likely to happen no matter what surface you go with?

G.2)  Meat-and-potatoes measurements*

G.2.a.i)

Here's a vector field:

\(Clear[x, y, z, m, n, p, Field]; 
    
{m[x_, y_, z_], n[x_, y_, z_], p[x_, y_, z_]} = {y\^2, z\^2, x\^2}; 

    Field[x_, y_, z_] = {m[x, y, z], n[x, y, z], p[x, y, z]}\)

Measure the net flow of this vector field across the surface of the three dimensional box
       -1 ≤ x ≤ 2, -3 ≤ y ≤ 3, 0 ≤ z ≤ 4.
Is the net flow of this vector field across this skin from inside to outside, from outside to inside, or 0?

If you are not using Gauss's 3D formula, then you are working too hard.

G.2.a.ii)

Here's a new vector field:

\(Clear[x, y, z, m, n, p, Field]; 
    
{m[x_, y_, z_], n[x_, y_, z_], p[x_, y_, z_]} = {x\^2, y\^2, z\^2}; 

    Field[x_, y_, z_] = {m[x, y, z], n[x, y, z], p[x, y, z]}\)

Measure the net flow of this vector field across the surface of the three dimensional box 
       -1 ≤ x ≤ 2, -3 ≤ y ≤ 3, 0 ≤ z ≤ 4.
Is the net flow across this skin from inside to outside, from outside to inside, or 0?

G.2.b)

Measure the net flow of the vector field
       Field[x, y, z] = {(x^2), (y^2), (z^2)}
across the surface of the sphere of radius 3 centered at {0, 0, 2}.
Is the net flow across this skin from inside to outside, from outside to inside, or 0?

G.2.c)

Here's a new vector field:

\(Clear[x, y, z, m, n, p, Field]; 
    
{m[x_, y_, z_], n[x_, y_, z_], p[x_, y_, z_]} = {x\^2, y\^3, z\^2}; 

    Field[x_, y_, z_] = {m[x, y, z], n[x, y, z], p[x, y, z]}\)

Use Gauss's formula to measure the net flow of this vector field
across the surface of the 3D solid region between the sphere of radius 1 centered at {0, 0, 0} and the sphere of radius 4 centered at {0, 0, 1}.

Measure the flow of Field[x, y, z] across the sphere of radius 1 centered at {0, 0, 0}.  Then measure the flow of Field[x, y, z] across the sphere of radius 4 centered at {0, 0, 1}.
Put the two measurements together in the right way to get the answer you are after.

G.2.d.i)

Here's a magic carpet:

\(Clear[x, y, z, s, t]; 
    
{x[s_, t_], y[s_, t_], z[s_, t_]} = {t, 0, 1 + 0.15\ Cos[4\ t]} + 
        s\ {0, 1, 0}; 

    \({{slow, shigh}, {tlow, thigh}} = {{0, 1.5}, {0, 6}}; \)\)carpet = 
      ParametricPlot3D[
        Evaluate[{x[s, t], y[s, t], z[s, t]}], {s, slow, shigh}, {t, tlow, 
          thigh}, PlotPoints -> {2, 30}, ViewPoint -> CMView, 
        BoxRatios -> Automatic, Boxed -> False, 
        AxesLabel -> {"x", "y", "z"}];

Look at the numbers displayed on the axes, and use them to say why it is clear that the surface area measurement of this magic carpet is a bit more than 9 square units. 
Then move in with a surface integral to give a more accurate measurement.

Use NIntegrate to calculate the surface integral.

G.2.d.ii)

While you're at it, take the same magic carpet as in part i) above and measure the flow of the 3D vector field
       Field[x, y, z] = {y -  z, x +  z, x -  y}
across (through) this carpet.  Determine whether the net flow of this vector field across (through) this carpet is from under to over or from over to under.

G.2.d.iii) Calculus Cal screws up

When that lab pest, Calculus Cal, looked over your shoulder and saw your answer to part ii) above, he said: "Your answer is wrong, and I'll tell you why.  Look at the vector field and its divergence:"

\(Clear[x, y, z, m, n, p, Field, divField]; 
    
{m[x_, y_, z_], n[x_, y_, z_], p[x_, y_, z_]} = {y - z, x + z, x - y}; 
    
\(Field[x_, y_, z_] = {m[x, y, z], n[x, y, z], p[x, y, z]}; \)\)divField[x_, y_, z_] = 
      D[m[x, y, z], x] + D[n[x, y, z], y] + D[p[x, y, z], z]

Calculus Cal went on to say: "It says right in B.1) that any vector field Field[x, y, z] with divField[x, y, z] = 0 for all points {x, y, z} has no sources or sinks.  Therefore, its flow across any old surface is 0."
Say why Calculus Cal is wrong and then tell Cal where to go.

G.2.e)

Here's a plot of the uv-paper ellipse 
       ((((u/2)))^2)+ ((((v/4)))^2)=1  
on the plane 
       x +  2  y +  4  z = 0
under the parameterization
       x[u, v] = u,
       y[u, v] = v, and
       z[u, v] = (1/4) (-u -  2  v).

\(Clear[x, y, z, u, v, t]; 
x[u_, v_] = u; 
\(y[u_, v_] = v; \)\)z[u_, v_] = (1/4) (-u - 2 v); u[t_] = 2 Cos[t]; v[t_] = 4 Sin[t]; curve = 
      ParametricPlot3D[{x[u[t], v[t]], y[u[t], v[t]], z[u[t], v[t]]}, {t, 0, 
          2 π}, DisplayFunction -> Identity]; {a, b} = {-5, -5}; h = 10; \(plane = 
      Graphics3D[
        Polygon[{{x[a, b], y[a, b], z[a, b]}, {x[a + h, b], y[a + h, b], 
              z[a + h, b]}, {x[a + h, b + h], y[a + h, b + h], 
              z[a + h, b + h]}, {x[a, b + h], y[a, b + h], z[a, b + h]}}]]; 

    
Show[curve, plane, AxesLabel -> {"x", "y", "z"}, 
      ViewPoint -> CMView, DisplayFunction -> $DisplayFunction]; 
    \)

Come up with a measurement of the area enclosed by this curve as measured on the plotted plane.

G.3)  Substitute surfaces for avoiding calculational nightmares*

G.3.a)

Here is a surface called (Subscript[C, 1]):

\(Clear[x1, y1, z1, s, t]; 
x1[s_, t_] = 2 + 2\ Sin[s]\ Cos[t]; 

    \(y1[s_, t_] = 1 + 2\ Sin[s]\ Sin[t]; \)\)z1[s_, t_] = 1 + (E^Sin)[y1[s, t] - 1] Cos[s]; {{s1low, s1high}, {t1low, t1high}} = {{0, (π/2)}, {0, 2 π}}; 
    C1plot = 
      ParametricPlot3D[
        Evaluate[{x1[s, t], y1[s, t], z1[s, t]}], {s, s1low, s1high}, {t, 
          t1low, t1high}, Boxed -> False, ViewPoint -> CMView, 
        PlotRange -> All, 
        AxesLabel -> {"x", "y", "z"}];

(Subscript[C, 2]) is a circular disk in the plane z = 1 centered at the point {2, 1, 1}:

\(Clear[x2, y2, z2, s, t]; 
x2[s_, t_] = 2 + s\ Cos[t]; 

    \(y2[s_, t_] = 1 + s\ Sin[t]; \)\)z2[s_, t_] = 1; {{s2low, s2high}, {t2low, t2high}} = {{0, 2}, {0, 2 π}}; C2plot = 
      ParametricPlot3D[
        Evaluate[{x2[s, t], y2[s, t], z2[s, t]}], {s, s2low, s2high}, {t, 
          t2low, t2high}, PlotPoints -> {2, Automatic}, 
        Boxed -> False, ViewPoint -> CMView, PlotRange -> All, 
        AxesLabel -> {"x", "y", "z"}];

(Subscript[C, 1]) and (Subscript[C, 2]) share the same boundary curve, as you can see by studying the code or by looking from underneath:

Show[C1plot, C2plot, ViewPoint -> {5, 5, -5}];

Here's a vector field:

\(Clear[x, y, z, Field]; 
Field[x_, y_, z_] = {z - y, x + z, y - x}\)

And its divergence:

\(Clear[m, n, p, divField]; 
    
{m[x_, y_, z_], n[x_, y_, z_], p[x_, y_, z_]} = Field[x, y, z]; 

    divField[x_, y_, z_] = 
      D[m[x, y, z], x] + D[n[x, y, z], y] + D[p[x, y, z], z]\)

Calculate the net flow of this vector field across (Subscript[C, 1]), 
       (∫_^)(∫_( (Subscript[C, 1]))^) 
          Field . topunitnormal dA, 
by calculating the net flow of this vector field across (Subscript[C, 2]),  
       (∫_^)(∫_( (Subscript[C, 2]))^) 
          Field . topunitnormal dA,
and explain why this gives the correct answer.

G.3.b)

Here is a new surface called (Subscript[C, 1]):

\(Clear[x1, y1, z1, r, s]; 
x1[r_, s_] = \(-3\) + 2\ r\ Cos[s]; 

    \(y1[r_, s_] = 1 + r\ Sin[s]; \)\)z1[r_, s_] = 2 + (E^Sin)[4 (y1[r, s] - 1)] (2 - r); {{r1low, r1high}, {s1low, s1high}} = {{0, 2}, {0, 2 π}}; C1plot = 
      ParametricPlot3D[
        Evaluate[{x1[r, s], y1[r, s], z1[r, s]}], {r, r1low, r1high}, {s, 
          s1low, s1high}, Boxed -> False, ViewPoint -> CMView, 
        PlotRange -> All, PlotPoints -> {30, 30}, 
        AxesLabel -> {"x", "y", "z"}];

Here is a vector field:

\(Clear[x, y, z, Field]; 

    Field[x_, y_, z_] = {3\ z - y, 3\ x + z, 6\ y - x}\)

And its divergence:

\(Clear[m, n, p, divField]; 
    
{m[x_, y_, z_], n[x_, y_, z_], p[x_, y_, z_]} = Field[x, y, z]; 

    divField[x_, y_, z_] = 
      D[m[x, y, z], x] + D[n[x, y, z], y] + D[p[x, y, z], z]\)

Calculate the net flow of this vector field across (Subscript[C, 1]), 
by calculating  
       (∫_^)(∫_( (Subscript[C, 2]))^) 
          Field . topunitnormal dA
where (Subscript[C, 2]) is a substitute surface of your own choice.
Explain why you believe in your answer.

G.4)  Avoiding another calculational nightmare*

Here's a vector field:

\(Clear[Field, x, y, z, m, n, p, divField1]; 

    Field[x_, y_, z_] = {z, 4\ x, \(-3\)\ y} + 
        \(3\ \(({x, y, z} - {0, 0.5, 0})\)\)\/\((
              \((x + 0)\)\^2 + \((y - 0.5)\)\^2 + \((z + 0)\)\^2)\)\^\(3/2\); 
    
{m[x_, y_, z_], n[x_, y_, z_], p[x_, y_, z_]} = Field[x, y, z]\)

Note the big singularity at {0, 0.5, 0}.
Here is the divergence of Field[x, y, z]:

divField[x_, y_, z_] = 
      Together[D[m[x, y, z], x] + D[n[x, y, z], y] + D[p[x, y, z], z]]

Here comes a surface:

\(Clear[xskin, yskin, zskin, radius, s, t]; 

    radius[s_, t_] = 5\ \((Cos[t]\^2 + 1)\)\ \((1.5 - Sin[s])\); 

    \({xskin[s_, t_], yskin[s_, t_], zskin[s_, t_]} = 
      \(radius[s, t]\ \) {Sin[s]\ Cos[t], Cos[s], Sin[s]\ Sin[t]}; \)\){{slow, shigh}, {tlow, thigh}} = {{0, π}, {0, 2 π}}; surfaceplot = 
      ParametricPlot3D[
        Evaluate[{xskin[s, t], yskin[s, t], zskin[s, t]}], {s, slow, shigh}, {
          t, tlow, thigh}, Boxed -> False, ViewPoint -> CMView, 
        PlotRange -> All, 
        AxesLabel -> {"x", "y", "z"}];

G4.a.i)

Is the singularity of Field[x, y, z] inside the surface plotted above?

G.4.a.ii)

Why is it a bad idea to assume in advance that since divField[x, y, z] calculated out to 0, then the net flow of Field[x, y, z] across the surface plotted above is 0?

G.4.a.iii)

Measure the flow of Field[x, y, z] across this surface.
Is the flow from outside to inside or inside to outside?

Look at:

\(Clear[Field, x, y, z]; 

    Field[x_, y_, z_] = {z, 4\ x, \(-3\)\ y} + 
        \(3\ \(({x, y, z} - {0, 0.5, 0})\)\)\/\((
              \((x + 0)\)\^2 + \((y - 0.5)\)\^2 + \((z + 0)\)\^2)\)\^\(3/2
              \)\)

Notice that Field[x, y, z] is the sum of two vector fields
Field1[x, y, z] and Field2[x, y, z] where

\(Clear[Field1, Field2]; 
Field1[x_, y_, z_] = {z, 4\ x, \(-3\)\ y}\)

and

Field2[x_, y_, z_] = 
      ((3 ({x, y, z} - {0, 0.5, 0}))/(((
            (((x + 0))^2) + (((y - 0.5))^2) + (((z + 0))^2)))^(3/2
            )))

You might want to make the calculations for Field1[x, y, z] and Field2[x, y, z] separately, remembering that Field[x, y, z] is an electric field and one of the tutorials told you all you need to know about electric fields.
If you are grinding a lot of Mathematica code on this, you are not practicing the art of avoiding calculation; Gauss would not be proud of you.
Go ahead and make Gauss proud of you.

G.4.b.i)

Here is a new vector field and its divergence:

\(Clear[Field, x, y, z, m, n, p, divField]; 

    Field[x_, y_, z_] = {z, 4\ x, \(-3\)\ y} + 
        \(3\ \(({x, y, z} - {10, 0, 0})\)\)\/\((
              \((x - 10)\)\^2 + \((y + 0)\)\^2 + \((z + 0)\)\^2)\)\^\(3/2\); 
    
{m[x_, y_, z_], n[x_, y_, z_], p[x_, y_, z_]} = Field[x, y, z]\)

divField[x_, y_, z_] = 
      Together[D[m[x, y, z], x] + D[n[x, y, z], y] + D[p[x, y, z], z]]

Is the singularity of Field[x, y, z] inside the surface plotted above?

G.4.b.ii)

Why is it a good idea to assume in advance that since divField[x, y, z] calculated out to 0, the net flow of Field[x, y, z] across the surface plotted above is 0?

G.5)  Flux of the electric field and Gauss's law

G.5.a.i)

Before you start, excecute the cell below:

Needs["Graphics`Polyhedra`"]

Here is a surface that is the whole skin of a solid region:

surfaceplot = 
      Show[Polyhedron[Dodecahedron, {0, 0.5, 1}, 2], Axes -> True, 
        Boxed -> False, ViewPoint -> CMView, 
        AxesLabel -> {"x", "y", "z"}];

The point {1, 0, 1} is inside this skin as you can see by including a vector whose tip is at {1, 0, 1} and whose tail is outside the skin:

point = {1, 0, 1}; tail = {2, 3, 0}; \(pointer = 
      Arrow[point - tail, Tail -> tail, VectorColor -> Blue]; 

    Show[surfaceplot, pointer, PlotRange -> All]; \)

An electrical charge of strength 3 is placed at {1, 0, 1}, resulting in the electric field
       Field[x, y, z] 
       \(\( = {
          \(3\ \((x\  - \ 1)\)\)\/\((
                \((x\  - \ 1)\)\^2\  + \ y\^2\  + \ \((z\  - \ 1)\)\^2)
                \)\^\(3/2\), 
		
          \(3\ y\)\/\((\((x\  - \ 1)\)\^2\  + \ y\^2\  + \ \((z\  - \ 1)\)\^2)
                \)\^\(3/2\), 
		
          \(3\ \((z\  - \ 1)\)\)\/\((
                \((x\  - \ 1)\)\^2\  + \ y\^2\  + \ \((z\  - \ 1)\)\^2)
                \)\^\(3/2\)}\)\).
Measure the flux of this electric field across this skin.

The flux of this electric field across this surface is the same as the flow of this field across this surface.
If you are going to heavy calculation here, then you are doing too much work.

G.5.a.ii)

Continue to go with the same surface as in part i) above.
This time place an electrical charge of strength 4 at {0, 0, 0} and another electical charge of strength -2 at {1, 0, 0}.
Measure the flux of the resulting combined electric field across this skin.

G.5.a.iii)

Continue to go with the same surface as in part i) above.
This time place an electrical charge of strength 4 at {2, 3, 2} and another electrical charge of strength -2 at {5, 0, 0}.
Measure the flux of the resulting combined electric field across this skin.

Check whether these points are inside the skin.

G.5.b.i) Gauss's 3D law

Gauss's law in physics says that if you have a surface C that is the boundary surface of a solid in three dimensions, and if you take n different points 
       {(Subscript[a, 1]), (Subscript[b, 1]), (Subscript[c, 1])}, {(Subscript[a, 2]), (Subscript[b, 2]), (Subscript[c, 2])}, 
      …, {(Subscript[a, n]), (Subscript[b, n]), (Subscript[c, n])} 
inside C, and you place electrical charges of strength 
       (Subscript[q, 1]) at {(Subscript[a, 1]), (Subscript[b, 1]), (Subscript[c, 1])},
       (Subscript[q, 2]) at {(Subscript[a, 2]), (Subscript[b, 2]), (Subscript[c, 2])},
        …
       (Subscript[q, n]) at {(Subscript[a, n]), (Subscript[b, n]), (Subscript[c, n])},
then the flux (= flow) of the resulting electric field across C is simply
       4  π ((Subscript[q, 1]) +  (Subscript[q, 2]) +  (Subscript[q, 3]) +  …  +  (Subscript[q, n])).
Explain where Gauss's law comes from.

G.5.b.ii) Gauss's law for dipoles

You put two electric charges of the same strength but opposite signs at two points that are very close to each other.  The resulting electrical field is called a dipole field.
Take a surface C that is the boundary surface of a solid in three dimensions with both points inside C.  What is the flux (= flow) of the resulting dipole field across C?

G.6)  Sources and sinks in the 3D gradient field, the Laplacian 
       (∂^2)f[x, y, z]/∂(x^2)+ (∂^2)f[x, y, z]/∂(y^2)+ (∂^2)f[x, y, z]/∂(z^2)
       and steady state heat*

One way to come up with a 3D vector field is to take a function f[x, y, z] and put 
       Field[x, y, z] = gradf[x, y, z].
Try it out:

\(Clear[f, gradf, Field, x, y]; 

    f[x_, y_, z_] = 1 - 1\/2\ \((x\^2 + y\^2 + z\^2)\); 

    gradf[x_, y_, z_] = {D[f[x, y, z], x], D[f[x, y, z], y], 
        D[f[x, y, z], z]}; 

Field[x_, y_, z_] = gradf[x, y, z]\)

This is the gradient field of 
       f[x, y, z] = 1 -  (1/2) ((x^2) +  (y^2) +  (z^2)).
Note that {x, y, z} = {0, 0, 0} maximizes f[x, y, z].
Here's a plot of the scaled gradient field of f[x, y, z] shown with the maximizer at {0, 0, 0}:

maximizerplot = Graphics3D[{Red, PointSize[0.06], Point[{0, 0, 0}]}]; 
    scalefactor = 0.4; \(gradfieldplot = 
      Table[Arrow[gradf[x, y, z], Tail -> {x, y, z}, 
          VectorColor -> Blue, ScaleFactor -> scalefactor], {x, 
          \(-1\), 1, 2}, {y, \(-1\), 1, 1}, {z, \(-1\), 1, 1}]; 


    Show[maximizerplot, gradfieldplot, ViewPoint -> CMView, 
      Axes -> Automatic, AxesLabel -> {"x", "y", "z"}]; \)

G.6.a.i)

Why did this happen?
Where are the trajectories in this gradient field headed?
What do you try to learn about a function f[x, y, z] by looking at a plot of its gradient field?

G.6.a.ii)

You are given a certain function f[x, y, z], and the information that 
       f[a, b, c] > f[x, y, z]
for all {x, y, z} close to but not equal to {a, b, c}.
You center a small sphere on {a, b, c} and plot the gradient field of f[x, y, z] on this sphere.  
Is the net flow of the gradient field of f[x, y, z] across this sphere from inside to outside or from outside to inside?

G.6.b.i) Minimizers

This time go with 
     f[x, y] = (e^(((x^2) +  (y^2) +  (z^2))/16)).

\(Clear[f, gradf, Field, x, y, z]; 

    f[x_, y_, z_] = E\^\(1\/16\ \((x\^2 + y\^2 + z\^2)\)\); 

    gradf[x_, y_, z_] = {D[f[x, y, z], x], D[f[x, y, z], y], 
        D[f[x, y, z], z]}; 

Field[x_, y_, z_] = gradf[x, y, z]\)

Note that {x, y, z} = {0, 0, 0} minimizes f[x, y, z].
Here's a plot of the scaled gradient field of f[x, y, z] shown with the minimizer at {0, 0, 0}:

minimizerplot = Graphics3D[{Red, PointSize[0.06], Point[{0, 0, 0}]}]; 
    scalefactor = 2.5; \(gradfieldplot = 
      Table[Arrow[gradf[x, y, z], Tail -> {x, y, z}, 
          VectorColor -> Blue, ScaleFactor -> scalefactor], {x, 
          \(-1\), 1, 2}, {y, \(-1\), 1, 1}, {z, \(-1\), 1, 1}]; 


    Show[minimizerplot, gradfieldplot, Axes -> Automatic, 
      AxesLabel -> {"x", "y", "z"}]; \)

Why did this happen?
What are the trajectories in this gradient field trying to get away from?

G.6.b.ii)

You are given a certain function f[x, y, z], and the information that 
       f[a, b, c] < f[x, y, z]
for all {x, y, z} close to but not equal to {a, b, c}.
You center a small sphere at {a, b, c} and plot the gradient field of f[x, y, z] on this sphere.  
Is the net flow of the gradient field of f[x, y, z] across this sphere from inside to outside or from outside to inside?

G.6.c.i) The Laplacian (∂^2)f[x, y, z]/∂(x^2)+ (∂^2)f[x, y, z]/∂(y^2)+ (∂^2)f[x, y, z]/∂(z^2)

Here is a cleared function and its gradient field:

\(Clear[x, y, z, f, gradf, m, n, p, Field, divField]; 

    gradf[x_, y_, z_] = {D[f[x, y, z], x], D[f[x, y, z], y], 
        D[f[x, y, z], z]}; 
    
{m[x_, y_, z_], n[x_, y_, z_], p[x_, y_, z_]} = gradf[x, y, z]; 

    Field[x_, y_, z_] = {m[x, y, z], n[x, y, z], p[x, y, z]}\)

Here is the divergence of this gradient field:

divField[x_, y_, z_] = 
      D[m[x, y, z], x] + D[n[x, y, z], y] + D[p[x, y, z], z]

The Laplacian of f[x, y, z] is given by
       (∂^2)f[x, y, z]/∂(x^2)+ (∂^2)f[x, y, z]/∂(y^2)+ (∂^2)f[x, y, z]/∂(z^2):

\(Clear[Laplacianf]; 

    Laplacianf[x_, y_, z_] = 
      D[f[x, y, z], {x, 2}] + D[f[x, y, z], {y, 2}] + 
        D[f[x, y, z], {z, 2}]\)

How does the divergence of the gradient field compare with the Laplacian?

G.6.c.ii)

How do you check the Laplacian           
       (∂^2)f[x, y, z]/∂(x^2)+ (∂^2)f[x, y, z]/∂(y^2)+ (∂^2)f[x, y, z]/∂(z^2)
to look for sources and sinks in the gradient field of a given function f[x, y, z]?
How do you check the Laplacian           
       (∂^2)f[x, y, z]/∂(x^2)+ (∂^2)f[x, y, z]/∂(y^2)+ (∂^2)f[x, y, z]/∂(z^2)
to check whether the gradient field of a given function f[x, y, z] is free of sources or sinks at points other than singularities?

G.6.c.iii)

Explain this: 
If f[x, y, z] is a function with no singularities, and with
       (∂^2)f[x, y, z]/∂(x^2)+ (∂^2)f[x, y, z]/∂(y^2)+ (∂^2)f[x, y, z]/∂(z^2)=0 
for all points {x, y, z}, then there can be no point {a, b, c} with 
       f[a, b, c] > f[x, y, z]
for all {x, y, z} close to but not equal to {a, b, c}.
And explain this:
If f[x, y, z] is a function with no singularities, and with
       (∂^2)f[x, y, z]/∂(x^2)+ (∂^2)f[x, y, z]/∂(y^2)+ (∂^2)f[x, y, z]/∂(z^2)=0
for all points {x, y, z}, then there can be no point {a, b, c} with 
       f[a, b, c] < f[x, y, z]
for all {x, y, z} close to but not equal to {a, b, c}.

Review what you said in parts a) and b) above.

G.6.d.i)

A large solid region in three dimensions represents a big rock.  Part of the surface of the rock is kept at a prescribed temperature - maybe hotter at one point than at another. The remainder of the surface is perfectly insulated.
You wait until the temperature inside the rock settles into its steady state condition. 
Say temp[x, y, z] represents the steady state temperature at a position {x, y, z} inside the rock.  
In the steady state, no point inside the rock and not on the surface can be a source of new heat flow or a sink for old heat.
Why does this tell you that if 
       Field[x, y, z] = gradtemp[x, y, z], 
then   
       divField[x, y, z] 
       =(∂^2)temp[x, y, z]/∂(x^2)+ (∂^2)temp[x, y, z]/∂(y^2)+ (∂^2)temp[x, y, z]/∂(z^2)
        = 0 
at each point {x, y, z} inside but not on the surface of the rock?

G.6.d.ii)

Explain why your answer to part i), immediately above, tells you that the hottest and the coldest locations of the rock must be on the outside skin of the rock and not inside the rock.

G.7)  Morphing and Moebius strips

Here's a flat ribbon:

\(Clear[s, t, flatribbon]; 
flatribbon[s_, t_] = {\(-2\), t, s}; 

    \(flatribbonplot = 
      ParametricPlot3D[
        flatribbon[s, t], {t, \(-2\)\ π, 2\ π}, {s, \(-0.5\), 0.5}, 
        PlotPoints -> {2, 2}, DisplayFunction -> Identity]; \)\)\(threedims = Axes3D[1. ]; 


    Show[flatribbonplot, threedims, ViewPoint -> CMView, 
      PlotRange 
        -> {{\(-2.5\), 2.5}, {\(-2\)\ π, 2\ π}, {\(-1.5\), 
            1.5}}, Boxed -> False, 
      DisplayFunction -> $DisplayFunction]; \)

You can pull the two ends around the z-axis, and join them together to make a nice cylindrical ribbon:

\(Clear[P, x, y, z, t, unittan, mainunitnormal, binormal, roundribbon]; 

    P[t_] = 2\ {\(-Cos[t]\), Sin[t], 0}\)

unittan[t_]=TrigExpand[((P'[t])/(Sqrt[P'[t].P'[t]]))]

mainunitnormal[t_]=((unittan'[t])/(Sqrt[TrigExpand[unittan'[t].unittan'[t]]]))

binormal[t_] = TrigExpand[unittan[t]\[Cross]mainunitnormal[t]]

roundribbon[s_, t_] = P[t] - s binormal[t]; \(roundribbonplot = 
      ParametricPlot3D[
        roundribbon[s, t], {s, \(-0.5\), 0.5}, {t, \(-π\), π}, 
        PlotPoints -> {2, Automatic}, DisplayFunction -> Identity]; 
    

Show[roundribbonplot, threedims, ViewPoint -> CMView, 
      PlotRange 
        -> {{\(-2.5\), 2.5}, {\(-2\)\ π, 2\ π}, {\(-1.5\), 
            1.5}}, Boxed -> False, 
      DisplayFunction -> $DisplayFunction]; \)

Here's an animation about how you go from the flat ribbon to the round ribbon:

\(Clear[morph, h]; 

    morph[h_] := 
      ParametricPlot3D[
        \((1 - h)\)\ flatribbon[s, 2\ t] + h\ roundribbon[s, t], {s, 
          \(-0.5\), 0.5}, {t, \(-π\), π}, 
        PlotPoints -> {2, Automatic}, DisplayFunction -> Identity]; 
    
\(Table[
      Show[morph[h], threedims, ViewPoint -> CMView, 
        PlotRange 
          -> {{\(-2.5\), 2.5}, {\(-2\)\ π, 2\ π}, {\(-1.5\), 
              1.5}}, Boxed -> False, 
        DisplayFunction -> $DisplayFunction], {h, 0, 1, 1\/5}]; \)\)

G.7.a)

You can start with the same flat ribbon:

Show[flatribbonplot, threedims, ViewPoint -> CMView, 
      PlotRange 
        -> {{-2.5, 2.5}, {-2 π, 2 π}, {-1.5, 
            1.5}}, Boxed -> False, 
      DisplayFunction -> $DisplayFunction];

You can join the ends giving it a twist along the way:

\(Clear[twistedribbon]; 

    twistedribbon[s_, t_] = 
      P[t] + s\ \((Sin[t\/2]\ mainunitnormal[t] - Cos[t\/2]\ binormal[t])\); 
    
twistedribbonplot = 
      ParametricPlot3D[
        twistedribbon[s, t], {s, \(-0.5\), 0.5}, {t, \(-π\), π}, 
        PlotPoints -> {2, Automatic}, DisplayFunction -> Identity]; 
    

Show[twistedribbonplot, threedims, ViewPoint -> CMView, 
      PlotRange 
        -> {{\(-2.5\), 2.5}, {\(-2\)\ π, 2\ π}, {\(-1.5\), 
            1.5}}, Boxed -> False, 
      DisplayFunction -> $DisplayFunction]; \)

The fancy folks like to call this a "Moebius strip."
Here's an animation about how you go from the flat ribbon to the Moebius strip:

\(Clear[morph, h]; 

    morph[h_] := 
      ParametricPlot3D[
        \((1 - h)\)\ flatribbon[s, 2\ t] + h\ twistedribbon[s, t], {s, 
          \(-0.5\), 0.5}, {t, \(-π\), π}, 
        PlotPoints -> {2, Automatic}, DisplayFunction -> Identity]; 
    
\(Table[
      Show[morph[h], threedims, ViewPoint -> CMView, 
        PlotRange 
          -> {{\(-2.5\), 2.5}, {\(-2\)\ π, 2\ π}, {\(-1.5\), 
              1.5}}, Boxed -> False, 
        DisplayFunction -> $DisplayFunction], {h, 0, 1, 1\/5}]; \)\)

Rip a strip of paper out of an old traditional calculus book and try it for yourself.
The round ribbon has two definite sides - the inside and the outside.  If you stick your finger on the inside of the round ribbon and move your finger around without lifting it, then your finger never leaves the inside.
If you stick your finger on the outside of the round ribbon and move your finger around without lifting it, then your finger never leaves the outside.
Can you say anything like this for the Moebius strip?
How many sides does the Moebius strip have?
Does it make any sense to talk about the flow of a vector field across a Moebius strip?

G.7.b)

What happens when you twist the ribbon twice?

G.8)  Bidding on rocket parts

You are an engineer working for the United Engineering Company, makers of specialty metal products for the industrial market.  A call for bids comes in for some front sections of a rocket upon which ceramic nose cones will be mounted.
The specifications say that the front section is to be made as follows:  
You start with the inner parabolic surface with all measurements in meters:

\(Clear[innerx, innery, innerz, r, s]; 
innerx[r_, s_] = r\ Cos[s]; 

    \(innery[r_, s_] = r\ Sin[s]; \)\)innerz[r_, s_] = 9 - (r^2); {innerrlow, innerrhigh} = {2, 3}; {innerslow, innershigh} = {0, 2 π}; innersurface = 
      ParametricPlot3D[{innerx[r, s], innery[r, s], innerz[r, s]}, {r, 
          innerrlow, innerrhigh}, {s, innerslow, innershigh}, 
        ViewPoint -> CMView, PlotRange -> All, 
        AxesLabel -> {"x", "y", "z"}];

Then you have the outer parabolic surface with all measurements in meters:

\(Clear[outerx, outery, outerz, r, s]; 
outerx[r_, s_] = 2\ r\ Cos[s]; 

    \(outery[r_, s_] = 2\ r\ Sin[s]; \)\)outerz[r_, s_] = 36 - (((2 r))^2); {outerrlow, outerrhigh} = {2, 3}; {outerslow, outershigh} = {0, 2 π}; outersurface = 
      ParametricPlot3D[{outerx[r, s], outery[r, s], outerz[r, s]}, {r, 
          outerrlow, outerrhigh}, {s, outerslow, outershigh}, 
        ViewPoint -> CMView, PlotRange -> All, 
        AxesLabel -> {"x", "y", "z"}];

The specifications say that you get the top of the front section by running a straight line from each point on the top of the inner surface 
       {innerx[2, s], innery[2, s], innerz[2, s]} 
to the corresponding point
       {outerx[2, s], outery[2, s], outerz[2, s]} 
on the top of the outer surface. 
You get the base, on which the section rests, by running a straight line from each point on the bottom of the inner surface 
       {innerx[3, s], innery[3, s], innerz[3, s]} 
to the corresponding point
       {outerx[3, s], outery[3, s], outerz[3, s]} 
on the bottom of the outer surface.

G.8.a)

Measure:
1)  The surface area of the inner skin. 
2)  The surface area of the outer skin.
3)  The surface area of the flat ring at the bottom.
4)  The surface area of the conical ring at the top.
5)  The volume enclosed by the outer skins composed of the outer shell, the flat ring at the bottom, the conical ring at the top and the inner shell.
Report these measurements, and throw in a plot of the finished product including the flat ring at the bottom and the conical ring at the top.
Show it from several advantageous viewpoints.

This function might be of use:

\(Clear[section, r, s, t]; 

    section[r_, s_, t_] = {innerx[r, s], innery[r, s], innerz[r, s]} + 
        t\ \(({outerx[r, s], outery[r, s], outerz[r, s]} - {innerx[r, s], 
                innery[r, s], innerz[r, s]})\)\)

G.9)  Volumes, flow and bouyancy

G.9.a)

Use Gauss's formula to explain why the flow measurement of the vector field 
       Field[x, y, z] = {(x/3), (y/3), (z/3)} 
across the surface of a solid region is the volume of the solid region.
How is the measurement of the flow of 
       Field[x, y, z] = {x, 0, 0} 
across the surface of a solid region related to the volume of the solid region?

G.9.b)

One day a long, long time ago, Archimedes jumped out of his bathtub and ran around the streets of Syracuse yelling "Eureka!"  Why?  It's a pretty safe bet that he wasn't looking for a vacuum cleaner.  
The plain fact is that he had just discovered the idea behind Ivory soap, and it was floating in his bathwater.  More than that, he had figured out the reason it floated.  
The bar of soap was able to displace only an amount of water of weight equal to that of the bar of soap.

G.9.b.i) Rub-a-dub-dub

Three dirty old men in a tub set out floating around a rather large swimming pool in a definitely large wash tub.  In the tub with them were three large pieces of lead, a case of something to drink and some fishing tackle.  Archimedes's law says that as they launched their craft, water in an amount with mass equal to the total mass of tub, men, lead, beverage, and tackle was displaced.  The only place for the water to go was up, so the level of the water in the pool raised a bit.  As the day wore on, the lead weights began to get into their way, so they threw them out of the tub.  
Use Archimedes's law to explain what happened to the level of the water in the pool when they got the lead out.

G.9.b.ii)

Look at:

water = 
      Plot[0.1 Sin[10 t] + 2, {t, -3, 3}, 
        AspectRatio -> Automatic, 
        PlotStyle -> {{Thickness[0.01], Blue}}, 
        DisplayFunction -> Identity]; \(arrows = 
      Table[Arrow[0.4\ {Cos[\(2\ k\ π\)\/10], Sin[\(2\ k\ π\)\/10]}, 
          Tail -> {Cos[\(2\ k\ π\)\/10], Sin[\(2\ k\ π\)\/10]}, 
          VectorColor -> Red], {k, 0, 10}]; 

    labels = Graphics[{Text["Ball", {0, 0}], Text["Waves", {1.5, 1.8}], 
          Text["Force vectors", {0, 1.5}]}]; 


    Show[{Graphics[{Thickness[0.01], Circle[{0, 0}, 1]}], water, arrows, 
        labels}, Axes -> None, PlotRange -> All, 
      DisplayFunction -> $DisplayFunction]; \)

What you have here is a ball submerged in water.  At each point (little patch) of the surface of the ball, a force is acting according to the rule 
       P[x, y, z] = PressureDensity 
        = FluidDensity g (-z)  
where z is depth measured starting from z = 0 at the surface of the pool.  The direction of the pressure is inward in the direction of the normal to the surface of the ball at each point.  The total (buoyancy) force on the surface, C, of the ball is nothing more than 
       Force = 
        (∫_^)(∫_( C)^) 
            P . n dA.
Your job is to explain Archimedes's law, namely,  
       Force = W {0, 0, 1}, 
where W is the weight of the water displaced.

G.10)  Rotating and measuring

G.10.a)

Here is part of the curve z = Sin[2  x] plotted in the xz-plane:

\(Clear[f, x, y, z]; 
xlow = 0.5; 
\(xhigh = 3.1; \)\)f[x_] = Sin[2 x]; xzplane = 
      Graphics3D[
        Polygon[{{0, 0, -1.5}, {0, 0, 1.5}, {4, 0, 1.5}, {4, 0, 
              -1.5}}]]; \(threedims = Axes3D[2, 0.2]; 

    curve = ParametricPlot3D[{x, 0, f[x]}, {x, xlow, xhigh}, 
        DisplayFunction -> Identity]; 


    Show[xzplane, curve, threedims, ViewPoint -> CMView, 
      PlotRange -> All, DisplayFunction -> $DisplayFunction]; \)

Here's a plot of the surface you get when you rotate this curve around the z-axis:

\(Clear[r, t]; 

    rotated = 
      ParametricPlot3D[{r\ Cos[t], r\ Sin[t], f[r]}, {r, xlow, xhigh}, {t, 0, 
          2\ π}, DisplayFunction -> Identity]; 


    Show[rotated, threedims, Axes -> Automatic, 
      ViewPoint -> CMView, PlotRange -> All, 
      DisplayFunction -> $DisplayFunction]; \)

Measure the area of this surface.

G.10.b)

Take a function z = f[x].  If you plot it in the xz-plane as above for a ≤ x ≤ b with 0 ≤ a < b, then say how you can arrive at the formula 
       (∫_a^b) 2π x(Sqrt[1+ ((f'[x])^2)])dx
to measure the area of the surface you get by rotating this curve about the z-axis.
Use this formula to confirm your answer above in part i).
Students in old-fashioned calculus courses spend a lot of time plugging and chugging with this formula.

Do what you did above but run with:

\(Clear[x, y, z, f, r, t]; 
x[r_, t_] = r\ Cos[t]; 

    \(y[r_, t_] = r\ Sin[t]; \)\)z[r_, t_] = f[r];

G.10.c)

Here is part of the parametric curve
       P[s] = {0, 3  s (3 -  s), 2 +  s} as it sits in the yz-plane:

\(Clear[x, y, z, s]; 
x[s_] = 0; 
\(y[s_] = 8 - 3\ s\ \((3 - s)\); 
    \)\)z[s_] = 2 + s; slow = 0; shigh = 2; yzplane = 
      Graphics3D[Polygon[{{0, 0, 0}, {0, 0, 5}, {0, 8, 5}, {0, 8, 0}}]]; 
    \(threedims = Axes3D[2, 0.2]; 

    curve = ParametricPlot3D[{x[s], y[s], z[s]}, {s, slow, shigh}, 
        DisplayFunction -> Identity]; 


    Show[curve, yzplane, curve, threedims, Axes -> Automatic, 
      ViewPoint -> CMView, PlotRange -> All, 
      DisplayFunction -> $DisplayFunction]; \)

Rotate this curve about the y-axis and plot what you get. 
Then measure the area of the surface you get.

G.10.d)

Calculus Cal, that calculus lab pest who hangs out in the calculus lab acting as if he knows everything, but in fact knows very little, taps you on the shoulder and tells you that a certain old-fashioned printed calculus text says:
If you want to measure the surface area of the surface explicitly given by 
       z = f[x, y] 
over the rectangle a ≤ x ≤ b and c ≤ y ≤ d, then you calculate
       (∫_c^d)(∫_a^b) (Sqrt[1+ (((∂f[x, y]/∂x))^2)+ (((∂f[x, y]/∂y))^2)])dxdy
       =(∫_c^d)(∫_a^b) (Sqrt[1+ (((∂f[u, v]/∂u))^2)+ (((∂f[u, v]/∂v))^2)])dudv.
But Cal can't seem to figure out where the formula comes from and the calculus book really doesn't say where it comes from.
Tell Cal where the formula comes from and then tell Cal where to go.