int - Maple Help

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

 Calling Sequence 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])

Parameters

 F or F_ - the integrand, can be an algebraic scalar expression F, or a vector function F_ (to represent vector functions see notation) C - 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 $d\stackrel{\to }{r}$ 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. S_ - the global symbol S_ (not another symbol); $d\stackrel{\to }{S}$ 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. V - the global symbol V (not another symbol); $\mathrm{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 $d\stackrel{\to }{r}$ or $d\stackrel{\to }{S}$ 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. inert - 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

Description

 • 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:

${\left({\int }_{\stackrel{\to }{A}}^{\stackrel{\to }{B}}F\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}ⅆ\stackrel{\to }{r}\right)}_{\mathrm{path}=C}$

${\left({\int }_{\stackrel{\to }{A}}^{\stackrel{\to }{B}}\stackrel{\to }{F}·\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}ⅆ\stackrel{\to }{r}\right)}_{\mathrm{path}=C}$

${\left({\int }_{\stackrel{\to }{A}}^{\stackrel{\to }{B}}\stackrel{\to }{F}×\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}ⅆ\stackrel{\to }{r}\right)}_{\mathrm{path}=C}$

 where $\stackrel{\to }{A}$ and $\stackrel{\to }{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 $\stackrel{\to }{F}$ is a vector function, so that the dot product $\stackrel{\to }{F}·d\stackrel{\to }{r}$ is a scalar and so is the integral, while in the third one $\stackrel{\to }{F}×d\stackrel{\to }{r}$ is a vector and so is its integration over the region $C$.
 • Likewise, there are three kinds of surface integrals

${\left(\int F\phantom{\rule[-0.0ex]{0.2em}{0.0ex}}ⅆ\stackrel{\to }{S}\right)}_{\mathrm{surface}=C,\mathrm{parameters}=\left[u=a..b,v=c..d\right]}$

${\left(\int \stackrel{\to }{F}·\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}ⅆ\stackrel{\to }{S}\right)}_{\mathrm{surface}=C,\mathrm{parameters}=\left[u=a..b,v=c..d\right]}$

${\left(\int \stackrel{\to }{F}×\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}ⅆ\stackrel{\to }{S}\right)}_{\mathrm{surface}=C,\mathrm{parameters}=\left[u=a..b,v=c..d\right]}$

 and two types of volume integrals

${\left(\int FⅆV\right)}_{\mathrm{volume}=C,\mathrm{parameters}=\left[u=a..b,v=c..d,w=f..g\right]}$

${\left(\int \stackrel{\to }{F}\phantom{\rule[-0.0ex]{0.2em}{0.0ex}}ⅆV\right)}_{\mathrm{volume}=C,\mathrm{parameters}=\left[u=a..b,v=c..d,w=f..g\right]}$

 • 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 $\stackrel{\to }{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. $\stackrel{\to }{F}·d\stackrel{\to }{r}$ for line integrals. If the optional argument kind = crossproduct is passed, the integral is understood as the integral of the cross product e.g. $\stackrel{\to }{F}×d\stackrel{\to }{S}$ 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 $d\stackrel{\to }{r}$ is a line element, $d\stackrel{\to }{S}$ a surface element and $\mathrm{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 $\stackrel{\to }{A}$ and $\stackrel{\to }{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\left(t\right)$ instead of just $x$ when indicating the integration region C.
 – The limits of integration $\stackrel{\to }{A}$ and $\stackrel{\to }{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 $d\stackrel{\to }{r}$ in path integrals is expressed in terms of a parameter $t$ as

$d\stackrel{\to }{r}=\left(\frac{ⅆ}{ⅆt}\stackrel{\to }{r}\left(t\right)\right)\mathrm{dt}$

 Using indexed notation for derivatives ${\stackrel{\to }{r}}_{u}=\frac{\partial }{\partial u}\stackrel{\to }{r}\left(u,v\right)$, the surface element $d\stackrel{\to }{S}$ in surface integrals is expressed in terms of parameters as

$d\stackrel{\to }{S}={\stackrel{\to }{r}}_{u}×{\stackrel{\to }{r}}_{v}\mathrm{du}\mathrm{dv}$

 and the volume element $dV$ in volume integrals as

$\mathrm{dV}={\stackrel{\to }{r}}_{u}·\left({\stackrel{\to }{r}}_{v}×{\stackrel{\to }{r}}_{w}\right)\mathrm{du}\mathrm{dv}\mathrm{dw}$

 Since both $d\stackrel{\to }{S}$ 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.

Examples

 > $\mathrm{with}\left(\mathrm{Physics}:-\mathrm{Vectors}\right)$
 $\left[{\mathrm{&x}}{,}{\mathrm{+}}{,}{\mathrm{.}}{,}{\mathrm{Assume}}{,}{\mathrm{ChangeBasis}}{,}{\mathrm{ChangeCoordinates}}{,}{\mathrm{CompactDisplay}}{,}{\mathrm{Component}}{,}{\mathrm{Curl}}{,}{\mathrm{DirectionalDiff}}{,}{\mathrm{Divergence}}{,}{\mathrm{Gradient}}{,}{\mathrm{Identify}}{,}{\mathrm{Laplacian}}{,}{\nabla }{,}{\mathrm{Norm}}{,}{\mathrm{ParametrizeCurve}}{,}{\mathrm{ParametrizeSurface}}{,}{\mathrm{ParametrizeVolume}}{,}{\mathrm{Setup}}{,}{\mathrm{Simplify}}{,}{\mathrm{^}}{,}{\mathrm{diff}}{,}{\mathrm{int}}\right]$ (1)
 > $\mathrm{Setup}\left(\mathrm{mathematicalnotation}=\mathrm{true}\right)$
 $\left[{\mathrm{mathematicalnotation}}{=}{\mathrm{true}}\right]$ (2)

Path integrals

Consider the following scalar function $F$, path $C$ and integration limits $\stackrel{\to }{A}$ and $\stackrel{\to }{B}$

 > $F≔xy$
 ${F}{≔}{x}{}{y}$ (3)
 > $C≔\left\{y={x}^{2},z=0\right\}$
 ${C}{≔}\left\{{y}{=}{{x}}^{{2}}{,}{z}{=}{0}\right\}$ (4)
 > $\mathrm{A_}≔\left[0,0,0\right]$
 $\stackrel{{\to }}{{A}}{≔}\left[{0}{,}{0}{,}{0}\right]$ (5)
 > $\mathrm{B_}≔\left[1,1,0\right]$
 $\stackrel{{\to }}{{B}}{≔}\left[{1}{,}{1}{,}{0}\right]$ (6)

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

 > $\left(\mathrm{Int}=\mathrm{int}\right)\left(F,\mathrm{r_}=\mathrm{A_}..\mathrm{B_},\mathrm{path}=C\right)$
 ${\mathrm{Int}}{}\left({x}{}{y}{,}{\mathrm{r_}}{=}\left[{0}{,}{0}{,}{0}\right]{..}\left[{1}{,}{1}{,}{0}\right]{,}{\mathrm{path}}{=}\left\{{y}{=}{{x}}^{{2}}{,}{z}{=}{0}\right\}\right){=}\frac{{2}}{{5}}{}{\mathrm{_j}}{+}\frac{{1}}{{4}}{}{\mathrm{_i}}$ (7)

Note that the output on the right-hand side is a vector. Within int, to perform this integration the curve $C=\left\{y={x}^{2},z=0\right\}$ is first parametrized using ParametrizeCurve

 > $\mathrm{ParametrizeCurve}\left(C\right)$
 $\left[{x}{}\left({t}\right){=}{t}{,}{y}{}\left({t}\right){=}{{t}}^{{2}}{,}{z}{}\left({t}\right){=}{0}\right]{,}{t}$ (8)

The output above is a sequence, first the parametric equations as an ordered list (order $\left[x,y,z\right]$) then the parameter, in this case $t$. For the formulation of the integral to make sense, the limits of integration $\stackrel{\to }{A}$ and $\stackrel{\to }{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$

 > $\mathrm{A_}=\genfrac{}{}{0}{}{{1}_{}}{\phantom{t=0}}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{|}\phantom{\rule[-0.0ex]{0.1em}{0.0ex}}\genfrac{}{}{0}{}{\phantom{{1}_{}}}{t=0}$
 $\left[{0}{,}{0}{,}{0}\right]{=}\genfrac{}{}{0}{}{\left[{x}{}\left({t}\right){=}{t}{,}{y}{}\left({t}\right){=}{{t}}^{{2}}{,}{z}{}\left({t}\right){=}{0}\right]}{\phantom{{t}{=}{0}}}{|}\genfrac{}{}{0}{}{\phantom{\left[{x}{}\left({t}\right){=}{t}{,}{y}{}\left({t}\right){=}{{t}}^{{2}}{,}{z}{}\left({t}\right){=}{0}\right]}}{{t}{=}{0}}$ (9)
 > $\mathrm{B_}=\genfrac{}{}{0}{}{{1}_{}}{\phantom{t=1}}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{|}\phantom{\rule[-0.0ex]{0.1em}{0.0ex}}\genfrac{}{}{0}{}{\phantom{{1}_{}}}{t=1}$
 $\left[{1}{,}{1}{,}{0}\right]{=}\genfrac{}{}{0}{}{\left[{x}{}\left({t}\right){=}{t}{,}{y}{}\left({t}\right){=}{{t}}^{{2}}{,}{z}{}\left({t}\right){=}{0}\right]}{\phantom{{t}{=}{1}}}{|}\genfrac{}{}{0}{}{\phantom{\left[{x}{}\left({t}\right){=}{t}{,}{y}{}\left({t}\right){=}{{t}}^{{2}}{,}{z}{}\left({t}\right){=}{0}\right]}}{{t}{=}{1}}$ (10)

To see the integral after being parametrized and before performing the integration use the option inert

 > $\left(\mathrm{Int}=\mathrm{int}\right)\left(F,\mathrm{r_}=\mathrm{A_}..\mathrm{B_},\mathrm{path}=C,\mathrm{inert}\right)$
 ${\mathrm{Int}}{}\left({x}{}{y}{,}{\mathrm{r_}}{=}\left[{0}{,}{0}{,}{0}\right]{..}\left[{1}{,}{1}{,}{0}\right]{,}{\mathrm{path}}{=}\left\{{y}{=}{{x}}^{{2}}{,}{z}{=}{0}\right\}{,}{\mathrm{inert}}\right){=}{\mathrm{Int}}{}\left({2}{}{\mathrm{_j}}{}{{t}}^{{4}}{+}{\mathrm{_i}}{}{{t}}^{{3}}{,}{t}{=}{0}{..}{1}\right)$ (11)

Since there is a relation one-to-one between the integration limits $\stackrel{\to }{A}$ and $\stackrel{\to }{B}$ and the parameter's range, instead of indicating $\stackrel{\to }{A}$ and $\stackrel{\to }{B}$ you can also indicate the range of $t$ itself, getting the same result (7)

 > $\left(\mathrm{Int}=\mathrm{int}\right)\left(F,\mathrm{r_},\mathrm{path}=C,\mathrm{parameter}=\left\{t=0..1\right\}\right)$
 ${\mathrm{Int}}{}\left({x}{}{y}{,}{\mathrm{r_}}{,}{\mathrm{path}}{=}\left\{{y}{=}{{x}}^{{2}}{,}{z}{=}{0}\right\}{,}{\mathrm{parameter}}{=}\left\{{t}{=}{0}{..}{1}\right\}\right){=}\frac{{2}}{{5}}{}{\mathrm{_j}}{+}\frac{{1}}{{4}}{}{\mathrm{_i}}$ (12)

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 $d\stackrel{\to }{r}$ is the differential of the parametric equations of C. In this case indicating path = C is redundant and can be omitted.

 > $\left(\mathrm{Int}=\mathrm{int}\right)\left(F,\mathrm{r_}=C,\mathrm{parameter}=\left\{t=0..1\right\}\right)$
 ${\mathrm{Int}}{}\left({x}{}{y}{,}{\mathrm{r_}}{=}\left\{{y}{=}{{x}}^{{2}}{,}{z}{=}{0}\right\}{,}{\mathrm{parameter}}{=}\left\{{t}{=}{0}{..}{1}\right\}\right){=}\frac{{2}}{{5}}{}{\mathrm{_j}}{+}\frac{{1}}{{4}}{}{\mathrm{_i}}$ (13)

The integration path and the limits of integration can be expressed in vector notation as well

 > $\mathrm{C_}≔x\mathrm{_i}+{x}^{2}\mathrm{_j}$
 $\stackrel{{\to }}{{C}}{≔}{{x}}^{{2}}{}\stackrel{{\wedge }}{{j}}{+}{x}{}\stackrel{{\wedge }}{{i}}$ (14)
 > $\mathrm{A_}≔0$
 $\stackrel{{\to }}{{A}}{≔}{0}$ (15)
 > $\mathrm{B_}≔\mathrm{_i}+\mathrm{_j}$
 $\stackrel{{\to }}{{B}}{≔}\stackrel{{\wedge }}{{i}}{+}\stackrel{{\wedge }}{{j}}$ (16)
 > $\left(\mathrm{Int}=\mathrm{int}\right)\left(F,\mathrm{r_}=\mathrm{A_}..\mathrm{B_},\mathrm{path}=\mathrm{C_}\right)$
 ${\mathrm{Int}}{}\left({x}{}{y}{,}{\mathrm{r_}}{=}{0}{..}{\mathrm{_i}}{+}{\mathrm{_j}}{,}{\mathrm{path}}{=}{\mathrm{_j}}{}{{x}}^{{2}}{+}{\mathrm{_i}}{}{x}\right){=}\frac{{2}}{{5}}{}{\mathrm{_j}}{+}\frac{{1}}{{4}}{}{\mathrm{_i}}$ (17)

The following $C$ represents a circle of radius $a$ on the $\left(x,y\right)$ plane

 > $C≔\left\{{x}^{2}+{y}^{2}={a}^{2},z=0\right\}$
 ${C}{≔}\left\{{z}{=}{0}{,}{{x}}^{{2}}{+}{{y}}^{{2}}{=}{{a}}^{{2}}\right\}$ (18)

To perform a path integral over this curve, the curve is first parametrized as

 > $\mathrm{ParametrizeCurve}\left(C\right)$
 $\left[{x}{}\left({\mathrm{\phi }}\right){=}{a}{}{\mathrm{cos}}{}\left({\mathrm{\phi }}\right){,}{y}{}\left({\mathrm{\phi }}\right){=}{a}{}{\mathrm{sin}}{}\left({\mathrm{\phi }}\right){,}{z}{}\left({\mathrm{\phi }}\right){=}{0}\right]{,}{\mathrm{\phi }}$ (19)

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 $\mathrm{\phi }=0..\frac{\mathrm{\pi }}{2}$, the limits of integration $\stackrel{\to }{A}$ and $\stackrel{\to }{B}$ are

 > $\genfrac{}{}{0}{}{{1}_{}}{\phantom{\mathrm{φ}=0}}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}|\phantom{\rule[-0.0ex]{0.1em}{0.0ex}}\genfrac{}{}{0}{}{\phantom{{1}_{}}}{\mathrm{φ}=0}$
 $\left[{x}{}\left({0}\right){=}{a}{,}{y}{}\left({0}\right){=}{0}{,}{z}{}\left({0}\right){=}{0}\right]$ (20)
 > $\mathrm{A_}≔a\mathrm{_i}$
 $\stackrel{{\to }}{{A}}{≔}{a}{}\stackrel{{\wedge }}{{i}}$ (21)
 > $\genfrac{}{}{0}{}{{1}_{}}{\phantom{\mathrm{φ}=\frac{\mathrm{Pi}}{2}}}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}|\phantom{\rule[-0.0ex]{0.1em}{0.0ex}}\genfrac{}{}{0}{}{\phantom{{1}_{}}}{\mathrm{φ}=\frac{\mathrm{Pi}}{2}}$
 $\left[{x}{}\left(\frac{{\mathrm{\pi }}}{{2}}\right){=}{0}{,}{y}{}\left(\frac{{\mathrm{\pi }}}{{2}}\right){=}{a}{,}{z}{}\left(\frac{{\mathrm{\pi }}}{{2}}\right){=}{0}\right]$ (22)
 > $\mathrm{B_}≔a\mathrm{_j}$
 $\stackrel{{\to }}{{B}}{≔}{a}{}\stackrel{{\wedge }}{{j}}$ (23)

So for the following integrand, we have (in the context of int, the keywords curve and path are synonyms)

 > $F≔1$
 ${F}{≔}{1}$ (24)
 > $\left(\mathrm{Int}=\mathrm{int}\right)\left(F,\mathrm{r_}=\mathrm{A_}..\mathrm{B_},\mathrm{curve}=C\right)$
 ${\mathrm{Int}}{}\left({1}{,}{\mathrm{r_}}{=}{a}{}{\mathrm{_i}}{..}{a}{}{\mathrm{_j}}{,}{\mathrm{curve}}{=}\left\{{z}{=}{0}{,}{{x}}^{{2}}{+}{{y}}^{{2}}{=}{{a}}^{{2}}\right\}\right){=}{-}{\mathrm{_i}}{}{a}{+}{\mathrm{_j}}{}{a}$ (25)

An example having for integrand a vector function $\stackrel{\to }{F}$, also expressing the path using vector notation

 > $\mathrm{F_}≔{x}^{2}\mathrm{_i}+y\mathrm{_j}+xyz\mathrm{_k}$
 $\stackrel{{\to }}{{F}}{≔}{x}{}{y}{}{z}{}\stackrel{{\wedge }}{{k}}{+}{{x}}^{{2}}{}\stackrel{{\wedge }}{{i}}{+}{y}{}\stackrel{{\wedge }}{{j}}$ (26)
 > $\mathrm{C_}≔x\left(\mathrm{_i}+\mathrm{_j}+\mathrm{_k}\right)$
 $\stackrel{{\to }}{{C}}{≔}{x}{}\left(\stackrel{{\wedge }}{{i}}{+}\stackrel{{\wedge }}{{j}}{+}\stackrel{{\wedge }}{{k}}\right)$ (27)

Integrate over this curve from the origin to the point $\stackrel{\wedge }{i}+\stackrel{\wedge }{j}+\stackrel{\wedge }{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 $\left[0,0,0\right]$ you can use $0$ and instead of $\left[1,1,1\right]$ you can use 1

 > $\mathrm{A_},\mathrm{B_}≔0,1$
 $\stackrel{{\to }}{{A}}{,}\stackrel{{\to }}{{B}}{≔}{0}{,}{1}$ (28)

When the integrand is a vector function, int computes the integral of the dot product $\stackrel{\to }{F}·d\stackrel{\to }{r}$ over the given curve, resulting in a scalar value

 > $\left(\mathrm{Int}=\mathrm{int}\right)\left(\mathrm{F_},\mathrm{r_}=\mathrm{A_}..\mathrm{B_},\mathrm{path}=\mathrm{C_}\right)$
 ${\mathrm{Int}}{}\left({\mathrm{_k}}{}{x}{}{y}{}{z}{+}{\mathrm{_i}}{}{{x}}^{{2}}{+}{\mathrm{_j}}{}{y}{,}{\mathrm{r_}}{=}{0}{..}{1}{,}{\mathrm{path}}{=}{x}{}\left({\mathrm{_i}}{+}{\mathrm{_j}}{+}{\mathrm{_k}}\right)\right){=}\frac{{13}}{{12}}$ (29)

To compute the integral of the cross product $\stackrel{\to }{F}×d\stackrel{\to }{r}$ use the option kind = crossproduct. In this example, we can see that the value of the parameter $t$ for which the points $\stackrel{\to }{A}$ and $\stackrel{\to }{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 $\stackrel{\to }{A}$ and $\stackrel{\to }{B}$

 > $\left(\mathrm{Int}=\mathrm{int}\right)\left(\mathrm{F_},\mathrm{r_},\mathrm{path}=\mathrm{C_},\mathrm{kind}=\mathrm{crossproduct},\mathrm{parameters}=\left\{t=0..1\right\}\right)$
 ${\mathrm{Int}}{}\left({\mathrm{_k}}{}{x}{}{y}{}{z}{+}{\mathrm{_i}}{}{{x}}^{{2}}{+}{\mathrm{_j}}{}{y}{,}{\mathrm{r_}}{,}{\mathrm{path}}{=}{x}{}\left({\mathrm{_i}}{+}{\mathrm{_j}}{+}{\mathrm{_k}}\right){,}{\mathrm{kind}}{=}{\mathrm{crossproduct}}{,}{\mathrm{parameters}}{=}\left\{{t}{=}{0}{..}{1}\right\}\right){=}\frac{{1}}{{4}}{}{\mathrm{_i}}{-}\frac{{1}}{{12}}{}{\mathrm{_j}}{-}\frac{{1}}{{6}}{}{\mathrm{_k}}$ (30)

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

 > $\mathit{P__1}≔2\mathrm{_i}-3\mathrm{_j}+4\mathrm{_k}$
 $\mathrm{P__1}{≔}{2}{}\stackrel{{\wedge }}{{i}}{-}{3}{}\stackrel{{\wedge }}{{j}}{+}{4}{}\stackrel{{\wedge }}{{k}}$ (31)
 > $\mathit{P__2}≔-4\mathrm{_i}+2\mathrm{_j}-\mathrm{_k}$
 $\mathrm{P__2}{≔}{-}{4}{}\stackrel{{\wedge }}{{i}}{+}{2}{}\stackrel{{\wedge }}{{j}}{-}\stackrel{{\wedge }}{{k}}$ (32)

we have (in the computational context of ParametrizeCurve, line and straightline are synonyms)

 > $\mathrm{ParametrizeCurve}\left(\mathrm{line}\left(\mathit{P__1},\mathit{P__2}\right)\right)$
 $\left[{x}{}\left({t}\right){=}{2}{-}{6}{}{t}{,}{y}{}\left({t}\right){=}{-}{3}{+}{5}{}{t}{,}{z}{}\left({t}\right){=}{-}{5}{}{t}{+}{4}\right]{,}{t}$ (33)

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$

 > $\mathrm{A_}≔\frac{16\mathrm{_i}}{5}-4\mathrm{_j}+5\mathrm{_k}$
 $\stackrel{{\to }}{{A}}{≔}\frac{{16}{}\stackrel{{\wedge }}{{i}}}{{5}}{-}{4}{}\stackrel{{\wedge }}{{j}}{+}{5}{}\stackrel{{\wedge }}{{k}}$ (34)
 > $\mathrm{B_}≔-\frac{44\mathrm{_i}}{5}+6\mathrm{_j}-5\mathrm{_k}$
 $\stackrel{{\to }}{{B}}{≔}{-}\frac{{44}{}\stackrel{{\wedge }}{{i}}}{{5}}{+}{6}{}\stackrel{{\wedge }}{{j}}{-}{5}{}\stackrel{{\wedge }}{{k}}$ (35)
 > $\left(\mathrm{Int}=\mathrm{int}\right)\left(\mathrm{F_},\mathrm{r_}=\mathrm{A_}..\mathrm{B_},\mathrm{path}=\mathrm{line}\left(\mathit{P__1},\mathit{P__2}\right),\mathrm{kind}=\mathrm{crossproduct}\right)$
 ${\mathrm{Int}}{}\left({\mathrm{_k}}{}{x}{}{y}{}{z}{+}{\mathrm{_i}}{}{{x}}^{{2}}{+}{\mathrm{_j}}{}{y}{,}{\mathrm{r_}}{=}\frac{{16}}{{5}}{}{\mathrm{_i}}{-}{4}{}{\mathrm{_j}}{+}{5}{}{\mathrm{_k}}{..}{-}\frac{{44}}{{5}}{}{\mathrm{_i}}{+}{6}{}{\mathrm{_j}}{-}{5}{}{\mathrm{_k}}{,}{\mathrm{path}}{=}{\mathrm{line}}{}\left({2}{}{\mathrm{_i}}{-}{3}{}{\mathrm{_j}}{+}{4}{}{\mathrm{_k}}{,}{-}{4}{}{\mathrm{_i}}{+}{2}{}{\mathrm{_j}}{-}{\mathrm{_k}}\right){,}{\mathrm{kind}}{=}{\mathrm{crossproduct}}\right){=}{-}\frac{{1030}}{{3}}{}{\mathrm{_i}}{-}\frac{{1008}}{{5}}{}{\mathrm{_j}}{+}\frac{{1052}}{{5}}{}{\mathrm{_k}}$ (36)

Consider integrating over a path $C$ that consists of three line segments, say ${C}_{1},{C}_{2},{C}_{3}$, connecting the origin with the point $\left[1,1,1\right]$ via $\left[0,0,0\right]\to \left[1,0,0\right]\to \left[1,1,0\right]\to \left[1,1,1\right]$, 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 ${C}_{1},{C}_{2},{C}_{3}$ then add the results. Another way, significantly simpler, is using the $\mathrm{path}=\mathrm{linesegments}\left(\mathrm{...}\right)$. First one path at a time: the vectorial representations of these paths and the three computations are as follows:

 > $\mathit{C__1_}≔x\mathrm{_i}$
 $\mathrm{C__1_}{≔}{x}{}\stackrel{{\wedge }}{{i}}$ (37)
 > $\mathrm{A_},\mathrm{B_}≔0,\mathrm{_i}$
 $\stackrel{{\to }}{{A}}{,}\stackrel{{\to }}{{B}}{≔}{0}{,}\stackrel{{\wedge }}{{i}}$ (38)
 > $\left(\mathrm{Int}=\mathrm{int}\right)\left(\mathrm{F_},\mathrm{r_}=\mathrm{A_}..\mathrm{B_},\mathrm{path}=\mathit{C__1_}\right)$
 ${\mathrm{Int}}{}\left({\mathrm{_k}}{}{x}{}{y}{}{z}{+}{\mathrm{_i}}{}{{x}}^{{2}}{+}{\mathrm{_j}}{}{y}{,}{\mathrm{r_}}{=}{0}{..}{\mathrm{_i}}{,}{\mathrm{path}}{=}{x}{}{\mathrm{_i}}\right){=}\frac{{1}}{{3}}$ (39)
 > $\mathit{C__2_}≔\mathrm{_i}+y\mathrm{_j}$
 $\mathrm{C__2_}{≔}{y}{}\stackrel{{\wedge }}{{j}}{+}\stackrel{{\wedge }}{{i}}$ (40)
 > $\mathrm{A_},\mathrm{B_}≔\mathrm{B_},\mathrm{B_}+\mathrm{_j}$
 $\stackrel{{\to }}{{A}}{,}\stackrel{{\to }}{{B}}{≔}\stackrel{{\wedge }}{{i}}{,}\stackrel{{\wedge }}{{i}}{+}\stackrel{{\wedge }}{{j}}$ (41)
 > $\left(\mathrm{Int}=\mathrm{int}\right)\left(\mathrm{F_},\mathrm{r_}=\mathrm{A_}..\mathrm{B_},\mathrm{path}=\mathit{C__2_}\right)$
 ${\mathrm{Int}}{}\left({\mathrm{_k}}{}{x}{}{y}{}{z}{+}{\mathrm{_i}}{}{{x}}^{{2}}{+}{\mathrm{_j}}{}{y}{,}{\mathrm{r_}}{=}{\mathrm{_i}}{..}{\mathrm{_i}}{+}{\mathrm{_j}}{,}{\mathrm{path}}{=}{\mathrm{_j}}{}{y}{+}{\mathrm{_i}}\right){=}\frac{{1}}{{2}}$ (42)
 > $\mathit{C__3_}≔\mathrm{_i}+\mathrm{_j}+z\mathrm{_k}$
 $\mathrm{C__3_}{≔}{z}{}\stackrel{{\wedge }}{{k}}{+}\stackrel{{\wedge }}{{i}}{+}\stackrel{{\wedge }}{{j}}$ (43)
 > $\mathrm{A_},\mathrm{B_}≔\mathrm{B_},\mathrm{B_}+\mathrm{_k}$
 $\stackrel{{\to }}{{A}}{,}\stackrel{{\to }}{{B}}{≔}\stackrel{{\wedge }}{{i}}{+}\stackrel{{\wedge }}{{j}}{,}\stackrel{{\wedge }}{{i}}{+}\stackrel{{\wedge }}{{j}}{+}\stackrel{{\wedge }}{{k}}$ (44)
 > $\left(\mathrm{Int}=\mathrm{int}\right)\left(\mathrm{F_},\mathrm{r_}=\mathrm{A_}..\mathrm{B_},\mathrm{path}=\mathit{C__3_}\right)$
 ${\mathrm{Int}}{}\left({\mathrm{_k}}{}{x}{}{y}{}{z}{+}{\mathrm{_i}}{}{{x}}^{{2}}{+}{\mathrm{_j}}{}{y}{,}{\mathrm{r_}}{=}{\mathrm{_i}}{+}{\mathrm{_j}}{..}{\mathrm{_i}}{+}{\mathrm{_j}}{+}{\mathrm{_k}}{,}{\mathrm{path}}{=}{\mathrm{_k}}{}{z}{+}{\mathrm{_i}}{+}{\mathrm{_j}}\right){=}\frac{{1}}{{2}}$ (45)
 > $++$
 ${\mathrm{Int}}{}\left({\mathrm{_k}}{}{x}{}{y}{}{z}{+}{\mathrm{_i}}{}{{x}}^{{2}}{+}{\mathrm{_j}}{}{y}{,}{\mathrm{r_}}{=}{0}{..}{\mathrm{_i}}{,}{\mathrm{path}}{=}{x}{}{\mathrm{_i}}\right){+}{\mathrm{Int}}{}\left({\mathrm{_k}}{}{x}{}{y}{}{z}{+}{\mathrm{_i}}{}{{x}}^{{2}}{+}{\mathrm{_j}}{}{y}{,}{\mathrm{r_}}{=}{\mathrm{_i}}{..}{\mathrm{_i}}{+}{\mathrm{_j}}{,}{\mathrm{path}}{=}{\mathrm{_j}}{}{y}{+}{\mathrm{_i}}\right){+}{\mathrm{Int}}{}\left({\mathrm{_k}}{}{x}{}{y}{}{z}{+}{\mathrm{_i}}{}{{x}}^{{2}}{+}{\mathrm{_j}}{}{y}{,}{\mathrm{r_}}{=}{\mathrm{_i}}{+}{\mathrm{_j}}{..}{\mathrm{_i}}{+}{\mathrm{_j}}{+}{\mathrm{_k}}{,}{\mathrm{path}}{=}{\mathrm{_k}}{}{z}{+}{\mathrm{_i}}{+}{\mathrm{_j}}\right){=}\frac{{4}}{{3}}$ (46)

These three steps can be compacted into one using $\mathrm{path}=\mathrm{linesegments}\left(\mathrm{...}\right)$

 > $\left(\mathrm{Int}=\mathrm{int}\right)\left(\mathrm{F_},\mathrm{r_},\mathrm{path}=\mathrm{linesegments}\left(0,\mathrm{_i},\mathrm{_i}+\mathrm{_j},\mathrm{_i}+\mathrm{_j}+\mathrm{_k}\right)\right)$
 ${\mathrm{Int}}{}\left({\mathrm{_k}}{}{x}{}{y}{}{z}{+}{\mathrm{_i}}{}{{x}}^{{2}}{+}{\mathrm{_j}}{}{y}{,}{\mathrm{r_}}{,}{\mathrm{path}}{=}{\mathrm{linesegments}}{}\left({0}{,}{\mathrm{_i}}{,}{\mathrm{_i}}{+}{\mathrm{_j}}{,}{\mathrm{_i}}{+}{\mathrm{_j}}{+}{\mathrm{_k}}\right)\right){=}\frac{{4}}{{3}}$ (47)

Moreover, note that this integral from 0 to $\left[1,1,1\right]=\stackrel{\wedge }{i}+\stackrel{\wedge }{j}+\stackrel{\wedge }{k}$ depends on the path of integration. To see that, compute the same integral over the straight line that joins these two points:

 > $\left(\mathrm{Int}=\mathrm{int}\right)\left(\mathrm{F_},\mathrm{r_},\mathrm{path}=\mathrm{linesegment}\left(0,\mathrm{_i}+\mathrm{_j}+\mathrm{_k}\right)\right)$
 ${\mathrm{Int}}{}\left({\mathrm{_k}}{}{x}{}{y}{}{z}{+}{\mathrm{_i}}{}{{x}}^{{2}}{+}{\mathrm{_j}}{}{y}{,}{\mathrm{r_}}{,}{\mathrm{path}}{=}{\mathrm{linesegment}}{}\left({0}{,}{\mathrm{_i}}{+}{\mathrm{_j}}{+}{\mathrm{_k}}\right)\right){=}\frac{{13}}{{12}}$ (48)

So $\frac{13}{2}$ instead of $\frac{4}{3}$. The reason for that: the curl of $\stackrel{\to }{F}$ is not zero

 > $\left(\mathrm{%Curl}=\mathrm{Curl}\right)\left(\mathrm{F_}\right)$
 ${\mathrm{%Curl}}{}\left({\mathrm{_k}}{}{x}{}{y}{}{z}{+}{\mathrm{_i}}{}{{x}}^{{2}}{+}{\mathrm{_j}}{}{y}\right){=}{\mathrm{_i}}{}{x}{}{z}{-}{\mathrm{_j}}{}{y}{}{z}$ (49)

therefore, the path integral from $\stackrel{\to }{A}$ to $\stackrel{\to }{B}$ depends on the path. Note as well that when there are only two points, the $\mathrm{path}=\mathrm{linesegment}\left(\stackrel{\to }{A},\stackrel{\to }{B}\right)$ notation is equivalent to $\stackrel{\to }{r}=\stackrel{\to }{A}..\stackrel{\to }{B},\mathrm{path}=\mathrm{line}\left(\stackrel{\to }{A},\stackrel{\to }{B}\right)$ so the integral above can also be expressed as

 > $\left(\mathrm{Int}=\mathrm{int}\right)\left(\mathrm{F_},\mathrm{r_}=0..\mathrm{_i}+\mathrm{_j}+\mathrm{_k},\mathrm{path}=\mathrm{line}\left(0,\mathrm{_i}+\mathrm{_j}+\mathrm{_k}\right)\right)$
 ${\mathrm{Int}}{}\left({\mathrm{_k}}{}{x}{}{y}{}{z}{+}{\mathrm{_i}}{}{{x}}^{{2}}{+}{\mathrm{_j}}{}{y}{,}{\mathrm{r_}}{=}{0}{..}{\mathrm{_i}}{+}{\mathrm{_j}}{+}{\mathrm{_k}}{,}{\mathrm{path}}{=}{\mathrm{line}}{}\left({0}{,}{\mathrm{_i}}{+}{\mathrm{_j}}{+}{\mathrm{_k}}\right)\right){=}\frac{{13}}{{12}}$ (50)

Consider the same computation over two different paths in a case where the curl of $\stackrel{\to }{F}$ is equal to zero; take for instance $\stackrel{\to }{F}$ to be equal to the position vector itself

 > $\mathrm{F_}≔x\mathrm{_i}+y\mathrm{_j}+z\mathrm{_k}$
 $\stackrel{{\to }}{{F}}{≔}{x}{}\stackrel{{\wedge }}{{i}}{+}{y}{}\stackrel{{\wedge }}{{j}}{+}{z}{}\stackrel{{\wedge }}{{k}}$ (51)
 > $\left(\mathrm{%Curl}=\mathrm{Curl}\right)\left(\mathrm{F_}\right)$
 ${\mathrm{%Curl}}{}\left({\mathrm{_i}}{}{x}{+}{\mathrm{_j}}{}{y}{+}{\mathrm{_k}}{}{z}\right){=}{0}$ (52)

Now the integral does not depend on the path:

 > $\left(\mathrm{Int}=\mathrm{int}\right)\left(\mathrm{F_},\mathrm{r_},\mathrm{path}=\mathrm{linesegments}\left(0,\mathrm{_i},\mathrm{_i}+\mathrm{_j},\mathrm{_i}+\mathrm{_j}+\mathrm{_k}\right)\right)$
 ${\mathrm{Int}}{}\left({\mathrm{_i}}{}{x}{+}{\mathrm{_j}}{}{y}{+}{\mathrm{_k}}{}{z}{,}{\mathrm{r_}}{,}{\mathrm{path}}{=}{\mathrm{linesegments}}{}\left({0}{,}{\mathrm{_i}}{,}{\mathrm{_i}}{+}{\mathrm{_j}}{,}{\mathrm{_i}}{+}{\mathrm{_j}}{+}{\mathrm{_k}}\right)\right){=}\frac{{3}}{{2}}$ (53)
 > $\left(\mathrm{Int}=\mathrm{int}\right)\left(\mathrm{F_},\mathrm{r_},\mathrm{path}=\mathrm{linesegment}\left(0,\mathrm{_i}+\mathrm{_j}+\mathrm{_k}\right)\right)$
 ${\mathrm{Int}}{}\left({\mathrm{_i}}{}{x}{+}{\mathrm{_j}}{}{y}{+}{\mathrm{_k}}{}{z}{,}{\mathrm{r_}}{,}{\mathrm{path}}{=}{\mathrm{linesegment}}{}\left({0}{,}{\mathrm{_i}}{+}{\mathrm{_j}}{+}{\mathrm{_k}}\right)\right){=}\frac{{3}}{{2}}$ (54)

You can indicate that the line integral is around a closed curve in two different ways: passing the initial and final points (integration limits) $\stackrel{\to }{A}$ and $\stackrel{\to }{B}$ such that $\stackrel{\to }{A}=\stackrel{\to }{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 $\left(x,y\right)$ plane

 > $C≔\left\{{x}^{2}+{y}^{2}={a}^{2},z=0\right\}$
 ${C}{≔}\left\{{z}{=}{0}{,}{{x}}^{{2}}{+}{{y}}^{{2}}{=}{{a}}^{{2}}\right\}$ (55)

Integrate the vectorial line element $d\stackrel{\to }{r}$ 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 $\left[a,0,0\right]$

 > $\mathrm{A_}≔a\mathrm{_i}$
 $\stackrel{{\to }}{{A}}{≔}{a}{}\stackrel{{\wedge }}{{i}}$ (56)
 > $\left(\mathrm{Int}=\mathrm{int}\right)\left(1,\mathrm{r_}=\mathrm{A_}..\mathrm{A_},\mathrm{path}=C\right)$
 ${\mathrm{Int}}{}\left({1}{,}{\mathrm{r_}}{=}{a}{}{\mathrm{_i}}{..}{a}{}{\mathrm{_i}}{,}{\mathrm{path}}{=}\left\{{z}{=}{0}{,}{{x}}^{{2}}{+}{{y}}^{{2}}{=}{{a}}^{{2}}\right\}\right){=}{0}$ (57)
 > $\left(\mathrm{Int}=\mathrm{int}\right)\left(1,\mathrm{r_},\mathrm{path}=C,\mathrm{parameter}=\left\{\mathrm{φ}=0..2\mathrm{Pi}\right\}\right)$
 ${\mathrm{Int}}{}\left({1}{,}{\mathrm{r_}}{,}{\mathrm{path}}{=}\left\{{z}{=}{0}{,}{{x}}^{{2}}{+}{{y}}^{{2}}{=}{{a}}^{{2}}\right\}{,}{\mathrm{parameter}}{=}\left\{{\mathrm{φ}}{=}{0}{..}{2}{}{\mathrm{π}}\right\}\right){=}{0}$ (58)

These are the contributions of the upper half only

 > $\left(\mathrm{Int}=\mathrm{int}\right)\left(1,\mathrm{r_},\mathrm{path}=C,\mathrm{parameter}=\left\{\mathrm{φ}=0..\mathrm{Pi}\right\}\right)$
 ${\mathrm{Int}}{}\left({1}{,}{\mathrm{r_}}{,}{\mathrm{path}}{=}\left\{{z}{=}{0}{,}{{x}}^{{2}}{+}{{y}}^{{2}}{=}{{a}}^{{2}}\right\}{,}{\mathrm{parameter}}{=}\left\{{\mathrm{φ}}{=}{0}{..}{\mathrm{π}}\right\}\right){=}{-}{2}{}{a}{}{\mathrm{_i}}$ (59)

Take now $\stackrel{\to }{F}=\stackrel{\to }{r}$, the position vector, and integrate the cross product $\stackrel{\to }{F}×d\stackrel{\to }{r}$ around the circle $C$: this time, at each point of the circle, $\stackrel{\to }{F}×d\stackrel{\to }{r}$ is perpendicular to the plane $\left(x,y\right)$, in the $\stackrel{\wedge }{k}$ direction, so there are no cancellations, everything adds. Here again start and finish the integration at the point $\left[a,0,0\right]$

 > $\mathrm{F_}≔x\mathrm{_i}+y\mathrm{_j}+z\mathrm{_k}$
 $\stackrel{{\to }}{{F}}{≔}{x}{}\stackrel{{\wedge }}{{i}}{+}{y}{}\stackrel{{\wedge }}{{j}}{+}{z}{}\stackrel{{\wedge }}{{k}}$ (60)
 > $\left(\mathrm{Int}=\mathrm{int}\right)\left(\mathrm{F_},\mathrm{r_}=\mathrm{A_}..\mathrm{A_},\mathrm{path}=C,\mathrm{kind}=\mathrm{crossproduct}\right)$
 ${\mathrm{Int}}{}\left({\mathrm{_i}}{}{x}{+}{\mathrm{_j}}{}{y}{+}{\mathrm{_k}}{}{z}{,}{\mathrm{r_}}{=}{a}{}{\mathrm{_i}}{..}{a}{}{\mathrm{_i}}{,}{\mathrm{path}}{=}\left\{{z}{=}{0}{,}{{x}}^{{2}}{+}{{y}}^{{2}}{=}{{a}}^{{2}}\right\}{,}{\mathrm{kind}}{=}{\mathrm{crossproduct}}\right){=}{2}{}{\mathrm{π}}{}{{a}}^{{2}}{}{\mathrm{_k}}$ (61)
 > $\left(\mathrm{Int}=\mathrm{int}\right)\left(\mathrm{F_},\mathrm{r_},\mathrm{path}=C,\mathrm{parameter}=\left\{\mathrm{φ}=0..2\mathrm{Pi}\right\},\mathrm{kind}=\mathrm{crossproduct}\right)$
 ${\mathrm{Int}}{}\left({\mathrm{_i}}{}{x}{+}{\mathrm{_j}}{}{y}{+}{\mathrm{_k}}{}{z}{,}{\mathrm{r_}}{,}{\mathrm{path}}{=}\left\{{z}{=}{0}{,}{{x}}^{{2}}{+}{{y}}^{{2}}{=}{{a}}^{{2}}\right\}{,}{\mathrm{parameter}}{=}\left\{{\mathrm{φ}}{=}{0}{..}{2}{}{\mathrm{π}}\right\}{,}{\mathrm{kind}}{=}{\mathrm{crossproduct}}\right){=}{2}{}{\mathrm{π}}{}{{a}}^{{2}}{}{\mathrm{_k}}$ (62)

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

 > $\mathrm{with}\left(\mathrm{Physics},\mathrm{Assume},\mathrm{CompactDisplay}\right)$
 $\left[{\mathrm{Assume}}{,}{\mathrm{CompactDisplay}}\right]$ (63)
 > $\mathrm{Assume}\left(0
 $\left\{{a}{::}\left({0}{,}{\mathrm{\infty }}\right)\right\}$ (64)
 > $\mathit{C__2}≔{x}^{2}+{y}^{2}+{z}^{2}={a}^{2}$
 $\mathrm{C__2}{≔}{{x}}^{{2}}{+}{{y}}^{{2}}{+}{{z}}^{{2}}{=}{{a}}^{{2}}$ (65)
 > $\mathrm{ParametrizeSurface}\left(\mathit{C__2}\right)$
 $\left[{x}{}\left({\mathrm{\theta }}{,}{\mathrm{\phi }}\right){=}{a}{}{\mathrm{sin}}{}\left({\mathrm{\theta }}\right){}{\mathrm{cos}}{}\left({\mathrm{\phi }}\right){,}{y}{}\left({\mathrm{\theta }}{,}{\mathrm{\phi }}\right){=}{a}{}{\mathrm{sin}}{}\left({\mathrm{\theta }}\right){}{\mathrm{sin}}{}\left({\mathrm{\phi }}\right){,}{z}{}\left({\mathrm{\theta }}{,}{\mathrm{\phi }}\right){=}{a}{}{\mathrm{cos}}{}\left({\mathrm{\theta }}\right)\right]{,}\left[{\mathrm{\theta }}{,}{\mathrm{\phi }}\right]$ (66)

From the definition of the vectorial surface element as

$d\stackrel{\to }{S}={\stackrel{\to }{r}}_{u}×{\stackrel{\to }{r}}_{v}\mathrm{du}\mathrm{dv}$

$d\stackrel{\to }{S}$ is a vector perpendicular to the surface of the sphere. Hence, the vectorial surface integral of $d\stackrel{\to }{S}$ over the upper half of the sphere should be a vector perpendicular to the plane $\left(x,y\right)$ in the $\stackrel{\wedge }{k}$ direction. Also, checking the form of the parametrization returned by ParametrizeSurface is useful to understand what the ranges for parameters $\mathrm{\theta }$ and $\mathrm{\phi }$ need to be to represent the desired region.

 > $\left(\mathrm{Int}=\mathrm{int}\right)\left(1,\mathrm{S_},\mathrm{surface}=\mathit{C__2},\mathrm{parameters}=\left[\mathrm{θ}=0..\frac{\mathrm{Pi}}{2},\mathrm{φ}=0..2\mathrm{Pi}\right]\right)$
 ${\mathrm{Int}}{}\left({1}{,}{\mathrm{S_}}{,}{\mathrm{surface}}{=}\left({{x}}^{{2}}{+}{{y}}^{{2}}{+}{{z}}^{{2}}{=}{{a}}^{{2}}\right){,}{\mathrm{parameters}}{=}\left[{\mathrm{θ}}{=}{0}{..}\frac{{1}}{{2}}{}{\mathrm{π}}{,}{\mathrm{φ}}{=}{0}{..}{2}{}{\mathrm{π}}\right]\right){=}{\mathrm{π}}{}{{a}}^{{2}}{}{\mathrm{_k}}$ (67)

From symmetry considerations, the integral of $d\stackrel{\to }{S}$ over the lower half of the sphere should have the same magnitude but opposite direction ($-\stackrel{\wedge }{k}$), from where the integral over the whole sphere, so for $\mathrm{\theta }=0..\mathrm{\pi }$, should be equal to 0

 > $\left(\mathrm{Int}=\mathrm{int}\right)\left(1,\mathrm{S_},\mathrm{surface}=\mathit{C__2},\mathrm{parameters}=\left[\mathrm{θ}=0..\mathrm{Pi},\mathrm{φ}=0..2\mathrm{Pi}\right]\right)$
 ${\mathrm{Int}}{}\left({1}{,}{\mathrm{S_}}{,}{\mathrm{surface}}{=}\left({{x}}^{{2}}{+}{{y}}^{{2}}{+}{{z}}^{{2}}{=}{{a}}^{{2}}\right){,}{\mathrm{parameters}}{=}\left[{\mathrm{θ}}{=}{0}{..}{\mathrm{π}}{,}{\mathrm{φ}}{=}{0}{..}{2}{}{\mathrm{π}}\right]\right){=}{0}$ (68)

From this example we see that to get the area computing the integral of $d\stackrel{\to }{S}$ over the whole surface it is necessary to take as integrand the modulus of $d\stackrel{\to }{S}$, 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

 > $\mathrm{CompactDisplay}\left(\mathrm{r_}\left(\mathrm{θ},\mathrm{φ}\right)\right)$
 $\stackrel{{\to }}{{r}}{}\left({\mathrm{\theta }}{,}{\mathrm{\phi }}\right){}{\mathrm{will now be displayed as}}{}\stackrel{{\to }}{{r}}$ (69)
 > $\mathrm{n_}≔\frac{\left(\frac{\partial }{\partial \mathrm{θ}}\mathrm{r_}\left(\mathrm{θ},\mathrm{φ}\right)\right)&x\left(\frac{\partial }{\partial \mathrm{φ}}\mathrm{r_}\left(\mathrm{θ},\mathrm{φ}\right)\right)}{\mathrm{Norm}\left(\left(\frac{\partial }{\partial \mathrm{θ}}\mathrm{r_}\left(\mathrm{θ},\mathrm{φ}\right)\right)&x\left(\frac{\partial }{\partial \mathrm{φ}}\mathrm{r_}\left(\mathrm{θ},\mathrm{φ}\right)\right)\right)}$
 $\frac{{\mathrm{&x}}{}\left({\mathrm{diff}}{}\left({\mathrm{r_}}{}\left({\mathrm{θ}}{,}{\mathrm{φ}}\right){,}{\mathrm{θ}}\right){,}{\mathrm{diff}}{}\left({\mathrm{r_}}{}\left({\mathrm{θ}}{,}{\mathrm{φ}}\right){,}{\mathrm{φ}}\right)\right)}{{\mathrm{Norm}}{}\left({\mathrm{&x}}{}\left({\mathrm{diff}}{}\left({\mathrm{r_}}{}\left({\mathrm{θ}}{,}{\mathrm{φ}}\right){,}{\mathrm{θ}}\right){,}{\mathrm{diff}}{}\left({\mathrm{r_}}{}\left({\mathrm{θ}}{,}{\mathrm{φ}}\right){,}{\mathrm{φ}}\right)\right)\right)}$ (70)

where $\stackrel{\to }{r}$ is the vectorial form of the parametric equations of the surface. It is easy to see this vector is the radial unit vector $\stackrel{\wedge }{r}$. For that purpose you can use the option output = vector of ParametrizeSurface to get the vectorial form of the parametric equations for ${C}_{2}$

 > $\mathrm{ParametrizeSurface}\left(\mathit{C__2},\mathrm{output}=\mathrm{vector}\right)$
 ${a}{}{\mathrm{sin}}{}\left({\mathrm{\theta }}\right){}{\mathrm{cos}}{}\left({\mathrm{\phi }}\right){}\stackrel{{\wedge }}{{i}}{+}{a}{}{\mathrm{sin}}{}\left({\mathrm{\theta }}\right){}{\mathrm{sin}}{}\left({\mathrm{\phi }}\right){}\stackrel{{\wedge }}{{j}}{+}{a}{}{\mathrm{cos}}{}\left({\mathrm{\theta }}\right){}\stackrel{{\wedge }}{{k}}{,}\left[{\mathrm{\theta }}{,}{\mathrm{\phi }}\right]$ (71)

Introduce this value of $\stackrel{\to }{r}$ into the expression for $\stackrel{\to }{n}$ and change basis to spherical

 > $\mathrm{n_}≔\genfrac{}{}{0}{}{\mathrm{n_}}{\phantom{\mathrm{r_}\left(\mathrm{θ},\mathrm{φ}\right)={1}_{}}}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}|\phantom{\rule[-0.0ex]{0.1em}{0.0ex}}\genfrac{}{}{0}{}{\phantom{\mathrm{n_}}}{\mathrm{r_}\left(\mathrm{θ},\mathrm{φ}\right)={1}_{}}$
 $\stackrel{{\to }}{{n}}{≔}\frac{{{a}}^{{2}}{}{{\mathrm{sin}}{}\left({\mathrm{\theta }}\right)}^{{2}}{}{\mathrm{cos}}{}\left({\mathrm{\phi }}\right){}\stackrel{{\wedge }}{{i}}{+}{{a}}^{{2}}{}{{\mathrm{sin}}{}\left({\mathrm{\theta }}\right)}^{{2}}{}{\mathrm{sin}}{}\left({\mathrm{\phi }}\right){}\stackrel{{\wedge }}{{j}}{+}{{a}}^{{2}}{}{\mathrm{cos}}{}\left({\mathrm{\theta }}\right){}{\mathrm{sin}}{}\left({\mathrm{\theta }}\right){}\stackrel{{\wedge }}{{k}}}{\sqrt{{{a}}^{{4}}{}{{\mathrm{sin}}{}\left({\mathrm{\theta }}\right)}^{{4}}{}{{\mathrm{cos}}{}\left({\mathrm{\phi }}\right)}^{{2}}{+}{{a}}^{{4}}{}{{\mathrm{sin}}{}\left({\mathrm{\theta }}\right)}^{{4}}{}{{\mathrm{sin}}{}\left({\mathrm{\phi }}\right)}^{{2}}{+}{{a}}^{{4}}{}{{\mathrm{cos}}{}\left({\mathrm{\theta }}\right)}^{{2}}{}{{\mathrm{sin}}{}\left({\mathrm{\theta }}\right)}^{{2}}}}$ (72)
 > $\mathrm{n_}≔\mathrm{ChangeBasis}\left(\mathrm{n_},\mathrm{spherical}\right)$
 $\stackrel{{\to }}{{n}}{≔}\stackrel{{\wedge }}{{r}}$ (73)

Putting all together, the area of a sphere of radius $a$ is given by this closed surface integral

 > $\left(\mathrm{Int}=\mathrm{int}\right)\left(\mathrm{n_},\mathrm{S_},\mathrm{surface}=\mathit{C__2},\mathrm{parameters}=\left[\mathrm{θ}=0..\mathrm{Pi},\mathrm{φ}=0..2\mathrm{Pi}\right]\right)$
 ${\mathrm{Int}}{}\left({\mathrm{_r}}{,}{\mathrm{S_}}{,}{\mathrm{surface}}{=}\left({{x}}^{{2}}{+}{{y}}^{{2}}{+}{{z}}^{{2}}{=}{{a}}^{{2}}\right){,}{\mathrm{parameters}}{=}\left[{\mathrm{θ}}{=}{0}{..}{\mathrm{π}}{,}{\mathrm{φ}}{=}{0}{..}{2}{}{\mathrm{π}}\right]\right){=}{4}{}{{a}}^{{2}}{}{\mathrm{π}}$ (74)

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.

 > $\left(\mathrm{Int}=\mathrm{int}\right)\left(\mathrm{n_},\mathrm{S_}=\mathit{C__2},\mathrm{parameters}=\left[\mathrm{θ}=0..\mathrm{Pi},\mathrm{φ}=0..2\mathrm{Pi}\right]\right)$
 ${\mathrm{Int}}{}\left({\mathrm{_r}}{,}{\mathrm{S_}}{=}\left({{x}}^{{2}}{+}{{y}}^{{2}}{+}{{z}}^{{2}}{=}{{a}}^{{2}}\right){,}{\mathrm{parameters}}{=}\left[{\mathrm{θ}}{=}{0}{..}{\mathrm{π}}{,}{\mathrm{φ}}{=}{0}{..}{2}{}{\mathrm{π}}\right]\right){=}{4}{}{{a}}^{{2}}{}{\mathrm{π}}$ (75)

In the case of the volume of a sphere, an algebraic representation of the region is

 > $\mathit{C__3}≔{x}^{2}+{y}^{2}+{z}^{2}={r}^{2}$
 $\mathrm{C__3}{≔}{{x}}^{{2}}{+}{{y}}^{{2}}{+}{{z}}^{{2}}{=}{{r}}^{{2}}$ (76)

from where the volume of a sphere of radius $a$ is equal to the integral of the corresponding $\mathrm{dV}={\stackrel{\to }{r}}_{u}·\left({\stackrel{\to }{r}}_{v}×{\stackrel{\to }{r}}_{w}\right)\mathrm{du}\mathrm{dv}\mathrm{dw}$ with parameters $r=0..a$, $\mathrm{\theta }=0..\mathrm{\pi }$ and $\mathrm{\phi }=0..2\mathrm{\pi }$

 > $\left(\mathrm{Int}=\mathrm{int}\right)\left(1,V,\mathrm{volume}=\mathit{C__3},\mathrm{parameters}=\left[r=0..a,\mathrm{θ}=0..\mathrm{Pi},\mathrm{φ}=0..2\mathrm{Pi}\right]\right)$
 ${\mathrm{Int}}{}\left({1}{,}{V}{,}{\mathrm{volume}}{=}\left({{x}}^{{2}}{+}{{y}}^{{2}}{+}{{z}}^{{2}}{=}{{r}}^{{2}}\right){,}{\mathrm{parameters}}{=}\left[{r}{=}{0}{..}{a}{,}{\mathrm{θ}}{=}{0}{..}{\mathrm{π}}{,}{\mathrm{φ}}{=}{0}{..}{2}{}{\mathrm{π}}\right]\right){=}\frac{{4}}{{3}}{}{{a}}^{{3}}{}{\mathrm{π}}$ (77)

Using ParametrizeVolume one can also see that the vectorial representation of this region is just the position vector $\stackrel{\to }{r}$ written in spherical coordinates and basis

 > $\mathrm{ParametrizeVolume}\left(\mathit{C__3},\mathrm{basis}=\mathrm{spherical},\mathrm{output}=\mathrm{vector}\right)$
 ${r}{}\stackrel{{\wedge }}{{r}}{,}\left[{r}{,}{\mathrm{\theta }}{,}{\mathrm{\phi }}\right]$ (78)

so one can use this simpler vectorial representation of the sphere as well

 > $\left(\mathrm{Int}=\mathrm{int}\right)\left(1,V,\mathrm{volume}=r\mathrm{_r},\mathrm{parameters}=\left[r=0..a,\mathrm{θ}=0..\mathrm{Pi},\mathrm{φ}=0..2\mathrm{Pi}\right]\right)$
 ${\mathrm{Int}}{}\left({1}{,}{V}{,}{\mathrm{volume}}{=}{r}{}{\mathrm{_r}}{,}{\mathrm{parameters}}{=}\left[{r}{=}{0}{..}{a}{,}{\mathrm{θ}}{=}{0}{..}{\mathrm{π}}{,}{\mathrm{φ}}{=}{0}{..}{2}{}{\mathrm{π}}\right]\right){=}\frac{{4}}{{3}}{}{{a}}^{{3}}{}{\mathrm{π}}$ (79)

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.

 > $\left(\mathrm{Int}=\mathrm{int}\right)\left(1,V=r\mathrm{_r},\mathrm{parameters}=\left[r=0..a,\mathrm{θ}=0..\mathrm{Pi},\mathrm{φ}=0..2\mathrm{Pi}\right]\right)$
 ${\mathrm{Int}}{}\left({1}{,}{V}{=}{r}{}{\mathrm{_r}}{,}{\mathrm{parameters}}{=}\left[{r}{=}{0}{..}{a}{,}{\mathrm{θ}}{=}{0}{..}{\mathrm{π}}{,}{\mathrm{φ}}{=}{0}{..}{2}{}{\mathrm{π}}\right]\right){=}\frac{{4}}{{3}}{}{{a}}^{{3}}{}{\mathrm{π}}$ (80)

Compatibility

 • The Physics[Vectors][int] command was introduced in Maple 2022.