Line/path integrals

> restart; with(LinearAlgebra): with(VectorCalculus):

Warning, the names &x, CrossProduct and DotProduct have been rebound

Warning, the assigned names <,> and <|> now have a global binding

Warning, these protected names have been redefined and unprotected: *, +, ., D, Vector, diff, int, limit, series

We have used line integrals in two fundamentally different forms, as an integral for scalar functions and as an integral for vector fields.  Maple distinguishes between these types and calls them path integrals and line integrals, respectively.

The path integral of a scalar function f(x,y,z) over a path r(t) is defined by

> r:= <x(t),y(t),z(t)>:

> int( f(x(t),y(t),z(t))*Norm(diff(r,t),2), t=a..b );

int(f(x(t), y(t), z(t))*(abs(diff(x(t), t))^2+abs(diff(y(t), t))^2+abs(diff(z(t), t))^2)^(1/2), t = (a .. b))

However, the VectorCalculus package makes this easier using PathInt.  For example,

> PathInt( z+(x*y)^2, [x,y,z]=Path(<cos(3*t),sin(3*t),4*t>,t=0..6*Pi), inert );

Int((4*t+cos(3*t)^2*sin(3*t)^2)*(16+9*sin(3*t)^2+9*cos(3*t)^2)^(1/2), t = (0 .. 6*Pi))

> value(%);

15/4*Pi+360*Pi^2

There are some nice predefined path types that save you from having to define a parameterization. For example,

> PathInt(x*y-z, [x,y,z]=LineSegments(<0,0,0>,<1,1,1>,<-1,-2,-3>), inert );

Int((t^2-t)*3^(1/2), t = (0 .. 1))+Int(((1-2*t)*(1-3*t)-1+4*t)*29^(1/2), t = (0 .. 1))

> PathInt( x^2+y^2, [x,y]=Circle(<1,1>,1), inert );

Int(((1+cos(t))^2+(1+sin(t))^2)*(sin(t)^2+cos(t)^2)^(1/2), t = (0 .. 2*Pi))

For integration of a vector field, use LineInt.  For example, to find work done by the force field

> F:= VectorField( <x^2*y,y^2*x>, 'cartesian'[x,y] );

F := Vector[column]([[x^2*y], [y^2*x]], [

over the parabola y=x^2 , between (-1,1) and (1,1), we would use

> LineInt( F, Path( <t,t^2>, t=-1..1 ), inert );

Int(t^4+2*t^6, t = (-1 .. 1))

> value(%);

34/35

Note that we could get the same thing manually by a regular integral of F . dr.

> r:=<t,t^2>:
int( evalVF(F,r) . diff(<t,t^2>,t), t=-1..1 );

34/35

Fundamental Theorem of Line Integrals

The FTLI says that for conservative fields, the potential can be used as an antiderivative to evaluate any line integral.  Here is a demonstration.

> SetCoordinates(cartesian[x,y,z]);

cartesian[x, y, z]

> F:= VectorField( <1+y+z, x+z, x+y> );

F := Vector[column]([[y+1+z], [x+z], [x+y]], [

> r:= t -> < t^3, sqrt(t), 2*t/(1+t) >;

r := proc (t) options operator, arrow; VectorCalculus:-<,>(t^3, sqrt(t), VectorCalculus:-*(VectorCalculus:-*(2, t), 1/VectorCalculus:-+(1, t))) end proc

> LineInt( F, Path(r(t),t=1..2) );

28/3*2^(1/2)+44/3

We now compare to the difference in values of the potential function at the endpoints.

> phi:= ScalarPotential(F);

phi := (y+1+z)*x+z*y

> phi:= unapply( phi,[x,y,z] );

phi := proc (x, y, z) options operator, arrow; (y+1+z)*x+z*y end proc

> A:= r(1);  B:= r(2);

A := Vector[column]([[1], [1], [1]], [

B := Vector[column]([[8], [2^(1/2)], [4/3]], [

> phi( B[1],B[2],B[3] ) - phi( A[1],A[2],A[3] );

28/3*2^(1/2)+44/3