5. Derivatives and Integrals

Initialization

Needs["TensorCalculus4`Tensorial`"]

Needs["TContinuumMechanics2`TContinuumMechanics`"]

Needs["DrawGraphics`DrawingMaster`"] <br />

numequ = 1 ;

SetScalarSingleCovariantD[False]

oldflavors = IndexFlavors ;

ClearIndexFlavor/@oldflavors ;

DeclareIndexFlavor[{black, Black}, {red, Red}, {green, ForestGreen}, {star, SuperStar}, {blue, Blue}, {hat, OverHat}, {tilde, OverTilde}, {bar, OverBar}]

DeclareBaseIndices[{1, 2, 3}] ;

SymbolSpaceDimension[] = NDim ;

TensorSymmetry[Γ, 3] = Symmetric[2, 3] ;

The following values are taken as an example of a (red) basis frame :

SetTensorValues[gdd[i, j], IdentityMatrix[3]]

RedBasisVectors = ({{1, 1, 0}, {0, 1, 2}, {1, 0, 1}}) ; RedMetric = ( {{2, 1, 1}, {1, 5, 2}, {1, 2, 2}} ) ;

SetTensorValueRules[d[red @ i], RedBasisVectors]

SetTensorValueRules[u[red @ i], Inverse[RedBasisVectors//Transpose]]

SetTensorValueRules[gdd[red @ i, red @ j], RedMetric]

SetTensorValueRules[guu[red @ i, red @ j], Inverse[RedMetric]]

and from equation (2.5) :

Tensor[ℰ§, {Void, Void}, {i_, j_}] := (PartialD[ud[red @ i], red @ j] + PartialD[ud[red @ j], red @ i])/2

Christoffel symbols

_ (i  ,  j)^(i  ,  j)   is related to the base via a Christoffel symbol .  (while the covariant derivative of _ i^i   is zero) .

When we want to differentiate a vector, we must differentiate the sum of the products of the components with the base vectors :

 = vu[red @ i] d[red @ i]

$ = vd[red @ i] u[red @ i]

v_i^i _i^i

v_i^i _i^i

Introduction of the Christoffel symbols

ChristoffeluSymbol[e,Γ,k] is equivalent to the Christoffel notation used in Tensorial 4.0, which is the unique notation used there. We have also introduced here the covariant ChristoffeldSymbol[e,Γ,k]

The Christoffel symbols appear in the basis expansions of the partial derivatives of the basis vectors:

PartialD[d[red @ i], red @ j]

%//ChristoffeluSymbol[, Γ, k]

%%//ChristoffeldSymbol[, Γ, k]

PartialD[u[red @ i], red @ j]

%//ChristoffeluSymbol[, Γ, k]

_i^i_ (, j)

_k^k Γ_ (kij)^(kij)

_k^k Γ_ (kij)^(kij)

_i^i_ (, j)

-_k^k Γ_ (ijk)^(ijk)

The Christoffel symbol are symmetrical with respect to the last two indices (see the proof below).
They can be put into a standard order using SymmetrizeSlots[] together with the constraint TensorSymmetry[Γ,3]=Symmetric[2,3] (which is now in Tensorial4, and replaces most of the time (but not always) SymmetricStandardOrder[Γ,{2}])

Γddd[k, j, i]//ToFlavor[red, black] ;

% == (%//SymmetrizeSlots[])

Γudd[k, j, i]//ToFlavor[red, black] ;

% == (%//SymmetrizeSlots[])

Γ_ (kji)^(kji) == Γ_ (kij)^(kij)

Γ_ (kji)^(kji) == Γ_ (kij)^(kij)

I will be necessary in the following to make the equivalence between partial derivatives with respect to the basis coordinates xu[i] and the partial derivatives with respect to the indices, using PartialToDif :

Examples :

1)

labels = {x, δ, g, Γ} ;

(drv = PartialD[labels][Tensor[T, {i, j}, {Void, Void}], {xu[k], xu[h]}]) == (drv//PartialDToDif)

∂^2T_ (ij)^(ij)/∂x_k^k∂x_h^h == T_ (ij)^(ij) _ (, kh)

The labels and the coordinates must of course agree. If they do not, the indices are not used :

(drv = PartialD[labels][Tensor[T, {i, j}, {Void, Void}], {yu[k], yu[h]}]) == (drv//PartialDToDif)

∂^2T_ (ij)^(ij)/∂y_k^k∂y_h^h == T_ (ij)^(ij) _ (, y_k^ky_h^h)

2) The reverse writing needs to introduce the labels :

(PartialD[Tensor[T, {i, j}, {Void, Void}], k]) ==  (PartialD[Tensor[T, {i, j}, {Void, Void}], k]//DifToPartialD[labels])

T_ (ij)^(ij) _ (, k) == ∂T_ (ij)^(ij)/∂x_k^k

(PartialD[Tensor[T, {i, j}, {Void, Void}], {k, h}]//ToFlavor[red, black]) ==  (PartialD[Tensor[T, {i, j}, {Void, Void}], {k, h}]//ToFlavor[red, black]//DifToPartialD[labels])

T_ (ij)^(ij) _ (, kh) == ∂^2T_ (ij)^(ij)/∂x_k^k∂x_h^h

Derivation of a vector v

PartialD[Tensor[], red @ j] == PartialD[, red @ j]

%//ChristoffeluSymbol[, Γ, k]

%%//ChristoffeldSymbol[, Γ, k]

(v_i^i _i^i) _ (, j) == _i^i_ (, j) v_i^i + v_i^i_ (, j) _i^i

(v_i^i _i^i) _ (, j) == v_i^i_ (, j) _i^i + v_i^i _k^k Γ_ (kij)^(kij)

(v_i^i _i^i) _ (, j) == v_i^i_ (, j) _i^i + v_i^i _k^k Γ_ (kij)^(kij)

res = PartialD[Tensor[], red @ j] == PartialD[, red @ j]//ChristoffeldSymbol[, Γ, k]

Print[but the following results cannot exist !!]

res//UpDownSwap[red @ i]

res[[2, 2]] guu[red @ j, red @ h] == (res[[2, 2]] guu[red @ j, red @ h]//MetricSimplify[g])

Print[as only the first index in Γ is tensorial and can be raised and lowered]

(v_i^i _i^i) _ (, j) == v_i^i_ (, j) _i^i + v_i^i _k^k Γ_ (kij)^(kij)

but the following results cannot exist !!

(v_i^i _i^i) _ (, j) == v_i^i_ (, j) _i^i + v_i^i _k^k Γ_ (kij)^(kij)

g_ (jh)^(jh) v_i^i _k^k Γ_ (kij)^(kij) == v_i^i _k^k Γ_ (kih)^(kih)

as only the first index in Γ is tensorial and can be raised and lowered

The symmetry of the two last indices of the Christoffel symbols comes from the commutation of the second derivatives, and we have,

PartialD[Tensor[r], {red @ i, red @ j}] ≡PartialD[Tensor[r], {red @ j, red @ i}]

PartialD[d[red @ i], red @ j] ≡PartialD[d[red @ j], red @ i]

%//ChristoffeluSymbol[, Γ, k]

%[[1, 2]] == %[[2, 2]]

r_ (, ij) ≡r_ (, ji)

_i^i_ (, j) ≡_j^j_ (, i)

_k^k Γ_ (kij)^(kij) ≡_k^k Γ_ (kji)^(kji)

Γ_ (kij)^(kij) == Γ_ (kji)^(kji)

Explicit expression of the Christoffel symbols

Note : PartialD involving only indices does not use all the properties of partial derivatives. To include them we need to go through explicit partial derivations via the labels {x,δ,g,Γ}. This is obtained using DifToPartialD[labels]. PartialDToDif restores the index notation.

PartialD[d[red @ j] . d[red @ k], red @ i] + PartialD[d[red @ k] . d[red @ i], red @ j] - PartialD[d[red @ i] . d[red @ j], red @ k]

%//DifToPartialD[labels]//PartialDToDif//ChristoffeluSymbol[, Γ, h]//SymmetrizeSlots[]

res = %//EvaluateDotProducts[, g]

2 (_h^h Γ_ (hij)^(hij)) . _k^k

2 Γ_ (kij)^(kij)

so that we have the explicit expression for the Christoffel symbols :

      2 Γ_ (kij)^(kij) == -g_ (ij)^(ij) _ (, k) + g_ (jk)^(jk) _ (, i) + g_ (ki)^(ki) _ (, j)       (5.1)

We see that with the notation "upper index in the third position", the above proof is immediate.

Covariant Derivative

Important remarks :
CovariantD is applied only over objects in the simple tensor shape without partial derivatives involved.
Mathematically the covariant derivative is only defined over strict tensors and a partial derivative is not a strict tensor.

Mathematically we are allowed to take covariant derivatives of other objects such as the first order total derivative or the non-expanded TotalDerivative or LieDerivative but they are not implemented because it could be too complicated for the general case. (It is preferable to have Tensorial sharp limitations rather than fuzzy ones)

What we can do instead is to take the Covariant derivative  of a simple tensor object, expand it and replace the values in the expanded expression. The calculation of the acceleration components is an example of this where we do not take the Absolute derivative of the Total derivative of the position directly.

The partial derivative can be taken over anything as well as the Total derivative but the Absolute derivative is like the Covariant derivative.

PartialD[, red @ j]//ChristoffeluSymbol[, Γ, k]

res = %[[1]] + (%[[2]]/.{i→k, k→i})//Factor

v_i^i_ (, j) _i^i + v_i^i _k^k Γ_ (kij)^(kij)

_i^i (v_i^i_ (, j) + v_k^k Γ_ (ikj)^(ikj))

so that the quantity,

res[[2]]

v_i^i_ (, j) + v_k^k Γ_ (ikj)^(ikj)

is the i-component of the j-derivative of v. It is the covariant derivative of v.

(*5.2*)ResultFrame[res52 = CovariantD[vu[red @ i], red @ j] == res[[2]]]

      v_i^i_ (; j) == v_i^i_ (, j) + v_k^k Γ_ (ikj)^(ikj)       (5.2)

This result is of course directly given by the operation ExpandCovariantD :

CovariantD[vu[red @ i], red @ j] == (CovariantD[vu[red @ i], red @ j]//ExpandCovariantD[labels, red @ k]//PartialDToDif)

v_i^i_ (; j) == v_i^i_ (, j) + v_k^k Γ_ (ijk)^(ijk)

similarly, the covariant derivative of the covariant component v_ i^i is given by,

PartialD[$, red @ j]//ChristoffeluSymbol[, Γ, k]

%[[1]] + (%[[2]]/.{i→k, k→i})//Factor

v_i^i_ (, j) _i^i - v_i^i _k^k Γ_ (ijk)^(ijk)

_i^i (v_i^i_ (, j) - v_k^k Γ_ (kji)^(kji))

or also,

CovariantD[vd[red @ i], red @ j]//ExpandCovariantD[labels, red @ k]

ResultFrame[res53 = CovariantD[vd[red @ i], red @ j] == %//PartialDToDif]

-v_k^k Γ_ (kji)^(kji) + ∂v_i^i/∂x_j^j

      v_i^i_ (; j) == v_i^i_ (, j) - v_k^k Γ_ (kji)^(kji)       (5.3)

φ = Add[red @ i, red @ j] uu[red @ i] vu[red @ j]

Dφ = PartialD[φ, red @ k]//Expand       

A_ (ij)^(ij) u_i^i v_j^j

v_j^j_ (, k) A_ (ij)^(ij) u_i^i + u_i^i_ (, k) A_ (ij)^(ij) v_j^j + A_ (ij)^(ij) _ (, k) u_i^i v_j^j

As φ is a scalar, Dφ is also a covariant derivative Dcovφ :

Dcovφ = CovariantD[φ, red @ k]//Expand       

v_j^j_ (; k) A_ (ij)^(ij) u_i^i + u_i^i_ (; k) A_ (ij)^(ij) v_j^j + A_ (ij)^(ij) _ (; k) u_i^i v_j^j

res1 = Dcovφ//ExpandCovariantD[labels, red @ h]//Expand//PartialDToDif

res2 = Dcovφ[[3]] + (Dcovφ - Dcovφ[[3]]//ExpandCovariantD[labels, red @ h])//Expand//PartialDToDif

Coefficient[(res1 - res2)//Factor, uu[red @ i] vu[red @ j]] == 0

-A_ (ij)^(ij) _ (; k) + A_ (ij)^(ij) _ (, k) - A_ (hj)^(hj) Γ_ (hki)^(hki) - A_ (ih)^(ih) Γ_ (hkj)^(hkj) == 0

The term   A_ (ij)^(ij) _ (, k)-A_ (hj)^(hj) Γ_ (hki)^(hki)-A_ (ih)^(ih) Γ_ (hkj)^(hkj) gives the covariant derivative A_ (ij)^(ij) _ (; k) of A_ (ij)^(ij).
Of course, we can verify that this directly obtained using ExpandCovariantD :

CovariantD[Add[red @ i, red @ j], red @ k] == (CovariantD[Add[red @ i, red @ j], red @ k]//ExpandCovariantD[labels, red @ h]//PartialDToDif)

A_ (ij)^(ij) _ (; k) == A_ (ij)^(ij) _ (, k) - A_ (hj)^(hj) Γ_ (hki)^(hki) - A_ (ih)^(ih) Γ_ (hkj)^(hkj)

and the three other equivalent expressions,

CovariantD[Aud[red @ i, red @ j], red @ k] == (CovariantD[Aud[red @ i, red @ j], red @ k]//ExpandCovariantD[labels, red @ h]//PartialDToDif)

A_ (ij)^(ij) _ (; k) == A_ (ij)^(ij) _ (, k) - A_ (ih)^(ih) Γ_ (hkj)^(hkj) + A_ (hj)^(hj) Γ_ (ikh)^(ikh)

CovariantD[Adu[red @ i, red @ j], red @ k] == (CovariantD[Adu[red @ i, red @ j], red @ k]//ExpandCovariantD[labels, red @ h]//PartialDToDif)

A_ (ij)^(ij) _ (; k) == A_ (ij)^(ij) _ (, k) - A_ (hj)^(hj) Γ_ (hki)^(hki) + A_ (ih)^(ih) Γ_ (jkh)^(jkh)

CovariantD[Auu[red @ i, red @ j], red @ k] == (CovariantD[Auu[red @ i, red @ j], red @ k]//ExpandCovariantD[labels, red @ h]//PartialDToDif)

A_ (ij)^(ij) _ (; k) == A_ (ij)^(ij) _ (, k) + A_ (hj)^(hj) Γ_ (ikh)^(ikh) + A_ (ih)^(ih) Γ_ (jkh)^(jkh)

Application : Derivative of a force

d = σuu[red @ i, red @ j] dAd[red @ i] d[red @ j]

dA_i^i _j^j σ_ (ij)^(ij)

CovariantD[d, red @ k]//Expand

σ_ (ij)^(ij) _ (; k) dA_i^i _j^j + _j^j_ (; k) dA_i^i σ_ (ij)^(ij) + dA_i^i_ (; k) _j^j σ_ (ij)^(ij)

The covariant derivative (in the above expression _ (j  ;  k)^(j  ;  k))  of the basis vectors are zero.

CovariantD[d[red @ i], red @ k]

CovDerivRule = CovariantD[d[red @ i_], red @ k_] → (%//ExpandCovariantD[labels, red @ h]//PartialDToDif//ChristoffeluSymbol[, Γ, h]//SymmetrizeSlots[])

_i^i_ (; k)

_i_^i__ (; k_) →0

Also the covariant derivative of the tensor g is zero :

d[red @ i] . d[red @ j] == (d[red @ i] . d[red @ j]//EvaluateDotProducts[, g])

_i^i . _j^j == g_ (ij)^(ij)

which derivative is explicitely :

MapAt[CovariantD[#, red @ k] &, #, 1] + MapAt[CovariantD[#, red @ k] &, #, 2] & [  d[red @ i] . d[red @ j]    ]

CovariantD[d[red @ i_] . d[red @ j_]//EvaluateDotProducts[, g], red @ k_] → (%/.CovDerivRule//EvaluateDotProducts[, g])

_i^i_ (; k) . _j^j + _i^i . _j^j_ (; k)

g_ (i_j_)^(i_j_) _ (; k_) →0

See Fluegge p.72 for an intuitive explanation of _ (j  ;  k)^(j  ;  k)≡ 0.

All this is summarized in the operator  CovariantDSimplify[e,g,e] .  Coming back to the covariant derivative of dF we have :

CovariantD[Tensor["d"], red @ k] == CovariantD[d, red @ k]//CovariantDSimplify[, g, e]

(d) _ (; k) == σ_ (ij)^(ij) _ (; k) dA_i^i _j^j + dA_i^i_ (; k) _j^j σ_ (ij)^(ij)

Now let us choose at x_ k^k and x_ k^k+ dx_ k^ktwo area elements dA equal in size and orientation. Then ((dA) _ (,  k))^k= 0  and hence dA_ (i  ;  k)^(i  ;  k)= 0 and the derivative of the force dF is,

dA_ i^i _ j^j σ_ (i  j  ;  k)^(i  j  ;  k)

This vanishes, for any choice of the components dA_ i^i of the two section elemnts, if and only if σ_ (i  j  ;  k)^(i  j  ;  k)= 0. Each of the 27 quantities σ_ (i  j  ;  k)^(i  j  ;  k) expresses one aspect of the rate of change of the stress tensor, namely the j-component of the change of the force as far as it depends on the  i-component of dA. Vanishing of all the components of the covariant derivative means that between adjacent points the physical stress does not change.

Case for the Levi-Civita tensors

As the covariant derivatives of the metric tensor are zero, it is also the case for the Levi-Civita tensor which only depends on the determinant of the metric tensor. As a consequence :

(CovariantD[eddd[1, 2, 3], k]//ToFlavor[red, black]) == 0

res = (%//BasisExpandCovariantD[labels, red @ h]//EinsteinSum[]//LeviCivitaOrder[e]//FullSimplify)

e_ (123)^(123) _ (; k) == 0

e_ (123)^(123) (Γ_ (1k1)^(1k1) + Γ_ (2k2)^(2k2) + Γ_ (3k3)^(3k3)) == ∂e_ (123)^(123)/∂x_k^k

(*5.4*)
ResultFrame[
res54=(res[[1]]//PartialDToDif)==res[[2]]==(eddd[1,2,3]Γudd[m,k,m]//ToFlavor[red,black])
]

The Riemann-Christoffel tensor R_ (mijk)^(mijk)

By definition :

(*5.5*)ResultFrame[res55 = (res = (CovariantD[vd[red @ i], {red @ j, red @ k}] - CovariantD[vd[red @ i], {red @ k, red @ j}])) == vd[red @ m] (Ruddd[m, i, j, k]//ToFlavor[red, black])]

      v_i^i_ (; jk) - v_i^i_ (; kj) == R_ (mijk)^(mijk) v_m^m      (5.5)

Explicit expression of the Riemann-Christoffel tensor :

res

%//ExpandCovariantD[labels, {red @ m, red @ l}]//Expand//PartialDToDif ;

%//SymmetrizeSlots[]

res = MapAt[#/. l:→ m&, %, {{3}, {4}}]

v_i^i_ (; jk) - v_i^i_ (; kj)

(*5.6*)ResultFrame[res56 = (Ruddd[m, i, j, k]//ToFlavor[red, black]) == Coefficient[res, {vd[red @ m]}] ]

Partial and covariant derivatives  of vectors (Flügge pages 68 and 74)

BasisDerivation assign to zero covariant derivatives of basis vectors, and express their partial derivatives using Christoffel symbols.
It is used here to prove the relation   _ (, jk)==_i^i (u_i^i_ (; jk)+u_i^i_ (; h) Γ_ (hjk)^(hjk)).

Examples

PartialD[d[red @ i], red @ j] == (PartialD[d[red @ i], red @ j]//BasisDerivation[Γ, red @ m][{, red @ i}, red @ j])

PartialD[u[red @ i], red @ j] == (PartialD[u[red @ i], red @ j]//BasisDerivation[Γ, red @ m][{, red @ i}, red @ j])

_i^i_ (, j) == _m^m Γ_ (mji)^(mji)

_i^i_ (, j) == -_m^m Γ_ (ijm)^(ijm)

PartialD[d[red @ i], {red @ j, red @ k}] == (PartialD[d[red @ i], {red @ j, red @ k}]//BasisDerivation[Γ, red @ h, red @ m][{, red @ i}, {red @ j, red @ k}])

PartialD[u[red @ i], {red @ j, red @ k}] == (PartialD[u[red @ i], {red @ j, red @ k}]//BasisDerivation[Γ, red @ h, red @ m][{, red @ i}, {red @ j, red @ k}])

_i^i_ (, jk) == _h^h (Γ_ (hji)^(hji) _ (, k) + Γ_ (hkm)^(hkm) Γ_ (mji)^(mji))

_i^i_ (, jk) == _h^h (-Γ_ (ijh)^(ijh) _ (, k) + Γ_ (ijm)^(ijm) Γ_ (mkh)^(mkh))

DivToCov will be used to write a partial derivative as a function of its covariant derivative corrected by the Christoffel contribution :

PartialD[ud[red @ i], red @ j] == (PartialD[ud[red @ i], red @ j]//DifToCov[Γ, red @ m][{u, red @ i}, red @ j])

PartialD[uu[red @ i], red @ j] == (PartialD[uu[red @ i], red @ j]//DifToCov[Γ, red @ m][{u, red @ i}, red @ j])

u_i^i_ (, j) == u_i^i_ (; j) + u_m^m Γ_ (mij)^(mij)

u_i^i_ (, j) == u_i^i_ (; j) - u_m^m Γ_ (ijm)^(ijm)

PartialD[uu[red @ i], {red @ j, red @ k}] == (PartialD[uu[red @ i], {red @ j, red @ k}]//DifToCov[Γ, red @ p, red @ q][{u, red @ i}, {red @ j, red @ k}])

PartialD[ud[red @ i], {red @ j, red @ k}] == (PartialD[ud[red @ i], {red @ j, red @ k}]//DifToCov[Γ, red @ p, red @ q][{u, red @ i}, {red @ j, red @ k}])

The first partial derivative of a vector is identical to its covariant derivative :

=. ; T = PartialD[Tensor[], red @ j] ;

 = d[red @ i] uu[red @ i] ;

PartialD[, {red @ j}] ;

%//BasisDerivation[Γ, red @ m][{, red @ i}, red @ j] ;

%[[1]] + (%[[2]]/.{i→k, m→i}) ; =. ; <br />(*5.7*)

ResultFrame[res57 = T == %//DifToCov[Γ, red @ k][{u, red @ i}, red @ j]//Simplify]

      _ (, j) == u_i^i_ (; j) _i^i      (5.7)

The second partial derivative of a vector contains a correction to its second covariant derivative, involving a Christoffel symbol :

T = PartialD[Tensor[], {red @ j, red @ k}] ;

 = d[red @ i] uu[red @ i] ;

PartialD[, {red @ k, red @ j}] ;

%//DifToCov[Γ, red @ h][{u, red @ i}, red @ k]//DifToCov[Γ, red @ h][{u, red @ i}, red @ j]//DifToCov[Γ, red @ m, red @ h][{u, red @ i}, {red @ j, red @ k}]//Expand ;

Collect[%, {d[red @ i], d[red @ m]}] ;

(%[[1]]) + (%[[2]]/.{i→m, m→i})//Factor//SymmetrizeSlots[] ;

resa = Coefficient[%, d[red @ i]] ;

res58 = T == d[red @ i] (resa[[Range[4]]] + (resa[[5]]/.{m→h}) + (resa[[6]]/.{m→h, h→m})//SymmetrizeSlots[]) ; (*5.8*)

ResultFrame[res58]

      _ (, jk) == _i^i (u_i^i_ (; jk) + u_i^i_ (; h) Γ_ (hjk)^(hjk))       (5.8)

Gradient, Divergence and Curl

Relation between the standard definitions included in Mathematica and the present tensorial definition.

       <<Calculus`VectorAnalysis`   

Gradient

Grad[f[x, y, z], Cartesian[x, y, z]]

{f^(1, 0, 0)[x, y, z], f^(0, 1, 0)[x, y, z], f^(0, 0, 1)[x, y, z]}

In tensorial notations, the gradient (we use the notation TGrad) is defined as,

Tf = Tensor[f] ;

res1 = TGrad[, red @ k][Tf]

f_ (; k) _k^k

Divergence

Div[{fx[x, y, z], fy[x, y, z], fz[x, y, z]}, Cartesian[x, y, z]]

fz^(0, 0, 1)[x, y, z] + fy^(0, 1, 0)[x, y, z] + fx^(1, 0, 0)[x, y, z]

In tensorial notations, the divergence (we use the notation TDiv) applied to  u or  v  gives,

{ = ud[red @ j] u[red @ j], }

TDiv[, g, red @ k]/@{, }

{u_j^j _j^j, v_i^i _i^i}

{u_k^k_ (; k), v_k^k_ (; k)}

TDiv[, g, blue @ j][]

v_j^j_ (; j)

Curl :

Curl[{f[r, θ, φ], g[r, θ, φ], h[r, θ, φ]}, Cylindrical[r, θ, φ]]

In tensorial notations, the curl (we use the notation TCurl) is defined as,

TCurl[, g, red/@{i, j, k}, e][]

u_j^j_ (; i) e_ (ijk)^(ijk) _k^k

Curl of a vector expressed in the red basis and calculated in the blue one :



TCurl[, g, blue/@{p, q, r}, e][]

u_j^j _j^j

u_q^q_ (; p) e_ (pqr)^(pqr) _r^r

Option False allows to leave the basis changes β unexpressed. Note that the basis changes can have non-zero convariant derivatives

TCurl[, β, blue/@{p, q, r}, e, False][]

%//KroneckerAbsorb[β]

e_ (pqr)^(pqr) _r^r (β_ (jq)^(jq) _ (; p) u_j^j + u_j^j_ (; p) β_ (jq)^(jq))

e_ (pqr)^(pqr) (u_q^q_ (; p) + β_ (jq)^(jq) _ (; p) u_j^j) _r^r

Laplacian

Tf

Δ[f] == TLaplacian[, g, red @ i, red @ h][Tf] == TLaplacian[, g, red @ h, red @ i][Tf]

f

Δ[f] == f_ (; hi) g_ (hi)^(hi) == f_ (; ih) g_ (ih)^(ih)

We can also check that a gradient field has no curl : the second covariant derivative of a scalar tensor is symmetrical with respect to i and j while the LeviCivita symbol is antisymmetrical.

(res = CovariantD[Tensor[f], {red @ i, red @ j}]) == (res//ExpandCovariantD[{x, δ, g, Γ}, {red @ a, red @ b}])

f_ (; ij) == ∂^2f/∂x_j^j∂x_i^i - Γ_ (bji)^(bji) ∂f/∂x_b^b

TCurl[, g, red/@{p, q, r}, e][TGrad[, red @ h][Tensor[f]]] <br />

%//SumExpansion[red @ p, red @ q]//LeviCivitaOrder[e]//CovariantDOrdering

f_ (; qp) e_ (pqr)^(pqr) _r^r

0

and that a curl field has no divergence

TDiv[, g, red @ r][TCurl[, g, red/@{p, q, i}, e][]]

%//SumExpansion[red/@{p, q, r}]//CovariantDSimplify[, g, e]//LeviCivitaOrder[e]

%//CovariantDOrdering

e_ (pqr)^(pqr) _ (; r) u_q^q_ (; p) + u_q^q_ (; pr) e_ (pqr)^(pqr)

-u_1^1_ (; 23) e_ (123)^(123) + u_1^1_ (; 32) e_ (123)^(123) + u_2^2_ (; 13) e_ (123)^(123) - u_2^2_ (; 31) e_ (123)^(123) - u_3^3_ (; 12) e_ (123)^(123) + u_3^3_ (; 21) e_ (123)^(123)

We can use CovariantDOrdering if the space has a zero Gaussian curvature !

0

Integral theorems of Stokes and Gauss

Gauss theorem in two dimensions :

Consider an element ds of a close curve C on a surface S; C is the contour of a domain A :

d := dsu[red @ j] d[red @ j]

Suppose that _ 3^3 is the vector normal to S at the considered point of C. dn is the vector tangent to S and normal to C.
Integration of a vector field v in S. First integrate along the contour ABCD of the figure :

Figure 5.3

[Graphics:HTMLFiles/index_258.gif]

Figure 5.3 Area element.

 d×d[red @ 3] ; d = %//LinearBreakout[Cross][d[_]]//CrossProductExpansion[, e, h] d§ = %/.ds->dr

ds_j^j e_ (j3h)^(j3h) _h^h

dr_j^j e_ (j3h)^(j3h) _h^h

DA = ( . d//EvaluateDotProducts[, g])//LeviCivitaOrder[e]

AB = %/.ds->dr

ds_j^j e_ (3ij)^(3ij) v_i^i

dr_j^j e_ (3ij)^(3ij) v_i^i

CovariantD[, red @ k] dru[red @ k]//Expand//CovariantDSimplify[, g, e]

v_i^i_ (; k) dr_k^k _i^i

BC = (( + CovariantD[, red @ k] dru[red @ k]//CovariantDSimplify[, g, e]//Factor) . d//EvaluateDotProducts[, g])//LeviCivitaOrder[e]

v_i^i_ (; k) dr_k^k ds_j^j e_ (3ij)^(3ij) + ds_j^j e_ (3ij)^(3ij) v_i^i

CD = (( + CovariantD[, red @ k] dsu[red @ k]//CovariantDSimplify[, g, e]//Factor) . d§//EvaluateDotProducts[, g])

v_i^i_ (; k) dr_j^j ds_k^k e_ (j3i)^(j3i) + dr_j^j e_ (j3i)^(j3i) v_i^i

ABCD = AB + BC - CD - DA//Simplify

v_i^i_ (; k) (dr_k^k ds_j^j e_ (3ij)^(3ij) - dr_j^j ds_k^k e_ (j3i)^(j3i)) + dr_j^j (e_ (3ij)^(3ij) - e_ (j3i)^(j3i)) v_i^i

(ABCD//SumExpansion[red @ i, red @ j, red @ k])/.CovariantD[vu[red @ i_], red @ 3] :→0//LeviCivitaOrder[e]//FullSimplify

-(v_1^1_ (; 1) + v_2^2_ (; 2)) (dr_2^2 ds_1^1 - dr_1^1 ds_2^2) e_ (123)^(123)

".d ==  " %/.((-eddd[i, j, 3] dru[i] dsu[j]//SumExpansion[i, j, k]//LeviCivitaOrder[e]) :> -dAd[red @ 3]//ToFlavor[red, black]//FullSimplify)

-.d ==   (v_1^1_ (; 1) + v_2^2_ (; 2)) (dr_2^2 ds_1^1 - dr_1^1 ds_2^2) e_ (123)^(123)

The second term in parenthesis is TDiv v in two dimensions. Now assembling together such quadrilaterals to fill the area A, gives the Gauss theorem in d = 2 :

       ∫_ATDiv  A = ∮_C   n          

Gauss theorem in three dimensions :

Figure 5.5

[Graphics:HTMLFiles/index_279.gif]

Figure 5.5 Volume element.

 d := dru[red @ j] d[red @ j] d := dtu[red @ k] d[red @ k]  {d, d, d}

v_i^i _i^i

{dr_j^j _j^j, ds_j^j _j^j, dt_k^k _k^k}

We calculate for the volume element defined by {dr, ds, dt} the surface integral vdA = v_ i^idA_ h^h

The surface delimited by the vector {ds, dt} is associated to the vector

d = d×d//LinearBreakout[Cross][d[_], u[_]]//CrossProductExpansion[, e, h]

dd[l_] := d . d[l]//EvaluateDotProducts[, g]

ds_j^j dt_k^k e_ (jkh)^(jkh) _h^h

so, for the two opposite faces defined by {ds, dt} (Note the subtility between Tensor... and its ShortCut )

vu[red @ i] (-dAd[red @ i]) + (vu[red @ i] + CovariantD[vu[red @ i], red @ h] dru[red @ h]) dAd[red @ i]//Simplify

%/.{dA->d}

%%/.dAd[red @ i] ->dd[red @ i]//LeviCivitaOrder[e]

drst = Coefficient[%, dru[red @ h] dsu[red @ j] dtu[red @ k]]

v_i^i_ (; h) dA_i^i dr_h^h

v_i^i_ (; h) dr_h^h d_i^i

v_i^i_ (; h) dr_h^h ds_j^j dt_k^k e_ (ijk)^(ijk)

v_i^i_ (; h) e_ (ijk)^(ijk)

The contribution of the other two pairs of faces of the volume element are obtained by cyclic permutation of the free indices {i j k} :

drstAll = (drst + (drst/.{h->j, j→k, k→h}) + (drst/.{h->j, j→k, k→h}/.{h->j, j→k, k→h})) dru[red @ h] dsu[red @ j] dtu[red @ k]

dr_h^h ds_j^j dt_k^k (v_i^i_ (; k) e_ (ihj)^(ihj) + v_i^i_ (; h) e_ (ijk)^(ijk) + v_i^i_ (; j) e_ (ikh)^(ikh))

which can then be compared to result  ( dr_ i^i ds_ j^j dt_ k^k e_ (i  j  k)^(i  j  k) v_ (h  ;  h)^(h  ;  h) ) :

(result = dru[red @ i] dsu[red @ j] dtu[red @ k] eddd[red @ i, red @ j, red @ k] CovariantD[vu[red @ h], red @ h])

v_h^h_ (; h) dr_i^i ds_j^j dt_k^k e_ (ijk)^(ijk)

so that the two last expressions are identical :

(drstAll //SumExpansion[red @ i, red @ j, red @ k, red @ h]//LeviCivitaOrder[e]//Simplify) ==  (result//SumExpansion[red @ i, red @ j, red @ k, red @ h]//LeviCivitaOrder[e]//Simplify)

True

This constitute the three dimensional form of the divergence theorem of Gauss :

Stokes theorem in two dimensions :

Figure 5.6

[Graphics:HTMLFiles/index_309.gif]

Figure 5.6 Triangular area element.

The triangle represented in the figure has an area represented by the vector,

d = 1/2d×d//LinearBreakout[Cross][d[_], u[_]]//CrossProductExpansion[, e, h]

1/2 dr_j^j dt_k^k e_ (jkh)^(jkh) _h^h

We calculate now the integral along the counterclockwise contour ABCA. On each three sides (dr_ i^i , dt_ i^i- dr_ i^i, - dt_ i^i ) we have an average value :.

dr_i^i (1/2 u_i^i_ (; j) dr_j^j + u_i^i) - dt_i^i (1/2 u_i^i_ (; j) dt_j^j + u_i^i) + (-dr_i^i + dt_i^i) (1/2 u_i^i_ (; j) (dr_j^j + dt_j^j) + u_i^i) ;

%//Simplify

1/2 u_i^i_ (; j) (dr_j^j dt_i^i - dr_i^i dt_j^j)

1/2 dr_p^p dt_q^q ε_ (jikpqk)^(jikpqk)//KroneckerContract[ε]//FullKroneckerExpand[ε]//Expand//KroneckerAbsorb[ε]

1/2 dr_j^j dt_i^i - 1/2 dr_i^i dt_j^j

Including this last result into the integral along the perimeter of ABCA gives

1/2 u_i^i_ (; j) dr_p^p dt_q^q ε_ (jikpqk)^(jikpqk) == 1/2 u_i^i_ (; j) dr_p^p dt_q^q ε_ (pqk)^(pqk) ε_ (jik)^(jik)

1/2 u_i^i_ (; j) dr_p^p dt_q^q ε_ (jikpqk)^(jikpqk) == 1/2 u_i^i_ (; j) dr_p^p dt_q^q ε_ (pqk)^(pqk) ε_ (jik)^(jik)

which is equal to TCurl[u].dA

TCurl[, g, red/@{j, i, k}, e][] . (d/.{j→p, k→q})//EvaluateDotProducts[, g]

%//LeviCivitaSimplify[e, ε][g, red]

1/2 u_i^i_ (; j) dr_p^p dt_q^q e_ (pqk)^(pqk) e_ (jik)^(jik)

1/2 u_i^i_ (; j) dr_p^p dt_q^q ε_ (pqk)^(pqk) ε_ (jik)^(jik)

Covering any area A with contour C with triangles of this kind leads to the cancellation of all the terms from adjacent sides of the infinitesimal triangles so that only the integration along C remains.
Stokes' theorem is then :

(*5.1*)ResultFrame[res510 = ∫    s == ∫   (TCurl ).A]                                  \C                            \A

Vector field versus scalar and solenoidal fields

φ=.

Given a vector field u, find the scalar field φ of which it is the gradient, or a vector field w of which it is the curl;
        If  TCurl u = 0    then     u = TGrad φ
        
If   TDiv u = 0    then    u = TCurl w
so, every vector field may be split (in more than one way) into a gradient field and a solenoidal field, and

ud[red @ i] == CovariantD[Tensor[φ], red @ i] + (CovariantD[wu[red @ k], red @ h] guu[red @ h, red @ j]) eddd[red @ i, red @ j, red @ k]//MetricSimplifyD[g] (*5.11*)

ResultFrame[res511 = %[[1]] == %[[2, 1]] + (%[[2, 2]]//UpDownSwapD[red @ h])]

u_i^i == φ_ (; i) + w_k^k_ (; h) e_ (ihk)^(ihk)

      u_i^i == φ_ (; i) + w_k^k^(; h) e_ (ihk)^(ihk)       (5.11)

where  φ  is a scalar potential, and w_ k^k a vector potential

ClearTensorShortcuts[{{, u, v, w, x, y, dA, dr, ds, dt}, 1}, {{σ}, 2}, {{ε, e}, 3}, {{R}, 4}, {{ε}, 6}] ;


Created by Mathematica  (November 27, 2007) Valid XHTML 1.1!