Lab 5B - Line Integrals of Vector Fields
Math 2374 - University of Minnesota
http://www.math.umn.edu/math2374
Questions to: swenson@math.umn.edu

Introduction

In last week's lab, we looked at arc length.  You should remember from class that the arc length of a curve is calculated with a line integral: the arc length of the curve C is \(\(∫\_C\%\ \)1 ds\), which is the same as (∫_a^b)∥f'(t)∥dt when C is parametrized by f(t), a≤t≤b.  This time, we're looking at something which is related, but distinct: line integrals of vector fields.  You should clearly separate these two concepts in your mind, and ask yourself, each time you calculate a line integral, "What kind of function am I integrating?"  Your textbook often helps by writing line integrals of scalar functions with the differential "ds," and line integrals of vector fields with the differential "•  ds ."  Helpful, isn't it?  (Sigh... just because the bold s can be hard to see, we might occasionally write d(Overscript[s, ⇀])to indicate when the 's' represents a vector.  That's still not that different from the scalar case, though.)

On the other hand, you should not let yourself be confused by the symbols (∫_( C)) and (∮_( C))- they mean the same thing!  The (∫_( C)) symbol can always be used in place of (∮_( C)). We write (∮_( C)) when we want an extra reminder that C is a closed path (it ends at the same point where it began).  Of course, we don't write (∮_( C)) if C is not closed!

Finally, be forewarned that, in some books, "line integral" and "path integral" are synonymous, whereas other books call them "line integrals of vector fields" and "line integrals of scalar functions," respectively.  Ask your TA if you need help sorting this out.  In this lab we're working with the integrals of vector fields; recall from class and your textbook that these are typically used to measure Work.  For a vector field F and a curve parametrized by f(t), a  ≤  t  ≤  b, they are defined as:

\(∫\_C\%\ \)F·ds = (∫_a^b)F(f(t))·f'(t)dt

Example - Integration Using Mathematica

Here's a sample problem to illustrate some of the Mathematica commands we'll need this week.  You should evaluate each "evaluatable" cell as you come to it.

Calculate the integral \(∫\_C\%\ \)F·ds, where F(x,y,z)=((z^3), (y^2), x) and C is parametrized by f(t)=(t,sin(t),1), 0≤t≤π.

First, let's define and graph our functions.

F[x_, y_, z_] = {z^3, y^2, x};
f[t_] = {t, Sin[t], 1};

    
vf1 = 
      PlotVectorField3D[F[x, y, z], {x, 0, Pi}, {y, -1, 1}, {z, 0, 2}, 
        VectorHeads -> True]

    
c1 = ParametricPlot3D[f[t], {t, 0, Pi}]
Show[vf1, c1, Axes -> True, 
      AxesLabel -> {"X", "Y", "Z"}]

If you've grown to prefer an interactive view of things, evaluate the next cell.

ShowLive[vf1, c1, Axes -> True, 
      AxesLabel -> {"X", "Y", "Z"}]

Which direction does C go?  Look at the definition of f, and ask your TA if you're not sure.  Then evaluate the cell below to create an animation and check your answer.  (This is the same sort of animation that you created at the end of Lab 2A; ask your TA if you don't remember how to create and view them.)  Should we expect the value of \(∫\_C\%\ \)F·ds to be positive or negative?

PathAnimate3D[f[t], {t, 0, π}, 40]

Now that we know what we're working with, let's calculate.  By definition, \(∫\_C\%\ \)F·dx=(∫_a^b)F(f(t))·f'(t)dt, so we must first plug f into F, and find the derivative of f.  Here are the appropriate commands.

Apply[F, f[t]]
D[f[t], t]

Remember that we use the command Apply[F,f[t]], where you'd think that we could just use F[f[t]].  We mentioned before that this is because  Mathematica reads F[f[t]] as F[{t,Sin[t],1}], but what we really want is F[t,Sin[t],1]. Look closely until you see the difference!

Next, we need to take a dot product.  To do this, we just put a dot (a period) between the two vectors:

{1, Sin[t]^2, t} . {1, Cos[t], 0}

Finally, we integrate.

Integrate[1 + Cos[t] Sin[t]^2, {t, 0, Pi}]

The Gravitational Force, Near Earth

In this example, we consider the gravitational force field for small objects near Earth.  We approximate Earth by the xy-plane, and assume that the acceleration due to gravity is the constant g=9.8 (m/(s^2)).  Newton's first law of motion, F=ma, gives an expression for the gravitational force on an object: mg, where m is the mass of the object.  This force pulls straight down, so the gravitational force field is F(x,y,z)=(0, 0, -mg), which should not be a surprise.  Here's a graph, for a specific value of m.

m = 1;
g = 
        9.8;
 F[x_, y_, z_] = {0, 0, -m*g};

vf2 = 
      PlotVectorField3D[
        F[x, y, z], {x, -50, 50}, {y, -50, 50}, {z, -50, 50},  
        VectorHeads -> True, ScaleFactor -> Max, 
        ViewPoint -> {0, -3, 0}]

"Points for Style": Since we're picturing Earth as flat, it would make more sense for the gravitational force to stop at Earth's surface.  The If command will help (you can look it up in the Help Browser).  Try it by replacing the above definition of F with F[x_,y_,z_]:={0,0,-m*g}*If[(z≤0),0,1].

Let f(t), a≤t≤b, parametrize a curve C.  Then \(∫\_C\%\ \)F·dx represents the work done by gravity on a particle moving from the beginning of C to the end.  In other words, this is the gravitational potential energy that the particle loses (or "uses up") by following the curve C.  If you've studied physics, you should expect that this equals mgΔh = mg((Subscript[f, 3])(a)-(Subscript[f, 3])(b)), where f=((Subscript[f, 1]),(Subscript[f, 2]),(Subscript[f, 3])).  Let's prove this.

By definition, \(∫\_C\%\ \)F·ds=(∫_a^b)F(f(t))·f'(t)dt, and since F is constant, F(f(t)) is (0,0,-mg)=-mgk, where k=(0,0,1).  Then we have (∫_a^b)(-mgk)·f'(t)dt=-mg\(∫\_a\%b f\_3' \((t)\) dt\)=-mg\((\(f\_3\) \((b)\) - \(f\_3\) \((a)\))\), using the Fundamental Theorem of Calculus.

Exercise 1: Use Mathematica to check this calculation, for the path parametrized by f(t)=(50  (e^(-t)) cos(t), 
      50  (e^(-t)) sin(t),  (t^2) + 5  t), 0≤t≤5.  [Specifically: Use ParametricPlot3D and Show to plot the path and the vector field together, then evaluate the integral.  Finally, check that the answer is what you expected!  Use the values m=1, g=9.8, as given above.]

The Gravitational Force, Farther From Earth

Newton's law of gravitation shows how the force of Earth's gravity on an object diminishes as the object moves farther from Earth.  If the center of the earth is at the origin (0,0,0), then the exact formula is F(v)=\(\((GmM\/\(\(∥\)\(v\)\( ∥ \^2\)\))\) \((\(-\(v\/\(\(∥\)\(v\)\(∥\)\)\)\))\)\).

Here's what the letters mean:
F is the gravitational force; a vector
v is the position of the object -- the vector (x,y,z)
G is the universal gravitational constant, 6.67·(10^(-11))((N·(m^2))/((kg^2)))
m is the mass of the object
M is the mass of Earth, 5.98·(10^24)kg

In this formula, the first factor, (\(GmM\/\(\(∥\)\(v\)\( ∥ \^2\)\)\)), is a scalar, which measures how strong the gravitational force will be.  The second factor, \(TraditionalForm\`\((\(-\(v\/\(\(∥\)\(v\)\(∥\)\)\)\))\)\), is the unit vector pointing from the object toward Earth; naturally, this is the direction of the gravitational force!

Suppose that the position of our object at time t is given by f(t), a≤t≤b.  Then the work done by Earth's gravity between time a and time b is given by the integral (∫_C)F·dx, where C is the curve parametrized by f.

Exercise 2: Let C be parametrized by f(t)=(0,0,(R/(1 - t))), 0<t<1, where R is Earth's radius, 6.37·(10^6)m.
a) What are the endpoints of C -- where are they in space?
b) Calculate(∫_C)F·ds , the work done by Earth's gravity, as a TA with mass 90 kg travels along C.  [Hint: Your answer should be negative: this represents work against gravity.]
c) Calculate the work done by gravity as a Boeing 747-400 with mass 396890 kg climbs to a cruising altitude of 10000 m.  [Hint: you may use any path with initial height R and final height R+10000.]
d) Compare your answers to parts b) and c).  What could you do to the TA with the energy from 57,285 gallons of jet fuel?
[For airliner-related questions, see http://www.boeing.com/commercial/747family/technical.html.]

A Radical New Vector Field

In the first gravitational-force example, we found that the value of the line integral of the gravitational force field depended only on the heights of the endpoints.  The same is true in the second gravitational-force example, as Barr proves on pp. 289-290.  When a vector field's line integrals depend only on the endpoints (and not on the route connecting them), the vector field is called conservative.  From the first two examples, a person might get the idea that this always happens, but it's actually pretty rare.  In the following exercise, for example, F is not conservative (hence the title of this section).

Exercise 3: Let F(x,y,z)=(y,-x,z).  For each curve C: first, animate the curve using the PathAnimate3D and/or PathTangentAnimate3D commands. Then find the endpoints of the curve (specify which is the beginning and which is the end), and evaluate \(∫\_C\%\ \)F·ds.

a) C is the upper half of the unit circle in the xy-plane -- i.e. the half where y≥0.  [Hint: All points in the xy-plane have the same z-value -- what is it?]
b) C is parametrized by f(t)=(cos t, -sin t, sin 4t), 0≤t≤π.
c) C is contained in both the plane y=0 and the parabolic sheet z=(x^2) - 1; it begins at  x=1 and ends at x=-1.
d) C is parametrized by f(t)=(-t, (e^((((-1)/(1 - (t^2)))))) 
        cos (20  t), (e^((((-1)/(1 - (t^2)))))) 
        sin (20  t)), -1≤t≤1.  [Hint: This is a hard integral to compute, even for Mathematica.  Instead of using the command Integrate in this part, use NIntegrate, which approximates the value of the integral.  Notice that f(t) is not actually defined at the two endpoints, so you'll have to integrate from "close to -1" to "close to 1."  Try integrating from -.99 to .99, then -.999 to .999, and so on, to see if the values approach something.  Ask your TA about using limits to evaluate improper integrals if this doesn't seem familiar.]

Credits

This lab was written from scratch in 2002 by James Swenson.  In Spring 2004 Jonathan Rogness went through and updated a few minor things to reflect the use of our math2374.nb file.  (Fall 2004: a few minor updates and changed notation to match the new textbook.)

This lab is copyright 2002 by James Swenson (swenson@math.umn.edu) and is protected by the Creative Commons Attribution-NonCommercial-ShareAlike License.  You can find more information on this license at http://creativecommons.org/licenses/by-nc-sa/1.0/. 

Although it's not specifically required by the license, I'd appreciate it if you let me know at rogness@math.umn.edu if you use parts of our labs, just so I can keep track of it.  Please send me any questions or comments!