Physics[Vectors][int] - extend the int command to also compute path, surface, and volume integrals from the mathematical representation of the region, vectorial, parametric or as a set of expressions relating the coordinates to each other
int(F, r_ = A .. B, path = C)
int(F, r_, path = C, parameter = [t = a..b])
int(F, r_ = C, parameter = [t = a..b])
int(F, r_ = A .. B, path = C, kind = crossproduct)
int(F, S_, surface = C, parameters = [u = a..b, v = c..d])
int(F, S_ = C, parameters = [u = a..b, v = c..d])
int(F, S_, parameters = [u = a..b, v = c..d], kind = crossproduct)
int(F, V, volume = C, parameters = [u = a..b, v = c..d, w = c..d])
int(F, V = C, parameters = [u = a..b, v = c..d, w = c..d])
F or F_
the integrand, can be an algebraic scalar expression F, or a vector function F_ (to represent vector functions see notation)
the mathematical formulation for the region of integration; it could be a vector function representation - of a curve, surface, or volume - or an algebraic equation relating the coordinates, or any region's representation as a set or list of such relations, solved or not for the coordinates in terms of parameters.
r_ = A..B
the global symbol r_ (not another symbol), representing the position vector, whose differential dr→ is the line element of the integration path. On the right-hand side A and B represent the initial and final points of the path C of integration and can be omitted when the parameter option is used and includes the parameter's range of integration.
r_ = C
in this case the right-hand side is itself the region of integration C and the argument path = C can be omitted.
the global symbol S_ (not another symbol); dS→ represents the surface element of the surface of integration.
S_ = C
in this case the right-hand side is itself the region of integration C and the argument surface = C can be omitted.
the global symbol V (not another symbol); dV represents the volume element of the volume of integration.
V = C
in this case the right-hand side is itself the region of integration C and the argument volume = C can be omitted.
path = C
synonym curve = C, together with using the symbol r_ as integration variable, it indicates that the integral is a 1-dimensional path integral
surface = C
together with using the symbol S_ as integration variable, indicates that the integral is a 2-dimensional surface integral
volume = C
together with using the symbol V as integration variable, indicates that the integral is a 3-dimensional volume integral
kind = crossproduct
indicates that the integrand is the cross product of the vector function F_ (the first argument to int) with the line or surface elements dr→ or dS→
parameters = ...
synonym parameter, optional for line integrals, mandatory for surface and volume integrals, the right-hand side is a list with the parameters and their ranges specifying the region of integration, e.g. in the case of surface integrals [u = a..b, v = c..d]. In the case of path integrals, the right-hand side can also be only the parameter, without its range, provide that the integration limits A and B are given.
optional, when passed it makes int return the integral expressed in terms of the parameters but before performing the integration, as an inert Int function call
The int command of the Vectors package extends the Maple int command to also compute vector integrals; these are path, surface, or volume integrals, where the integrand is a scalar or vector function, and starting from any region's description (algebraic, parametric, vectorial). In the context of the Physics Vectors package, vectors are names that end with the underscore _ and vector functions are functions where the name ends with the underscore _.
There are three kinds of line or path integrals:
where A→ and B→ are points in space, the limits of integration, that belong to the curve C over which the integral is performed. In the first integral, F is a scalar function and the result of the integration is thus a vector. In the second and third integrals the integrand F→ is a vector function, so that the dot product F→·dr→ is a scalar and so is the integral, while in the third one F→×dr→ is a vector and so is its integration over the region C.
Likewise, there are three kinds of surface integrals
and two types of volume integrals
The conventions to represent these integrals are those of the standard int Maple command, extended to handle vector integrals as follows:
The first argument - the integrand - can be a scalar function, say F, or a vector function F→, in which case, for line and surface integrals, where the element of integration is also a vector, the integral is understood as the integral of their scalar product e.g. F→·dr→ for line integrals. If the optional argument kind = crossproduct is passed, the integral is understood as the integral of the cross product e.g. F→×dS→ for surface integrals.
The second argument, the integration variable, also indicates the kind of integration - line (path), surface, or volume - by respectively using the global names r_, S_, or V, so that dr→ is a line element, dS→ a surface element and dV a volume element. In the case of path integrals, the second argument can include the range as in r_ = A_ .. B_ where A_ and B_ represent two points in space that belong to the integration curve C.
The region of integration is indicated as region = ... where region is the keyword path or curve for line integrals, and surface and volume for surface and volume integrals. The right-hand side of region = ... specifies the region of integration as a vector function or as an equation relating the coordinates, or as a set or list of them. That specification is used by int to derive parametric equations representing the region using the ParametrizeCurve, ParametrizeSurface, and ParametrizeVolume commands. Alternative ways of specifying the region of integration are discussed in the Examples section.
The parameters and their ranges covering the region of integration, are required in the case of surface and volume integrals. Indicating the parameter, or its range, are both optional in the case of line integrals and, when the range is not passed, the integration limits are required expressed as two points A→ and B→. When these two points are one and the same, it is understood to be a closed path of integration. The parameters can also be indicated as functionality of the coordinates, for example using x⁡t instead of just x when indicating the integration region C.
The limits of integration A→ and B→ in path integrals must be points of the integration path and can be represented using the notation for algebraic vectors of the Vectors package, as a sum of terms where each one is the product of a unit vector times some coefficient, or as a list with the three components of the vector.
You can use a shortcut notation for all of path, surface, and volume integrals, consisting of passing the second argument as an equation having integration variable (r_, S_, or V) on the left-hand side, and the region of integration C on the right-hand side. In those cases, the argument region = C where region is one of path, surface, or volume becomes redundant and can be omitted.
The line element dr→ in path integrals is expressed in terms of a parameter t as
Using indexed notation for derivatives r→u=∂∂ur→⁡u,v, the surface element dS→ in surface integrals is expressed in terms of parameters as
and the volume element dV in volume integrals as
Since both dS→ and dV involve a cross product, there is a sign that depends on the ordering of the parameters u,v,w. To have control over that sign, the parameters on the right-hand side of parameters = ... are expected as an ordered list.
The integrals in the three cases are computed by first expressing the integrand and the integration element in terms of the parameters using the parametric equations derived with ParametrizeCurve, ParametrizeSurface, and ParametrizeVolume, then performing the vector product operations, then the integration. Passing the optional argument inert, the last integration step is not performed and a result is returned using the inert function Int.
Consider the following scalar function F, path C and integration limits A→ and B→
F ≔ x⁢y
C ≔ y=x2,z=0
A_ ≔ 0,0,0
B_ ≔ 1,1,0
The line or path integral, shown here in inert form on the left-hand side and active, computed to the end on the right-hand side, is
Note that the output on the right-hand side is a vector. Within int, to perform this integration the curve C=y=x2,z=0 is first parametrized using ParametrizeCurve
The output above is a sequence, first the parametric equations as an ordered list (order x,y,z) then the parameter, in this case t. For the formulation of the integral to make sense, the limits of integration A→ and B→ must belong to this curve, i.e. satisfy the parametric equations for some value of the parameter, in this case t=0 and t=1
To see the integral after being parametrized and before performing the integration use the option inert
Since there is a relation one-to-one between the integration limits A→ and B→ and the parameter's range, instead of indicating A→ and B→ you can also indicate the range of t itself, getting the same result (7)
When the parameter's range is passed, you can also use a shortcut notation, passing the second argument as an equation r_ = C, making more explicit that r_ is the vector representation of region of integration, so the line element dr→ is the differential of the parametric equations of C. In this case indicating path = C is redundant and can be omitted.
The integration path and the limits of integration can be expressed in vector notation as well
C_ ≔ x⁢_i+x2⁢_j
A_ ≔ 0
B_ ≔ _i+_j
The following C represents a circle of radius a on the x,y plane
C ≔ x2+y2=a2,z=0
To perform a path integral over this curve, the curve is first parametrized as
Checking the form of the parametrization returned is useful when using the parameter = a..b option to understand what the values of a and b need to be. From the above we see that for φ=0..π2, the limits of integration A→ and B→ are
A_ ≔ a⁢_i
B_ ≔ a⁢_j
So for the following integrand, we have (in the context of int, the keywords curve and path are synonyms)
F ≔ 1
An example having for integrand a vector function F→, also expressing the path using vector notation
F_ ≔ x2⁢_i+y⁢_j+x⁢y⁢z⁢_k
C_ ≔ x⁢_i+_j+_k
Integrate over this curve from the origin to the point i∧+j∧+k∧. To represent a point whose three coordinates are equal, you can use a list with three equal values or, as a shortcut notation, use the single value of the three coordinates. So instead of 0,0,0 you can use 0 and instead of 1,1,1 you can use 1
A_,B_ ≔ 0,1
When the integrand is a vector function, int computes the integral of the dot product F→·dr→ over the given curve, resulting in a scalar value
To compute the integral of the cross product F→×dr→ use the option kind = crossproduct. In this example, we can see that the value of the parameter t for which the points A→ and B→ satisfy the parametric equations are t=0 and t=1. Knowing those values allows for passing this information directly and omit the integration limits A→ and B→
The case of a straight line that passes through two given points is special: in addition to handling any mathematical formulation of a line, ParametrizeCurve can also compute the parametric equations directly from the coordinates of those two points. For example
P__1 ≔ 2⁢_i−3⁢_j+4⁢_k
P__2 ≔ −4⁢_i+2⁢_j−_k
we have (in the computational context of ParametrizeCurve, line and straightline are synonyms)
Likewise, int can compute path integrals over a straight line that passes through two points in the same way. Take for instance as integration limits the points that satisfy this line for t=5 and t=−5
A_ ≔ 16⁢_i5−4⁢_j+5⁢_k
B_ ≔ −44⁢_i5+6⁢_j−5⁢_k
Consider integrating over a path C that consists of three line segments, say C1,C2,C3, connecting the origin with the point 1,1,1 via 0,0,0⁢→⁢1,0,0⁢→⁢1,1,0⁢→⁢1,1,1, so first a translation along the x axis only, then one along the y axis, then one along the z axis.
One way of performing this computation is to make three calls to int, passing each of the three different paths C1,C2,C3 then add the results. Another way, significantly simpler, is using the path=linesegments⁡.... First one path at a time: the vectorial representations of these paths and the three computations are as follows:
C__1_ ≔ x⁢_i
A_,B_ ≔ 0,_i
C__2_ ≔ _i+y⁢_j
A_,B_ ≔ B_,B_+_j
C__3_ ≔ _i+_j+z⁢_k
A_,B_ ≔ B_,B_+_k
These three steps can be compacted into one using path=linesegments⁡...
Moreover, note that this integral from 0 to 1,1,1=i∧+j∧+k∧ depends on the path of integration. To see that, compute the same integral over the straight line that joins these two points:
So 132 instead of 43. The reason for that: the curl of F→ is not zero
therefore, the path integral from A→ to B→ depends on the path. Note as well that when there are only two points, the path=linesegment⁡A→,B→ notation is equivalent to r→=A→..B→,path=line⁡A→,B→ so the integral above can also be expressed as
Consider the same computation over two different paths in a case where the curl of F→ is equal to zero; take for instance F→ to be equal to the position vector itself
F_ ≔ x⁢_i+y⁢_j+z⁢_k
Now the integral does not depend on the path:
You can indicate that the line integral is around a closed curve in two different ways: passing the initial and final points (integration limits) A→ and B→ such that A→=B→, or entirely omitting the integration limits and passing a range for the parameter such that the curve is closed. The following represents a circle on the x,y plane
Integrate the vectorial line element dr→ around the whole circle using the two mentioned ways of representing a closed curve. From symmetry considerations, this integral should be equal to 0: we are adding infinitesimal vectorial line elements tangent to the circle around all of it: the contributions of the upper half cancel those of the lower half. Start and finish the integration at the point a,0,0
These are the contributions of the upper half only
Take now F→=r→, the position vector, and integrate the cross product F→×dr→ around the circle C: this time, at each point of the circle, F→×dr→ is perpendicular to the plane x,y, in the k∧ direction, so there are no cancellations, everything adds. Here again start and finish the integration at the point a,0,0
Surface and Volume integrals
The case of surface and volume integrals is analogous to that of line (path) integrals, but for two things: instead of one, there are two or three parameters, and instead of indicating integration limits, it is required that you indicate the parameter's ranges.
The following C represents the surface of a sphere of radius a centered at the origin
C__2 ≔ x2+y2+z2=a2
From the definition of the vectorial surface element as
dS→ is a vector perpendicular to the surface of the sphere. Hence, the vectorial surface integral of dS→ over the upper half of the sphere should be a vector perpendicular to the plane x,y in the k∧ direction. Also, checking the form of the parametrization returned by ParametrizeSurface is useful to understand what the ranges for parameters θ and φ need to be to represent the desired region.
From symmetry considerations, the integral of dS→ over the lower half of the sphere should have the same magnitude but opposite direction (−k∧), from where the integral over the whole sphere, so for θ=0..π, should be equal to 0
From this example we see that to get the area computing the integral of dS→ over the whole surface it is necessary to take as integrand the modulus of dS→, that is its scalar product with a unit vector parallel to it. By definition of surface element (see the Description) that unit vector is given by
r→⁡θ,φ⁢will now be displayed as⁢r→
n_ ≔ ∂∂θ⁢r_⁡θ,φ &x ∂∂φ⁢r_⁡θ,φNorm⁡∂∂θ⁢r_⁡θ,φ &x ∂∂φ⁢r_⁡θ,φ
where r→ is the vectorial form of the parametric equations of the surface. It is easy to see this vector is the radial unit vector r∧. For that purpose you can use the option output = vector of ParametrizeSurface to get the vectorial form of the parametric equations for C2
Introduce this value of r→ into the expression for n→ and change basis to spherical
n_ ≔ n_r_⁡θ,φ=1|n_r_⁡θ,φ=1
n_ ≔ ChangeBasis⁡n_,spherical
Putting all together, the area of a sphere of radius a is given by this closed surface integral
You can also use a shortcut notation for surface integrals passing the second argument as an equation S_ = C, making more explicit that S_ is the vector representation of the surface. In this case indicating surface = C is redundant and can be omitted.
In the case of the volume of a sphere, an algebraic representation of the region is
C__3 ≔ x2+y2+z2=r2
from where the volume of a sphere of radius a is equal to the integral of the corresponding dV=r→u·r→v×r→w⁢du⁢dv⁢dw with parameters r=0..a, θ=0..π and φ=0..2⁢π
Using ParametrizeVolume one can also see that the vectorial representation of this region is just the position vector r→ written in spherical coordinates and basis
so one can use this simpler vectorial representation of the sphere as well
You can also use a shortcut notation for volume integrals passing the second argument as an equation V = C, making more explicit that V is the specified volume of integration C. In this case indicating volume = C is redundant and can be omitted.
ChangeBasis, ChangeCoordinates, convert,VectorCalculus, Identify, int, notation, operations, ParametrizeCurve, ParametrizeSurface, ParametrizeVolume, Physics, Physics conventions, Physics examples, Physics Updates, Tensors - a complete guide, Mini-Course Computer Algebra for Physicists, Physics[Vectors], Setup, standard int, VectorCalculus:-int
The Physics[Vectors][int] command was introduced in Maple 2022.
For more information on Maple 2022 changes, see Updates in Maple 2022.
Download Help Document