Line integrals are about moving in a vectorfield

Ivan Cnop
Vrije universiteit Brussel
icnop@vub.ac.be

Some examples

Load package

If necessary we have to load this package

<< Graphics`PlotField`

PlotVectorField[{Sin[x^2], Cos[y]},
             {x, 0, Pi}, {y, 0, Pi}]

Moving through this vector field

ParametricPlot[{(Sin[3 t] - t)/2 + 3,  
        Cos[2 t] +  .5 t +  .5}, {t,  .2, 4}]

Show[%, %%]

Conservative?

D[Sin[x^2], y] == D[Cos[y], x]

Gradient Vectorfield

Clear[f];

f[x_, y_] := -(x^2)  - (y^2) + 2

vectors = 
      PlotGradientField[f[x, y], {x, -3, 3}, {y, -3, 3}]

<< RealTime3D`

surface=Plot3D[
        f[x, y], {x, -3, 3}, {y, -3, 3}]

x[t_] := Sqrt[t] Cos[t]

y[t_] := Sqrt[t] Sin[t]

path = 
      ParametricPlot[{x[t], y[t]}, {t, 0, 8}, 
        AspectRatio -> Automatic]

Show[path, vectors]

lijn = 
      ParametricPlot3D[{x[t], y[t], f[x[t], y[t]]}, {t, 0, 8}]

Show[{surface, lijn}, BoxRatios -> {1, 1, 2}]

Spin this object to see how the path "climbs" to the top

Other vector fields

Check Help for  vector fields other than the gradient.
One of these is the Hamiltonian field:

spin = 
      PlotVectorField[{y, -x}, {x, -3, 3}, {y, -3, 3}]

Show[{path, spin}]

against = 
      PlotVectorField[{-y, +x}, {x, -3, 3}, {y, -3, 
          3}]

Show[{path, against}]