Line Integrals - FacStaff Home Page for CBU

Line Integrals
> restart:with(Student[VectorCalculus]):
To evaluate line integrals over standard curves, we use the LineInt command from the VectorCalculus
package. So as not to have to list the coordinates for each vector field, we set default vectorfield
coordinates using the SetCoordinates command.
> SetCoordinates( cartesian[x,y] );
cartesianx, y
We first consider the line integral of the vector fields 3 x K 4 y, x2 K y3 over the line segment from (3,6)
to (7, 13).
> LineInt( VectorField( <3*x-4*y,x^2-y^3> ), Line( <3,6>, <7,13> ) );
80687
K
12
We now look at the line integral of the same vector field over the circular arc of radius 2 centered at the
5p
2p
origin from
to
.
6
3
> C:=LineInt( VectorField( <3*x-4*y,x^2-y^3> ), Arc( Circle( <0,0>, 2
), 5*Pi/6, 2*Pi/3 ) );
26
4
C := K
C3 3 K
p
3
3
We next compute the circulation of the vector field yi - xj around the closed curve C composed of the
circular arc of radius 2 from (1,1) to (1,-1) (C1 ), the line segment from (1,-1) to (2,-2) (C2 ), the circular
arc of radius 2 2 from (2,-2) to (2,2) (C3 ), and the line segment from (2,2) to (1,1) (C4 ). We compute
the line integrals for the four curves separately, then sum.
> C1:=LineInt( VectorField( <y,-x> ), Arc( Circle( <0,0>, sqrt(2) ),
Pi/4, -Pi/4 ) );
C1 := p
> C2:=LineInt( VectorField( <y,-x> ), Line( <1,-1>, <2,-2> ) );
C2 := 0
> C3:=LineInt( VectorField( <y,-x> ), Arc( Circle( <0,0>, 2*sqrt(2)
), -Pi/4, Pi/4 ) );
C3 := K4 p
> C4:=LineInt( VectorField( <y,-x> ), Line( <2,2>, <1,1> ) );
C4 := 0
> C:=C1+C2+C3+C4;
C := K3 p
Next we look at integrating over the path of line segments from (0,0) to (1,1) to (1,-1) to (-2,-2).
> LineInt( VectorField( <4*x,-5*y> ), LineSegments( <0,0>, <1,1>, <1,
-1>, <-2,-2> ) );
K2
Here we look at integrating over the parametric representation of y = x2 from (0,0) to (2,4).
> LineInt( VectorField( <x^2,y^2> ), Path( <t,t^2>, t=0..2 ) );
24
Now we integrate over the circle or radius r centered at (a,b).
> LineInt( VectorField( <x-y,x+3*y> ), Circle( <a,b>, r ) );
2 p r2
x2
y2
x2
y2
C
= 1, entered in the form
C
K 1 (=0).
4
9
4
9
> LineInt( VectorField( <3*y,-x-y> ), Ellipse( x^2/4+y^2/9-1 ) );
K24 p
Now over the ellipse
For a final example, we move to 3 dimentions. We first reset our coordinates.
> SetCoordinates( 'cartesian'[x,y,z] );
cartesianx, y, z
The last parameter of Circle3D is a vector that is normal to the plane of the circle.
> LineInt( VectorField( <y,-x,z>), Circle3D( <a,b,c>, r, <a+1,b+1,
c+1> ) );
2 c C 1 r2 p
K
aC1 2 C bC1 2 C cC1 2
Using the output = plot option, you can visually represent the integral for a LineInt command before
solving the problem.
The LineInt command computes a line integral, which is also commonly known as a work integral.
The command has four domain types over which it can be integrated: Path, Line, LineSegments, and
Circle.
The Circle domain is available only in two dimensions, the others are available in two or three
dimensions.
Visually represent a line integral over an ellipse, and compute the integral. Note the direction of the
tangent vector.
> LineInt(VectorField(<y, -x>), Path(<5*cos(t), 3*sin(t)>, t = 0 ..
2*Pi), output = plot);
LineInt(VectorField(<y, -x>), Path(<5*cos(t), 3*sin(t)>, t = 0 ..
2*Pi));
3
y
2
1
K6
K4
K2
0
K1
2
4
6
x
K2
K3
Curve 1
Curve 2
Curve 3
Polygons 1
The path of integration, vector(s) tangent to the path, and vector-field
arrows
K30 p
To reverse the direction of the path (and tangent vector), reverse the endpoints of the parameter range in
the Path definition.
> LineInt(VectorField(<y, -x>), Path(<5*cos(t), 3*sin(t)>, t = 2*Pi .
. 0), output = plot);
LineInt(VectorField(<y, -x>), Path(<5*cos(t), 3*sin(t)>, t = 2*Pi .
. 0));
3
y
2
1
K6
K4
K2
0
K1
2
4
x
K2
K3
Curve 1
Curve 2
Curve 3
Polygons 1
The path of integration, vector(s) tangent to the path, and vector-field
arrows
30 p
6