Mathematica in teaching: Green’s and Stokes’ theorems

Author : Dr hab. Galina Filipuk (University of Warsaw)

MATHEMATICA DAY AT THE UNIVERSITY OF WARSAW 9.12.2017

References:

J. Marsden, A. Tromba, Vector Calculus, 6th edition, W.H. Freeman and Company, New York, 2012. 
R. Adams, C. Essex, Calculus. A Complete Course, 7th edition, Pearson, 2010.
J. Stewart, Calculus, 5th edition, Brooks Cole, 2002.  
C. Canuto, A.Tabacco, Mathematical Analysis II, Springer, 2010;
I. Madsen, J. Tornehave, From Calculus to Cohomology, Cambridge University Press, 1997.

Plan of the lecture:

1. Recap on the theory (calculus, analysis)

2. The use of Mathematica in understanding the theory and examples

In this talk I shall explain how Mathematica can be used to explain Green's and Stokes' theorems. Stokes' theorem is one of the fundamental theorems of Vector Analysis relating line integrals and surface integrals
of vector fields. Stokes' theorem is also known as the Kelvin - Stokes theorem or the curl theorem. It was discovered around 1850. Stokes' theorem is based on Green's theorem, relating line integrals to double integral over the region.

The Stokes theorem

The Stokes theorem is also known as the Kelvin - Stokes theorem or the curl theorem. It was discovered around 1850.

In (ℝ^3)  the vector field is given by F(x,y,z)==((Subscript[F, 1])(x,y,z), (Subscript[F, 2])(x,y,z),(Subscript[F, 3])(x,y,z)).

The curl of the vector field F  is a new vector field defined by curl F==∇×F==(((∂(Subscript[F, 3]))/(∂y))-((∂(Subscript[F, 2]))/(∂z)),((∂(Subscript[F, 1]))/(∂z))-((∂(Subscript[F, 3]))/(∂x)),((∂(Subscript[F, 2]))/(∂x))-((∂(Subscript[F, 1]))/(∂y))).

The gradient vector field is given by ∇ f(x,y,z)==(((∂f)/(∂x)),((∂f)/(∂y)),((∂f)/(∂z))).

The divergence of  the vector field F is the scalar field div F==∇·F==((∂(Subscript[F, 1]))/(∂x))+((∂(Subscript[F, 2]))/(∂y))+((∂(Subscript[F, 3]))/(∂z)).

Integration of a vector field along a path: for a vector field F  continuous on the (piecewise) (C^1) path c: [a,b]->(ℝ^3) (oriented)
the line integral is defined by (∫_c)F·ds==(∫_a^b)F(c(t))·c'(t)dt.

The surface integral of vector fields is equal to the integral of the normal component of the vector field over the surface oriented by the unit normal vector field: ∫(∫_S)F·dS==∫(∫_S) F·n d S.

If the surface S is described by z==g(x,y), (x,y)∈D, and is oriented by the upward-pointing normal, then we can calculate
the surface integral by using the formula: ∫(∫_S)F·dS==(Subscript[∫∫, D])((Subscript[F, 1])(-((∂g)/(∂x)))+(Subscript[F, 2])(-((∂g)/(∂y)))+(Subscript[F, 3]))dxdy.

If the surface is the image of a function Φ,  S==Φ(D), where  Φ: D⊂(ℝ^2)->(ℝ^3) is given by Φ(u,v)==(x(u,v),y(u,v),z(u,v)), (u,v)∈D, then the surface integral of the vector field F defined on  S is defined by
	 ∫(∫_Φ)F·dS==∫(∫_D)F·((Subscript[T, u])×(Subscript[T, v]))dudv. 
Here (Subscript[T, u])=(∂/(∂u))(x(u,v),y(u,v),z(u,v)),(Subscript[T, v])=(∂/(∂v))(x(u,v),y(u,v),z(u,v)).

Three main integral theorems 
of vector analysis

Green' s theorem: (∫_(∂D))(Pdx+Qdy)==(Subscript[∫∫, D])(((∂Q)/(∂x))-((∂P)/(∂y)))dxdy

Stokes' theorem: (∫_(∂S))F·ds==(Subscript[∫∫, S])(∇×F)·dS

Gauss' (Ostrogradsky’s, divergence) theorem: (Subscript[∫∫, ∂W])F·dS==(Subscript[∫∫∫, W])(∇·F)dV

Green’s theorem

Let D  be a regular, closed region in the x y plane with the boundary C consisting of one or more piecewise smooth, simple closed curves. The orientation of C is positive with respect to D. For a smooth vector field on D given by F=P(x,y) i+Q(x,y)j the following statement holds:

(∫_(∂D))F·ds=(∫_C)P(x,y)dx+Q(x,y)dy==∫(∫_D)(((∂Q)/(∂x))-((∂P)/(∂y)))dxdy

(the line integral is related to the double integral over the region D enclosed by C).

Stokes’ theorem

Let S be a piecewise smooth, oriented surface in 3D with the normal n. Let the boundary C consist of one or more piecewise smooth, closed curves with the consistent orientation. For a smooth vector field F on S we have (∫_(∂S))F·ds==(Subscript[∫∫, S])(∇×F)·dS=∫(∫_S)(∇×F)· n dS=∫(∫_S)curl F· n dS.

The line integral of the tangential component of F around the boundary ∂S is equal to the integral of the normal component of the curl of a vector field  F  over a surface S.

Stokes' theorem (∫_(∂S))F ·ds=∫(∫_S)curl F·dS for graphs

Let S be an oriented surface  parametrized by (x, y, z==f(x,y)), (x,y)∈D, where f is a (C^2) function  and D is the region to which Green’s theorem applies,  F  is  a (C^1) vector field on S. Then ∫(∫_S)curl F·dS==∫(∫_S)(∇)×F·dS==(∫_(∂S))F·ds.

Proof: express integrals on both sides in terms of double integrals over D by using Green' s theorem.

Proof of Stokes' theorem (∫_(∂S))F ·ds=∫(∫_S)curl F·dS for graphs

The vector field F if given by

F[{x_,y_,z_}]:={F1[x,y,z],F2[x,y,z],F3[x,y,z]}

F[{x,y,z}]

and its curl is

Curl[F[{x,y,z}],{x,y,z}]

Here ((Subscript[F, 1])^((0,0,1)))(x,y,z) stands for  the partial derivative with respect to z.

The surface S is given by z=f(x,y), where (x,y) are in D. The function f is of class (C^2).
The boundary of D, ∂D, is parametrized by (x(t), y(t)). Assume that Green’s theorem applies to this region.
The boundary of S, the closed curve C, is parametrized by (x(t),y(t),f(x(t),y(t))).
Assume that the orientations of the boundaries and of the surface are all compatible.

To calculate ∫(∫_S)curl F·dS we need to express it as a double integral ∫(∫_D) ((Subscript[expr, 1])) dA, where (Subscript[expr, 1])=curl  F(x,y,f(x,y))·(-(Subscript[(f'), x]),-(Subscript[(f'), y]),1):

expr1=Curl[F[{x,y,f[x,y]}],{x,y,z}].({-D[f[x,y],x],-D[f[x,y],y],1})//Simplify

To calculate the line integral (∫_(∂S))F ·ds, we substitute the parametrization of ∂S and by definition of the line integral compute a dot product with (x'(t),y'(t),(d/dt)f(x(t),y(t))) to express it as the integral over t, ∫(Subscript[expr, 2])(t)dt, where t∈[a,b]:

F[{x[t],y[t],f[x[t],y[t]]}].{x'[t],y'[t],D[f[x[t],y[t]],t]}

After rearranging the terms we have

expr2=Collect[%,{x'[t],y'[t]}]

We recognize the integral over t of this expression as the line integral  for the new vector field (P(x,y),Q(x,y)) over the boundary of the region D: (∫_(∂D))(P,Q)·ds=∫[P(x(t),y(t))x'(t)+Q(x(t),y(t))y'(t)]dt for the functions

P[x_,y_]:=F1[x,y,f[x,y]]+F3[x,y,f[x,y]] D[f[x,y],x]

Q[x_,y_]:=F2[x,y,f[x,y]]+F3[x,y,f[x,y]] D[f[x,y],y]

and, so, the Green’s theorem gives the double integral ∫(∫_D) ((Subscript[expr, 3])) dA, where (Subscript[expr, 3])=(Subscript[Q, x])-(Subscript[P, y]) (here we need that the function f is of class (C^2))

expr3=D[Q[x,y],x]-D[P[x,y],y]//Simplify

Now we have two double integrals  ∫(∫_D) ((Subscript[expr, 1])) dA and  ∫(∫_D) ((Subscript[expr, 3])) dA (coming from the surface integral and from the line integral) and the expressions under the integrals are equal:

expr1-expr3

This proves the statement of the theorem.

This is the short online version of the talk. Other examples, computations  and visualisations  were presented during the conference.

Thank you very much for your attention!