14. Vector Algebra and Vector Analysis

2014-06-18

$Version

Mathematica 9: The commands for vector analysis are contained in the kernel in contrast to earlier versions.

Mathematica 7 or 8: The package must be loaded by the command  <<"VectorAnalysis`" .
Some of the commands differ from those given in version 9, so in these lecture notes. In particular, the arguments of the operators do not contain the list of the independent variables as arguments.
 
Ph. Boylard: A Guide to Standard Mathematica Packages.  Mathematica  Technical Report (1991).
E. Martin: Mathematica 3.0  Standard Add-On Packages. Cambridge University Press.  pp.74-82.

14.1 Rectangular, Cylindrical and Spherical Coordinates

Rectangular (as well as cylindrical and spherical) coordinates have been treated at the end of Chap.3.
Knowledge of these subjects is pressuposed in this chapter.

14.2 	Curvilinear Orthogonal Coordinates

14.2.1	Literature

Murray R. Spiegel, Schaum's Mathemtical Handbook of Formulas and Tables, 
	McGraw-Hill, New York 1968, pp.116-130
Philip M. Morse, Herman Feshbach: Methods of Theoretical Physics, 
	McGraw-Hill, New York, 1953. (MF), 656ff.
George B. Arken, Mathematical Methods for Pysicists, 3 rd  ed., Academic Press, New York, 1985.
B. Schnizer, Analytical methods in applied theoretrical physics. Lecture notes (in German).  Chaps. 6 and 7.
	http://itp.tugraz.at/~schnizer/AnalyticalMethods/
P. Moon, D.E. Spencer, Field Theory Handbook. 2 nd ed., Springer, 1988.  (MS)

G. Wendt, Statische Felder und Stationäre Ströme. Hb. d. Physik XVI  Springer, 1958, S.1 ff.
W.R. Smith, Static and Dynamic Electricity, McGraw-Hill, 1950

14.2.2	Covariant and contravariant coordinates

A general non-singular transformation from Cartesian coordinates  (Subscript[x, 1]),(Subscript[x, 2]),(Subscript[x, 3]) to more general 
curvilinear coordinates   (Subscript[u, 1]),(Subscript[u, 2]),(Subscript[u, 3])  is given by:

(Subscript[x, i])  =(Subscript[x, i])((Subscript[u, 1]),(Subscript[u, 2]),(Subscript[u, 3])),       (Subscript[u, k]) =(Subscript[u, k])((Subscript[x, 1]),(Subscript[x, 2]),(Subscript[x, 3]));      i,k=1,2,3.    (1)

So a triple of numbers for the  (Subscript[u, k])'s gives a point in space in the same way as a triple of  Cartesian 
coordinates  (Subscript[x, 1]),(Subscript[x, 2]),(Subscript[x, 3]). Keeping two (Subscript[u, k])'s constant while varying the third one gives a curve in space. 
There are three such curves passing through each point. The three tangents to these curves are given by:

					(Overscript[(Subscript[τ, i]), k]) =  ∂(Subscript[x, i])/ ∂(Subscript[u, k]);  					(2)	
			
k numbering the curves; i numbering the components of each vector. These three vectors are orthogonal to each other, but they are not normalized; in addition, their directions and lengths 
may change from point to point. 
Varying two  (Subscript[u, k])'s for a fixed third  (Subscript[u, s ])gives a surface in space. There are three surfaces passing through a given point with coordinates (Subscript[u, 1]),(Subscript[u, 2]),(Subscript[u, 3]). The three gradients 

					(Overscript[(Subscript[γ, i]), k]) =  ∂(Subscript[u, k])/ ∂(Subscript[x, i]);  					 (3)
					
(k numbering the surface; i numbering the components of each vector) make up  a second triple of 
orthogonal non-normalized vectors. The two triples are reciprocal to each other, i.e.

					(Overscript[(Subscript[τ, i]), p])(Overscript[(Subscript[γ, i]), q]) =  (Subscript[δ, pq]).						(4)

The inner products of the vectors are called the covariant metric tensor

				(Subscript[g, pq]) :=  (Overscript[(Subscript[τ, i]), p])(Overscript[(Subscript[τ, i]), q])  =   (∂(Subscript[x, i])/ ∂(Subscript[u, p])) (∂(Subscript[x, i])/ ∂(Subscript[u, q]))  =  (Subscript[g, qp]) ;			(5)
 
 and the contravariant metric tensor 
 
 				(g^pq) :=   (Overscript[(Subscript[γ, i]), p])(Overscript[(Subscript[γ, i]), q])  =  (∂(Subscript[u, p])/ ∂(Subscript[x, i])) (∂(Subscript[u, q])/ ∂(Subscript[x, i]))  =  (g^qp).			(6)

So in  non-orthogonal coordinate systems there are two systems, whose base vectors may change
their orientations and lengths  from point to point. The components of any vector  a , whose 
Cartesian components are  (Subscript[a, i]):
						a   =  (Subscript[a, i]) (Subscript[e, i])

 may be taken with respect to each of these systems.  The covariant components   (Subscript[A, p]) are:
						
		(Subscript[a, i])  =   (Subscript[A, p]) (Overscript[(Subscript[γ, i]), p])  =  (Subscript[A, p  ])∂(Subscript[u, p])/ ∂(Subscript[x, i]),  	(Subscript[A, p]) :=  (Subscript[A, i])(Overscript[(Subscript[τ, i]), k]) =  (Subscript[A, i]) ∂(Subscript[x, i])/ ∂(Subscript[u, k]);			(7)

while the contravariant components   (A^p) are:		
		
		(Subscript[a, i])  =   (A^p) (Overscript[(Subscript[τ, i]), p])  =  (A^p) ∂(Subscript[x, i])/ ∂(Subscript[u, k]),  	(A^p)  :=  (Subscript[a, i])(Overscript[(Subscript[γ, i]), k]) =  (Subscript[a, i]) ∂(Subscript[u, k])/ ∂(Subscript[x, i]).			(8)
		
The arc element may be expressed by the covariant metric tensor  (5):	

			d(s^2):=  d(Subscript[x, i])d(Subscript[x, i]) =  (Subscript[g, pq])  (Subscript[du, p]) (Subscript[du, q]).						(9)

14.2.3	Introducing physical coordinates for orthogonal curvilinear systems

In orthogonal curvilinear systems, the base vectors  (Overscript[(Subscript[γ, i]), p])  and  (Overscript[(Subscript[τ, i]), p])  have the same directions. One introduces one set of normalized base vectors  (Subscript[𝔢, i]):
		 			(Subscript[𝔢, i]) :=  (Overscript[(Subscript[τ, i]), p])/(Subscript[h, p])  =  (Overscript[(Subscript[γ, i]), p])(Subscript[h, p])

In place of the covariant and contravariant components of a vector one gets one set, the physical coordinates   (Subscript[𝔞, i])  such that :
				a   =  (Subscript[a, i]) (Subscript[e, i]) =  (Subscript[𝔞, i])(Subscript[𝔢, i]) =   (A^p) (Overscript[τ, p])  =   (Subscript[A, p]) (Overscript[γ, p]);      			(10)
	
	 			(Subscript[𝔞, i]) =  (Subscript[h, i])(A^i) =  (Subscript[A, i])/ (Subscript[h, i]).	(No summation in this line !)

For example, in cylindrical coordinates  ρ, ϕ, z  the transformation from rectangular coordinates, the three tangents to the coordinate curves and the gradients of the coordinate surfaces are:

	x = (Subscript[x, 1])= ρ cosϕ,  y = (Subscript[x, 2])= ρ sinϕ, z = (Subscript[x, 3]);   ρ =  (Sqrt[(x^2) + (y^2)]), ϕ = tan(y/x),  z = (Subscript[x, 3]).

	(Overscript[(Subscript[τ, i]), k]) =  ∂(Subscript[x, i])/ ∂(Subscript[u, k]):   (Overscript[(Subscript[τ, i]), 1])= ( cosϕ, sinϕ,  0),   (Overscript[(Subscript[τ, i]), 2])= ( -ρ sinϕ, ρ cosϕ,  0),   (Overscript[(Subscript[τ, i]), 3])= (0, 0, 1), with ρ =  (Sqrt[(x^2) + (y^2)]),
	
	(Overscript[(Subscript[γ, i]), k]) =  ∂(Subscript[u, k])/ ∂(Subscript[x, i]);  (Overscript[(Subscript[γ, i]), 1])= (x/ρ, y/ρ, 0),	(Overscript[(Subscript[γ, i]), 2])= (-y, x)/((x^2) + (y^2)),        (Overscript[(Subscript[γ, i]), 3]) = (0, 0, 1).
	
The metric coefficients  (Subscript[h, i])are:	 
				        (Subscript[h, ρ])  =  (Subscript[h, z])  =  1,  (Subscript[h, ϕ])=  ρ.
				
The various coordinates of the position  (r) and of the velocity vector (v) are:

   r  =   (Subscript[r, ρ])𝔢ρ +  (Subscript[r, ϕ])𝔢ϕ  +  (Subscript[r, z])z 𝔢z ,    rρ= ρ,   (Subscript[r, ϕ])= 0,     (Subscript[r, z])= z.  (A^ρ)= (Subscript[A, ρ])= 0,  (A^ϕ)= (Subscript[A, ϕ])= 0,  (A^z)= (Subscript[A, z])= z.
   v  =  (Subscript[v, ρ])𝔢ρ +  (Subscript[v, ϕ])𝔢ϕ  +  (Subscript[v, z])z 𝔢z ,  vρ= (OverDot[ρ]),  vϕ= ρ(OverDot[ϕ]),  vz= (OverDot[z]).  (A^ρ)= (Subscript[A, ρ])= (OverDot[ρ]), (A^ϕ)= (OverDot[ϕ]), (Subscript[A, ϕ])= ρ(OverDot[ϕ]), (A^z)= (Subscript[A, z])= z.

The square of the arc element is:

			d(s^2) = (dx^2) + (dy^2) + (dz^2) =  (Subscript[h, 1]^2) (Subscript[du, 1]^2)+ (Subscript[h, 2]^2) (Subscript[du, 2]^2) +   (Subscript[h, 3]^2) (Subscript[du, 3]^2) .		(11)

The surface elements and the volume elment are:

(Subscript[df, 1]) = (Subscript[h, 2])(Subscript[h, 3])(Subscript[du, 2])(Subscript[du, 3]), (Subscript[df, 2]) = (Subscript[h, 1])(Subscript[h, 3]) (Subscript[du, 1])(Subscript[du, 3]), (Subscript[df, 3]) = (Subscript[h, 1])(Subscript[h, 2]) (Subscript[du, 1])(Subscript[du, 2]);		(12)
       		 
        					dV	=  (Subscript[h, 1]) (Subscript[h, 2]) (Subscript[h, 3]) (Subscript[du, 1])  (Subscript[du, 2]) (Subscript[du, 3]).					(13)

The Vector Analysis Package contains 14 orthogonal systems but no non-orthogonal ones.   
A description of this package is found in   Wolfram Mathematica - VectorAnalysis/tutorial/VectorAnalysis  
to be found via the Help menue. 
The package must be called by :

<<VectorAnalysis`

or

Needs["VectorAnalysis`"];

14.2.4  Selecting the Wanted System

CoordinateSystem  		gives the name of the default coordinate system

Coordinates[ ]    		give a list of the default names of the variables in the default 
					coordinate  system

Coordinates[coordsys] 	give the default names of the variables in the coordinate  system 
					coordsys

 SetCoordinates[coordsys]    set the default coordinate system to be  coordsys with default 
 					variable names
 
 SetCoordinates[coordsys[varnames]]	set the default coordinate system to be 
 					coordsys  with default variable names  varnames

Available systems are:

({{Bipolar, Bispherical}, {Cartesian, ConfocalEllipsoidal}, {ConfocalParaboloidal, Conical}, {Cylindrical, EllipticCylindrical}, {OblateSpheroidal, ParabolicCylindrical}, {Paraboloidal, ProlateSpheroidal}, {Spherical, Toroidal}})

14.2.5	Transformations between Systems

(Subscript[x, i])  =  (Subscript[x, i])(pt), pt =( (Subscript[u, 1]),(Subscript[u, 2]),(Subscript[u, 3]))= ( (Subscript[u, 1]),(Subscript[u, 2]),(Subscript[u, 3]))[x,y,z]

CoordinatesToCartesian[pt]   		give the Cartesian coordinates of point  pt,  which 
							is given in default coordinates

CoordinatesToCartesian[pt, coordsys] 	give the Cartesian coordinates of point  pt, which 
							is given in the coordinate system  coordsys
						
CoordinatesFromCartesian[pt]		give the coordinates in the default 
							coordinate system of point  pt, whose 
							Cartesian coordinates are given

CoordinatesFromCartesian[pt, coordsys]  	give the coordinates in the coordinate 
								system  coordsys  of point  pt,  which is 
								given in Cartesian coordinates

SetCoordinates[Cylindrical[r,φ,z]]

CoordinatesToCartesian[{r,φ,z}]

CoordinatesToCartesian[{5., N[Pi] /3., 2.}]

{5. Cos[N[Pi] /3.], 5. Sin[N[Pi] /3.], 2.}

CoordinatesFromCartesian[{x,y,z}]

Note:   ArcTan[x,y] works correctly in all four quadrants of the x, y-plane; whereas ArcTan[y/x] is limited 
to the  1st and 4th quadrant (principal branch of ArcTan[]).

CoordinatesFromCartesian[{1.,1.,2}]

N[Pi]/4.

14.2.6	Vector Algebra

Needs["VectorAnalysis`"];

a = {ar, aφ, az}; b = {br, bφ, bz}; c = {cr, cφ, cz};

SetCoordinates[Cylindrical[r,φ,z]]

14.2.6.1		Scalar product of two vectors

a.b										(* correct *)

DotProduct[a,b]							(*  wrong  *)

DotProduct[a,b,Cartesian]				(* correct *)

DotProduct[a,b,Cylindrical]				(*  wrong  *)

DotProduct[a,b,Spherical]				(*  wrong  *)

14.2.6.2		Vector product

Cross[a,b]                                                                    (* correct *)

CrossProduct[a,b,Cartesian]				(* correct *)

CrossProduct[a,b]						(*  wrong  *)

CrossProduct[a,b,Cylindrical]			(*  wrong  *)

14.2.6.3		Scalar triple product  ( German: Spatprodukt)

a.Cross[b,c]                                                            (* correct *)

ScalarTripleProduct[a,b,c, Cartesian]	(*  correct  *)

ScalarTripleProduct[a,b,c]				(*  wrong  *)

14.2.7 	Vector Analysis

Grad[s]   		give the gradient of the scalar field  s	in the default coordinate system

Div[v]    		give the divergence of the vector field  v   in the default coordinate system
 
 Curl[v]   		give the curl (rotor) of the vector field  v   in the default coordinate system

Laplacian[s]  	give the Laplacian of the scalar field  s  or the in the default coordinate system
			
Laplacian[v]  	give the Laplacian of the vector field   v   in the default coordinate system

Biharmonic[s] 	give the Laplacian of the Laplacian of the scalar field  s  in the default 
			coordinate system

Grad[s, coordsys], Div[v, coordsys], ... give the result for the coordinate system
									coordsys

Needs["VectorAnalysis`"];

SetCoordinates[Cylindrical[r,φ,z]]

14.2.7.1		Gradient of a scalar field

Grad[ψ[r,φ,z]]

Grad[ψ[r,ϑ,φ], Spherical[r,ϑ,φ]]

14.2.7.2		Divergence of a vector field

Clear[a,b,c];
a = {ar[r,φ,z], aφ[r,φ,z], az[r,φ,z] };

Div[a]//Expand

14.2.7.3		Curl of a vector field

Curl[a]//Expand

14.2.7.4		Laplacian of a scalar field

Expand[Laplacian[ ψ[r,φ,z] ]]

14.2.7.5		Vector Laplacian = Laplacian of a vector field

Δ(Overscript[a, →]) =  grad(div(Overscript[a, →])) - rot(rot(Overscript[a, →]))
follows from:     rot(rot(Overscript[a, →])) = [∇,[∇(Overscript[a, →])]] =  ∇(∇, (Overscript[a, →])) -  (∇,∇)(Overscript[a, →]) = grad(div(Overscript[a, →])) - Δ(Overscript[a, →]) = grad(div(Overscript[a, →])) - Δ(Overscript[a, →])

Expand[ Grad[Div[a]] - Curl[Curl[a]]  ]

The third component of the Vector Laplacian applied to the vector    a  equals the expression  Laplacian[az]  as in Cartesian coordinates (cf. § 3.14). However, in the first two components 
of the vector Laplacian the two first components of the vector  a are mixed.
The operator Laplacian[] applied to vector fields works also properly:

Laplacian[a] - % //Simplify

14.2.8 	Curvilinear Systems Implemented in Mathematica.

The systems of  orthogonal curvilinear systems implemented in the package "Calculus`VectorAnalysis`"  
(now: "VectorAnalysis`") (Guide to Standard Packages, p.26f, Standard Add-on Packages, p. 75)  
are listed below and in more detail in Table 14.1.
This table can be found in the File Table14-1.pdf in the directory Mathematica Course notes.

Important information on these systems and the corresponding coordinates are obtained by the following 
commands.

CoordinateRange[]	give the intervalls over which the coordinates of the default coordinate system may vary

Parameters[ ]      	give a list of the default values for the parameters of the default coordinate system

ParameterRanges[]	give the intervals over which each of the parameters of the default coordinate system 
					may range
					
CoordinateRange[coordsys], Paramters[coordsys], ParameterRanges[coordsys]  
          			give the result for the coordinate system  coordsys
SetCoordinates[coordsys[varnames, param]] set the default coordinate system to be 
					coordsys with variable names varnames and parameter values param

Needs["VectorAnalysis`"]

SetCoordinates[Cylindrical[r,φ,z]]

Paraboloidal Coordinates μ,ν,ψ  are defined in Moon Spencer in Table 1.08, pp. 34 f.

SetCoordinates[Paraboloidal[μ,ν,ψ]]

One set of coordinates surfaces is given by paraboloids of rotation open upwards,
while the parameter μ varies in  the range 0 < μ < ∞, the other one by 0 < ν < ∞
giving by similar surfaces open downwards. The azimuth varies within -π ≤ ψ ≤ π.

CoordinatesToCartesian[{μ,ν,ψ}]

CoordinateRanges[]

The paraboloidal coordinate system has no free parameters:

ParameterRanges[]

Prolate Spheroidal Coordinates  ξ, η, ϕ  are defined in Moon Spencer in Table 1.06, pp. 28 f.

SetCoordinates[ProlateSpheroidal[]]

One set of coordinate surfaces are prolate ellipsoids of rotation corresponding to 0 ≤ ξ < ∞.
The equal semi-axes are smaller than the third semi-axis || to the z-axis.  0 ≤ η ≤ π gives a
hyperboloid of rotation consisting of two sheets as it is obtained by rotating a hyperbola 
arond an axis passing through the foci.  The azimuth varies within -π ≤ ϕ ≤ π.  
There is an infinite number of such coordinate systems. Each system corresponds to 
a given value of the parameter  a  determining the distance of the foci common to all
conics of the system from the origin. The default value of  a  is unity as shown above.

SetCoordinates[ProlateSpheroidal[ξ,η,ϕ,a]]

CoordinatesToCartesian[{ξ,η,ϕ}]

CoordinateRanges[]

The parameter  a may be any positive real number:

ParameterRanges[]

Oblate Spheroidal Coordinates  ξ, η, ϕ  are defined in Moon Spencer in Table 1.07, pp. 31 f.

SetCoordinates[OblateSpheroidal[]]

One set of coordinate surfaces are oblate ellipsoids of rotation corresponding to 0 ≤ ξ < ∞.
The equal semi-axes are longer than the third semi-axis || to the z-axis.  -π/2 ≤ η ≤ π/2 gives a
hyperboloid of rotation consisting of one sheet as it is obtained by rotating a hyperbola 
around an axis passing through the middle between the foci.  The azimuth varies within 
-π ≤ ϕ ≤ π.  There is an infinite number of such coordinate systems. Each system corresponds 
to a given value of the parameter  a  determining the distance of the foci common to all
conics of the system from the origin. The default value of  a  is unity as shown above.

SetCoordinates[OblateSpheroidal[ξ,η,ϕ,a]]

CoordinatesToCartesian[{ξ,η,ϕ}]

CoordinateRanges[]

The parameter  a may be any positive real number:

ParameterRanges[]

Bipolar coordinates u, v, z  are a system corresponding to parallel wires, Moon Spencer Fig. 2.09,
p.64 and  p.51

SetCoordinates[Bipolar]

CoordinateRanges[]

Note: Mathematica uses the default names and coordinate ranges as just given.
We use the letters u and v just reversed to the use in the figure quoted above 
following Moon and Spencer"s notation.

CoordinateRanges[]

cuvz = CoordinatesToCartesian[{u,v,z}]

CoordinatesFromCartesian[{x,y,z}]

CoordinatesToCartesian[{0.2 N[Pi/2],0.7 N[Pi/2], 0}]

CoordinatesFromCartesian[{1.86,.43,z}]

Clear[x,y,z]
x[u_,v_] = cuvz[[1]]
y[u_,v_] = cuvz[[2]]

u = -∞ (+∞) gare the poles x =  -a = -2 (a = 2). u = const. are circles around these.  Above  u ϵ [-2,2] with stepwidth Δu = 0.25, -π ≤ v ≤ π.
u = 0 is the y-axis.  v = const,  with  u ϵ [-∞, ∞]  gives circles passing through the poles. Above v ϵ [-π, π] with Δv = π/6. 
v = 0, ±π  corresponds to points on the x-axis.  v = π, -π: x ϵ [-1,1]; v = 0: x ϵ [ -∞, -1] ⋁ [1,∞].

Bispherical coordinates η, θ, ψ, Moon Spencer Table E4Rx and Fig. 4.03, pp.110

are obtained from the plane bipolar coordinates by rotating them around the x-axis;
anr renaming v -> η,  u -> θ, ψ the new azimuthal coordinate:

X = y[θ, η] Cos[ψ]

Y = y[θ, η] Sin[ψ]

Z =  x[θ, η]

Toroidal coordinates η, θ, ψ, Moon Spencer Table E4Ry and Fig 4.03, pp.112

are obtained from the plane bipolar coordinates by rotating them around the y-axis;
anr renaming v -> η,  u -> θ, ψ the new azimuthal coordinate:

X = x[θ, η] Cos[ψ]

Y = x[θ, η] Sin[ψ]

Z =  y[θ, η]

Ellipsoidal coordinates  λ, μ, ν are defined in Moon Spencer in Table 1.10, pp.40 f

SetCoordinates[ConfocalEllipsoidal[λ,μ,ν]]

The coordinate surfaces are three sets of confocal conics: Three-axial ellipsoids, whose semi-axes 
have the lengths 3,2,1 in the default case.  λ = const. determines a certain ellipsoid. λ may 
vary in the range -∞ < λ < 1. μ = const. (1 < μ < 4) gives a hyperboloid of one sheet. 
ν (4 < ν < 9)  gives a hyperboloid of two sheets. 
There are three parameter values determining the ratios of the semi-axes of the conics and
the ranges of the coordinate values.

CoordinateRanges[]

CoordinatesToCartesian[{λ,μ,ν}]

CoordinatesFromCartesian[{x,y,z}]

Length[%]

ParameterRanges[]

14.2.6  Arclength and Volume Element

The package   "VectorAnalysis`"  permits one to calculate differential arc length and the 
Jacobian matrix needed for volume integrals in the orthogonal curvilinear coordinates listed in the preceeding 
paragraph. In three-dimensional Cartesian coordinates a curve may be given by a parametric representation  
{ x(t), y(t), z(t) }. Then   ds, the differential of arc length  s  is given by the arc length factor  [ x2 + y2 + z2]1/2  
multiplied with   dt:  	
			 	ds  =   [ x2 + y2 + z2]1/2  dt .

Clear[x,y,z]
SetCoordinates[Cartesian[x,y,z]]

ArcLengthFactor[{x,y,z},t]

In cylindrical coordinates the arc length factor is for a curve given  in parametric representation  by  
r(t), φ(t), z(t) :

ArcLengthFactor[{r,φ,z},t,Cylindrical]

In spherical coordinates the arc length factor is

ArcLengthFactor[{r,θ,φ},t,Spherical]

ArcLengthFactor[{f1,f2,f3},t] 	give the derivative of the arc length along the curve 
						{f1(t),f2(t),f3(t)} in the default coordinate system. 
						f1, f2, f3  are the three independent variables of the system.

ArcLengthFactor[{f1,f2,f3},t, coordsys]  give the derivative in the system  coordsys

With the help of the arc length factor it is easy to calculate the length of a curve given in parametric 
representation.  One just integrates over the arc length factor for the range of the paramter belonging to the 
part of the curve, whose length is required. Note that the total derivative  Dt  (cf. §  10.1.2)  is used in the 
ArcLengthFactor[].  Therefore for any symbols their dependence on the paramter  t is assumed. Any 
symbol representing  a constant, e.g.  ar,  must be so declared by   Attributes[ ar,  Constant].

Below a screw is given in Cartesian coordinates:

screw = {5 Cos[t], 5 Sin[t], 3 t};

Integrate[ ArcLengthFactor[screw, t, Cartesian],{t, 0, 2 π}]

Here a circle of radius  1   is given in cylindrical coordinates:

kreis = {1, t, 0};

Integrate[ ArcLengthFactor[kreis, t, Cylindrical], {t,0,2π}]

Now the radius of the circle is  a,  i.e. a symbol. It represents  the constant radius of the circle. As explained 
above this property must declarted by Attributes[] so that the calculation runs properly.

kreis = {a, t, 0} ;
SetAttributes[a, Constant]

Integrate[ ArcLengthFactor[kreis, t, Cylindrical], {t,0,2π}]

The scale factors h1, h2, h3 (called metric elements at the beginning of § 14.2.2) are the square roots 
of the diagonal elements of the diagonal metric tensor,  Their product is the Jacobian determinant.

ScaleFactors[]			The 3 scale factors for the default coordinate system

	ScaleFactors[coordsys]	The 3 scale factors for the system   coordsys

ScaleFactors[Cylindrical[r,φ,z]]

ScaleFactors[Spherical]

The Jacobian matrix is the matrix of all the partial derivatives of the coordinate transformation   
xi(u1,u2,u3)   w.r.t. the curvilinear coordinates  uk.  Its determinant measures how the volume 
element changes under this transformation.  So the matrix is:

JacobianMatrix[]			Jacobian Matrix in default coordinate system 

	JacobianMatrix[coordsys]	Jacobian Matrix in default coordinate system coordsys

	JacobianDeterminant[]	Determinant of Jacobian Matrix

JacobianMatrix[Cylindrical[r,φ,z]]//MatrixForm

JacobianDeterminant[Cylindrical]

SetCoordinates[Spherical[r,θ,φ]];

jm = JacobianMatrix[]; MatrixForm[jm]

JacobianDeterminant[]

The volume of a sphere of radius a is:

Integrate[JacobianDeterminant[], {r,0,a},{θ,0,π},{φ,0,2π}]

14.3   Vector Field Solutions of the Vector Helmholtz Equation

The scalar Hemholtz equation is:
					( Δ +  (k^2))  Φ = 0.
The corresponding equation for vector fields  A  is the vector Helmholtz equation:

				( (Overscript[Δ, →]) +  (k^2)(Overscript[I, →]))  A =  ( graddiv - rotrot  +  (k^2)(Overscript[I, →]))  A = 0.
(Overscript[I, →])  is the unit matrix.  In Cartesian coordinates this equation separates into three independent equations
scalar Helmholtz equations, each for one component of the Cartesian components  (Subscript[A, x]), (Subscript[A, y]), (Subscript[A, z]).
However, in curvilinear coordinates the operator  (Overscript[Δ, →])   mixes the components.  There are six coordinate
systems in which a decomposition into three scalar field equations can be achieved. These are the
four cylindrical systems (Cartesian, Cylindrical, EllipticCylindrical, ParabolicCylindrical)  and the 
two systems with spherical coordinate surfaces (Spherical, Conical).

14.3.1	Cylindrical systems

In the cylindrical systems denoted in the Table 14.1  by   MC  (Cartesian, Cylindrical, EllipticCylindrical, 
 ParabolicCylindrical  the vector Helmholtz equation can be separated by the following vector fields

L = grad(ψ) , 		M = curl( ez ψ), 	N = 1/k  curl M,

provided  ψ   is a solution of the scalar Helmholtz equation Δψ + (k^2)ψ = 0 and   ez   is a constant vector 
along the cylindrical axis. With the same condition the vector fields  M  and  N  are solutions of  Maxwell's 
eqs. and of the eq.  "curl curl . - k^2 . = 0" ,  but  the fields  L  are not.

Note:	L is a solution of the homogeneous and the inhomogenous vector Helmholtz equation only,  but not 
of the homogeneous Maxwell equations nor of  the ensuing eq. "curl curl . - k^2 . = 0".  L  may be needed 
for solving the inhomogeneous Maxwell equations and the ensuing inhomogeneous equation   
curl curl .  -  k^2 .  =   ...  .

Needs["VectorAnalysis`"]

SetCoordinates[Cylindrical[r,φ,z]]

a = {0,0,1} (* = ez *);

m = Curl[a ψ[r,φ,z]]

Div[m]

Now it is shown that the vector field  M = m  is a solution of the eq. "curl curl . - k^2 . = 0". Then it is also a solution of the vector Helmholtz eq. in view of the preceding result . At first the definition of the field      m  is inserted into the expression giving the vector  c . In order to distinguish the 3 components of    c    more clearly,  the commas separating them in the output are enhanced by two vertical bars.

c = Expand[Curl[Curl[m]] - k^2 m]

c[[1]]//Simplify

Up to now we did not use the assumption that ψ is a solution of the scalar Helmholtz equation:

rps = Expand[Laplacian[ψ[r,φ,z]] + k^2 ψ[r,φ,z]] == 0

We intend to solve this equation for the second derivative of  ψ  w.r.t.    z, i.e. w.r.t.  D[ψ,{z,2}]. Before we can do that,  we must find out how  this command is stored in the list of commands of the last eq. This is displayed by the following command (cf. §  23.1) :

FullForm[rps]

sps = ExpandAll[Solve[rps, Derivative[0,0,2][ψ][r,φ,z]]]//Flatten

Only the third derivatives of psi occur in the vector c. Therefore these  are calculated and combined in a list  dsps  below.

drsps = Flatten[D[sps,r]]

dpsps = Flatten[D[sps,φ]]

dzsps = Flatten[D[sps,z]]

dsps = Join[drsps, dpsps, dzsps];

Now these third derivatives are inserted into the first, second, third component of the vector   c ; finally into the total vector in one step.

Expand[c[[1]] /. dsps]

Together[c[[2]] /. dsps]

Together[c[[3]] /. dsps]

Together[c /. dsps]

This completes the proof  that the vector field  M = m   satisfies the equation   curl curl M   -  k^2 M  =  0  and the vector Helmholtz equation. The same proof is now given for the vector field  N = n .

n = Curl[Curl[a ψ[r,φ,z]]];     Div[n]

c = Expand[Curl[Curl[n]] - k^2 n ]

Here the fourth and the third derivatives of  D[ψ, {z,2}] (ψ   a solution  of the scalar Helmholtz equation)  must be inserted into the vector   c.

ddsps = Flatten[Union[D[sps,r,r],D[sps,φ,φ],D[sps,z,z],
			D[sps,r,φ], D[sps,φ,z], D[sps,r,z], dsps]];

Together[c /. ddsps]

The field    L = l   is a solution of  the vector Helmholtz equation provided  ψ   is a solution of the scalar Helmholtz equation:

l = Grad[ ψ[r,φ,z] ]

Curl[l]

c = Grad[ Div[l] ] + k^2 l ;

Expand[c /. dsps ]

14.3.2	Systems with a radial vector

In the systems with spherical coordinate surfaces  denoted in the Table 14.1  by   MR (Spherical, Conical)  
the vector Helmholtz equation can be separated by the following vector fields :

L = grad(ψ) , 		M = curl( r ψ), 		N = 1/k  curl M.

r  is the radius vector. M  and  N  only are solutions of Maxwells eqs. and of the eq. "curl curl . - k^2 . = 0" provided ψ is a solution of the scalar Helmholtz equation. M  and  N  are solenoidal (source-free rotational) vectors fields.  L  gives irrotational source fields.  
 The proof follows the same lines as that in the cylindrical case, but one must use the vector  r = (r,0,0).
 See ex.14.8 .

Exercises

14.1	A plane contains the point C = (cx,cy,cz) and the vectors a  = (ax,ay,az) and  b = (bx,by,bz).
	Compute a general formula for the distance  d  of a point  P = (px,py,pz) from this plane.

14.2	Check which of the following polynomials are solutions of the potential equation:
	1.	f1 = (x + I y)^2 (z^2), 	2.	f2 = (x + I y)^2  z .

14.3	In the plane a triangle is given by the coordinates of its three corners. There is given a point P.
	Develop a test which checks whether P is inside, on the or outside the triangle.  
	
	Hints: H1: A half-ray emanating from P crosses a closed polygon in an odd number of points, 
	if P is in the interior. H2: The vector to P may be spanned on two vectors forming the triangle.
	The expansion coefficients must be positive and their sum < 1, if P is inside the triangle. 
	H3. Let a,b,c be the vectors pointing from P to the 3 corners. The vector products (a x b),
	(b x c), (c x a) must all be right-handed (or all left-handed) if the point is in the interior. One of
	these is zero if the point is on an edge.

14.4	The point  P = (1,2,3) has the rectangular coordinates just given. 
	a) What are the values of its spherical coordinates ?
	b) What are the values of its parabolic coordinates ?
	c) What are the values of its coordinates in prolate spheroidal coordinates with focal length  a = .5 ?

14.5	The point  P has spherical coordinates  r = 3, ϑ = 3π/7, φ = .3 π.
	a) What are the values of its cylindrical coordinates ?
	b) What are the values of its parabolic coordinates ?
	c) What are the values of its coordinates in prolate spheroidal coordinates with focal length  a = 2 ?

14.6	Compute the length of the arc of an Archimedian spiral  r = a φ  extending from φ = 0  to  φ = π.

14.7 	Show that the vector fields  L, M, N  defined in sect. 14.7  are solutions of the 
      	vector Helmholtz equation in parabolic cylinder coordinates provided  ψ  is a solution 
     	 of the scalar Helmholtz eq. in these coordinates.  
     	 a  = constant unit vector along z-direction.

14.8  	Show that the vector fields  L, M, N defined in sect. 14.7  are solutions of the vector 
    	Helmholtz equation in spherical coordinates  provided  ψ  is a solution of the scalar 
     	Helmholtz eq. in these coordinates.  a  = r =  radial vector.  In this case it is particularly 
     	important to insert  anew all the previous solutions into the derivatives of   ∂2ψ/∂r2   -> ... .