Line Integrals

Recall from basic calculus that if a force f(x) acts from x=a to x=b the work done is the integral from a to b of f(x). If the work is done along a path, this brings us to the concept of line integral. You also know that work is f.x (dot product) . If we break up our curve r(t) into small segments dr and do f.dr on each segment and add them up, this is our total work. It is also the idea behing a line integral: Integrate f(r(t)).dr, where dr=r'(t)dt.

Another way of writing this is if f={f1,f2,f3} (or f1 i + f2 j +f3 k), and if we write x'(t)dt as dx, y'(t)dt as dy and z'(t)dt as dz, then we can write Integal of f(r).dr as
Integral of f1dx + f2dy + f3dz.

Let's try f(x,y)=2xy i+x^3 j on an upper semicircular path with radius 1.


  f[x_,y_]:={2 x y,x^3}


  r[t_]:={Cos[t],Sin[t]}


  D[r[t],t]


  arc=ParametricPlot[r[t],{t,0,Pi},AspectRatio->Automatic]


  f[r[t][[1]],r[t][[2]]].D[r[t],t]


  Integrate[f[r[t][[1]],r[t][[2]]].D[r[t],t],{t,0,Pi}]

It should be clear that if you follow the curve backwards, the integral is the negative of the integral following the curve forwards.


  Integrate[f[r[t][[1]],r[t][[2]]].D[r[t],t],{t,Pi,0}]

If your curve is made up of two or more curves pieced together, simply do each piece separately and add them up. Let's try the semicircle along with the "bottom line".


  r2[t_]:={t,0}
  bottomline=ParametricPlot[r2[t],{t,-1,1},
  PlotStyle->{RGBColor[1,0,0]}]
  


  Show[arc,bottomline]

Be careful. When integrating around this curve, we follow the semicircle counterclockwise (t from 0 to Pi) and the bottom line from -1 to 1.


  f[r2[t][[1]],r2[t][[2]]].D[r2[t],t]

Well, that certainly makes life easy. The line integral along r2 contributes nothing, so the line integral around arc+bottomline is the same as the line integral around arc.

This works the same way in three dimensions.

Up to Some Multivariable Calculus Ideas