VC.05 Flow Measurements by Integrals
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};

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)   Flow along and flow across*

G.1.a)

Here's a vector field:

\(Clear[x, y, m, n, Field]; 
    
{m[x_, y_], n[x_, y_]} = {x\^2 - 2\ y, \(-y\^2\) + x}; 

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

Here's the circle C of radius 3 centered at {1, 2} parameterized in the counterclockwise way:

\(Clear[t]; 
{x[t_], y[t_]} = {1, 2} + 3\ {Cos[t], Sin[t]}; 

    \(tlow = 0; \)\)\(thigh = 2\ π; 


    curveplot = 
      ParametricPlot[{x[t], y[t]}, {t, tlow, thigh}, 
        PlotStyle -> {{Thickness[0.01], Red}}, 
        AspectRatio -> Automatic, AxesLabel -> {"x", "y"}]; 
    \)

Calculate   
       (∮_( C)) -n[x, y] dx +  
        m[x, y] dy 
and use your result to determine whether the net flow of this vector field across this curve is from inside to outside, outside to inside, or 0.
Calculate   
       (∮_( C)) m[x, y] dx +  
        n[x, y] dy 
and use your result to determine whether the net flow of this vector field along this curve is clockwise, counterclockwise or 0.

G.1.b)

Here's a vector field:

\(Clear[x, y, m, n, Field]; 
    
{m[x_, y_], n[x_, y_]} = {0.5\ x - 1.2\ y, 1}; 

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

Here's a parameterization and a plot of a closed curve C:

\(Clear[t]; 
{x[t_], y[t_]} = {3\ t\ \((3 - t)\), t\ \((t - 3)\)\^2}; 

    \(tlow = 0; \)\)\(thigh = 3; 


    curveplot = 
      ParametricPlot[{x[t], y[t]}, {t, tlow, thigh}, 
        PlotStyle -> {{Thickness[0.01], Red}}, 
        PlotLabel -> "The closed curve C", 
        AspectRatio -> Automatic, AxesLabel -> {"x", "y"}]; 
    \)

Is C parameterized in the counterclockwise or clockwise way?
Use a path integral to determine whether the net flow of this vector field across C is from outside to inside, inside to outside, or 0.
Use a path integral to determine whether the net flow of this vector field along C is clockwise, counterclockwise, or 0.

G.1.c)

Here's a vector field:

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

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

Here's a parameterization and a plot of a closed curve C.

\(Clear[t]; 
    
{x[t_], y[t_]} = {3\ Sin[t]\ Cos[t], Sin[t]\^2 + 1\/6\ Cos[6\ t] + 2}; 
    
\(tlow = 0; \)\)\(thigh = π; 


    curveplot = 
      ParametricPlot[{x[t], y[t]}, {t, tlow, thigh}, 
        PlotStyle -> {{Thickness[0.015], Red}}, 
        AspectRatio -> Automatic, AxesLabel -> {"x", "y"}]; 
    \)

Is the curve parameterized in the counterclockwise or clockwise way?
Use a path integral to determine whether the net flow of this vector field across this curve is from outside to inside, inside to outside, or 0.
Use a path integral to determine whether the net flow of this vector field along this curve is clockwise, counterclockwise, or 0.

G.1.d.i) A gradient field

Here's the gradient field of the function 
       f[x, y] = (e^(2  x  -  y)):

\(Clear[f, gradf, x, y, m, n, Field]; 
f[x_, y_] = E\^\(2\ x - y\); 

    \(gradf[x_, y_] = {D[f[x, y], \ x], D[f[x, y], \ y]}; 
    
{m[x_, y_], n[x_, y_]} = gradf[x, y]; 

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

Here's a parameterization and a plot of a closed curve C.

\(Clear[t]; 
    
{x[t_], y[t_]} = {6\ Sin[t]\ Cos[t]\ \((1 - 0.7\ Sin[4\ t])\), 
        3\ Sin[t]\^2 + 2}; 
\(tlow = 0; \)\)\(thigh = π; 


    curveplot = 
      ParametricPlot[{x[t], y[t]}, {t, tlow, thigh}, 
        PlotStyle -> {{Thickness[0.01], Red}}, 
        AspectRatio -> Automatic, AxesLabel -> {"x", "y"}]; 
    \)

Explain how you know in advance that the net flow of this vector field along this curve is 0.
Use a path integral to determine whether the net flow of this vector field across this curve is from outside to inside, inside to outside, or 0.

G.1.d.ii)

You already know that the net flow of a gradient field along a closed curve is guaranteed to be 0.
Is it true that the net flow of a gradient field across a closed curve is guaranteed to be 0?

G.2)   Path integrals: Backward and forward*

G.2.a.i)

Suppose (Subscript[C, 1]) and (Subscript[C, 2]) are the same physical curve, but the starting point of (Subscript[C, 1]) is the ending point of (Subscript[C, 2]) , and the ending point of (Subscript[C, 1]) is the starting point of (Subscript[C, 2]). 
Express
       (∫_( (Subscript[C, 2]))) m[x, y] dx +  
        n[x, y] dy 
in terms of
       (∫_( (Subscript[C, 1]))) m[x, y] dx +  
        n[x, y] dy.

G.2.a.ii)

Calculate the path integral 
       (∫_( (Subscript[C, 1]))) (x^2) y dx -  
        3  x y dy,
where (Subscript[C, 1]) starts at {-1, 3}, runs to {1, 0} on a straight line, and then follows the parabola y = 3 (((x - 1))^2) to {2, 3} where it stops.
Then calculate the path integral 
       (∫_( (Subscript[C, 2]))) (x^2) y dx -  
        3  x y dy,
where (Subscript[C, 2]) starts at {2, 3}, runs to {1, 0} on the parabola 
y = 3 (((x - 1))^2), and then follows the straight line from {1, 0} to {-1, 3} where it stops.

After you've gone to the trouble of calculating  
       (∫_( (Subscript[C, 1]))) (x^2) y dx -  
        3  x y dy, 
you should be able to write down the value of 
       (∫_( (Subscript[C, 2]))) (x^2) y dx -  
        3  x y dy
with no extra labor.

G.2.b)

Here's a parameterization of the ellipse 
       (((((x  -  1)/3)))^2)+(((((y  +  2)/2)))^2)=1:

\(Clear[x, y, t]; 
tlow = 0; 
\(thigh = 2\ π; \)\){x[t_], y[t_]} = {1, -2} + {3 Sin[t], 2 Cos[t]}

Call this ellipse C.
Now look at this calculation:

NIntegrate[y[t]^2 x'[t]+(x[t] y[t] + 1) y'[t],{t, tlow, thigh}]

Does this result calculate  
       (∮_( C)) (y^2) dx  +  
        (x y +  1) dy?
If not, how do you modify this result to get the value of
       (∮_( C)) (y^2) dx  +  
        (x y +  1) dy?

G.3)   Calculations and interpretations*

Many different notations for path integrals are in regular use in science.  In this problem, you will meet some of them. 
Go with a given vector field
       Field[x, y] = {m[x, y], n[x, y]}, 
a curve C, and a direction for C via a parameterization 
       P[t] = {x[t], y[t]}, tlow ≤ t ≤ thigh.

Integrals measuring flow - along - C

All the following four integrals calculate out to the same value, and all measure flow of
       Field[x, y] = {m[x, y], n[x, y]} 
along C:
i)     (∫_( C)) m[x, y] dx  +  
        n[x, y] dy;
ii)    (∫_tlow^thigh)  Field[x[t], y[t]].{x'[t],y'[t]}dt;
iii)   (∫_( C))  Field[x[t], y[t]] . dP,
    where dP={x'[t],y'[t]}dt;
iv)    (∫_( C))  
        Field[x[t], y[t]] . unittan ds.
This last integral is with respect to length measured on the curve from the start of the curve.  The way to see that the last integral is the same as the others, notice that 
       ds=(Sqrt[((x'[t])^2)+ ((y'[t])^2)])dt 
and 
       unittan[t]=(({x'[t], y'[t]})/(Sqrt[((x'[t])^2) +  ((y'[t])^2)])) . 
When you transform to the t variable, you get 
       Field . unittands  ⟷  Field[x[t], y[t]].{x'[t],y'[t]}dt.

Integrals measuring flow - across - C

All of the following integrals calculate out to the same value, and all measure the flow of
       Field[x, y] = {m[x, y], n[x, y]} 
across C:
i)     (∫_( C)) -n[x, y] dx  +  
        m[x, y] dy;
ii)    (∫_tlow^thigh)  Field[x[t], y[t]].{y'[t],-x'[t]}dt;
iii)   (∫_( C))  
        Field[x[t], y[t]] . unitnormal ds.
This last integral is with respect to length measured on the curve from the start of the curve.  The way to see that the last integral is the same as the others is to notice that 
       ds=(Sqrt[((x'[t])^2)+ ((y'[t])^2)])dt
and 
       unitnormal[t]=(({y'[t], -x'[t]})/(Sqrt[((x'[t])^2) +  ((y'[t])^2)])).
When you transform to the t variable, you get 
       Field . unitnormalds  ⟷  Field[x[t], y[t]].{y'[t],-x'[t]}dt.

G.3.a.i)

Calculate
       (∮_( C)) Field . unittan ds  
in the case in which 
     Field[x, y] = {(x^2) (y^2), x (y^2)} 
and the curve C is the ellipse (x^2) +  2  (y^2) = 1.
Give an interpretation of the result as a flow-along measurement and illustrate with a plot.

Remember (∮_( C))  demands a counterclockwise parameterization.

G.3.a.ii)

Calculate
       (∮_( C))  Field . dP  
in the case in which 
     Field[x, y] = {(x^2) (y^2), x (y^2)} 
and the curve C is the ellipse (x^2) +  2  (y^2) = 1.
Give an interpretation of the result.

G.3.a.iii)

Calculate
       (∮_( C))  
        Field . unitnormal ds
in the case in which 
     Field[x, y] = {(x^2) (y^2), x (y^2)} 
and the curve C is the ellipse (x^2) +  2  (y^2) = 1.
Give an interpretation of the result.

G.3.a.iv)

Calculate
       (∫_( C)) Field . unitnormal ds  
        
in the case in which 
     Field[x, y] = {(x^2) (y^2), x (y^2)}
and the curve C is the top half of the ellipse (x^2) +  2  (y^2) = 1 starting on the far right and ending on the far left.
Give an interpretation of the result.

G.3.b)

Calculate
       (∮_( C))(-5 y) dx  +  
        x dy
where C is the circle 
       (x^2) + (((y -  2))^2) = 9 
and interpret the result in two ways:
-> As a flow - along - C measurement of a certain vector field and
-> As a flow - across - C measurment of another vector field.

Remember (∮_( C)) demands a counterclockwise parameterization.

G.3.c)

Calculate
       (∮_( C))  Sin[y] dx  +  
        Cos[x] dy
where C is the circle 
       (x^2) +  (((y -  1))^2) = 0.8 
and give two interpretations of the measurement.

G.4)   Water*

For an incompressible fluid flow, like water flow, the net flow across any closed curve C without loops must be 0 unless there are sources (spigots) or sinks (drains) inside C.
In addition, for water flow, the net flow along a closed curve C can't be positive because you can't have more water at the end of a trip around a closed curve than you had at the beginning.
Also the net flow along a closed curve C can't be negative because you can't have less water at the end of a trip around a closed curve than you had at the beginning. 
The upshot:
For water flow without sources or sinks, you know that net flow across any closed curve C without loops must be 0.  And you know that net flow along any closed curve C must be 0.
Now look at the vector field 
       Field[x, y] = {0.07  x, -0.14 y} 
shown with the circle C of radius 1 centered at {2, 2}:

Clear[Field, m, n, x, y]; {m[x_, y_], n[x_, y_]} = {0.07 x, -0.14 y}; Field[x_, y_] = {m[x, y], n[x, y]}; \(vectorfieldplot = 
      Table[Arrow[Field[x, y], Tail -> {x, y}], {x, 0, 4, 0.5}, {y, 0, 
          4, 0.5}]; 
\({x[t_], y[t_]} = {2, 2} + {Cos[t], Sin[t]}; \)\)tlow = 0; thigh = 2 π; \(Cplot = 
      ParametricPlot[{x[t], y[t]}, {t, tlow, thigh}, 
        PlotStyle -> {{Thickness[0.02], Red}}, 
        DisplayFunction -> Identity]; 


    Show[vectorfieldplot, Cplot, AxesLabel -> {"x", "y"}, 
      DisplayFunction -> $DisplayFunction]; \)

This looks like water flowing around a corner. 
Check whether it can be by looking at  
       (∮_( C)) m[x, y] dx  +  
        n[x, y] dy:

Chop[(∫_tlow^thigh)(m[x[t], y[t]] x'[t]+n[x[t], y[t]] y'[t])\[DifferentialD]t]

Good; the flow of this vector field along this curve is 0.
Now look at
       (∮_( C))  -n[x, y] dx  +  
        m[x, y] dy:

Chop[(∫_tlow^thigh)(-n[x[t], y[t]] x'[t]+m[x[t], y[t]] y'[t])\[DifferentialD]t]

Whoops!
The flow across this curve is from outside to inside. 
The must be a weak sink (drain) inside C.
The upshot: 
This vector field cannot be a model for water flow without sources (spigots) or sinks (drains).

G.4.a)

Look at the vector field 
       Field[x, y] = {0.14  x, -0.14 y} 
shown with the circle C of radius 1 centered at {2, 2}:

Clear[Field, m, n, x, y]; {m[x_, y_], n[x_, y_]} = 0.14 {x, -y}; Field[x_, y_] = {m[x, y], n[x, y]}; \(vectorfieldplot = 
      Table[Arrow[Field[x, y], Tail -> {x, y}], {x, 0, 4, 0.5}, {y, 0, 
          4, 0.5}]; 
\({x[t_], y[t_]} = {2, 2} + {Cos[t], Sin[t]}; \)\)tlow = 0; thigh = 2 π; \(Cplot = 
      ParametricPlot[{x[t], y[t]}, {t, tlow, thigh}, 
        PlotStyle -> {{Thickness[0.02], Red}}, 
        DisplayFunction -> Identity]; 


    Show[vectorfieldplot, Cplot, AxesLabel -> {"x", "y"}, 
      DisplayFunction -> $DisplayFunction]; \)

This also looks like water flowing around a corner. 
Go with the curve C plotted above and report on whether the flow measurements 
       (∮_( C))  m[x, y] dx  +  
        n[x, y] dy
       (∮_( C))  -n[x, y] dx  +  
        m[x, y] dy
tell you that this vector field cannot be a model for water flow without sources (spigots) or sinks (drains).

G.4.b.i)

Look at this vector field shown with the circle C of radius 0.5 centered at {0, 1}:

Clear[Field, m, n, x, y]; {m[x_, y_], n[x_, y_]} = {0.2 Cos[x] Cosh[y], 
        0.4 Sin[x] Sinh[y]}; Field[x_, y_] = {m[x, y], n[x, y]}; \(vectorfieldplot = 
      Table[Arrow[Field[x, y], Tail -> {x, y}], {x, \(-\(π\/2\)\), 
          π\/2, π\/8}, {y, 0, 2, 0.5}]; 

    \({x[t_], y[t_]} = {0, 1} + 0.5\ {Cos[t], Sin[t]}; \)\)tlow = 0; thigh = 2 π; \(Cplot = 
      ParametricPlot[{x[t], y[t]}, {t, tlow, thigh}, 
        PlotStyle -> {{Thickness[0.01], Red}}, 
        DisplayFunction -> Identity]; 


    Show[vectorfieldplot, Cplot, AxesLabel -> {"x", "y"}, 
      DisplayFunction -> $DisplayFunction]; \)

This looks like water flowing down on the left toward the x-axis and then flowing up on the right.
Go with the curve C plotted above and report on whether the flow measurements 
       (∮_( C))  m[x, y] dx  +  
        n[x, y] dy
       (∮_( C))  -n[x, y] dx  +  
        m[x, y] dy
tell you that this vector field cannot be a model for water flow without sources (spigots) or sinks (drains).

Use NIntegrate with AccuracyGoal -> 2.

G.4.b.ii)

Look at this vector field shown with the circle C of radius 0.5 centered at {0, 1}:

Clear[Field, m, n, x, y]; {m[x_, y_], n[x_, y_]} = {0.2 Cos[x] Cosh[y], 
        0.2 Sin[x] Sinh[y]}; Field[x_, y_] = {m[x, y], n[x, y]}; \(vectorfieldplot = 
      Table[Arrow[Field[x, y], Tail -> {x, y}], {x, \(-\(π\/2\)\), 
          π\/2, π\/8}, {y, 0, 2, 0.5}]; 

    \({x[t_], y[t_]} = {0, 1} + 0.5\ {Cos[t], Sin[t]}; \)\)tlow = 0; thigh = 2 π; \(Cplot = 
      ParametricPlot[{x[t], y[t]}, {t, tlow, thigh}, 
        PlotStyle -> {{Thickness[0.01], Red}}, 
        DisplayFunction -> Identity]; 


    Show[vectorfieldplot, Cplot, AxesLabel -> {"x", "y"}, 
      DisplayFunction -> $DisplayFunction]; \)

Again, this looks like water flowing down on the left toward the x-axis and then flowing up on the right.
Go with the curve C plotted above and report on whether the flow measurements 
       (∮_( C))  m[x, y] dx  +  
        n[x, y] dy, and
       (∮_( C))  -n[x, y] dx  +  
        m[x, y] dy
tell you that this vector field cannot be a model for water flow without sources (spigots) or sinks (drains).

Use NIntegrate with AccuracyGoal -> 2.

G.5)   Sources and sinks*

The simplest way to spot a source of new fluid or a drain of old fluid at a point {a, b} is to center a circle C[r] of very small radius r at {a, b} and then to calculate the flow - across - C[r] measurement 
       (∮_( C[r])) -n[x, y] dx  +  
        m[x, y] dy.
If this measurement is positive for ALL very small r's, then you can be sure that the point {a, b} is a source of new fluid.
If this measurement is negative for ALL very small r's, then you can be sure that the point {a, b} is a drain of old fluid.
Try this out on 
     Field[x, y] = {3  (x^2), 4  (y^4)}:

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

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

Center a circle C[r] of radius r at {a, b} = {2, 1} 
and calculate the flow - across - C[r] measurement
       (∮_( C[r])) -n[x, y] dx  +  
        m[x, y] dy:

{a, b} = {2, 1}; \(Clear[r, t]; 
tlow = 0; 
\(thigh = 2\ π; \)\){x[t_], y[t_]} = {a, b} + r {Cos[t], Sin[t]};

(∫_tlow^thigh)(-n[x[t], y[t]] x'[t]+m[x[t], y[t]] y'[t])\[DifferentialD]t

This is positive no matter what r you go with.
The upshot:
-> {a, b} = {2, 1} is a source for new fluid.
Now go with cleared values of {a, b} and center a circle C[r] of very small radius r at {a, b} and calculate the flow - across - C[r] measurement 
       (∮_( C[r])) -n[x, y] dx  +  
        m[x, y] dy:

\(Clear[a, b, r, t]; 
tlow = 0; 
\(thigh = 2\ π; \)\){x[t_], y[t_]} = {a, b} + r {Cos[t], Sin[t]};

(∫_tlow^thigh)(-n[x[t], y[t]] x'[t]+m[x[t], y[t]] y'[t])\[DifferentialD]t

This tells you that:
-> {a, b} is a source of new fluid if (3  a + 8  (b^3)) > 0, 
and 
-> {a, b} is a sink (drain) for old fluid if (3  a + 8  (b^3)) < 0.
Here's a sample plot of some of the sources and sinks in this vector field:

sourcesandsinks = 
      Show[Table[
          If[3 a + 8 (b^3) > 0, 
            Graphics[{PointSize[0.015], Red, Point[{a, b}]}], 
            Graphics[{PointSize[0.025], GrayLevel[0.05], Point[{a, b}]}]], {
            a, -5, 5, 0.25}, {b, -4, 4, 0.25}], Axes -> True, 
        AxesLabel -> {"x", "y"}];

The sinks are in the lower part of the plot. 
Think of the sources as little individual springs feeding the flow.  
Think of the sinks as little holes through which fluid seeps out as the flow goes by.

G.5.a.i)

Give a sample plot of some of the sources and sinks in the vector field
       Field[x, y] = {(x^2), (y^3)}.

G.5.a.ii)

Give a sample plot of some of the sources and sinks in the vector field
       Field[x, y] = {3  x, -(x^2) (y^3)}.

G.5.b) Singularity source

Here's a look at the vector field
       Field[x, y]=3 {(x/((x^2)  +   (y^2))),(y/((x^2)  +   (y^2)))}:
Note the singularity at {0, 0}.

\(Clear[Field, m, n, x, y]; 
    
{m[x_, y_], n[x_, y_]} = 3\ {x\/\(x\^2 + y\^2\), y\/\(x\^2 + y\^2\)}; 

    \(Field[x_, y_] = {m[x, y], n[x, y]}; \)\)\(fieldplot = 
      Table[Arrow[Field[x, y], Tail -> {x, y}], {x, \(-5\), 5, 2}, {y, 
          \(-5\), 5, 1}]; 
\(singularity = {0, 0}; \)\)\(singularityplot = Graphics[{Red, PointSize[0.03], Point[singularity]}]; 
    

Show[fieldplot, singularityplot, 
	Axes -> True, 
      AxesLabel -> {"x", "y"}]; \)

Go with the circle C of radius 2 centered at the singularity at {0, 0} 
and look at the calculation  
       (∮_( C)) -n[x, y] dx  +  
        m[x, y] dy 
of the flow of this vector field across C :

\(Clear[x, y, t]; 
r = 2; 
\({x[t_], y[t_]} = r\ {Cos[t], Sin[t]}; \)\)tlow = 0; thigh = 2 π;

(∫_tlow^thigh)(-n[x[t], y[t]] x'[t]+m[x[t], y[t]] y'[t])\[DifferentialD]t

Now go with the circle (Subscript[C, 1]) of radius 1 centered at the singularity at {0, 0} and look at this calculation  
       (∮_( (Subscript[C, 1]))) -n[x, y] dx  +  
        m[x, y] dy 
of the flow of this vector field across (Subscript[C, 1]):

\(Clear[x, y, t]; 
r = 1; 
\({x[t_], y[t_]} = r\ {Cos[t], Sin[t]}; \)\)tlow = 0; thigh = 2 π;

(∫_tlow^thigh)(-n[x[t], y[t]] x'[t]+m[x[t], y[t]] y'[t])\[DifferentialD]t

Now go with any circle (Subscript[C, r]) of radius r centered at the singularity at {0, 0} and look at this calculation  
       (∮_( (Subscript[C, r]))) -n[x, y] dx  +  
        m[x, y] dy
of the flow of this vector field across (Subscript[C, r]):

\(Clear[r, x, y, t]; 
{x[t_], y[t_]} = r\ {Cos[t], Sin[t]}; 
\(tlow = 0; 
    \)\)thigh = 2 π;

(∫_tlow^thigh)(-n[x[t], y[t]] x'[t]+m[x[t], y[t]] y'[t])\[DifferentialD]t

No matter what positive radius you go with, the flow of this vector field across the circle of radius r centered at the singularity is 6  π.
What clue does this give you about the location of the only source of new fluid in this flow?

G.6)   Gradient fields are where the mathematical action is*

G.6.a.i)

The curve (Subscript[C, 1]) runs on a straight line starting at {0, 0} and ending at {1, 2}.  Here's a parameterization of (Subscript[C, 1]) with t running from 0 to 1:

\(Clear[x1, y1, t]; 
{x1[t_], y1[t_]} = {0, 0} + t\ {1, 2}\)

The curve (Subscript[C, 2]) also starts at {0, 0} and ends at {1, 2}, but (Subscript[C, 2]) runs on the parabola 
       y = 2  (x^2) 
Here's a parameterization of (Subscript[C, 2]) with t running from 0 to 1:

\(Clear[x2, y2, t]; 
{x2[t_], y2[t_]} = {t, 2\ t\^2}\)

The curve (Subscript[C, 3]) also starts at {0, 0} and ends at {1, 2} but (Subscript[C, 3]) runs on the sine curve 
       y=2Sin[((π x)/2)] 
Here's a parameterization of (Subscript[C, 3]) with t running from 0 to 1:

\(Clear[x3, y3, t]; 
{x3[t_], y3[t_]} = {t, 2\ Sin[\(π\ t\)\/2]}\)

Take a look:

ParametricPlot[{{x1[t], y1[t]}, {x2[t], y2[t]}, {x3[t], y3[t]}}, {t, 
        0, 1}, PlotStyle -> {{Red}, {Blue}, {Thickness[0.01]}}, 
      AxesLabel -> {"x", "y"}, AspectRatio -> (1/2)];

Here are calculations of the three path integrals
       (∫_( (Subscript[C, 1])))  y Sin[x y] dx  +  
        x Sin[x y] dy,
       (∫_( (Subscript[C, 2])))  y Sin[x y] dx  +  
        x Sin[x y] dy, and
       (∫_( (Subscript[C, 3])))  y Sin[x y] dx  +  
        x Sin[x y] dy
in order:

Clear[m, n, x, y];
{m[x_, y_], n[x_, y_]} = {y Sin[x y], x Sin[x y]};
NIntegrate[m[x1[t], y1[t]] x1'[t]+n[x1[t], y1[t]] y1'[t],{t, 0, 1}]

NIntegrate[m[x2[t], y2[t]] x2'[t]+n[x2[t], y2[t]] y2'[t],{t, 0, 1}]

NIntegrate[m[x3[t], y3[t]] x3'[t]+n[x3[t], y3[t]] y3'[t],{t, 0, 1}]

Here are calculations of the three path integrals
       (∫_( (Subscript[C, 1])))  x Sin[x y] dx  +  
        y Sin[x y] dy,
       (∫_( (Subscript[C, 2])))  x Sin[x y] dx  +  
        y Sin[x y] dy, and
       (∫_( (Subscript[C, 3])))  x Sin[x y] dx  +  
        y Sin[x y] dy
in order:

Clear[m, n, x, y];
{m[x_, y_], n[x_, y_]} = {x Sin[x y], y Sin[x y]};
NIntegrate[m[x1[t], y1[t]] x1'[t]+n[x1[t], y1[t]] y1'[t],{t, 0, 1}]

NIntegrate[m[x2[t], y2[t]] x2'[t]+n[x2[t], y2[t]] y2'[t],{t, 0, 1}]

NIntegrate[m[x3[t], y3[t]] x3'[t]+n[x3[t], y3[t]] y3'[t],{t, 0, 1}]

Explain how you could have predicted in advance that the first three integrals would have calculated out to the same value.
Explain why most knowledgeable folks would have been quite surprised if the second three path integrals had all calculated out to be equal.

G.6.a.ii)

Given specific functions m[x, y] and n[x, y], what do you look for in order to recognize whether
       (∫_( (Subscript[C, 1])))  m[x, y] dx  +  
          n[x, y] dy = 
        (∫_( (Subscript[C, 2])))  m[x, y] dx  +  
          n[x, y] dy
provided (Subscript[C, 1]) and (Subscript[C, 2]) are two curves starting at the same point and ending at the same point?

G.6.b.i) Substitute curves

Here's a curve C running from its start at {-2, -3} to its end at {5, 4}:

start = {-2, -3}; end = {5, 4}; curve = 
      Graphics[{Red, Thickness[0.01], 
          Line[{start, {0, -1}, {-1, 2}, {0, 3}, {2, -1}, {3, 
                2.5}, end}]}]; \(labels = {Graphics[Text["start", start, {\(-1\), \(-1\)}]], 
        Graphics[Text["end", end, {1, 1}]]}; 


    Show[curve, labels, Axes -> True, AxesLabel -> {"x", "y"}, 
      PlotLabel -> "The curve C"]; \)

Some yo-yo asks you how to calculate
       (∫_( C))  y (e^(-x y)) dx  + 
         x (e^(-x y)) dy.
At first your stomach tightens up because you don't want to go to the trouble of parameterizing that silly curve C. 
Then your anxiety turns into a smile as you look at
       m[x, y] =  y (e^(-x y)) and n[x, y] = x (e^(-x y)).
And then you say: "I don't need to use this silly curve because I can use a simple substitute curve (Subscript[C, 1]) with the same start and the same end, and then I'll calculate:"
       (∫_( (Subscript[C, 1])))  
          y (e^(-x y)) dx  +  
        x (e^(-x y)) dy
Come up with the substitute curve (Subscript[C, 1]), make the calculation, and explain how you know that your calculation is correct.

G.6.b.ii)

Go with the same curve C as in part i) immediately above.
If you had been asked to calculate
       (∫_( C))  x (e^(-x y)) dx  + 
         y (e^(-x y)) dy,
would you have even considered the use of a substitute curve?
Why or why not?

G.6.c.i)

Here's a function f[x, y]:

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

Here's the gradient field of this function:

\(Clear[gradf, m, n, Field]; 

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

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

Here's a closed curve C:

\(Clear[t]; 
    
{x[t_], y[t_]} = {1 + 2\ Cos[t] - 1\/8\ Cos[4\ t], 
        Sin[t] + 1\/2\ Sin[3\ t]}; 
\(tlow = 0; \)\)\(thigh = 2\ π; 


    curveplot = 
      ParametricPlot[{x[t], y[t]}, {t, tlow, thigh}, 
        PlotStyle -> {{Thickness[0.01], Red}}, 
        AxesLabel -> {"x", "y"}, 
        Epilog -> {Text["start", {x[tlow], y[tlow]}, {1.3, \(-1\)}], 
            Text["end", {x[thigh], y[thigh]}, {1.3, 1}]}]; \)

Look at this calculation of
       (∫_( C)) m[x, y] dx  +  
        n[x, y] dy
 for 
       {m[x, y], n[x, y]} = gradf[x, y].

pathintegral=(∫_tlow^thigh)(m[x[t], y[t]] x'[t]+n[x[t], y[t]] y'[t])\[DifferentialD]t

Why should you have been able to predict this result before you did the calculation?

G.6.c.ii)

Here's a function f[x, y]:

\(Clear[f, x, y]; 
f[x_, y_] = Sin[x]\ Cos[y]; \)

Here's the gradient field of this function:

\(Clear[gradf, m, n, Field]; 

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

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

Here's a curve C:

\(Clear[t]; 
    
{x[t_], y[t_]} = {2\ Cos[t], t\/3 + Sin[t] + 1\/2\ Sin[3\ t]}; 

    \(tlow = 0.3; \)\)\(thigh = 4.2; 


    curveplot = 
      ParametricPlot[{x[t], y[t]}, {t, tlow, thigh}, 
        PlotStyle -> {{Thickness[0.01], Red}}, 
        AxesLabel -> {"x", "y"}, 
        Epilog -> {Text["start", {x[tlow], y[tlow]}, {1.3, 1}], 
            Text["end", {x[thigh], y[thigh]}, {\(-1\), 0}]}]; \)

Look at this calculation of
       (∫_( C)) m[x, y] dx  +  
        n[x, y] dy
 for 
       {m[x, y], n[x, y]} = gradf[x, y]
 as above.

pathintegral=NIntegrate[m[x[t], y[t]] x'[t]+n[x[t], y[t]] y'[t],{t, tlow, thigh}]

Now look at this:

fchange = f[x[thigh], y[thigh]] - f[x[tlow], y[tlow]]

Compare:

{pathintegral, fchange}

Why did this happen?

G.6.d)

Take:

\(Clear[f, x, y]; 
f[x_, y_] = Sin[x\^2\ y]\)

Look at gradf[x, y]:

{D[f[x, y],  x], D[f[x, y],  y]}

If C is any curve starting at {0, 1.2} and ending at {2.7, -5.1}, then
       (∫_( C)) 2  x y Cos[(x^2) y] dx  + 
         (x^2) Cos[(x^2) y] dy
       (∫_( C))  df  
        = f[2.7, -5.1] -  f[0, 1.2]:

f[2.7, -5.1] - f[0, 1.2]

Do you agree or disagree? 
Why?

G.6.e)

Do you think that 
       Field[x, y] = {y +  (x^2), x -  Sin[y]} 
is a gradient field?
If you do, then come up with a function f[x, y] with 
       gradf[x, y] = {y +  (x^2), x -  Sin[y]}.

G.6.f)

Suppose you know for sure that Field[x, y] = {m[x, y], n[x, y]} is a gradient field.  
Explain how you know that the flow of Field[x, y] along any one curve starting at {(Subscript[x, 0]), (Subscript[y, 0])} and ending at {(Subscript[x, 1]), (Subscript[y, 1])} is the same as the flow of Field[x, y] along any other curve starting at {(Subscript[x, 0]), (Subscript[y, 0])} and ending at {(Subscript[x, 1]), (Subscript[y, 1])}.

G.7)   Work and how the physicists measure it

What's work for some folks is fun for other folks.  Trig identities come to mind; they always seem to be work to the math student but seem to be fun to the math teacher.  
The physicists have their own technical notion of work.
The physicists envision a vector field 
       Field[x, y] = {m[x, y], n[x, y]} 
to represent the force (push) on an object positioned at {x, y}.  In this interpretation, the vector field Field[x, y] is called a force field.
Next, the physicists say that if you push an object along a curve C parameterized by by 
       {x[t], y[t]} with tlow ≤ t ≤ thigh, 
then the work done by the force field Field[x, y] for you during the duration of the trip is measured by
       (∫_( C)) m[x, y] dx  +  
        n[x, y] dy
       =(∫_tlow^thigh) (m[x[t], y[t]] x'[t]+ n[x[t], y[t]] y'[t])dt
       =(∫_tlow^thigh) Field[[x[t], y[t]].{x'[t],y'[t]}dt.
This might not be what your own notion of work is, but the physicists have a pretty good reason for using that word for this measurement.  Think of it this way:
If, at a point on the trip
        Field[x[t], y[t]].{x'[t],y'[t]}>0, 
then at this point the force field Field[x, y] is working this much to push the object and you do no work at all.
But if 
        Field[x[t], y[t]].{x'[t],y'[t]}<0, 
then at this point the force field Field[x, y] is against your efforts to advance the object; you are working this much and the force field Field[x, y] does no work at all.
With this in mind, you can think of
       (∫_( C)) m[x, y] dx  +  
        n[x, y] dy
      =(∫_tlow^thigh) Field[[x[t], y[t]].{x'[t],y'[t]}dt
as a measurement of
       the force field' s work  -  your work.
-> If 
       (∫_( C)) m[x, y] dx  +  
        n[x, y] dy
      =(∫_tlow^thigh) Field[[x[t], y[t]].{x'[t],y'[t]}dt=0,
then the force field did the same amount of work that you did during the duration of the trip.
-> If 
       (∫_( C)) m[x, y] dx  +  
        n[x, y] dy
      =(∫_tlow^thigh) Field[[x[t], y[t]].{x'[t],y'[t]}dt>0,
then the force field did most of the work during the duration of the object's trip.
-> If
       (∫_( C)) m[x, y] dx  +  
        n[x, y] dy
      =(∫_tlow^thigh) Field[[x[t], y[t]].{x'[t],y'[t]}dt<0,
then you did most of the work during the duration of the object's trip.

G.7.a)

Is there a difference between net flow - along - the - curve measurements and work?

Full answer given as a gesture of friendship:

Mathematically there is no difference because they are both measured by the same formula
       (∫_( C)) m[x, y] dx  +  
        n[x, y] dy.
The difference is in the interpretation.
When you are talking about flow - along - the - curve measurements, then you envision 
       Field[x, y] = {m[x, y], n[x, y]} 
as the velocity vector at {x, y} of a fluid flow.
The fluid is flowing and the curve is just sitting there.
When you are talking about work, then you envision 
       Field[x, y] = {m[x, y], n[x, y]} 
as the force on an object at {x, y} moving on a curve.
This time the force field is just sitting there and the object is moving on the curve.

G.7.b)

Here is a force field:

\(Clear[Field, m, n, x, y]; 
m[x_, y_] = x\/4; 

    \(n[x_, y_] = \(x - y\)\/5; \)\)Field[x_, y_] = {m[x, y], n[x, y]}; \(forcefieldplot = 
      Table[Arrow[Field[x, y], Tail -> {x, y}], {x, \(-2\), 4}, {y, 
          \(-3\), 3}]; 


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

An object starts at {3.3, 0} and moves through this force field one time around the ellipse
       (((((x  -  1)/2.3)))^2)+ ((((y/1.3)))^2)=1
Which way should the object go (counterclockwise or clockwise) to make the force field do most of the work?

G.7.c)

Comment on the statement:
If a given force field 
       Field[x, y] = {m[x, y], n[x, y]} 
is a gradient field, and you are pushing an object from a start point {(Subscript[x, 0]), (Subscript[y, 0])} to an end point {(Subscript[x, 1]), (Subscript[y, 1])}, you might as well push it on the line C starting at {(Subscript[x, 0]), (Subscript[y, 0])} and ending at {(Subscript[x, 1]), (Subscript[y, 1])}, because if (Subscript[C, 1]) is any other curve starting at {(Subscript[x, 0]), (Subscript[y, 0])} and ending at {(Subscript[x, 1]), (Subscript[y, 1])}, then
       (∫_( C)) m[x, y] dx  +  
        n[x, y] dy 
        = 
        (∫_( (Subscript[C, 1]))) m[x, y] dx  +  
          n[x, y] dy.

G.7.d)

Here is a force field that changes as time t(measured in minutes) changes:

\(Clear[Field, m, n, x, y, t, td]; 
    
{m[x_, y_, t_], n[x_, y_, t_]} = 
      \(\(-x\)\ \) {Cos[\(π\ t\)\/3], Sin[\(π\ t\)\/3]} - 
        1\/2\ {\(-Sin[\(π\ t\)\/3]\), Cos[\(π\ t\)\/3]}; 

    Field[x_, y_, t_] = {m[x, y, t], n[x, y, t]}\)

Here is how this vector field looks at {x, y} = {1, 1} for t = 0, 1, 2, 3, 4, 5, and 6 minutes:

Table[
      Show[Graphics[{PointSize[0.02], Point[{1, 1}]}], 
        Arrow[Field[1, 1, t], Tail -> {1, 1}], Axes -> True, 
        AxesOrigin -> {0, 0}, 
        PlotRange -> {{-0.5, 2.5}, {-0.5, 2.5}}, 
        PlotLabel -> "t = "<>ToString[t]], {t, 0, 6}];

At time t, Field[x, y, t] is the vector {-x, -(1/2)} rotated by ((π t)/3) radians. The effect is that this time-dependent force field is like a revolving force beacon at each point {x, y}.
Here's an idea of how the whole vector field does its dance:

Table[
      Show[Table[
          Arrow[Field[x, y, t], Tail -> {x, y}], {x, -2.6, 2.6, 
            (5.2/3)}, {y, -1.7, 1.7, (3.4/3)}], Axes -> True, 
        PlotLabel -> "t = "<>ToString[t], 
        PlotRange -> {{-6, 6}, {-5, 5}}], {t, 0, 5}];

You are making plans to send an object on a trip around the ellipse 
       (x^2)+ ((((y/2)))^2)=1
in the counterclockwise direction through this force field.
The procedure is to start the clock now, wait (Subscript[t, d]) seconds, and then start the motion so that at time t the object is at the position 
       {x[t], y[t]} = {Cos[t - (Subscript[t, d])], 2  Sin[t - (Subscript[t, d])]} 
for 
       (Subscript[t, d]) ≤ t ≤ (Subscript[t, d]) +  2  π.
Your job is to select a delay time (Subscript[t, d]) with 0 ≤ (Subscript[t, d]) ≤ 10 to make the work done by the time-dependent force field as large as you can.

To calculate work of the time-dependent force field as a function of (Subscript[t, d]), you integrate
       m[x[t], y[t], t] x'[t]+ n[x[t], y[t], t] y'[t],
using appropriate limits.
Once you get a formula for work [(Subscript[t, d])], then you can plot to estimate what the best (Subscript[t, d]) is.

G.7.e)

You are moving along the x-axis, starting at {0, 0} and ending at {s, 0}, under a constant force F = {(Subscript[d, 1]), (Subscript[d, 2])} at all points.
Explain the formula
       work done by the force field = (Subscript[d, 1]) s.
Given that physicists measure force in newtons and distance in meters, say why physicists measure work in newton-meters (which they call joules).

For your information and enjoyment:
       power = joules/second
One unit of power is also called a watt.  This is where the electric meter on the side of your house gets the measurement of kilowatt hour.
A kilowatt hour is 1000 watts times 3600 seconds 
        = 3.6 (10^6) (joules/second) seconds
        = 3.6 (10^6) joules.
Every time you pay your power bill, you are paying for units of work done by electricity in keeping your computer running.

G.7.f)

Write a few words on what you think is the difference between the everyday English language definition of work and the technical definition of work as used by the physicists.  To get started, think about this:
According to the physicists, if there is no change of position, then there is no work.
If you must hold a heavy old computer in your arms while you stand in place for one hour, the physicists would say that you did no work.  Do you agree?

G.8)   Spin fields

Start with a vector field 
       Field[x, y] = {m[x, y], n[x, y]}
and make what some folks call the spin field 
       spinField[x, y] = {-n[x, y], m[x, y]}.
Here's a vector field:

\(Clear[x, y, m, n, Field, spinField]; 
{m[x_, y_], n[x_, y_]} = {x, y}; 
    
\(Field[x_, y_] = {m[x, y], n[x, y]}; \)\)spinField[x_, y_] = {-n[x, y], m[x, y]}; \(fieldplot = 
      Table[Arrow[Field[x, y], Tail -> {x, y}], {x, \(-3\), 3, 2}, {y, 
          \(-3\), 3, 2}]; 

Show[fieldplot, Axes -> True]; \)

Here's the same vector field plotted together with its spin field:

\(spinfieldplot = 
      Table[Arrow[spinField[x, y], Tail -> {x, y}, 
          VectorColor -> Red], {x, \(-3\), 3, 2}, {y, \(-3\), 3, 2}]; 

    
Show[fieldplot, spinfieldplot, Axes -> True]; \)

Again:

\(Clear[x, y, m, n, Field, spinField]; 
    
{m[x_, y_], n[x_, y_]} = {0.3\ x + 0.2, 0.2\ x\ \((1 - y\/3)\)}; 

    \(Field[x_, y_] = {m[x, y], n[x, y]}; \)\)spinField[x_, y_] = {-n[x, y], m[x, y]}; \(fieldplot = 
      Table[Arrow[Field[x, y], Tail -> {x, y}], {x, \(-3\), 3, 1}, {y, 
          \(-3\), 3, 1}]; 

Show[fieldplot, Axes -> True]; \)

Here's the same vector field plotted together with its spin field:

\(spinfieldplot = 
      Table[Arrow[spinField[x, y], Tail -> {x, y}, 
          VectorColor -> Red], {x, \(-3\), 3, 1}, {y, \(-3\), 3, 1}]; 

    
Show[fieldplot, spinfieldplot, Axes -> True]; \)

Run some more of these of your own choice to get a feeling for the relationship between a vector field and its spin field.

G.8.a)

Try to describe the geometric relationship between a vector field and its spin field.

Think rotation.

G.8.b)

True or false:
Trajectories of a vector field 
       Field[x, y] = {m[x, y], n[x, y]} 
cross the trajectories of the spin field 
       SpinField[x, y] = {-n[x, y], m[x, y]} 
at right angles.
Try to explain your response.

G.8.c.i)

Explain why:
If C is a closed curve directed in the counterclockwise way, then the measurement of the flow of a vector field 
       Field[x, y] = {m[x, y], n[x, y]} 
across C is the same as the measurement of the flow of its spin field 
       spinField[x, y] = {-n[x, y], m[x, y]} 
along C.
Consequently, if the net flow of 
       Field[x, y] = {m[x, y], n[x, y]}
across C is from inside to outside, then the net flow of 
       spinField[x, y] = {-n[x, y], m[x, y]}
along C is counterclockwise.

G.8.c.ii)

In what way is the measurement of the net flow of a vector field 
       Field[x, y] = {m[x, y], n[x, y]}
along C related to the measurement of the net flow of its spin field 
       spinField[x, y] = {-n[x, y], m[x, y]}
across C?

G.8.d.i)

True or false:
If a vector field  
       Field[x, y] = {m[x, y], n[x, y]}
is a gradient field, then you are guaranteed that its spin field 
       spinField[x, y] = {-n[x, y], m[x, y]}
is also a gradient field.

Field[x, y] = {m[x, y], n[x, y]} = {2 x y, (x^2)} 
is a gradient field because 
       D[(x^2), x] = D[2 x y, y] = 2  x.
Is spinField[x, y] = {-(x^2), 2 x y} also a gradient field?

G.8.d.ii)

Suppose f[x, y] is a function and
       Field[x, y] = {D[f[x, y], x], D[f[x, y], y]}  
is its gradient field, and that neither D[f[x, y], x] nor D[f[x, y], y] has any singularities. 
What condition on    
       (∂^2)f[x, y]/∂(x^2) + (∂^2)f[x, y]/∂(y^2)  
        = D[f[x, y], {x, 2}] +  D[f[x, y], {y, 2}] 
guarantees that the spin field
       spinField[x, y] = {-D[f[x, y], y], D[f[x, y], x]} 
passes the gradient test?

G.9)  "Calculus Cal" screws up again

Today, Cal is in the lab doing his homework for the traditional course. Of course, he has hardly looked at his text or at the Basics and Tutorials of this lesson.  Here are Cal's halfbaked responses to some problems:
Your job is to explain to Cal where he went wrong and to do them right.

G.9.a)

-> Cal's problem: 
Calculate the path integral
       (∫_( C)) y Cos[x] dx  +  
        2  x y dy
where C is the line starting at {0, 0} and ending at {(π/2), 4}
-> Cal's solution:
       (∫_( C)) y Cos[x] dx  +  
        2  x y dy
       \(\( = 
        y\ Sin[x] ]\_{0, 0}\%{π/2, 4} + \ 
          x\ \(y\^2\) ]\_{0, 0}\%{π/2, 4}\)\)
        = 
        (4 -  0) +  (((π/2)) 16 -  0) = 
          8  π +  4.

G.9.b)

-> Cal's problem:
Given m[x, y] = x y and n[x, y]=((x^2)/2)  
Calculate the path integral
       (∫_( C))  m[x, y] dx  +  
        n[x, y] dy
where C is the line starting at {0, 0} and ending at {1, 2}.
-> Cal's solution:
       D[m[x, y], y] = x
and 
       D[n[x, y], x] = x.
So 
       D[m[x, y], y] = D[n[x, y], x],
and this tells me that {m[x, y], n[x, y]} is a gradient field. 
Therefore
       (∫_( C))  m[x, y] dx  +  
          n[x, y] dy = 0.

G.9.c)

-> Cal's problem:
Given m[x, y] = (x^2) + y   and n[x, y] = (y^2) - x  
Calculate the path integral
       (∮_( C)) m[x, y] dx  +  
        n[x, y] dy
where C is the circle of radius 3 centered at {1, 2}.
-> Cal's solution:

\(Clear[m, n, x, y, t]; 
m[x_, y_] = x\^2 + y; 
\(n[x_, y_] = y\^2 - x; 
    \)\)tlow = 0; thigh = 4 π; {x[t_], y[t_]} = {1, 2} + 3 {Sin[t], Cos[t]};

(∫_tlow^thigh)(m[x[t], y[t]] x'[t]+n[x[t], y[t]] y'[t])\[DifferentialD]t

G.9.d)

-> Cal's problem:
Given 
       m[x, y]=(((x^2)  -  y  +  (y^2))/((x^2)  +   (y^2))) 
and 
       n[x, y]=((x  +  (x^2) +  (y^2))/((x^2)  +   (y^2)))
Calculate the path integral
       (∮_( C)) m[x, y] dx  +  
        n[x, y] dy
where C is the circle of radius 1 centered at {0, 0}.
-> Cal's solution:
Look at the gradient test:

\(Clear[m, n, x, y]; 
m[x_, y_] = \(x\^2 - y + y\^2\)\/\(x\^2 + y\^2\); 
    
\(n[x_, y_] = \(x + x\^2 + y\^2\)\/\(x\^2 + y\^2\); \)\)Together[D[m[x, y],  y] - D[n[x, y],  x]]

This guarantees that {m[x, y], n[x, y]} is a gradient field and so
       (∮_( C)) m[x, y] dx  +  
          n[x, y] dy = 0.

G.10)  Force fields and their trajectories

A vector field is a function that spits out vectors. You make a 2D vector field by taking two regular functions m[x, y] and n[x, y] and throwing them into the two slots:

Clear[Field, m, n, x, y]; m[x_, y_] = 0.2 y; n[x_, y_] = -0.4 x; Field[x_, y_] = {m[x, y], n[x, y]}

You plot a vector field by plotting the vector Field[x, y] with its tail at {x, y} for a selection of points {x, y}:

\(vectorfieldplot = 
      Table[Arrow[Field[x, y], Tail -> {x, y}], {x, \(-2\), 2, 0.5}, {y, 
          \(-2\), 2, 0.5}]; 


    Show[vectorfieldplot, Axes -> True, AxesLabel -> {"x", "y"}]; 
    \)

If you go with the usual interpretation of this vector field as velocity vectors of fluid flow and you drop a cork into the flow at {-0.5, 0}, then the cork advances on a trajectory of the vector field:

{a, b} = {-0.5, 0}; starterpoint = {a, b};

Clear[Derivative, x, y, t];
endt = 12;
approxsolutions=NDSolve[{x'[t]==m[x[t], y[t]],y'[t]==n[x[t], y[t]],x[0] == a,y[0] == b},{x[t], y[t]},{t, 0, endt}];

Clear[trajectory];
trajectory[t_] = {
          x[t] /. approxsolutions[[1]], 
          y[t] /. approxsolutions[[1]]}
          ;
trajectoryplot = 
        ParametricPlot[trajectory[t], {t, 0, endt}, 
          PlotStyle -> {{Red, Thickness[0.01]}}, 
          DisplayFunction -> Identity]; \(starterplot = Graphics[{Red, PointSize[0.04], Point[starterpoint]}]; 


    Show[vectorfieldplot, starterplot, trajectoryplot, PlotRange -> All, 
      PlotLabel -> "Flow trajectory", Axes -> True, 
      AxesLabel -> {"x", "y"}, 
      DisplayFunction -> $DisplayFunction]; \)

On the other hand, if you interpret this vector field as a force field, and you put an object of mass 4 into this force field at {-0.5, 0}, and you give it an initial velocity of {0, 0}, then the path of this object isn't the trajectory you see above.  
Reason:
One of Newton's laws says 
       force = mass acceleration.  
So the object moves on a curve parameterized by {x[t], y[t]} with
       Field[x[t], y[t]]=mass{(x')'[t],(y')'[t]}
with 
       {x[0], y[0]} = {-0.5, 0} and {x'[0],y'[0]}={0, 0}.
Here's a look:

endt = 12; mass = 4; {a, b} = {-0.5, 0};

Clear[Derivative, x, y, t];
approxsolutions=NDSolve[{m[x[t], y[t]]==mass x''[t],n[x[t], y[t]]==mass y''[t],x[0] == a,x'[0]==0,y[0] == b,y'[0]==0},{x[t], y[t]},{t, 0, endt}];

Clear[forcetrajectory];
forcetrajectory[t_] = {
          x[t] /. approxsolutions[[1]], 
          y[t] /. approxsolutions[[1]]}
          ;
forcetrajectoryplot = 
        ParametricPlot[forcetrajectory[t], {t, 0, endt}, 
          PlotStyle -> {{Red, Thickness[0.01]}}, 
          DisplayFunction -> Identity]; \(newstarterplot = Graphics[{Red, PointSize[0.04], Point[{a, b}]}]; 


    Show[vectorfieldplot, newstarterplot, forcetrajectoryplot, 
      PlotRange -> All, PlotLabel -> "Force trajectory", 
      DisplayFunction -> $DisplayFunction]; \)

G.10.a)

Experiment with different masses and report what you observe.
Does lowering the mass make the trajectory more or less responsive to the desires of the force field?

G.10.b)

Here's a new force field shown with its two singularities:

\(Clear[Field, m, n, x, y]; 
q = \(-2.5\); 
\(qq = \(-1.5\); \)\){x0, y0} = {2, 0}; {x1, y1} = {-2, 0}; {m[x_, y_], n[x_, y_]} = 
      ((q {x - x0, y - y0})/((((x - x0))^2) + (((y - y0))^2))) + 
        ((qq {x - x1, y - y1})/((((x - x1))^2) + (((y - y1))^2))); 
    \(Field[x_, y_] = {m[x, y], n[x, y]}; 


    forcefieldplot = 
      Show[Graphics[{PointSize[0.04], Point[{x0, y0}]}], 
        Graphics[{PointSize[0.04], Point[{x1, y1}]}], 
        Table[Arrow[Field[x, y], Tail -> {x, y}], {x, \(-5\), 5, 2}, {y, 
            \(-5\), 5, 2}], Axes -> True, 
        AxesLabel -> {"x", "y"}]; \)

Here's what happens when you put an object of mass 0.9 into this force field at {3, 4} and you give it an initial velocity of 
       {x'[0],y'[0]}={-2, 0}:

mass = 0.9; {a, b} = {3, 4}; endt = 25;

Clear[Derivative, x, y, t];
approxsolutions=NDSolve[{m[x[t], y[t]]==mass x''[t],n[x[t], y[t]]==mass y''[t],x[0] == a,x'[0]==-2,y[0] == b,y'[0]==0},{x[t], y[t]},{t, 0, endt}];

Clear[forcetrajectory];
forcetrajectory[t_] = {
          x[t] /. approxsolutions[[1]], 
          y[t] /. approxsolutions[[1]]}
          ;
forcetrajectoryplot = 
        ParametricPlot[forcetrajectory[t], {t, 0, endt}, 
          PlotStyle -> {{Red, Thickness[0.01]}}, 
          DisplayFunction -> Identity]; \(starterplot = Graphics[{Red, PointSize[0.04], Point[{a, b}]}]; 


    Show[forcefieldplot, starterplot, forcetrajectoryplot, 
      PlotRange -> All, Axes -> True, 
      AxesLabel -> {"x", "y"}, 
      DisplayFunction -> $DisplayFunction]; \)

Quite an electric trip.
Experiment with what happens when you keep everything the same but start by giving it an initial velocity of 
       {x'[0],y'[0]}={-v, 0}
for a selection of v's like v = 0, 1, 3, and 4. 
Report on your results.