Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
sagemanifolds
GitHub Repository: sagemanifolds/IntroToManifolds
Path: blob/main/20Manifold_Stokes.ipynb
Views: 83
Kernel: SageMath 9.6

20. Integration of differential forms on singular kk-cubes

This notebook is part of the Introduction to manifolds in SageMath by Andrzej Chrzeszczyk (Jan Kochanowski University of Kielce, Poland).

version()
'SageMath version 9.6, Release Date: 2022-05-15'

Remark. This notebook is an attempt to present a more friendly version of Chapter 4 of:

Michael Spivak. Calculus on manifolds, Addison Wesley, NY 1965,

with elementary examples in SageMath.

Remark. Readers interested in application of free software to illustrate the classical Stokes theorem should consult for example https://docs.sympy.org/latest/modules/vector/vector_integration.html

Warning. In the present notebook we extensively use the information on differential forms from notebook 14 and notebook 16.


Explicit description of some pullbacks

Let us start from some more explicit description of pullback of kk-forms on kk-dimensional open sets.

Consider the smooth map ϕ:UV\phi:U\to V between open subsets in RkR^k. Let x1,,xkx^1,\ldots,x^k be the coordinates on VV and t1,,tkt^1,\ldots,t^k - the coordinates on UU. For kk-form ω(x)=f(x)dx1dxk, \omega(x)=f(x)dx^1\wedge\ldots\wedge dx^k,\ fC(V)f\in C^\infty(V) we have

(ϕω)(t)=f(ϕ(t))(ϕ1,,ϕk)(t1,,tk)dt1dtk,\begin{equation} (\phi^*\omega)(t)=f(\phi(t))\frac{\partial(\phi^1,\ldots,\phi^k)}{\partial(t^{1},\ldots,t^{k})}dt^1\wedge\ldots\wedge dt^k, \tag{20.1} \end{equation}

where ϕ=(ϕ1,,ϕk)\phi=(\phi^1,\ldots,\phi^k) and  (ϕ1,,ϕk)(t1,,tk)=det[ϕitj]\ \frac{\partial(\phi^1,\ldots,\phi^k)}{\partial(t^{1},\ldots,t^{k})}=\det\big[\frac{\partial\phi^i}{\partial t^j}\big].

In fact

ϕ(ω)=f(ϕ(t))(ϕ1ti1dti1)(ϕktikdtik)=f(ϕ(t))ϕ1ti1ϕktikdti1dtik=f(ϕ(t))(σSk(signσ)ϕ1tσ(1)ϕktσ(k))dt1dtk=f(ϕ(t))det[ϕitj]dt1dtk,\phi^*(\omega)=f(\phi(t))\big(\frac{\partial\phi^1}{\partial t^{i_1}}dt^{i_1}\big) \wedge\ldots\wedge\big(\frac{\partial\phi^k}{\partial t^{i_k}}dt^{i_k}\big)\\ =f(\phi(t))\frac{\partial\phi^1}{\partial t^{i_1}}\ldots\frac{\partial\phi^k}{\partial t^{i_k}}dt^{i_1}\wedge \ldots\wedge dt^{i_k}\\ =f(\phi(t))\big(\sum_{\sigma\in S_k} (\text{sign}\,\sigma) \frac{\partial\phi^1}{\partial t^{\sigma(1)}}\ldots\frac{\partial\phi^k}{\partial t^{\sigma(k)}}\big)dt^{1}\wedge \ldots\wedge dt^{k}\\ =f(\phi(t))\det\big[\frac{\partial\phi^i}{\partial t^j}\big]dt^{1}\wedge \ldots\wedge dt^{k},

(we have used the relations i1=σ(1),,ik=σ(k), i_1=\sigma(1),\ldots,i_k=\sigma(k),\  dti1dtik=(signσ)dt1dtk\ dt^{i_1}\wedge\ldots\wedge dt^{i_k}=(\text{sign}\,\sigma)dt^1\wedge\ldots\wedge dt^k and the definition of determinant).


Singular kk-cubes


Let [0,1]k=[0,1]××[0,1]k-times[0,1]^k=\underbrace{[0,1]\times\ldots\times[0,1]}_{k\mbox{-times}} and UU be an open subset of RkR^k such that [0,1]kU.[0,1]^k\subset U.

Let ϕ:UV\phi : U \to V be a CC^\infty map of UU into an open set VV in RmR^m (kk and mm may be different). We will write this map simply as ϕ:[0,1]kV,\begin{equation} \phi:[0,1]^k\to V, \tag{20.2} \end{equation}

(this map is a restriction of a CC^\infty map UV U\to V).

The map ϕ:[0,1]kV\phi:[0,1]^k\to V will be called a singular kk-cube in VV. The word singular indicates that the map need not be one-to-one, though we will require that ϕ\phi be in CC^\infty. For k=1,2k=1,2 the singular kk-cubes are just parametrized curves and surfaces, respectively.


Standard kk-cubes


By the standard kk-cube we will mean the map I:[0,1]kRk I:[0,1]^k\to R^k defined by

I(t)=t,t[0,1]k,\begin{equation} I(t)=t,\quad t\in[0,1]^k, \tag{20.3} \end{equation}

so II is an example of singular kk-cube with ϕ[0.1]k=id[0,1]k.\phi\big|_{[0.1]^k}=id_{[0,1]^k}.

For standard kk-cube II we can define singular (k1)(k-1)-cubes Ii0I^0_i and Ii1I^1_i (the i-th pieces of the boundary of II) as the maps

Ii0:[0,1]k1tx(t)Rk, wherex1(t)=t1,...........,xi1(t)=ti1,xi(t)=xi=0,xi+1(t)=ti,...........,xk(t)=tk1,t=(t1,,tk1)[0,1]k1,\begin{equation} \begin{matrix} I^0_i:[0,1]^{k-1}\ni t\to x(t)\in R^k, \text{ where}\\ x^1(t)=t^1,\\ ...........,\\ x^{i-1}(t)=t^{i-1},\\ x^i(t)=x^i=0,\\ x^{i+1}(t)=t^i,\\ ...........,\\ x^k(t)=t^{k-1},\\ t=(t^1,\ldots,t^{k-1})\in [0,1]^{k-1}, \end{matrix} \tag{20.4} \end{equation}

and

Ii1:[0,1]k1tx(t)Rk, wherex1(t)=t1,...........,xi1(t)=ti1,xi(t)=xi=1,xi+1(t)=ti,...........,xk(t)=tk1,t=(t1,,tk1)[0,1]k1.\begin{equation} \begin{matrix} I^1_i:[0,1]^{k-1}\ni t\to x(t)\in R^k, \text{ where}\\ x^1(t)=t^1,\\ ...........,\\ x^{i-1}(t)=t^{i-1},\\ x^i(t)=x^i=1,\\ x^{i+1}(t)=t^i,\\ ...........,\\ x^k(t)=t^{k-1},\\ t=(t^1,\ldots,t^{k-1})\in [0,1]^{k-1}. \end{matrix} \tag{20.5} \end{equation}

The singular (k1)(k-1)-cubes Ii0I^0_i and Ii1I^1_i are called (0,i)(0,i) and (1,i)(1,i) faces of II respectively.


Boundary of the singular kk-cube


In the definition of the boundary of a singular kk-cube we will use some auxiliary notions.

For arbitrary family of objects W={wi}iJW=\{w_i\}_{i\in J} we can construct a vector space of formal linear combinations of elements wiWw_i\in W as the family of functions f:WRf:W\to R, such that f(wi)=0f(w_i) = 0 for all but finitely many wiw_i. Vector space operations on such functions are defined as usual: if f,gf,g are formal linear combinations of elements of WW, then

(f+g)(wi)=f(wi)+g(wi)and   (qf)(wi)=q(f(wi)),for wiW,qR.(f+g)(w_i)=f(w_i)+g(w_i)\quad\mbox{and }\ \ (qf)(w_i)=q(f(w_i)),\quad \mbox{for } w_i\in W, q\in R.

The formal linear combination ff are usually written as

f=aiwi, where   ai=f(wi).f=\sum a_iw_i,\quad \mbox{ where } \ \ a_i=f(w_i).

If we take as WW the family of all singular kk-cubes in VV we can define the space of kk-chains in VV as the space of formal linear combinations of singular kk-cubes in VV. Thus the space of kk-chains consists of (finite) linear combinations

$$ \sum a_i\phi_i,\quad \mbox{where } \phi_i\ \ \mbox{are singular}\ \ \text{$kParseError: KaTeX parse error: Expected 'EOF', got '}' at position 11: -cubes and}̲\ \ a_i\in R. $

Using the introduced notion we can define the boundary I\partial I of the standard kk-cube II as the (k1)(k-1)-chain

I=i=1k(1)i1(Ii1Ii0).\begin{equation} \partial I=\sum_{i=1}^k (-1)^{i-1}(I^1_i-I^0_i). \tag{20.6} \end{equation}

In the case of singular kk-cube ϕ:[0,1]kV\phi:[0,1]^k\to V we define the (0,i)(0,i) and (1,i)(1,i) faces as

ϕi0=ϕIi0,ϕi1=ϕIi1,\begin{equation} \phi^0_i=\phi\circ I^0_i,\qquad \phi^1_i=\phi\circ I^1_i, \tag{20.7} \end{equation}

respectively and the boundary ϕ\partial \phi of ϕ\phi as the (k1)(k-1)-chain

ϕ=i=1k(1)i1(ϕi1ϕi0).\begin{equation} \partial\phi =\sum_{i=1}^k (-1)^{i-1}(\phi^1_i-\phi^0_i). \tag{20.8} \end{equation}

Integrals of kk-forms on singular kk-cubes and chains


Let ω\omega be a smooth kk-form on an open set URkU\subset R^k containing [0,1]k[0,1]^k. Assume that ω\omega is of the form

ω=fdx1dxk,\begin{equation} \omega=fdx^1\wedge\ldots\wedge dx^k, \tag{20.9} \end{equation}

where ff is a smooth function on UU.

We define first the integral of ω\omega over [0,1]k[0,1]^k

[0,1]kω=[0,1]kfdx1dxk=[0,1]kf(x)dx1dxk=[0,1]kf,\begin{equation} \int_{[0,1]^k}\omega =\int_{[0,1]^k}fdx^1\wedge\ldots\wedge dx^k=\int_{[0,1]^k}f(x)dx^1\ldots dx^k=\int_{[0,1]^k} f, \tag{20.10} \end{equation}

where the right hand side denotes the Riemann integral over the rectangle [0,1]k[0,1]^k.

Using this relation we can define the integral of the smooth kk-form ω\omega on VV over singular kk-cube ϕ:[0,1]kV\phi:[0,1]^k\to V:

ϕω=[0,1]kϕω.\begin{equation} \int_\phi\omega =\int_{[0,1]^k}\phi^\star\omega. \tag{20.11} \end{equation}

With the help of (20.1) we can rewrite this formula:

ϕω=[0,1]kf(ϕ(t))(ϕ1,,ϕk)(t1,,tk)dt1dtk,\begin{equation} \int_{\phi}\omega=\int_{[0,1]^k}f(\phi(t)) \frac{\partial(\phi^1,\ldots,\phi^k)}{\partial(t^{1},\ldots,t^{k})}dt^1\wedge\ldots\wedge dt^k, \tag{20.12} \end{equation}

where ϕ=(ϕ1,,ϕk)\phi=(\phi^1,\ldots,\phi^k).

In the special case of standard kk-cube II given by x1=t1,,xk=tkx^1=t^1,\ldots,x^k=t^k, t[0,1]kt\in [0,1]^k we obtain

Ifdx1dxk=[0,1]kI(fdx1dxk)=[0,1]kf(I(t))(x1,,xk)(t1,,tk)dt1dtk=[0,1]kf(t)dt1dtk.\begin{equation} \begin{matrix} \int_I fdx^1\wedge\ldots\wedge dx^k= \int_{[0,1]^k}I^*(fdx^1\wedge\ldots\wedge dx^k)\\ =\int_{[0,1]^k}f(I(t)) \frac{\partial(x^1,\ldots,x^k)}{\partial(t^{1},\ldots,t^{k})}dt^1\wedge\ldots\wedge dt^k\\ =\int_{[0,1]^k}f(t)dt^1\ldots dt^k. \end{matrix} \tag{20.13} \end{equation}

Finally we define the integral of kk-form of ω\omega over kk-chain c=aiϕic=\sum a_i\phi_i:

cω=aiϕiω.\begin{equation} \int_c\omega=\sum a_i\int_{\phi_i}\omega. \tag{20.14} \end{equation}

The last formula applied to (k1)(k-1)-chain   I=i=1k(1)i1(Ii1Ii0)  \ \ \partial I=\sum_{i=1}^k (-1)^{i-1}(I^1_i-I^0_i)\ \ and (k1)(k-1)-form ω\omega gives

Iω=i=1k(1)i1(Ii1ωIi0ω),\begin{equation} \int_{\partial I}\omega=\sum_{i=1}^k (-1)^{i-1}(\int_{I^1_i}\omega -\int_{I^0_i}\omega), \tag{20.15} \end{equation}

and in the case of (k1)(k-1)-chain   ϕ=i=1k(1)i1(ϕi1ϕi0)  \ \ \partial \phi=\sum_{i=1}^k (-1)^{i-1}(\phi^1_i-\phi^0_i)\ \ :

ϕω=i=1k(1)i1(ϕi1ωϕi0ω).\begin{equation} \int_{\partial \phi}\omega=\sum_{i=1}^k (-1)^{i-1}(\int_{\phi^1_i}\omega -\int_{\phi^0_i}\omega). \tag{20.16} \end{equation}

The definition (20.15) of the integral of ω\omega on I\partial I looks artificially, but we can give it a quite natural interpretation if we define the orientation of Ii0I^0_i and Ii1I^1_i.

We recall that the transition from one frame e1,...,eke_1,..., e_k in RkR^k to a second frame e1,...,eke_1',..., e_k' can be defined by the square matrix obtained from ej=Ajieie_j'=A^i_je_i. The determinant of this matrix is always nonzero, and the set of all frames divides into two equivalence classes, each class containing all possible frames such that for any two of them the determinant of transition matrix is positive. Such equivalence classes are called orientation classes of frames in RnR^n. To define an orientation means to fix one of these orientation classes. Thus, the oriented space RkR^k is the space RkR^k together with a fixed orientation class of frames.

Let nin_i be the unit outward (with respect to [0,1]k[0,1]^k) normal vector to Ii1I^1_i or Ii0I^0_i defined in (20.4),(20,5). Assume that the space R𝑘R^𝑘 has been oriented by e1,,eke_1,\ldots,e_k. We can define the orientation of I01I^1_0 and Ii0I^0_i prescribed by the unit outward normal vector to Ii1I^1_i or Ii0I^0_i in the following way.

Compare the frame 𝑛i,𝑒1,...,ei^,𝑒k𝑛_i,𝑒_1,...,\widehat{e_i}\ldots,𝑒_k (eie_i omitted) with the frame e1,..,,𝑒ke_1,..,,𝑒_k, that orients the space R𝑘R^𝑘.

If these are in the same orientation class, then Ii0I^0_i (or Ii1I^1_i) has the orientation prescribed by the unit outward normal vector to Ii0I^0_i (or Ii1I^1_i).

If these two frames are in different orientation classes, then we take the orientation of Ii0I^0_i ( or Ii1I^1_i) opposite to that defined by 𝑛i,𝑒1,...,ei^,𝑒k𝑛_i,𝑒_1,...,\widehat{e_i}\ldots,𝑒_k as the one prescribed by the outward unit normal vector.

Defining  Iω  \ \int_{\partial I}\omega\ \ we take the sum of all  Ii0ω  \ \int_{ I^0_i}\omega\ \ and  Ii1ω,  \ \int_{I^1_i}\omega,\ \ but if  Ii0 \ I^0_i\ or  Ii1 \ I^1_i\ have the orientation opposite to that prescribed by the outward unit normal vector we take the corresponding integrals with minus sign.


Example 20.1

Consider the case k=2k=2.

l1=polygon2d([(1.0,0.5),(1.5,0.5),(1.5,1.0),(1.0,1.0)], fill=False,color='black',xmin=0,xmax=2.5, ymin=0,ymax=1.5) e1=arrow((1.35,1),(1.1,1),color='black') t1=text('$-e_1$',(1.1,1.1),fontsize=20, color='black') n1=arrow((1.35,1),(1.35,1.2),color='black') tn1=text('$n$',(1.35,1.25),fontsize=20, color='black') I21=text('$I^1_2$',(1.2,1.3),fontsize=24, color='black') e2=arrow((1.1,0.5),(1.35,0.5),color='black') t2=text('$e_1$',(1.25,0.6),fontsize=20, color='black') n2=arrow((1.1,0.5),(1.1,0.3),color='black') tn2=text('$n$',(1.1,0.25),fontsize=20, color='black') I20=text('$I^0_2$',(1.3,0.2),fontsize=24, color='black') e3=arrow((1,0.85),(1.0,0.65),color='black') t3=text('$-e_2$',(0.85,0.65),fontsize=20, color='black') n3=arrow((1.0,0.85),(0.8,0.85),color='black') nt3=text('$n$',(0.75,0.9),fontsize=20, color='black') I11=text('$I^1_1$',(1.9,0.75),fontsize=24, color='black') e4=arrow((1.5,0.65),(1.5,0.85),color='black') t4=text('$e_2$',(1.6,0.85),fontsize=20, color='black') n4=arrow((1.5,0.65),(1.7,0.65),color='black') nt4=text('$n$',(1.75,0.65),fontsize=20, color='black') I01=text('$I^0_1$',(0.6,0.75),fontsize=24, color='black') (l1+e1+t1+n1+tn1+e2+n2+tn2+t2+e3+t3+n3+nt3+ e4+t4+n4+nt4+I21+I20+I11+I01).show(axes=False)
Image in a Jupyter notebook

If k=2k=2, then the integral over the boundary of  I \ I\ defined in (20.15) takes the form

Iω=i=12(1)i1[Ii1ωIi0ω]=I11ωI10ωI21ω+I20ω.\begin{equation} \begin{matrix} \int_{\partial I}\omega =\sum_{i=1}^2(-1)^{i-1}\big[\int_{I^1_i}\omega-\int_{I^0_i}\omega\big] \\ =\int_{I^1_1}\omega-\int_{I^0_1}\omega -\int_{I^1_2}\omega+\int_{I^0_2}\omega. \end{matrix} \tag{*} \end{equation}

The orientation of the boundary of II prescribed by the unit normal outward vector implies that:

on I20I^0_2 the frame n,e1n,e_1 is in the same orientation class as e1,e2e_1,e_2 in R2R^2,

on I11I^1_1 the frame n,e2n,e_2 is in the same orientation class as e1,e2e_1,e_2 in R2R^2,

on I21I^1_2 the frame n,e1n,-e_1 is in the same orientation class as e1,e2e_1,e_2 in R2R^2,

on I10I^0_1 the frame n,e2n,-e_2 is in the same orientation class as e1,e2e_1,e_2 in R2R^2.

This is in accordance with the fact that in (*) the integrals over I21I^1_2 and I10I^0_1 are taken with the minus sign.

As we can see, in the case k=2k=2 the formula (20.15) agrees with the orientation of boundary of II prescribed by the unit outward normal vector and corresponds to going around the square counterclockwise.


Example 20.2

Consider the case k=3k=3.

x1=arrow((0.5,0.2),(1.8,0.2),color='black') x2=arrow((0.5,0.2),(1.6,1.05),color='lightgrey') x3=arrow((0.5,0.2),(0.5,1.4),color='black') t1=text('$x_1$',(2.1,0.2),fontsize=20, color='black') t2=text('$x_2$',(1.5,1.4),fontsize=20, color='black') t3=text('$x_3$',(0.4,1.7),fontsize=20, color='black') #(x1+x2+x3).show(axes=False) l1=polygon2d([(0.5,0.2),(0.5,0.8),(1.0,0.8),(1,0.2)], fill=False,color='black') l2=polygon2d([(0.5,0.8),(0.8,1.),(1.3,1.),(1.0,0.8)], fill=False,color='black') l3=polygon2d([(1.0,0.2),(1.0,0.8),(1.3,1),(1.3,0.5)], fill=False,color='black') p11=x1+t1+x2+t2+x3+t3+l1+l2+l3 e2=arrow((0,0),(-0.6,-0.6),color='grey',xmin=-2,ymin=-2,xmax=2,ymax=2) t2=text('$-e_2$',(-0.75,-0.75),fontsize=20, color='black') e3=arrow((0,0),(0,1.2),color='grey',xmin=-2,ymin=-2,xmax=2,ymax=2) t3=text('$e_3$',(0,1.4),fontsize=20, color='black') n=arrow((0,0),(-0.7,0),color='grey',xmin=-2,ymin=-2,xmax=2,ymax=2) tn=text('$n$',(-0.8,0.),fontsize=20, color='black') left=text("$I^0_1$",(1.8,0),fontsize=28, color='black') p10=e2+t2+e3+t3+n+tn+left e2=arrow((0,0),(0.6,0.6),color='grey',xmin=-2,ymin=-2,xmax=2,ymax=2) t2=text('$e_2$',(0.75,0.75),fontsize=20, color='black') e3=arrow((0,0),(0,1.2),color='grey',xmin=-2,ymin=-2,xmax=2,ymax=2) t3=text('$e_3$',(0,1.4),fontsize=20, color='black') n=arrow((0,0),(0.7,0),color='grey',xmin=-2,ymin=-2,xmax=2,ymax=2) tn=text('$n$',(0.8,0.),fontsize=20, color='black') right=text("$I^1_1$",(-1.9,0),fontsize=28, color='black') p12=e2+t2+e3+t3+n+tn+right e1=arrow((0,0),(0.7,0.0),color='grey',xmin=-2,ymin=-2,xmax=2,ymax=2) t1=text('$e_1$',(0.8,0.0),fontsize=20, color='black') e2=arrow((0,0),(0.7,0.7),color='grey',xmin=-2,ymin=-2,xmax=2,ymax=2) t2=text('$e_2$',(0.8,0.8),fontsize=20, color='black') n=arrow((0,0),(0,1),color='grey',xmin=-2,ymin=-2,xmax=2,ymax=2) tn=text('$n$',(0.,1.1),fontsize=20, color='black') ttop=text("$I^1_3$",(0,-1.9),fontsize=28, color='black') p01=e1+t1+e2+t2+n+tn+ttop e1=arrow((0,0),(0.7,0.0),color='grey',xmin=-2,ymin=-2,xmax=2,ymax=2) t1=text('$e_1$',(0.8,0.0),fontsize=20, color='black') e2=arrow((0,0),(-0.7,-0.7),color='grey',xmin=-2,ymin=-2,xmax=2,ymax=2) t2=text('$-e_2$',(-0.8,-0.8),fontsize=20, color='black') n=arrow((0,0),(0,-1),color='grey',xmin=-2,ymin=-2,xmax=2,ymax=2) tn=text('$n$',(0.,-1.1),fontsize=20, color='black') bottom=text("$I^0_3$",(0,1.8),fontsize=28, color='black') p21=e1+t1+e2+t2+n+tn+bottom e1=arrow((0,0),(-0.7,0.0),color='grey',xmin=-2,ymin=-2,xmax=2,ymax=2) t1=text('$-e_1$',(-1,0.0),fontsize=20, color='black') e3=arrow((0,0),(0,1.2),color='grey',xmin=-2,ymin=-2,xmax=2,ymax=2) t3=text('$e_3$',(0,1.4),fontsize=20, color='black') n=arrow((0,0),(0.7,0.7),color='grey',xmin=-2,ymin=-2,xmax=2,ymax=2) tn=text('$n$',(0.8,0.8),fontsize=20, color='black') back=text("$I^1_2$",(-1.8,-1.8),fontsize=28, color='black') p02=e1+t1+e3+t3+n+tn+back e1=arrow((0,0),(0.7,0.0),color='grey',xmin=-2,ymin=-2,xmax=2,ymax=2) t1=text('$e_1$',(0.8,0.0),fontsize=20, color='black') e3=arrow((0,0),(0,1.2),color='grey',xmin=-2,ymin=-2,xmax=2,ymax=2) t3=text('$e_3$',(0,1.4),fontsize=20, color='black') n=arrow((0,0),(-0.7,-0.7),color='grey',xmin=-2,ymin=-2,xmax=2,ymax=2) tn=text('$n$',(-0.8,-0.8),fontsize=20, color='black') front=text("$I^0_2$",(1.8,1.8),fontsize=28, color='black') p20=e1+t1+e3+t3+n+tn+front graphics_array([[text("",(1,1)),p01,p02], [p10,p11,p12], [p20,p21,text("",(1,1))]]).show(axes=False, figsize=(8,6))
Image in a Jupyter notebook

If k=3k=3, then the integral over the boundary of  I \ I\ defined in (20.15) takes the form

Iω=i=13(1)i1[Ii1ωIi0ω]=I11ωI10ωI21ω+I20ω+I31ωI30ω.\begin{equation} \begin{matrix} \int_{\partial I}\omega =\sum_{i=1}^3(-1)^{i-1}\big[\int_{I^1_i}\omega-\int_{I^0_i}\omega\big] \\ =\int_{I^1_1}\omega-\int_{I^0_1}\omega -\int_{I^1_2}\omega+\int_{I^0_2}\omega +\int_{I^1_3}\omega-\int_{I^0_3}\omega. \end{matrix} \tag{**} \end{equation}

The orientation of the boundary of II prescribed by the unit outward normal vector implies that:

on I11I^1_1 the frame n,e2,e3n,e_2,e3 is in the same orientation class as e1,e2,e3e_1,e_2,e_3 in R3R^3,

on I10I^0_1 the frame n,e2,e3n,-e_2,e_3 is in the same orientation class as e1,e2,e3e_1,e_2,e_3 in R3R^3,

on I21I^1_2 the frame n,e1,e3n,-e_1,e_3 is in the same orientation class as e1,e2,e3e_1,e_2,e_3 in R3R^3,

on I20I^0_2 the frame n,e1,e3n,e_1,e_3 is in the same orientation class as e1,e2,e3e_1,e_2,e_3 in R3R^3,

on I31I^1_3 the frame n,e1,e2n,e_1,e_2 is in the same orientation class as e1,e2,e3e_1,e_2,e_3 in R3R^3,

on I30I^0_3 the frame n,e1,e2n,e_1,-e_2 is in the same orientation class as e1,e2,e3e_1,e_2,e_3 in R3R^3.

This is in accordance with the fact that in (**) the integrals over I10,I21,I30I^0_1,I^1_2,I^0_3 are taken with the minus sign.

As we can see, in the case k=3k=3 the formula (20.15) agrees with the orientation of boundary of II prescribed by the unit outward normal vector.


Integrals of (k1)(k-1)-forms over Ii0I^0_i and Ii1I^1_i


General smooth (k1)(k-1)-form on an open subset URkU\subset R^k containing [0,1]k[0,1]^k is of the form

ω=j=1kωj(x1,,xk)dx1dxj^dxk,\begin{equation} \omega=\sum_{j=1}^k\omega_j(x^1,\ldots,x^k)dx^1\wedge\ldots \widehat{dx^j} \wedge\ldots dx^k, \tag{20.17} \end{equation}

(dxjdx^j is omitted).

Consider the single summand  ωjdx1dxj^dxk\ \omega_j dx^1\wedge\ldots \wedge \widehat{dx^j}\wedge\ldots\wedge dx^k.

Since the map Ii0I^0_i is given by (20.4) and xi=0x^i=0 is constant, for iji\neq j we have

Ii0ωjdx1dxj^dxk=[0,1]k1(Ii0)(ωjdx1dxj^dxk)=[0,1]k1ωj(Ii0(t))(x1,0xj^,xk)(t1,,tk1)dt1dtk1=0\int_{I^0_i}\omega_j dx^1\wedge\ldots \wedge \widehat{dx^j}\wedge\ldots\wedge dx^k\\ =\int_{[0,1]^{k-1}}(I^0_i)^*(\omega_j dx^1\wedge\ldots \wedge \widehat{dx^j}\wedge\ldots\wedge dx^k)\\ =\int_{[0,1]^{k-1}}\omega_j(I^0_i(t)) \frac{\partial(x^1,\ldots 0\ldots\widehat{x^j}\ldots,x^k)}{\partial(t^{1},\ldots,t^{k-1})} dt^{1}\wedge\ldots\wedge dt^{k-1}=0

and analogously for Ii1I^1_i , so if iji\neq j

Ii0ωjdx1dxj^dxk=0,Ii1ωjdx1dxj^dxk=0.\begin{equation} \begin{matrix} \int_{I^0_i}\omega_j dx^1\wedge\ldots \wedge \widehat{dx^j}\wedge\ldots\wedge dx^k=0,\\ \int_{I^1_i}\omega_j dx^1\wedge\ldots \wedge \widehat{dx^j}\wedge\ldots\wedge dx^k=0. \end{matrix} \tag{20.18} \end{equation}

If i=ji=j we have

Ii0ωidx1dxi^dxk=[0,1]k1(Ii0)(ωidx1dxi^dxk)=[0,1]k1ωi(Ii0(t))(x1,xi^,xk)(t1,,tk1)dt1dtk1=[0,1]k1ωi(Ii0(t))dt1dtk1=[0,1]k1ωixi=0dx1dxi^dxk=[0,1]kωixi=0dx1dxk.\int_{I^0_i}\omega_i dx^1\wedge\ldots \wedge \widehat{dx^i}\wedge\ldots\wedge dx^k\\ =\int_{[0,1]^{k-1}}(I^0_i)^*(\omega_i dx^1\wedge\ldots \wedge \widehat{dx^i}\wedge\ldots\wedge dx^k)\\ =\int_{[0,1]^{k-1}}\omega_i(I^0_i(t)) \frac{\partial(x^1,\ldots\widehat{x^i}\ldots,x^k)}{\partial(t^{1},\ldots,t^{k-1})} dt^{1}\wedge\ldots\wedge dt^{k-1}\\ =\int_{[0,1]^{k-1}}\omega_i(I^0_i(t)) dt^{1}\ldots dt^{k-1}\\ =\int_{[0,1]^{k-1}}\omega_i\big|_{x^i=0} dx^{1}\ldots\widehat{dx^i}\ldots dx^{k}\\ =\int_{[0,1]^{k}}\omega_i\big|_{x^i=0} dx^{1}\ldots\ldots dx^{k}.

The last equality follows from the fact, that if a function gg is constant with respect to xix^i, then g=01gdxig=\int_0^1 gdx^i.

Analogously we can compute the integral over Ii1I^1_i, so

Ii0ωidx1dxi^dxk=[0,1]kωixi=0dx1dxk,\begin{equation} \begin{matrix} \int_{I^0_i}\omega_i dx^1\wedge\ldots \wedge \widehat{dx^i}\wedge\ldots\wedge dx^k\\ =\int_{[0,1]^{k}}\omega_i\big|_{x^i=0} dx^{1}\ldots dx^{k}, \end{matrix} \tag{20.19} \end{equation}

and Ii1ωidx1dxi^dxk=[0,1]kωixi=1dx1dxk.\begin{equation} \begin{matrix} \int_{I^1_i}\omega_i dx^1\wedge\ldots \wedge \widehat{dx^i}\wedge\ldots\wedge dx^k\\ =\int_{[0,1]^{k}}\omega_i\big|_{x^i=1} dx^{1}\ldots dx^{k}. \end{matrix} \tag{20.20} \end{equation}


Stokes theorem on the standard kk-cube


Consider a smooth (k1)(k-1)-form (20.17) on an open subset VRkV\subset R^k containing [0,1]k[0,1]^k and let II be the standard kk-cube defined in (20.3). Let us compute  Idω.\ \int_I d\omega.

By linearity we can compute each summand

Id(ωidx1dxi^dxk)\int_I d(\omega_idx^1\wedge\ldots \widehat{dx^i}\wedge\ldots dx^k)

separately. Let us focus on i=1i=1 first. We have

Id(ω1dx1^dx2dxk)=[0,1]kI(d(ω1dx2dxk))=[0,1]kd(I(ω1dx2dxk))=[0,1]kω1t1dt1dtk=tk=01t1=01ω1t1dt1dtk=tk=01t2=01[ω1(t)t1=1ω1(t)t1=0]dt2dtk.\int_I d(\omega_1 \widehat{dx^1}\wedge dx^2\wedge\ldots\wedge dx^k)\\ =\int_{[0,1]^k}I^*( d(\omega_1 dx^2\wedge\ldots\wedge dx^k))\\ =\int_{[0,1]^k} d(I^*(\omega_1 dx^2\wedge\ldots\wedge dx^k))\\ =\int_{[0,1]^k}\frac{\partial \omega_1}{\partial t^1}dt^1\wedge\ldots\wedge dt^k\\ = \int_{t^k=0}^{1}\ldots\int_{t^1=0}^{1} \frac{\partial \omega_1}{\partial t^1}dt^1\ldots dt^k\\ =\int_{t^k=0}^{1}\ldots\int_{t^2=0}^{1} \big[\omega_1(t)\big|_{t^1=1}-\omega_1(t)\big|_{t^1=0}\big]dt^2\ldots dt^k.

Since the integrand g=ω1(t)t1=1ω1(t)t1=0g=\omega_1(t)\big|_{t^1=1}-\omega_1(t)\big|_{t^1=0} does not depend on t1t^1 it is equal to its integral 01g  dt1\int^1_0g\;dt^1, so

Id(ω1dx1^dx2dxk)=[0,1]k[ω1(t)t1=1ω1(t)t1=0]dt1dtk=[0,1]k[ω1x1=1ω1x1=0]dx1dxk=I11ω1dx1^dx2dxkI10ω1dx1^dx2dxk.\int_I d(\omega_1 \widehat{dx^1}\wedge dx^2\wedge\ldots\wedge dx^k)\\ =\int_{[0,1]^k}\big[\omega_1(t)\big|_{t^1=1}-\omega_1(t)\big|_{t^1=0}\big]dt^1\ldots dt^k\\ =\int_{[0,1]^k}\big[\omega_1\big|_{x^1=1}-\omega_1\big|_{x^1=0}\big]dx^1\ldots dx^k\\ =\int_{I_1^1}\omega_1\widehat{dx^1}\wedge dx^2\wedge\ldots\wedge dx^k -\int_{I_1^0}\omega_1\widehat{dx^1}\wedge dx^2\wedge\ldots\wedge dx^k.

In the last equality we have used (20.19) and (20.20) for i=1i=1.

For i=2i=2 we have

Id(ω2dx1dx2^dx3dxk)=[0,1]kI(d(ω2dx1dx3dxk))=[0,1]kd(I(ω2dx1dx3dxk))=[0,1]kω2t2dt2dt1dt3dtk=(1)[0,1]kω2t2dt1dt2dt3dtk=(1)tk=01t2=01t1=01ω2t2dt1dtk=(1)tk=01t3=01t1=01t2=01ω2t2dt2dt1dt3dtk=(1)tk=01t2=01^t1=01[ω2(t)t2=1ω2(t)t2=0]dt1dt2^dtk.\int_I d(\omega_2 dx^1\wedge\widehat{dx^2}\wedge dx^3\ldots\wedge dx^k)\\ =\int_{[0,1]^k}I^*( d(\omega_2 dx^1\wedge dx^3\ldots\wedge dx^k))\\ =\int_{[0,1]^k} d(I^*(\omega_2 dx^1\wedge dx^3\ldots\wedge dx^k))\\ =\int_{[0,1]^k}\frac{\partial \omega_2}{\partial t^2}dt^2\wedge dt^1\wedge dt^3\ldots\wedge dt^k\\ =(-1)\int_{[0,1]^k}\frac{\partial \omega_2}{\partial t^2}dt^1\wedge dt^2\wedge dt^3\ldots\wedge dt^k\\ =(-1)\int_{t^k=0}^{1}\ldots\int_{t^2=0}^1\int_{t^1=0}^{1} \frac{\partial \omega_2}{\partial t^2}dt^1\ldots dt^k\\ =(-1)\int_{t^k=0}^{1}\ldots\int_{t^3=0}^1\int_{t^1=0}^1\int_{t^2=0}^{1} \frac{\partial \omega_2}{\partial t^2}dt^2dt^1 dt^3\ldots dt^k\\ =(-1)\int_{t^k=0}^{1}\ldots\widehat{\int_{t^2=0}^1}\int_{t^1=0}^{1} \big[\omega_2(t)\big|_{t^2=1}-\omega_2(t)\big|_{t^2=0}\big]dt^1\ldots\widehat{dt^2}\ldots dt^k.

Since the integrand g=ω2(t)t2=1ω2(t)t2=0g=\omega_2(t)\big|_{t^2=1}-\omega_2(t)\big|_{t^2=0} does not depend on t2t^2 it is equal to its integral 01g  dt2\int^1_0g\;dt^2, so

Id(ω2dx1dx3dxk)=(1)[0,1]k[ω2(t)t2=1ω2(t)t2=0]dt1dtk=(1)[0,1]k[ω2x2=1ω2x2=0]dx1dxk=(1)[I21ω2dx1dx2^dxkI20ω2dx1dx2^dxk].\int_I d(\omega_2 dx^1\wedge dx^3\wedge\ldots\wedge dx^k)\\ =(-1)\int_{[0,1]^k}\big[\omega_2(t)\big|_{t^2=1}-\omega_2(t)\big|_{t^2=0}\big]dt^1\ldots dt^k\\ =(-1)\int_{[0,1]^k}\big[\omega_2\big|_{x^2=1}-\omega_2\big|_{x^2=0}\big]dx^1\ldots dx^k\\ =(-1)\big[\int_{I_2^1}\omega_2dx^1\wedge\widehat{dx^2}\wedge\ldots\wedge dx^k -\int_{I_2^0}\omega_2dx^1\wedge\widehat{dx^2}\wedge\ldots\wedge dx^k\big].

In the last equality we have used (20.19) and (20.20) for i=2i=2.

Now we are ready to consider the complete (k1)(k-1) form (20.17). First compute the exterior differential

dω=i=1kωixidxidx1dxi^dxk=i=1k(1)i1ωixidx1dxidxk=(i=1k(1)i1ωixi)dx1dxidxk,d\omega=\sum_{i=1}^k\frac{\partial \omega_i}{\partial x^i} dx^i\wedge dx^1\wedge\ldots \widehat{dx^i}\wedge\ldots\wedge dx^k\\ =\sum_{i=1}^k (-1)^{i-1}\frac{\partial \omega_i}{\partial x^i} dx^1\wedge\ldots \wedge dx^i\wedge\ldots\wedge dx^k\\ =\big(\sum_{i=1}^k (-1)^{i-1}\frac{\partial \omega_i}{\partial x^i}\big) dx^1\wedge\ldots \wedge dx^i\wedge\ldots\wedge dx^k,

and next the integral

Idω=i=1k(1)i1Iωixidx1dxidxk=i=1k(1)i1tk=01ti=01^t1=01ti=01ωitidtidt1dti^dtk=i=1k(1)i1tk=01ti=01^t1=01[ωixi=1ωixi=0]dt1dti^dtk=i=1k(1)i1[0,1]k[ωixi=1ωixi=0]dx1dxk=i=1k(1)i1[Ii1ωidx1dxi^dxkIi0ωidx1dxi^dxk].\int_{I}d\omega=\sum_{i=1}^k(-1)^{i-1}\int_{I} \frac{\partial \omega_i}{\partial x^i} dx^1\wedge\ldots \wedge dx^i\wedge\ldots\wedge dx^k\\ =\sum_{i=1}^k(-1)^{i-1}\int_{t^k=0}^{1} \ldots\widehat{\int_{t^i=0}^{1}}\ldots\int_{t^1=0}^{1}\int_{t^i=0}^{1} \frac{\partial \omega_i}{\partial t^i} dt^idt^1\ldots \widehat{dt^i}\ldots dt^k\\ =\sum_{i=1}^k(-1)^{i-1}\int_{t^k=0}^{1} \ldots\widehat{\int_{t^i=0}^{1}}\ldots\int_{t^1=0}^{1} [\omega_i\big|_{x^i=1}-\omega_i\big|_{x^i=0}]dt^1\ldots \widehat{dt^i}\ldots dt^k\\ =\sum_{i=1}^k(-1)^{i-1}\int_{[0,1]^k} \big[\omega_i\big|_{x^i=1}-\omega_i\big|_{x^i=0}\big]dx^1\ldots \ldots dx^k\\ =\sum_{i=1}^k(-1)^{i-1}\big[\int_{I^1_i}\omega_i dx^1\wedge\ldots \wedge \widehat{dx^i}\wedge\ldots\wedge dx^k\\ -\int_{I^0_i}\omega_i dx^1\wedge\ldots \wedge \widehat{dx^i}\wedge\ldots\wedge dx^k\big].

As a consequence of (20.18)-(20.20) we obtain

Ii0ωidx1dxi^dxk=Ii0ω,Ii1ωidx1dxi^dxk=Ii1ω.\int_{I^0_i}\omega_i dx^1\wedge\ldots \wedge \widehat{dx^i}\wedge\ldots\wedge dx^k =\int_{I^0_i}\omega,\\ \int_{I^1_i}\omega_i dx^1\wedge\ldots \wedge \widehat{dx^i}\wedge\ldots\wedge dx^k =\int_{I^1_i}\omega.

Thus we have checked that

Idω=i=1k(1)i1[Ii1ωIi0ω].\begin{equation} \int_{I}d\omega= \sum_{i=1}^k(-1)^{i-1}\big[\int_{I^1_i}\omega-\int_{I^0_i}\omega\big]. \tag{20.21} \end{equation}

Recall, that in (20.15) we defined the boundary integral of ω\omega as Iω=i=1k(1)i1[Ii1ωIi0ω], \int_{\partial I}\omega=\sum_{i=1}^k(-1)^{i-1}\big[\int_{I^1_i}\omega-\int_{I^0_i}\omega\big], so we get:


Formulation of Stokes theorem on the standard kk-cube.


If  ω \ \omega\ is a smooth (k1)(k-1)-form (20.17) on an open set URkU\subset R^k containing [0,1]k[0,1]^k,  I\ \ I is the standard kk-cube defined in (20.3) and if the boundary integral  Iω \ \int_{\partial I}\omega\ is defined by (20.15), then

Idω=Iω.\begin{equation} \int_{I}d\omega=\int_{\partial I}\omega. \tag{20.22} \end{equation}

Example 20.3

Using Stokes theorem compute the integral  Ixy2zdxdy, \ \int_{\partial I} xy^2zdx\wedge dy,\ where I\partial I denotes the boundary of the unit cube [0,1]×[0,1]×[0,1][0,1]\times[0,1]\times[0,1], oriented by the outward unit normal.


Using Stokes theorem we can replace the integral by Ida, \int_I da,\ where a=xy2zdxdy,a=xy^2zdx\wedge dy,

so we start from definition of 2-form aa and computing its exterior derivative dada.

%display latex M = Manifold(3, 'R^3') # manifold M=R^3 c_xyz.<x,y,z> = M.chart() # Cartesian coordinates a=M.diff_form(2,name='a') # 2-form a E=c_xyz.coframe() # coframe (dx,dy,dz) dx,dy,dz=E[:] # define dx,dy,dz a=x*y^2*z*dx.wedge(dy) # define 2-form a da=a.exterior_derivative() # exterior derivative of a da.disp() # show da

xy2dxdydz\displaystyle x y^{2} \mathrm{d} x\wedge \mathrm{d} y\wedge \mathrm{d} z

Computing Ida, \int_I da,\ we use (20.13) and the iterated integral 010101xy2dzdydx.\int_0^1\int_0^1\int_0^1 xy^2dzdydx.

integrate(integrate(integrate(x*y^2,(z,0,1)),(y,0,1)),(x,0,1))

16\displaystyle \frac{1}{6}


Formulation of Stokes theorem on singular kk-cubes


Assume that VV is an open subset of RkR^k, let ω\omega be a smooth (k1)(k-1)-form on VV and ϕ:IV\phi:I\to V be singular kk-cube. Recall that in (20.16) we defined the boundary integral of ω\omega over ϕ\partial \phi as   ϕω=i=1k(1)i1[ϕi1ωϕi0ω]\ \ \int_{\partial\phi}\omega= \sum_{i=1}^k(-1)^{i-1}\big[\int_{\phi^1_i}\omega-\int_{\phi^0_i}\omega\big].

The Stokes theorem on singular kk-cubes reads as follows

ϕdω=ϕω.\begin{equation} \int_{\phi} d\omega= \int_{\partial\phi}\omega. \tag{20.23} \end{equation}

Before the proof we check that for arbitrary singular kk-cube ϕ:IV\phi:I\to V and (k1)(k-1)-form on VV the following relation holds true

ϕω=Iϕω.\begin{equation} \int_{\partial\phi}\omega=\int _{\partial I}\phi^*\omega. \tag{20.24} \end{equation}

Let us compute both sides separately.

ϕω=i=1k(1)i1(ϕi1ωϕi0ω)=i=1k(1)i1([0,1]k1(ϕi1)ω[0,1]k1(ϕi0)ω).\int_{\partial\phi}\omega=\sum_{i=1}^k(-1)^{i-1}\big(\int_{\phi^1_i}\omega -\int_{\phi^0_i}\omega\big)\\ = \sum_{i=1}^k(-1)^{i-1}\big(\int_{[0,1]^{k-1}}(\phi^1_i)^*\omega -\int_{[0,1]^{k-1}}(\phi^0_i)^*\omega\big).

From the properties of pullback we know, that ϕi1=ϕIi1\phi^1_i=\phi\circ I^1_i implies (ϕi1)=(Ii1)ϕ(\phi^1_i)^*=(I^1_i)^*\circ\phi^* and analogously (ϕi0)=(Ii0)ϕ(\phi^0_i)^*=(I^0_i)^*\circ\phi^*. Thus

ϕω=i=1k(1)i1([0,1]k1(Ii1)ϕω[0,1]k1(Ii0)ϕω).\int_{\partial\phi}\omega= \sum_{i=1}^k(-1)^{i-1}\big(\int_{[0,1]^{k-1}}(I^1_i)^*\circ\phi^*\omega -\int_{[0,1]^{k-1}}(I^0_i)^*\circ\phi^*\omega\big).

On the other hand from (20.15)

Iϕω=i=1k(1)i1(Ii1ϕωIi0ϕω)=i=1k(1)i1([0,1]k1(Ii1)ϕω[0,1]k1(Ii0)ϕω),\int_{\partial I}\phi^*\omega=\sum_{i=1}^k (-1)^{i-1}\big(\int_{I^1_i}\phi^*\omega -\int_{I^0_i}\phi^*\omega\big)\\ =\sum_{i=1}^k (-1)^{i-1}\big(\int_{[0,1]^{k-1}}(I^1_i)^*\circ\phi^*\omega -\int_{[0,1]^{k-1}}(I^0_i)^*\circ\phi^*\omega\big),

so both sides of (20.24) are equal.

The formula (20.23) is a consequence of (20.22) and (20.24), since

ϕdω=Iϕdω=Id(ϕω)=Iϕω=ϕω.\int_{\phi} d\omega=\int_I\phi^*d\omega =\int_Id(\phi^*\omega)=\int_{\partial I}\phi^*\omega=\int_{\partial\phi}\omega.

Extending the integration domains


Assume that f,gf,g are smooth functions on [a,b],[a,b],  fg \ f\leq g\ and define the set

D={(u,v)R2:aub,f(u)vg(u)}.\begin{equation} D = \{(u, v) ∈ R^2 : a ≤ u ≤ b, f (u) ≤ v ≤ g(u)\}. \tag{20.25} \end{equation}

Consider the mapping

ψ:[0,1]2(s,t)((1s)a+sb,(1t)f(1s)a+sb)+tg((1s)a+sb))DR2.ψ: [0,1]^2\ni (s, t) \to \big((1-s)a+sb,(1-t)f(1-s)a+sb)+tg((1-s)a+sb)\big)\in D\subset R^2.

One can prove that

ψ:[0,1]2D ψ : [0,1]^2 → D is one-to-one and ψ(I2)=D\psi(I^2)=D.

If ϕ:DR2\phi:D\to R^2 is a smooth map, then φψ:[0,1]2ϕ(D)R2φ ◦ ψ : [0,1]^2 → \phi(D)\subset R^2 is a singular 2-cube, so for 1-forms on some neighborhood of ϕ(D)\phi(D) Stokes formula takes the form

ϕψdω=(ϕψ)ω.\int_{\phi\circ\psi}d\omega= \int_{\partial(\phi\circ\psi)}\omega.

If we define   ϕDdω=ϕψdω  \ \ \int_{\phi_D}d\omega=\int_{\phi\circ\psi}d\omega\ \ and   ϕDω=(ϕψ)ω,  \ \ \int_{\partial \phi_D}\omega=\int_{\partial(\phi\circ\psi)}\omega,\ \ then

ϕDdω=ϕψdω=(ϕψ)ω=ϕDω,\int_{\phi_D}d\omega=\int_{\phi\circ\psi}d\omega= \int_{\partial(\phi\circ\psi)}\omega=\int_{\partial \phi_D}\omega,

so we can use Stokes theorem for domains of type (20.25).

Thus Stokes theorem can be applied to domains whose parameterizations can be reparameterized into unit cubes.

Remark. In practice, computing integrals ϕDω\int_{\phi_D} \omega for ω\omega of the form ω=hdx1dx2\omega=hdx^1\wedge dx^2 on ϕ(D)\phi(D) we do not use reparametrizations but the formula ϕDω=abf(u)g(u)h(ϕ(u,v))(ϕ1,ϕ2)(u,v)dudv.\int_{\phi_D}\omega=\int_a^b\int_{f(u)}^{g(u)}h(\phi(u,v))\frac{\partial(\phi^1,\phi^2)}{\partial(u,v)}dudv.

One can prove that Stokes theorem can be applied to analogous domains in higher dimensions, for example

D={(u1,u2,u3)R3:a1u1b1,c(u1)u2d(u1),f(u1,u2)u3g(u1,u2)},D = \{(u_1,u_2,u_3 ) ∈ R^3 : a_1 ≤ u_1 ≤ b_1, c(u_1)\leq u_2\leq d(u_1), f (u_1,u_2) ≤ u_3 ≤ g(u_1,u_2)\},

for some smooth functions c,d,f,gc,d,f,g.


Example 20.4

Compute  S2xdydz+ydzdx+zdxdy,\ \int_{S^2}xdy\wedge dz+ydz\wedge dx+zdx\wedge dy, where S2S^2 denotes the 2-dimensional unit sphere, which can be considered as the (reparametrized version of) singular 2-cube ϕ:[0,π]×[0,2π]R3\phi:[0,\pi]\times[0,2\pi]\to R^3

(θ,ϕ)(sin(θ)cos(ϕ),sin(θ)sin(ϕ),cos(θ)).(\theta,\phi)\to (\sin(\theta)\cos(\phi), \sin(\theta)\sin(\phi),\cos(\theta)).

We define the 2-form aa first.

%display latex M = Manifold(3, 'R^3') # manifold M=R^3 c_xyz.<x,y,z> = M.chart() # Cartesian coordinates N = Manifold(2, 'N') # manifold N=S^2 c_sph.<theta,phi>=N.chart() # spherical coordinates # embedding S^2->R^3 defines the singular 2-cube phi Phi = N.diff_map(M, (sin(theta)*cos(phi), sin(theta)*sin(phi),cos(theta)), name='ph',latex_name=r'\Phi') a=M.diff_form(2,name='a') # 2-form on N a E=c_xyz.coframe() # coframe (dx,dy,dz) dx,dy,dz=E[:] # define dx,dy,dz a=x*dy.wedge(dz)+y*dz.wedge(dx)+z*dx.wedge(dy) # define a a.disp() # show a

zdxdyydxdz+xdydz\displaystyle z \mathrm{d} x\wedge \mathrm{d} y -y \mathrm{d} x\wedge \mathrm{d} z + x \mathrm{d} y\wedge \mathrm{d} z

To use (reparametrized version of) (20.11) we need the pullback Φa\Phi^*a.

Phi.pullback(a).disp()

sin(θ)dθdϕ\displaystyle \sin\left(\theta\right) \mathrm{d} \theta\wedge \mathrm{d} \phi

To obtain the final result we use the iterated integral 02π0πsinθ  dθdϕ\int_0^{2\pi}\int_0^\pi \sin\theta\; d\theta d\phi.

integrate(integrate(sin(theta), (theta,0,pi)), (phi,0,2*pi))

4π\displaystyle 4 \, \pi


Example 20.5

Compute  S13zdxdy \ \int_S \frac{1}{3}zdx\wedge dy\ where SS is the part of the elliptic cone  x26+y29=z2, \ \frac{x^2}{6}+\frac{y^2}{9}= z^2,\ bounded by the planes z=1,z=1z=-1,z=1, which may be considered as (reparametrized version of) the singular 2-cube ψ:[1,1]×[0,2π]R3\psi:[-1,1]\times[0,2\pi]\to R^3

(Z,ϕ)(2Zcos(ϕ),3Zsin(ϕ),Z).(Z,\phi)\to (2Z\cos(\phi), 3Z\sin(\phi),Z).

Let us define 2-form aa and its pullback under ψ\psi.

%display latex M = Manifold(3, 'R^3') # manifold M=R^3 c_xyz.<x,y,z> = M.chart() # Cartesian coordinates N = Manifold(2, 'N') # manifold N=S^2 c_sph.<phi,Z>=N.chart() # spher. coordinates E=c_xyz.coframe() # coframe (dx,dy,dz) dx,dy,dz=E[:] # define dx,dy,dz a=1/3*z*dx.wedge(dy) # 2-form a # psi defines the singular 2-cube psi = N.diff_map(M, (2*Z*cos(phi), 3*Z*sin(phi),Z), name='psi',latex_name=r'\psi') psi.pullback(a).disp() # pullback psi^*a

2Z2dϕdZ\displaystyle -2 \, Z^{2} \mathrm{d} \phi\wedge \mathrm{d} Z

We use (reparametrized version of) (20.11) and replace the double integral by the iterated integral 02π11(2Z2)  dZdϕ.\int_0^{2\pi}\int_{-1}^1(-2Z^2)\;dZd\phi.

integrate(integrate(-2*Z^2,(Z,-1,1)),(phi,0,2*pi))

83π\displaystyle -\frac{8}{3} \, \pi


Example 20.6

Compute the integral Sxdydz+zdzdx\int_S xdy\wedge dz +zdz\wedge dx, where SS is the sphere x2+y2+z2=9.x^2+y^2+z^2=9.


First we define the 2-form aa,

E.<x1,x2,x3>=EuclideanSpace(3,"E") # Euclidean space E^3 cart=E.cartesian_coordinates() # Cartesian coordinates spher.<r,th,ph> = E.spherical_coordinates() # spherical coordinates Phi=E.coord_change(spher, cart) # transition spher -> cart a=E.diff_form(2,name='a') # 2-form a cf=c_xyz.coframe() # coframe (dx,dy,dz) dx,dy,dz=cf[:] # define dx,dy,dz a=x*dy.wedge(dz)+z*dz.wedge(dx) # define 2-form a a.disp() # show a

zdxdz+xdydz\displaystyle -z \mathrm{d} x\wedge \mathrm{d} z + x \mathrm{d} y\wedge \mathrm{d} z

and its exterior differential:

da=a.exterior_derivative() da.disp()

dxdydz\displaystyle \mathrm{d} x\wedge \mathrm{d} y\wedge \mathrm{d} z

Using spherical coordinates (θ,ϕ)(\theta,\phi), the sphere can be considered as reparametrized singular 22-cube   [0,π]×[0,2π]R3\ \ [0,\pi]\times[0,2\pi]\to R^3.

Phi.disp()

{x1=rcos(ϕ)sin(θ)x2=rsin(ϕ)sin(θ)x3=rcos(θ)\displaystyle \left\{\begin{array}{lcl} x_{1} & = & r \cos\left({\phi}\right) \sin\left({\theta}\right) \\ x_{2} & = & r \sin\left({\phi}\right) \sin\left({\theta}\right) \\ x_{3} & = & r \cos\left({\theta}\right) \end{array}\right.

jac=Phi.jacobian_det();jac

r2sin(θ)\displaystyle r^{2} \sin\left({\theta}\right)

So if we apply (reparametrized version of) (20.12), and the relation 02πdϕ=2π\int_0^{2\pi}d\phi=2\pi, we obtain the following form of the iterated integral: 2π(03r2  dr)0πsin(θ)  dθ.2\pi(\int_0^3r^2\;dr) \int_0^\pi\sin(\theta)\;d\theta.

2*pi*integrate(r^2,(r,0,3))*integrate(sin(th),(th,0,pi))

36π\displaystyle 36 \, \pi


Example 20.7

Using Stokes theorem, compute the integral Sxdydz+ydzdx+zdxdy\int_Sxdy\wedge dz+ydz\wedge dx + zdx\wedge dy over the unit sphere x2+y2+z2=1x^2+y^2+z^2=1. (In Example 20.4 we computed the integral using (20.11)).


As in the previous example we start from defining the 2-form aa and its exterior derivative.

%display latex M = Manifold(3, 'R^3') # manifold M=R^3 c_xyz.<x,y,z> = M.chart() # Cartesian coordinates N = Manifold(2, 'N') # manifold N=S^2 c_sph.<theta,phi>=N.chart() # spherical coordinates # embedding S^2->R^3 psi = N.diff_map(M, (sin(theta)*cos(phi), sin(theta)*sin(phi),cos(theta)), name='psi',latex_name=r'\psi') a=M.diff_form(2,name='a') E=c_xyz.coframe() # coframe (dx,dy,dz) dx,dy,dz=E[:] # define dx,dy,dz a=x*dy.wedge(dz)+y*dz.wedge(dx)+z*dx.wedge(dy) # a da=a.exterior_derivative() # da da.disp()

3dxdydz\displaystyle 3 \mathrm{d} x\wedge \mathrm{d} y\wedge \mathrm{d} z

We can use the value of Jacobian from previous example,

# from previous example jac=r^2*sin(theta)

and obtain the following iterated integral: 010π2π3jac  dϕdθdr.\int_0^1\int_0^\pi\int^{2\pi}3\text{jac}\;d\phi d\theta dr.

integrate(integrate(integrate(3*jac,(phi,0,2*pi)),(theta,0,pi)),(r,0,1))

4π\displaystyle 4 \, \pi


Example 20.8

Compute the integral Sxdx+xdy+ydz \int_{\partial S} xdx+xdy+ydz, where S\partial S is the boundary of hemisphere x2+y2+z2=r2,z0x^2+y^2+z^2=r^2,\quad z\geq 0.


Define the 1-form aa and 2-form dada.

%display latex M = Manifold(3, 'R^3') # manifold M=R^3 c_xyz.<x,y,z> = M.chart() # Cartesian coordinates a=M.diff_form(2,name='a') E=c_xyz.coframe() # coframe (dx,dy,dz) dx,dy,dz=E[:] # define dx,dy,dz a=x*dx+x*dy+y*dz # a da=a.exterior_derivative() # da da.disp()

dxdy+dydz\displaystyle \mathrm{d} x\wedge \mathrm{d} y+\mathrm{d} y\wedge \mathrm{d} z

Let us compute both sides of Stokes formula. Note that using spherical coordinates we can define the hemisphere as the (reparametrized) singular 2-cube

Φ:[0,π2]×[0,2π](θ,ϕ)(rsin(θ)cos(ϕ),rsin(θ)sin(ϕ),rcos(θ)).\Phi:[0,\frac{\pi}{2}]\times[0,2\pi]\ni(\theta,\phi)\to (r\sin(\theta)\cos(\phi), r\sin(\theta)\sin(\phi),r\cos(\theta)).

The corresponding parts of Φ\partial\Phi can be defined as follows:

Φ10\Phi^0_1 corresponds to   θ=0,ϕ[0,2π],  \ \ \theta=0,\phi\in[0,2\pi],\ \ so   Φ10:ϕ(0,0,1)\ \ \Phi^0_1: \phi\to (0,0,1),

Φ11\Phi^1_1 corresponds to   θ=π2,ϕ[0,2π],  \ \ \theta=\frac{\pi}{2},\phi\in[0,2\pi], \ \ so Φ11:ϕ(rcosϕ,rsinϕ,0)\Phi^1_1: \phi\to (r\cos\phi,r\sin\phi,0),

Φ20\Phi^0_2 corresponds to   θ[0,π2],ϕ=0,  \ \ \theta\in[0,\frac{\pi}{2}],\phi=0, \ \ so Φ20:θ(rsinθ,0,rcosθ)\Phi^0_2: \theta\to (r\sin\theta,0,r\cos\theta),

Φ21\Phi^1_2 corresponds to   θ[0,π2],ϕ=2/pi,  \ \ \theta\in[0,\frac{\pi}{2}],\phi=2/pi, \ \ so Φ21:θ(rsinθ,0,rcosθ)\Phi^1_2: \theta\to (r\sin\theta,0,r\cos\theta).

Since by (20.16) Φ=Φ11Φ10Φ21+Φ20\int_{\partial\Phi}=\int_{\Phi^1_1}-\int_{\Phi^0_1} -\int_{\Phi^1_2}+\int_{\Phi^0_2}, the integral ϕ10a\int_{\phi^0_1} a is zero and last two integrals cancel each other, the boundary integral reduces to Φ11a\int_{\Phi^1_1}a.

Define the pullback of aa under ψ:t(rcos(t),sin(t),0)\psi:t\to (r\cos(t),\sin(t),0),

N = Manifold(1, 'N') # 1-dim manifold -curve c.<t>=N.chart() # polar coordinate on N r=var('r') # embedding N->R^3: psi = N.diff_map(M, (r*cos(t), r*sin(t),0), name='psi',latex_name=r'\psi') psi.pullback(a).disp() # pullback of a

(r2cos(t)2r2cos(t)sin(t))dt\displaystyle \left( r^{2} \cos\left(t\right)^{2} - r^{2} \cos\left(t\right) \sin\left(t\right) \right) \mathrm{d} t

and use (reparametrized version of) (20.11), to obtain the boundary integral: r202π(cos2tcostsint)  dtr^2\int_0^{2\pi}(\cos^2 t-\cos t\sin t)\;dt.

r^2*integrate(cos(t)^2-cos(t)*sin(t),(t,0,2*pi))

πr2\displaystyle \pi r^{2}

Now we use the map Φ:(θ,ϕ)(rsin(θ)cos(ϕ),rsin(θ)sin(ϕ),rcos(θ))\Phi:(\theta,\phi)\to (r\sin(\theta)\cos(\phi), r\sin(\theta)\sin(\phi),r\cos(\theta)),

r=var('r') N = Manifold(2, 'N') # manifold N=S^2 c_sph.<theta,phi>=N.chart() # spherical coordinates # embedding S^2->R^3 Phi = N.diff_map(M, (r*sin(theta)*cos(phi), r*sin(theta)*sin(phi),r*cos(theta)), name='psi',latex_name=r'\psi')

and the pullback Φda\Phi^*da.

Phi.pullback(da).disp()

(r2cos(ϕ)sin(θ)2+r2cos(θ)sin(θ))dθdϕ\displaystyle \left( r^{2} \cos\left(\phi\right) \sin\left(\theta\right)^{2} + r^{2} \cos\left(\theta\right) \sin\left(\theta\right) \right) \mathrm{d} \theta\wedge \mathrm{d} \phi

We can apply (reparametrized version of) (20.11) to obtain the integral of dada over the hemisphere: r202π0π/2(cosϕsin2ϕ+cosθsinθ)  dθdϕ.r^2\int_0^{2\pi}\int_0^{\pi/2}(\cos\phi\sin^2\phi+\cos\theta\sin\theta)\; d\theta d\phi.

r^2*integrate(integrate(cos(phi)*(sin(theta))^2+cos(theta)*sin(theta), (theta,0,pi/2)),(phi,0,2*pi))

πr2\displaystyle \pi r^{2}


Example 20.9

Compute the integral Sx2dydz+12y2dzdx+dxdy\int_S x^2dy\wedge dz+\frac{1}{2}y^2dz\wedge dx+dx\wedge dy over the tetrahedron bounded by the coordinate planes and the plane x+y+z=1x+y+z=1.


As usual we start from defining 2-form aa and 3-form dada.

%display latex M = Manifold(3, 'R^3') # manifold M=R^3 c_xyz.<x,y,z> = M.chart() # Cartesian coordinates a=M.diff_form(2,name='a') E=c_xyz.coframe() # coframe (dx,dy,dz) dx,dy,dz=E[:] # define dx,dy,dz a=x^2*dy.wedge(dz)+1/2*y^2*dz.wedge(dx)+dx.wedge(dy) #a da=a.exterior_derivative() # da da.disp()

(2x+y)dxdydz\displaystyle \left( 2 \, x + y \right) \mathrm{d} x\wedge \mathrm{d} y\wedge \mathrm{d} z

Since the tetrahedron can be described by the inequalities

0x1,0y1x,0z1xy,0\leq x\leq 1,\quad 0\leq y\leq 1-x,\quad 0\leq z\leq 1-x-y,

which is a three-dimensional version of (20.25), by Stokes theorem, the boundary integral is equal to

01[01x[01xy(2x+y)dz]dy]dx.\int_0^1\Big[\int_0^{1-x}\Big[\int_0^{1-x-y} (2x+y)dz\Big] dy\Big] dx.
integrate(integrate(integrate(2*x+y,(z,0,1-x-y)),(y,0,1-x)),(x,0,1))

18\displaystyle \frac{1}{8}


Example 20.10

Compute the integral S(x+y)dx+(2xz)dy+(y+3z)dz,\int_S (x+y)dx+(2x-z)dy+(y+3z)dz, where SS is the boundary of the triangle with vertices (3,0,0), (0,3,0), (0,0,3)(3,0,0), \ (0,3,0), \ (0,0,3).


We start from defining 1-form aa and 2-form dada.

%display latex M = Manifold(3, 'R^3') # manifold M=R^3 c_xyz.<x,y,z> = M.chart() # Cartesian coordinates a=M.diff_form(2,name='a') E=c_xyz.coframe() # coframe (dx,dy,dz) dx,dy,dz=E[:] # define dx,dy,dz a=(x+y)*dx+(2*x-z)*dy+(y+3*z)*dz # a da=a.exterior_derivative() # da da.disp()

dxdy+2dydz\displaystyle \mathrm{d} x\wedge \mathrm{d} y + 2 \mathrm{d} y\wedge \mathrm{d} z

First we compute the integral of dada over the triangle using the pullback of dada under Φ:(X,Y)(X,Y,3XY)\Phi:(X,Y)\to(X,Y,3-X-Y).

N = Manifold(2, 'N') # triangle S plane c.<X,Y>=N.chart() # coord on N # N-> R^3 Phi = N.diff_map(M, (X, Y,3-X-Y), name='Phi',latex_name=r'\Phi') Phi.pullback(da).disp() #pullback of da

3dXdY\displaystyle 3 \mathrm{d} X\wedge \mathrm{d} Y

The iterated integral   03[03x3dy]dx\ \ \int_0^3[\int_0^{3-x}3dy]dx is equal to272\frac{27}{2}.

integrate(integrate(3,(y,0,3-x)),(x,0,3))

272\displaystyle \frac{27}{2}

The boundary of the triangle can be considered as the 1-chain c=ψ1+ψ2+ψ3c=\psi_1+\psi_2+\psi_3, where ψ1=Φ21,  ψ2=Φ10,  ψ3=Φ20\psi_1=-\Phi^1_2,\ \ \psi_2=-\Phi^0_1,\ \ \psi_3=\Phi^0_2 are (reparametrized) singular 1-cubes (parametric curves). Note that the counterpart of Φ11\Phi^1_1 reduces to a point.

Let us define the space for the parameter tt,

N = Manifold(1, 'N') # 1-dim manifold N "t axis" c.<t>=N.chart() # coordinate on N

next the singular 1-cubes ψ1,ψ2,ψ3\psi_1,\psi_2,\psi_3 and the pullbacks ψ1a,ψ2a,ψ3a\psi_1^*a,\psi_2^*a,\psi_3^*a:

psi1 = N.diff_map(M, (3-t, t,0), name='psi1',latex_name=r'\psi1') psi1.pullback(a).disp()

(2t+3)dt\displaystyle \left( -2 \, t + 3 \right) \mathrm{d} t

psi2 = N.diff_map(M, (0, 3-t,t), name='psi2',latex_name=r'\psi2') psi2.pullback(a).disp()

(3t+3)dt\displaystyle \left( 3 \, t + 3 \right) \mathrm{d} t

psi3 = N.diff_map(M, (t, 0,3-t), name='psi3',latex_name=r'\psi3') psi3.pullback(a).disp()

(4t9)dt\displaystyle \left( 4 \, t - 9 \right) \mathrm{d} t

According to (reparametrized version of) (20.16), the integral of 1-form aa over 1-chain cc is equal to

ψ1a+ψ2a+ψ3a=[0,3]ψ1a+[0,3]ψ2a+[0,3]ψ3a=03((2t+3)+(3t+3)+(4t9))dt.\textstyle\int_{\psi_1}a+\int_{\psi_2}a+\int_{\psi_3}a=\int_{[0,3]}\psi_1^*a+\int_{[0,3]}\psi_2^*a+\int_{[0,3]}\psi_3^*a\\ =\int_0^3 ((-2t+3)+(3t+3)+(4t-9))dt.
integrate((-2*t+3)+(3*t+3)+(4*t-9),(t,0,3))

272\displaystyle \frac{27}{2}


Stokes theorem for chains


Extending Stokes theorem to kk-chains is easy, since for kk-chain c=aiϕic=\sum a_i\phi_i, where ϕi\phi_i are singular kk-cubes in an open set VV and for (k1)(k-1)-form ω\omega in VV, we have by (20.14) and (20.23)

cdω=aiϕidω=aiϕiω=cω.\int_c d\omega=\sum a_i\int_{\phi_i} d\omega=\sum a_i\int_{\partial \phi_i}\omega=\int_{\partial c}\omega.

Remark. In case of problems, some iterated integrals can be also computed with the help of https://www.wolframalpha.com/

For example the command (without #):

#integrate(integrate(integrate(2*exp(x+y)*sin(y), (z,0,1-x-y)), (y,0,1-x)), (x,0,1))

in wolframalpha window returns

0101x01xy2exp(x+y)sin(y)  dzdydx=3e(sin(1)2).\int_0^1\int_0^{1-x}\int_0^{1-x-y}2\exp(x+y)\sin(y)\;dzdydx= -3-e(\sin(1)-2).

Remark. Computing iterated integrals, SageMath (or strictly speaking Maxima) may need some assumptions, for example:

%display latex var('x y z') forget() assume(y+x-1<0) assume(x-1<0) integrate(integrate(integrate(2*exp(x+y+z)*sin(x-2*z),(z,0,1-x-y)),(y,0,1-x)),(x,0,1))

215cos(2)e+13cos(1)e+115esin(2)13esin(1)15\displaystyle -\frac{2}{15} \, \cos\left(2\right) e + \frac{1}{3} \, \cos\left(1\right) e + \frac{1}{15} \, e \sin\left(2\right) - \frac{1}{3} \, e \sin\left(1\right) - \frac{1}{5}

What's next?

Take a look at the notebook Connection.