VC.05 Flow Measurements by Integrals
TUTORIALS

\(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]; \)

T.1)  Backward and forward

T.1.a.i)

Explain why:
If (Subscript[C, 1]) and (Subscript[C, 2]) are the same physical curve, but 
-> the starting point of (Subscript[C, 1]) =  the ending point of (Subscript[C, 2])   
and 
-> the ending point of (Subscript[C, 1]) =  the starting point of (Subscript[C, 2]), 
then for any m[x, y] and n[x, y] that come down the pike, you will always get
       (∫_( (Subscript[C, 1])))m[x, y] dx +  
        n[x, y] dy 
        = 
        -(∫_( (Subscript[C, 2])))m[x, y] dx +  
          n[x, y] dy.
In other words, if you reverse the direction, then you reverse the sign of the path integral.

Both 
       (∫_( (Subscript[C, 1])))m[x, y] dx +  
        n[x, y] dy
and 
       (∫_( (Subscript[C, 2])))m[x, y] dx +  
        n[x, y] dy
measure the flow of the vector field 
       Field[x, y] = {m[x, y], n[x, y]} 
along the same curve. But the interpretation is different in each case, because the unit tangent vectors on (Subscript[C, 1]) point in the direction exactly opposite of those on (Subscript[C, 2]) .
The opposite direction of the tangent vectors accounts for the minus sign.

T.1.a.ii)

Illustrate by calculating the path integral
       (∫_( (Subscript[C, 1])))(y^3) dx +  
        (x^2) y dy,
where (Subscript[C, 1]) is the segment of the parabola 
       y = (x^2) 
starting at {0, 0} and ending at {2, 4}, and then calculating the path integral
       (∫_( (Subscript[C, 2])))(y^3) dx +  
        (x^2) y dy
where (Subscript[C, 2]) is the segment of the same parabola, but starting at {2, 4} and ending at {0, 0}.

\(Clear[m, n, x, y]; 
m[x_, y_] = y\^3; 
\(n[x_, y_] = x\^2\ y; \)\)

To calculate the path integral
       (∫_( (Subscript[C, 1])))(y^3) dx +  
        (x^2) y dy,
where (Subscript[C, 1]) is the segment of the parabola 
       y = (x^2) 
starting at {0, 0} and ending at {2, 4}, parameterize (Subscript[C, 1]) so that it runs from {0, 0} to {2, 4} and integrate:

\(Clear[t]; 
x[t_] = t; 
\(y[t_] = t\^2; \)\)tlow = 0; thigh = 2; start1 = {x[tlow], y[tlow]}

end1 = {x[thigh], y[thigh]}

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

To calculate the path integral
       (∫_( (Subscript[C, 2])))(y^3) dx +  
        (x^2) y dy
where (Subscript[C, 2]) is the segment of the parabola y = (x^2) starting at {2, 4} and ending at {0, 0}, parameterize (Subscript[C, 2]) so that it starts at {2, 4} and runs to {0, 0} and integrate:

\(Clear[x, y]; 
x[t_] = 2 - t; 
\(y[t_] = \((2 - t)\)\^2; \)\)tlow = 0; thigh = 2; start2 = {x[tlow], y[tlow]}

end2 = {x[thigh], y[thigh]}

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

Compare:

{C1pathintegral, C2pathintegral}

Just as you knew in advance; they are negatives of each other.

T.1.b.i)

Calculate the path integral 
       (∫_( C))-(x^2) y dx +  
        2  x y dy,
where C starts at {-1, 2}, runs on a straight line to {8, -1}, and then runs on the straight line from {8, -1} to {4, 7}, where C ends.

Enter the integrands:

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

Here's a look at C:

point1 = {-1, 2}; point2 = {8, -1}; point3 = {4, 7}; \(points = {point1, point2, point3}; 


    Show[Graphics[{Red, Thickness[0.01], Line[points]}], Axes -> True, 
      AxesLabel -> {"x", "y"}, PlotLabel -> "C", 
      Epilog -> {Text["Point1", point1, {\(-1\), 0}], 
          Text["Point2", point2, {1, 0}], Text["Point3", point3]}]; \)

Here comes the parameterization that makes C run from point1 to point2 and then to point3 and the calculation of
       (∫_( C))-(x^2) y dx +  
        2  x y dy:

\(Clear[x1, y1, x2, y2, t]; 
    
{x1[t_], y1[t_]} = point1 + t\ \((point2 - point1)\); 

    \({x2[t_], y2[t_]} = point2 + t\ \((point3 - point2)\); \)\)tlow = 0; thigh = 1;

Cpathintegral=NIntegrate[m[x1[t], y1[t]] x1'[t]+n[x1[t], y1[t]] y1'[t],{t, tlow, thigh}]+NIntegrate[m[x2[t], y2[t]] x2'[t]+n[x2[t], y2[t]] y2'[t],{t, tlow, thigh}]

And you're out of here.

T.1.b.ii)

Calculate the path integral 
       (∫_( C))-(x^2) y dx +  
        2  x y dy
where C starts at {4, 7}, runs on a straight line to {8, -1} and then runs on the straight line from {8, -1} to {-1, 2}:

This is almost the same as in part i) above.
The curve C is physically the same here as it was in part i).
The only difference is that this time the direction of C is the reverse of the direction in part i).
To do the calculation, take the answer to part i) above and multiply it by -1.

T.1.c.i)  Clockwise versus counterclockwise

It's late and you're calculating 
       (∫_( C)) (y^2) dx + 
        (2 (x^2) +  y) dy
where C is the ellipse (((((x  +  1)/4)))^2)+((((y/2)))^2)=1.
In your haste to meet your date at the local hangout, you type:

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

A friend looking over your shoulder says: "Good work, but your answer is wrong because your parameterization is clockwise and not counterclockwise."
After looking at a plot of some tangent vectors, you see that your parameterization is clockwise. 
And then you say, "The correct answer is:"

correctanswer = -answer

Are you right?

Yes.

T.2)  Screwing up

T.2.a)

What are the best ways of screwing up the calculation of a path integral
       (∮_( C)) m[x, y] dx +  
        n[x, y] dy?

The best way to screw up is to give a clockwise parameterization instead of a counterclockwise parameterization of C.
The second best way to screw up is to give a counterclockwise parameterization that covers C more than once.
Case in point:
Calculate
       (∮_( C)) -y dx +  
        x dy,
given that C is the circle (x^2) +  (y^2) = 1.

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

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

Check the parameterization:

curveplot = 
      ParametricPlot[{x[t], y[t]}, {t, tlow, thigh}, 
        PlotStyle -> {{Red, Thickness[0.01]}}, 
        AxesLabel -> {"x", "y"}, DisplayFunction -> Identity]; jump = (π/4); tangentvectors=Table[Arrow[{x'[t],y'[t]},Tail -> {x[t], y[t]},VectorColor -> Red],{t, tlow, thigh - jump, jump}];

Show[curveplot, tangentvectors, 
        DisplayFunction -> $DisplayFunction];

So far, so good. Everything looks fine.
Now look at:

{x[tlow], y[tlow]} == {x[thigh], y[thigh]}

The starting point and the ending point are the same.
So this parameterization passes the usual tests, but the calculated value of 
       (∮_( C)) -y dx +  
        x dy  
above is DEAD WRONG.
To see why, look at:

ParametricPlot[{x[t], y[t]}, {t, tlow, 2 π}, 
      PlotStyle -> {{Red, Thickness[0.01]}}, 
      AxesLabel -> {"x", "y"}];

ParametricPlot[{x[t], y[t]}, {t, 2 π, thigh}, 
      PlotStyle -> {{Red, Thickness[0.01]}}, 
      AxesLabel -> {"x", "y"}];

As t advances from tlow = 0 to thigh = 4  π as orginally specified, the parameterization goes around the curve twice, and this is not what you want.  
The right value for
       (∮_( C)) -y dx +  
        x dy 
is:

tlow = 0; correctthigh = 2 π; correctpathintegral=NIntegrate[m[x[t], y[t]] x'[t]+n[x[t], y[t]] y'[t],{t, tlow, correctthigh}]

T.3)  Recognizing gradient fields:  The gradient test

When you have to calculate a path integral  
       (∫_( C)) m[x, y] dx +  
        n[x, y] dy 
and you recognize that the vector field 
       Field[x, y] = {m[x, y], n[x, y]}  
is the gradient field of a function f[x, y], then a warm comfortable feeling radiates through your body.
If you want to exploit the advantages you get from a gradient field, you'll have to be in a position to recognize when a given vector field is a gradient field.
To this end, go with a cleared gradient field:

\(Clear[f, gradf, x, y, m, n]; 

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

Look at this:

gradtest = D[m[x, y],  y] - D[n[x, y],  x]

This tells you that if you have a gradient field 
       Field[x, y] = {m[x, y], n [x, y}, 
then
       D[m[x, y], y] -  D[n[x, y], x] = 0.

T.3.a.i)

If you are given a vector field 
       Field[x, y] = {m[x, y], n [x, y}
and you learn that
       D[m[x, y], y] -  D[n[x, y], x] = 0, 
then are you automatically guaranteed that Field[x, y] is a gradient field?

Yes,  provided that neither m[x, y] nor n[x, y] has a singularity (blow-up or blow-down).

T.3.a.ii)

Is the vector field
       Field[x, y] = {(e^x) Cos[y], -(e^x) Sin[y]} 
a gradient field?

Look at:

\(Clear[m, n, x, y]; 
    
{m[x_, y_], n[x_, y_]} = {E\^x\ Cos[y], \(-E\^x\)\ Sin[y]}\)

Good; neither m[x, y] nor n[x, y] has any singularities.
Now go with the gradient test:

gradtest = D[m[x, y],  y] - D[n[x, y],  x]

Hot dog!
No doubt about it, this vector field is a gradient field.

T.3.a.iii)

Is the vector field
       Field[x, y] = {(e^y) Cos[x], -(e^y) Sin[x]} 
a gradient field?

Look at:

\(Clear[m, n, x, y]; 
    
{m[x_, y_], n[x_, y_]} = {E\^y\ Cos[x], \(-E\^y\)\ Sin[x]}\)

Good; neither m[x, y] nor n[x, y] has any singularities.
Now go with the gradient test:

gradtest = D[m[x, y],  y] - D[n[x, y],  x]

This is not 0.
Absolutely no doubt about it, this vector field is NOT a gradient field.

T.3.a.iv) Singularities (blow-ups or blow-downs)

Is the vector field
       Field[x, y]={-(y/((x^2)  +  (y^2))),(x/((x^2)  +  (y^2)))} 
a gradient field?

Look at:

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

A big fat singularity at {x, y} = {0, 0}.
You can see this by plotting.

Plot[m[0, y], {y, -1, 1}, PlotStyle -> Red, 
      AspectRatio -> 1];

Plot[n[x, 0], {x, -1, 1}, PlotStyle -> Red, 
      AspectRatio -> 1];

This vector field fails the first part of the gradient test.
Now look at the second part of the gradient test:

gradtest = Simplify[D[n[x, y],  x] - D[m[x, y],  y]]

This field passes the second part of the gradient test.
Whether this vector field is a genuine gradient field is in doubt.
Try something else by looking at
       (∮_( C)) m[x, y] dx +  
        n[x, y] dy
where C is the circle of radius 1 centered at the singularity at {0, 0}:

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

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

Not zero.
This tells you for sure that this vector field is not a gradient field.

T.3.a.v)

Is every vector field a gradient field?

Hell no.

T.3.b)

Here's a vector field:

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

No singularities.
Give it the second part of the gradient test:

gradtest = D[m[x, y],  y] - D[n[x, y],  x]

Good. 
Field[x, y] is definitely a gradient field.
Try to come up with a function f[x, y] so that
       gradf[x, y] = Field[x, y].

The goal is to come up with a function f[x, y] with
       gradf[x, y] = Field[x, y].
To do this, fix any point {a, b} you like and parameterize a line C (or other curve) running from {a, b} to the variable point {x, y}:

\(Clear[t]; 
{a, b} = {0, 0}; 
\(fixedpoint = {a, b}; \)\)variablepoint = {x, y}; tlow = 0; \(thigh = 1; 

    
{x[t_], y[t_]} = fixedpoint + t\ \((variablepoint - fixedpoint)\)\)

To get a function f[x, y] with 
       gradf[x, y] = {m[x, y], n[x, y]}, 
all you gotta do is set
       f[x, y] = 
        (∫_( C)) m[x, y] dx +  
          n[x, y] dy
where C is the line (or other curve) running from the fixed point {a, b} to the variable point {x, y}:

Clear[f];
f[x_, y_]=(∫_tlow^thigh)(m[x[t], y[t]] x'[t]+n[x[t], y[t]] y'[t])\[DifferentialD]t

Try it out:

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

Compare:

{m[x, y], n[x, y]}

TrigExpand[gradf[x, y]] == TrigExpand[{m[x, y], n[x, y]}]

Great.
This tells you that 
       gradf[x, y] = {m[x, y], n[x, y]}
just as you wanted.
See what happens when you go with {a, b} = {1, (π/2)}:

\(Clear[x, y, t]; 
{a, b} = {1, π\/2}; 
\(fixedpoint = {a, b}; 
    \)\)variablepoint = {x, y}; tlow = 0; \(thigh = 1; 

    
{x[t_], y[t_]} = fixedpoint + t\ \((variablepoint - fixedpoint)\)\)

Set
       f[x, y] = 
        (∫_( C)) m[x, y] dx +  
          n[x, y] dy
where C is the line running from {a, b} to {x, y}:

Clear[f];
f[x_, y_]=(∫_tlow^thigh)(m[x[t], y[t]] x'[t]+n[x[t], y[t]] y'[t])\[DifferentialD]t

Looks bad; check whether it feels good:

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

Compare:

{m[x, y], n[x, y]}

TrigExpand[gradf[x, y]] == TrigExpand[{m[x, y], n[x, y]}]

It feels great!
Each time you change the fixed point {a, b}, you make a different function f[x, y] whose gradient is {m[x, y], n[x, y]}.

T.3.c)

What is the value of 
       (∫_( C ))(e^(-5 x y)) 
          (3 Cos[3  x] -  5  y Sin[3  x]) dx  
            - 5 x (e^(-5 x y)) Sin[3  x] dy
for any curve C running from {-0.7, 0} to {1.1, 0.4}?

Here's the vector field:

\(Clear[Field, m, n, x, y]; 
    
{m[x_, y_], n[x_, y_]} = {
        E\^\(\(-5\)\ x\ y\)\ \((3\ Cos[3\ x] - 5\ y\ Sin[3\ x])\), 
        \(-5\)\ x\ E\^\(\(-5\)\ x\ y\)\ Sin[3\ x]}; 

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

No singularities (because (e^s) > 0 no matter what s is).
Give it the second part of the gradient test:

gradtest = Together[D[m[x, y],  y] - D[n[x, y],  x]]

Good. Now you know that
       Field[x, y] = {m[x, y], n[x, y]} 
is a gradient field. 
This is really good news because this tells you that
       (∫_( C ))(e^(-5 x y)) 
          (3 Cos[3  x] -  5  y Sin[3  x]) dx  
            - 5 x (e^(-5 x y)) Sin[3  x] dy
calculates out to the same value no matter what curve C you go with as long as C starts at {-0.7, 0} and stops at {1.1, 0.4}. This information is quite a relief because now you know that you can calculate this integral by using any cheap curve C running from {-0.7, 0} to  {1.1, 0.4}. 
One really cheap curve is the straight line parameterized by:

\(Clear[x, y, t]; 
start = {\(-0.7\), 0}; 
\(end = {1.1, 0.4}; \)\)tlow = 0; thigh = 1; {x[t_], y[t_]} = start + t (end - start)

Here comes the calculation of
       (∫_( C ))(e^(-5 x y)) 
          (3 Cos[3  x] -  5  y Sin[3  x]) dx  
            - 5 x (e^(-5 x y)) Sin[3  x] dy
for any curve C running from {-0.7, 0} to  {1.1, 0.4} :

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

Not hard at all.

T.4)  Line integrals

T.4.a)

What do folks mean when they talk about line integrals?

Answer:

A line integral is the same thing as a path integral.  This alternate terminology is in common use.  This is unfortunate because many path integrals involve curves that are not lines.

T.5)  Summary of main ideas

T.5.a.i) Flow along

If a curve C is parameterized by {x[t], y[t]} with tlow ≤ t ≤ thigh, then
       (∫_( C)) m[x, y] dx +  
        n[x, y] dy
       (∫_tlow^thigh)  Field[x[t], y[t]].{x'[t],y'[t]}dt 
       =(∫_tlow^thigh)(m[x[t], y[t]] x'[t]+ n[x[t], y[t]] y'[t])dt 
measures of the flow of a vector field 
       Field[x, y] = {m[x, y], n[x, y]} 
along the curve C.

T.5.a.ii)

If you have a closed curve C (like a deformed circle), and if
       (∮_( C)) m[x, y] dx +  
          n[x, y] dy > 0, 
then the flow of Field[x, y] = {m[x, y], n[x, y]} along C is counterclockwise.
But if
       (∮_( C)) m[x, y] dx +  
          n[x, y] dy < 0, 
then the flow of Field[x, y] = {m[x, y], n[x, y]} along C is clockwise.

T.5.b.i) Flow across

If a curve C is parameterized by {x[t], y[t]} with tlow ≤ t ≤ thigh, then
       (∫_( C)) -n[x, y] dx +  
        m[x, y] dy
       =(∫_tlow^thigh) Field[x[t], y[t]].{y'[t],-x'[t]}dt 
       =(∫_tlow^thigh) (-n[x[t], y[t]] x'[t]+ m[x[t], y[t]] y'[t])dt
measures of the flow of a vector field 
       Field[x, y] = {m[x, y], n[x, y]} 
across the curve C.

T.5.b.ii)

If you have a closed curve C (like a deformed circle), and if
       (∮_( C)) -n[x, y] dx +  
          m[x, y] dy > 0, 
then the flow of Field[x, y] = {m[x, y], n[x, y]} across C is from inside to outside.
But if
       (∮_( C)) -n[x, y] dx +  
          m[x, y] dy < 0, 
then the flow of Field[x, y] = {m[x, y], n[x, y]} across C is from outside to inside.

T.5.c.i) Gradient fields

A vector field 
       Field[x, y] = {m[x, y], n[x, y]} 
is a gradient field if there is a function f[x, y] with 
       gradf[x, y] = Field[x, y].
You can be sure a vector field 
       Field[x, y] = {m[x, y], n[x, y]} 
is a gradient field if neither m[x, y] nor n[x, y] has singularities and
       D[m[x, y], y] = D[n[x, y], x].

T.5.c.ii)

If a vector field 
       Field[x, y] = {m[x, y], n[x, y]} 
is a gradient field, then for any closed curve C, you are guaranteed that
       (∮_( C)) m[x, y] dx +  
          n[x, y] dy = 0.
This tells you that the net flow of a gradient field along any closed curve is 0.

T.5.c.iii)

If a vector field
       Field[x, y] = {m[x, y], n[x, y]} 
is a gradient field, then for any curve C, the value of the path integral 
       (∫_( C)) m[x, y] dx +  
        n[x, y] dy 
depends on the location of the starting point of C and the location of the end point of C but does not depend on the specific path C takes as it runs from its start to its end.