Classroom Tips and Techniques: Stepwise Solutions in Maple - Part 3 - Vector Calculus
Robert J. Lopez
Emeritus Professor of Mathematics and Maple Fellow
Maplesoft
Introduction
In the preceding two articles (Stepwise Solutions in Maple - Part 1, Stepwise Solutions in Maple - Part 2 - Linear Algebra), we detailed the Maple tools for obtaining stepwise solutions of problems in algebra, calculus of one and several variables, and linear algebra. In this sequel, we detail the stepwise tools available in vector calculus.
These tools include eleven task templates for computing the flux of a vector field through curves and surfaces, nine task templates for iterated integration, and eight task templates for computing surface integrals. In addition, there is a task template for integrating a planar vector field, and a task template that provides access to the Multiple Integration Maplet, yet another interface to the modified int command in the VectorCalculus packages. Finally, there are two tutors, one for visualizing the Frenet-Serret formalism for a space curve, and one for visualizing a vector field.
But again, we point out that Maple "does" symbolic math, and can therefore be directed to implement the steps of nearly any algorithmic computation.
Integrate a Planar Vector Field
Table 1 shows the default application of the task template that integrates a planar vector field. Given the field, an integral curve (or flow line) is drawn through each point clicked on with the mouse. For any coordinate system chosen, the Cartesian coordinates of the point selected are written in the relevant window.
Tools_Tasks_Browse: Vector Calculus_Vector Fields_Integrate Planar Vector Field
Integrate Planar Vector Field
Plot Window
,
Vector Field
Component 1:
Component 2:
Coordinates
System: Variables:
Path Parameter
Table 1 Interactive integration a planar vector field - flow lines drawn through each point clicked on
Flux through a Plane Curve
The Flux command in the VectorCalculus package computes flux of a vector field through curves and surfaces. The syntax for this command varies for each of the four distinct curves it recognizes (circle, ellipse, line segment, polygonal line), and for the general parametrically defined curve. The following four task templates provide simplified interfaces to the Flux command in each of these cases.
Circle
Table 2 shows the calculation of the flux of the Cartesian vector field through the circle with center and radius 2.
Tools_Tasks_Browse: Vector Calculus_Integration_Flux_2-D_Through a Circle
Flux through a Circle
Center :
Radius:
Table 2 Flux through a circle computed by task template
Ellipse
Table 3 shows the calculation of the flux of the Cartesian vector field through the ellipse whose equation is .
Tools_Tasks_Browse: Vector Calculus_Integration_Flux_2-D_Through an Ellipse
Flux through an Ellipse
Table 3 Flux through an ellipse computed by task template
Line Segment or Polygonal Line
Table 4 shows the calculation of the flux of the Cartesian vector field through a polygonal line determined by three nodes. If only two nodes are given, the flux through the line segment these nodes determine will be computed. The integral that is displayed shows how the line segments are parametrized. If the Simplify button is pressed, a single integral results, which is simpler to evaluate but harder to interpret.
Tools_Tasks_Browse: Vector Calculus_Integration_Flux_2-D_Through a Polygonal Line
Flux through a Polygonal Line
Table 4 Flux through a polygonal line computed by task template
General Plane Curve
Table 5 shows the calculation of the flux of the Cartesian vector field through the curve .
Tools_Tasks_Browse: Vector Calculus_Integration_Flux_2-D_Through a Plane Curve
Table 5 Flux through an arbitrary plane curve computed by task template
Flux through a Surface
The Flux command in the VectorCalculus package computes flux of a vector field through curves and surfaces. The syntax for this command varies for each of the two distinct closed surfaces it recognizes (box, sphere), and for the general parametrically defined surface. For such surfaces there are three specific domains the command recognizes (disk, ellipse, triangle), in addition to the general planar domain.
The following seven task templates provide simplified interfaces to the Flux command in each of these cases.
Box
Table 6 shows the calculation of the flux of the field through the box defined by .
Tools_Tasks_Browse: Vector Calculus_Integration_Flux_3-D_Through a Box
Flux through a Box
For the Vector Field:
Table 6 Flux through a box whose sides are parallel to the coordinate planes
Sphere
Table 7 shows the calculation of the flux of the field through the sphere with center and radius 3.
Tools_Tasks_Browse: Vector Calculus_Integration_Flux_3-D_Through a Sphere
Flux through a Sphere
Table 7 Flux through a sphere computed by task template
Parametric Surface
Table 8 shows the calculation of the flux of the field through the surface whose domain is the planar region defined by . In this formulation, the surface parameters are and .
Tools_Tasks_Browse: Vector Calculus_Integration_Flux_3-D_Through a Parametric Surface
Flux through a Parametrically Defined Surface
Table 8 Flux through a parametrically defined surface
Surface Defined over a Disk
Table 9 shows the calculation of the flux of the field through the surface whose domain is the disk with center and radius 3. In this formulation, the surface parameters are and , but in the flux integral, coordinates are automatically changed to polar to accommodate the domain of the surface.
Tools_Tasks_Browse: Vector Calculus_Integration_Flux_3-D_Through a Surface Defined over a Disk
Flux through a Surface Defined over a Disk
Table 9 Flux through a surface defined over a disk
Surface Defined over an Ellipse
Table 10 shows the calculation of the flux of the field through the surface whose domain is the interior of the ellipse . In this formulation, the surface parameters are and , but in the flux integral, coordinates are automatically changed to polar to accommodate the domain of the surface. Unfortunately, although the Flux integral is written in polar coordinates, Maple uses for and for .
Tools_Tasks_Browse:
Vector Calculus_Integration_Flux_3-D_Through a Surface Defined over an Ellipse
Flux through a Surface Defined over Interior of an Ellipse
Table 10 Flux through a surface defined over the interior of an ellipse
Surface Defined over a Triangle
Table 11 shows the calculation of the flux of the field through the surface whose domain is the interior of the triangle whose vertices are . In this formulation, the surface parameters are and .
Tools_Tasks_Browse: Vector Calculus_Integration_Flux_3-D_Through a Surface Defined over a Triangle
Flux through a Surface Defined over a Triangle
Table 11 Flux through a surface defined over the interior of a triangle
Surface Defined over a General Planar Region
Table 12 shows the calculation of the flux of the field through the surface whose domain is the planar region defined by . In this formulation, the surface parameters are and .
Vector Calculus_Integration_Flux_3-D_Through a Surface Defined over a Planar Region
Flux through a Surface Defined over a General Planar Region
Table 12 Flux through a surface defined over an arbitrary planar region
The astute reader will notice a similarity between the calculations in Tables 12 and 8. However, the task template in Table 8 is more general in that it provided for the definition of the surface in more than just the Cartesian coordinate system.
Surface Integration
Closely related to surface flux calculations implemented by the Flux command, Maple's VectorCalculus packages have a SurfaceInt command for computing surface integrals. Surface flux is just the surface integral of the normal component of a vector field on a surface. The Flux command determines both that normal component and the element of surface area. The SurfaceInt command computes the surface integral of a scalar, and to do so it determines the appropriate surface-area element.
As for the Flux command, the SurfaceInt command recognizes the box and sphere as closed surfaces, and provides for integration over surfaces defined on a disk, ellipse, rectangle, triangle, or arbitrary planar region.
Table 13 contains a task template used to compute the surface integral of the scalar function over the surface of the box . There are six surfaces to consider, and the underlying SurfaceInt command pairs parallel faces of the box, so only three separate integrals appear.
Tools_Tasks_Browse: Vector Calculus_Integration_Surface Integration_Over a Box
Surface Integral on a Box in
Integrand
Table 13 Surface integral of a scalar field over the surface of a box
Table 14 contains a task template used to compute the surface integral of the scalar function over the surface of the sphere with radius 3 and center . The SurfaceInt command automatically writes the integral in spherical coordinates where is the angle measured down from the positive -axis, and is the angle measured around that axis. Note that , the surface-area element in spherical coordinates, is automatically inserted into the integrand.
Surface Integral on a Sphere
Sphere Radius:
Sphere Center:
Table 14 Surface integral of a scalar field over the surface of a sphere
Table 15 contains a task template used to compute the surface integral of the scalar function over the surface whose domain is the planar region bounded by the curves and .
Surface Integral on a Surface Defined Parametrically
Table 15 Surface integral of a scalar field over a surface defined parametrically
Notice the surface-area element in the integrand. Because of this, Maple can evaluate the inner integral analytically, but the resulting outer integral has to be evaluated numerically. Surface integrals are some of the most difficult integrals in calculus to evaluate in closed form.
Surface Defined over a Rectangle
Table 16 contains a task template used to compute the surface integral of the scalar function over the surface whose domain is the rectangle .
Surface Integral on a Surface Defined over a Rectangle
Surface
Rectangle
Table 16 Surface integral of a scalar field over a surface defined on a rectangle
Table 17 contains a task template used to compute the surface integral of the scalar function over the surface whose domain is the disk with center and radius 3.
Surface Integral on a Surface Defined over a Disk
From to
Table 17 Surface integral of a scalar field over a surface defined on a disk
Maple spends at least five minutes trying to evaluate this integral in closed form, but never succeeds. The calculation was stopped by pressing the Interrupt icon (hexagonal stop-sign with hand superimposed) in the toolbar. The numeric approximation of the integral was obtained by pressing the Floating-Point Approximation button. As has been noted earlier, surface integrals are some of the most difficult integrals in calculus to evaluate in closed form.
Table 18 contains a task template used to compute the surface integral of the scalar function over the surface whose domain is the interior of the ellipse . As with the computation of flux, the surface parameters are and , but in the SurfaceInt integral, coordinates are automatically changed to polar to accommodate the domain of the surface.
Surface Integral on a Surface Defined over an Ellipse
Equation of Ellipse:
Table 18 Surface integral of a scalar field over a surface defined on the interior of an ellipse
The inner integral can be evaluated analytically, but the resulting outer integral can only be evaluated numerically.
Table 19 contains a task template used to compute the surface integral of the scalar function over the surface whose domain is the interior of the triangle with vertices .
Surface Integral on a Surface Defined over a Triangle
Triangle
Vertices
Table 19 Surface integral of a scalar field over a surface defined over the interior of a triangle
The inner integrals can be evaluated exactly, the resulting outer integrals can only be evaluated numerically. The underlying SurfaceInt command writes the integral as a sum because the triangular domain cannot be swept with a single multiple integral. From the limits of integration on the displayed integrals, it would be possible to infer the equations for the lines making up the sides of the triangle.
Table 20 contains a task template used to compute the surface integral of the scalar function
over the surface whose domain is the first-quadrant region bounded by the curves . The task template provides the option for integrating in either order, that is, , or .
Surface Integral on a Surface Defined over a General 2-D Region
Table 20 Surface integral of a scalar field over a surface defined on a general planar region
The inner integral can be evaluated exactly, but the resulting outer integral can only be evaluated numerically.
Double Integrals
In the VectorCalculus packages, the int command was modified with special syntax to make writing multiple integrals easier. Thus, the iterated integral
can be constructed at top-level with either of the commands shown in Table 36.
Table 21 Top-level ways for writing an iterated double integral
Integration carried out with the syntax on the right in Table 21 is more robust that that on the left. Corresponding to the older usage on the left of Table 21, we have the special VectorCalculus syntax
The inert integral is generated by adding the optional parameter "inert" to the modified int command. In addition, the special domains of rectangle, disk, ellipse, and triangle are recognized, along with provision for formulating a double integral over a general planar region. These integrations are implemented in the following task templates.
Table 22 contains a task template used to compute the integral of the function over the rectangle .
Tools_Tasks_Browse: Vector Calculus_Integration_Multiple Integration_2-D_Over a Rectangle
Integrate over a Rectangle
Inner Integral: Outer Integral:
Table 22 Iterated double integral over a rectangular domain
Disk
Table 23 contains a task template used to compute the integral of the function over a disk with center and radius 3.
Tools_Tasks_Browse: Vector Calculus_Integration_Multiple Integration_2-D_Over a Circle
Integrate over a Circle
Center : , Radius =
Table 23 Iterated double integral over the disk with center and radius 3
Table 24 contains a task template used to compute the integral of the function over the interior of the ellipse .
Tools_Tasks_Browse: Vector Calculus_Integration_Multiple Integration_2-D_Over an Ellipse
Integrate over an Ellipse
Equation of ellipse:
Table 24 Iterated double integral over an elliptic domain
Table 25 contains a task template used to compute the integral of the function over the interior of the triangle whose vertices are .
Integrate over a Triangle
Table 25 Iterated double integral over the interior of a triangle
General Planar Region
Table 26 contains a task template used to compute the integral of the function over that portion of the first-quadrant bounded by the curves and .
Integrate over a General Region
Table 26 Iterated double integral over a planar region with curved boundaries
Triple Integrals
In the VectorCalculus packages, the modified int command supports integration over a cube, sphere, and tetrahedron, and over a general three-dimensional region. The following task templates implement these integrations.
Cube
Table 27 contains a task template used to compute the integral of the function over the cube .
Tools_Tasks_Browse: Vector Calculus_Integration_Multiple Integration_3-D_Over a Cube
Integrate over a Cube
Table 27 Iterated triple integral over a cube in
Table 28 contains a task template used to compute the integral of the function over the sphere with center and radius 4.
Tools_Tasks_Browse: Vector Calculus_Integration_Multiple Integration_3-D_Over a Sphere
Integrate over a Sphere
Center : , , Radius =
Table 28 Iterated triple integral over a sphere in
Tetrahedron
Table 29 contains a task template used to compute the integral of the function over the interior of a tetrahedron with vertices .
Integrate over a Tetrahedron
Table 29 Iterated triple integral over a tetrahedron in
General 3-D Region
Table 30 contains a task template used to compute the integral of the function over the first-octant region bounded by the surfaces and , lying inside the cylinder whose cross-section is bounded by the curves and .
Table 30 Iterated triple integral over a general region in
Multiple Integration Maplet
The Multiple Integration Maplet provides alternative access to the int command as modified in the VectorCalculus packages. Table 46 contains the "minimal content" of the task template. The "default content" would include the Extended Help section, which we have placed here, outside of Table 46.
Extended Help
The Multiple Integration Maplet provides simplified access to the int command as modified in the VectorCalculus packages. These modifications allow int to create multiple (iterated) integrals, both active and inert. A number of pre-defined regions of integration are known to the command, which also admits user-defined domains.
The Maplet, accessed from the task template shown in Table 31, contains three panels. The initial panel is shown in Figure 1.
Figure 1 Initial panel for the Multiple Integration Maplet
An integrand is entered in the field designated as "Function =".
By default, the Maplet expects a triple integral, but this can be changed by clicking on the 2D button to the right of "Dimensions."
The variables of integration are entered in the fields to the right of (or in the 2D case). Thus, if integration is over a disk, the underlying int command will switch to polar coordinates, with the first variable being the radial coordinate. (For such cases, int will automatically include the appropriate Jacobian.)
Regions of integration are accessed by clicking on the "Edit 3D Region" or "Edit 2D Region" buttons. The panels that open are shown in Figures 2 and 3, respectively.
Figure 2 Regions of integration for triple integrals
Figure 3 Regions of integration for double integrals
Three pre-defined 3D regions are recognized, namely, the sphere, parallelepiped, and the tetrahedron. The general 3D region is entered by providing appropriate bounding functions in the section designated by "3D Region."
Four pre-defined 2D regions are recognized, namely, the triangle, rectangle, circle, and the ellipse. Clearly, by "circle" is meant the closure, or more appropriately, the disk. Both the circle and ellipse can be subdivided by choosing the Sector option. The general 2D region is entered by providing appropriate bounding functions in the section designated by "2D Region."
Briefly, there are two panels that have to be filled out for a calculation by this maplet. However, the cases of two- and three-dimensional regions are separated, so there are three possible panels that can open when using this maplet.
Tools_Tasks_Browse: Vector Calculus_Integration_Multiple Integration Maplet
To launch the Multiple Integration Maplet, click the button to the right.
An abbreviated Help file is available from within the Maplet.
Extended help is available in the attached collapsed section.
Inserting Minimal Content excludes the Extended Help section.
Inserting Default Content includes the Extended Help section.
Table 31 The Multiple Integration Maplet accessed by task template
For example, to integrate over the planar region bounded by the curves and , fill in the secondary panel as shown in Table 32.
Table 32 Secondary panel for Multiple Integration Maplet
The initial panel for the maplet is show in Table 33. The function is entered, the variables and are entered, the 2D radio button is selected, and the panel shown in Table 32 appears. The 2D Region radio button is selected in that panel, and the bounds describing the planar region are entered.
Table 33 Initial panel for the Multiple Integration Maplet
After the secondary panel is closed, the Display Integral and Symbolic Evaluation buttons are pressed. Note the explicit display of the relevant int command at the bottom of the primary panel.
There is one shortcoming of the Multiple Integration Maplet that the task templates in Tables 23, 24, and 28 overcome. Suppose, for example, the integral of over the unit sphere centered at the origin is to be computed. The Multiple Integration Maplet would construct the integral
and display the command
int(z, [x, y, z] = Sphere(<0, 0, 0>, 1), inert)
The letters in the list are interpreted by Maple as , respectively. The volume element has correctly been included, and the variable has correctly been converted to spherical coordinates: . Given that the integration variables are actually , the desired integral has been properly constructed.
To display the integral
requires the syntax
but unfortunately, the Multiple Integration Maplet does not have provision for the option of including a list of variable names within the definition of the region of integration.
Space Curves Tutor
The Space Curves tutor is an interface to the Frenet-Serret formalism for plane and space curves. Thus, given such a curve, the tutor draws the curve and plots the triad of tangent, principal normal, and binormal vectors. These frames can be animated to move along the curve. Any one of these three vectors can be isolated and graphed along the curve. For space curves, the osculating circle and the torsion are graphed, and for any curve, the curvature is graphed.
Table 34 shows the default space curve for this tutor.
Table 34 Space Curves tutor and its default space curve
We have modified the settings slightly. Instead of the default 5 frames, we have chosen just 1, and have used the Plot Options button to change the axis style to "frame" rather than the default "normal." The unit tangent vector is drawn in blue; the unit (principal) normal, in green; and the unit binormal, in magenta.
Of course, the Frenet-Serret formalism is also available in the Context Menu, which contains the options TNB Frame, Tangent Vector, Principal Normal, Binormal Vector, Curvature, Torsion, and Radius of Curvature.
It is also possible to implement these calculations stepwise, from first principles, as we summarize in Table 35.
Initialize
Loading VectorCalculus
Define curve
Unit tangent vector
Curvature
Principal Normal
Binormal
Torsion
Table 35 Frenet-Serret formalism stepwise, by first principles
Vector Fields Tutor
Table 36 contains an image of the Vector Fields tutor where we have changed the default three-dimensional vector field to a planar field. The tutor draws the arrows of the field and one flow line, and integral curve for the field emanating from a given initial point. The graph is generated by the FlowLine command of the Student VectorCalculus package.
Table 36 The Vector Fields tutor
To modify the graph produced by the tutor, it is necessary to invoke the FlowLine command and impose the options inherited from the fieldplot command of the plots package. Table 37 shows what can be done to the plot working outside the tutor.
Table 37 Illustration of the FlowLine command with options
Table 38 illustrates the integration of the same vector field via a task template.
Table 38 Integration of a vector field via task template
After entering the data for the field and the window in which it would be displayed, a flow line is generated by clicking on the point through which it must pass. Multiple flow lines can be drawn on the same direction field, and the coordinates of the point clicked on and through which the flow line passes are displayed.
It is possible to integrate the flow line in both directions, as is done in Table 38.
Legal Notice: © Maplesoft, a division of Waterloo Maple Inc. 2010. Maplesoft and Maple are trademarks of Waterloo Maple Inc. This application may contain errors and Maplesoft is not liable for any damages resulting from the use of this material. This application is intended for non-commercial, non-profit use only. Contact Maplesoft for permission if you wish to use this application in for-profit activities.