VectorCalculus
int
computes the integral of a function
Calling Sequence
Parameters
Description
Examples
int(f, dom, inert)
f
-
Vector(algebraic) or algebraic; specify the object to be integrated
dom
list(name)=domain or extra arguments to be passed to the top-level int command
inert
(optional) name; specify that the inert (Int) form is to be returned
The int(f, dom) command computes the integral of the function f over the region specified by dom.
If f is an expression, dom must have the form list(name)=domain where the left-hand side is a list of the variables of integration and domain is an unevaluated function call describing the region. If f is a Vector, the top-level int command is mapped over the components of f with dom passed to int as well as the extra arguments.
The regions of integration are represented by unevaluated function calls. The possible regions of integration are Circle(cen, rad), Ellipse(cen, a, b, phi), Ellipse(eqn), Parallelepiped(r1, ..., rk), Rectangle(r1, r2), Region(r1, ..., rk), Sector(obj, start, finish), Sphere(cen, rad), Tetrahedron(v1, v2, v3, v4), and Triangle(v1, v2, v3).
Circle(cen, rad) The first parameter of Circle, cen, must have type Vector(2, algebraic) and rad must have type algebraic. These represent the center and the radius of the circle, respectively. If a coordinate system attribute is specified on cen, the center is interpreted in that coordinate system.
Ellipse(cen, a, b, phi)
The parameter cen is the center of the ellipse and must have type 'Vector'(algebraic). If a coordinate system attribute is specified on cen, it is interpreted in that coordinate system. The parameters a and b are the lengths of the semimajor and semiminor axes, respectively. The resulting ellipse is constructed via the following process: Start with an ellipse centered at the origin having the specified axes lengths, with its major axis initially on the x-axis. It is rotated through an angle of phi in the counterclockwise direction and translated to cen.
Ellipse(eqn)
The parameter eqn is either an equation specifying the ellipse or an algebraic expression such that the equation eqn = 0 specifies the ellipse. A Cartesian equation for a general conic section is of the form A⁢x2+B⁢x⁢y+C⁢y2+E⁢x+F⁢y+G=0, and specifies the locus of all points x,y that satisfy the equation; this locus is a non-degenerate, real ellipse if and only if three conditions hold:
Δ≔Determinant⁡2⁢A|B|E,B|2⁢C|F,E|F|2⁢G≠0
C⁢Δ<0
−4⁢A⁢C+B2<0
The two variable names that appear in eqn must be the ones specified on the left-hand side of dom.
Parallelepiped(r1, ..., rk) This specifies a k-fold region of integration. Each ri must have type algebraic..algebraic and the expressions in the ranges cannot depend on the variables of integration. These are the ranges that are used for each variable during integration.
Rectangle(r1, r2) This is a specialization of Parallelepiped to R^2. In the xy-plane, the integration has the order dx dy, and range r1 can be of the form x1(y)..x2(y), in contrast to the restrictions on ranges in Parallelepiped.
Region(r1, ..., rk) This specifies a k-fold region of integration. Each ri must have type algebraic..algebraic and the ith range can only depend on the first i-1 variables. Thus, the region can easily be transformed into an iterated integral.
Sector(obj, start, finish) The first parameter of Sector, obj, must be a Circle or Ellipse structure. The Sector structure defines a sector of the circle or ellipse with boundaries specified by the start and finish angles. The sector is defined by the region inside the circle or ellipse swept out by a ray emanating from its center as it rotates from the start angle to the finish angle.
To define precisely how angles are measured, it suffices to discuss only circles and ellipses centered at the origin. For a circle or ellipse centered elsewhere, the start and finish angles are determined as if the circle or ellipse were first translated to the origin.
For a Circle centered at the origin, angle is measured counterclockwise from the positive x-axis. Therefore, the angle 3⁢π2 specifies the negative y-axis.
To define how angle is measured for an Ellipse centered at the origin, we first define the right semimajor axis of the ellipse to be the semimajor axis in the right half-plane (the first and fourth quadrants of the plane). If the major axis of the ellipse is coincident with the y-axis, then its right semimajor axis is defined to be the one on the negative y-axis. Thus, for an ellipse centered at the origin with its major axis sitting on the line y = x, its right semimajor axis is the one inside the first quadrant.
For an Ellipse centered at the origin, angle is measured counterclockwise from its right semimajor axis. Therefore, in the example ellipse given in the previous paragraph, the angle π4 specifies the positive y-axis.
If the start and finish angles are more than 2⁢π apart, int does not discard the repeated area. That is, int counts the multiplicity of the region over which the integration is being done. For example, if start = 0, finish = 3Pi, and the region is a Circle structure, then the result is equal to twice the integral of f over the top half of the circle plus its integral over the bottom half of the circle.
If the finish angle is less than the start angle, the sign of the integral is flipped. In general, the integral of f over the sector from start to finish is always the negative of the same integral with the start and finish angles swapped.
Sphere(cen, rad) The first parameter of Sphere, cen, must have type 'Vector'(3, algebraic) and rad must have type algebraic. These represent the center and the radius of the sphere, respectively. If a coordinate system attribute is specified on cen, the center is interpreted in that coordinate system.
Tetrahedron(v1, v2, v3, v4) Each vi must have type 'Vector'(3, algebraic). These represent the vertices of the tetrahedron. If coordinate system attributes are specified on these Vectors, each vertex is interpreted in its own coordinate system.
Triangle(v1, v2, v3) Each vi must have type 'Vector'(2, algebraic). These represent the vertices of the triangle. If coordinate system attributes are specified, each vertex is interpreted in its own coordinate system.
If the specified region contains an additional argument of type list(name), the integration variables will be substituted with the variables in that list. Note that this substitution will only be visible if the integral is returned unevaluated.
The int(f, dom, inert) command returns the unevaluated (inert) form of the integral of f over dom.
with⁡VectorCalculus:
int⁡x2+y2,x,y=Circle⁡0,0,r
π⁢r42
int⁡exp⁡−x2−y2−z2,x,y,z=Sphere⁡0,0,0,r
π⁢π⁢erf⁡r⁢ⅇr2−2⁢r⁢ⅇ−r2
int⁡exp⁡−x2−y2−z2,x,y,z=Sphere⁡0,0,0,1,r,φ,θ,inert
∫01∫0π∫02⁢πr2⁢ⅇ−r2⁢sin⁡φⅆθⅆφⅆr
int⁡x⁢y,x,y=Triangle⁡0,0,1,0,0,1
124
int⁡sin⁡x⁢cos⁡y⁢tan⁡z,x,y,z=Parallelepiped⁡0..π,0..π2,0..π4
ln⁡2
int⁡sin⁡xx,x,y=Rectangle⁡0..π2,0..π2
Si⁡π2⁢π2
int⁡1,x,y=Region⁡0..1,x2..x
16
int⁡x+y+z,x,y,z=Tetrahedron⁡0,0,0,1,0,0,0,1,0,0,0,1
18
int⁡x+y+z,x,y,z=Tetrahedron⁡0,0,0,1,0,0,0,1,0,0,0,1,inert
∫01∫01−t∫0−1+t⁢x−1+t1−tx+y+tⅆyⅆxⅆt
int⁡1,x,y=Ellipse⁡x24+y29−1
6⁢π
int⁡y2,x,y=Sector⁡Circle⁡0,0,r,0,π
π⁢r48
int⁡x,x,y=Sector⁡Ellipse⁡x24+y29−1,0,π2
4
int⁡t,t2,t3,t
See Also
VectorCalculus[diff]
VectorCalculus[Flux]
VectorCalculus[limit]
VectorCalculus[LineInt]
VectorCalculus[PathInt]
VectorCalculus[series]
VectorCalculus[SurfaceInt]
VectorCalculus[Vector]
Download Help Document