Introduction To Tensor Calculus
Introduction To Tensor Calculus
Introduction To Tensor Calculus
2 Cartesian Tensors 7
2.1 Tensor Notation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.2 Tensor Derivatives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
m
3 Curvilinear coordinates 15
3.1 Tensor invariance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
co
3.2 Covariant differentiation . . . . . . . . . . . . . . . . . . . . . . . . . . 19
3.3 Orthogonal coordinates . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
e.
3.3.1 Unit vectors and stretching factors . . . . . . . . . . . . . . . . . 21
3.3.2
re
Physical components of tensors . . . . . . . . . . . . . . . . . . 24
ef
4 Problems 27
in
A Solutions to problems 30
nl
Bibliography 45
llo
Index 46
.a
w
w
w
2
Preface
Nomenclature
m
co
A B A is defined as B, or A is equivalent to B
Ai Bi
∑3i Ai Bi . Note: Ai Bi A j B j
Ȧ partial derivative over time: ∂∂tA
e.
Ai partial derivative over xi : ∂∂ xAi
V control volume
t
xi
time
re
i-th component of a coordinate (i=0,1,2), or xi x u z
ef
RHS Right-hand-side
LHS Left-hand-side
in
PDE Partial differential equation
.. Continued list of items
nl
llo
.a
w
w
w
3
There are two aspects of tensors that are of practical and fundamental im-
portance: tensor notation and tensor invariance. Tensor notation is of great prac-
tical importance, since it simplifies handling of complex equation systems. The
idea of tensor invariance is of both practical and fundamental importance, since it
provides a powerful apparatus to describe non-Euclidean spaces in general and
curvilinear coordinate systems in particular.
A definition of a tensor is given in Section 1. Section 2 deals with an im-
portant class of Cartesian tensors, and describes the rules of tensor notation.
Section 3 provides a brief introduction to general curvilinear coordinates, invari-
m
ant forms and the rules of covariant differentiation.
co
1 Coordinates and Tensors
e.
Consider a space of real numbers of dimension n, Rn , and a single real time,
re
t. Continuum properties in this space can be described by arrays of different
dimensions, m, such as scalars (m 0), vectors (m 1), matrices (m 2), and
ef
general multi-dimensional arrays. In this space we shall introduce a coordinate
x̃i x̃ x
x
i 1 n
(1)
llo
nate system xi to a new coordinate system x̃i using the partial differentiation rules
applied to (1):
w
∂ x̃i j
w
d x̃i dx (2)
∂xj
w
This transformation rule2 can be generalized to a set of vectors that we shall call
contravariant vectors:
Ãi ∂x̃i j
∂xj
A (3)
1
Super-indexes denote components of a vector (i 1 n) and not the power exponent, for the reason
explained later (Definition 1.1)
2 The repeated indexes imply summation (See. Proposition 21)
4
That is, a contravariant vector is defined as a vector which transforms to a new
coordinate system according to (3). We can also introduce the transformation
matrix as:
aij ∂ x̃i
∂xj
(4)
Ai aij A j
m
(5)
Transformation rule (3) will not apply to all the vectors in our space. For
co
example, a partial derivative ∂ ∂ xi will transform as:
e.
∂
∂ x̃i
∂ ∂xj
∂ x̃i ∂ x j
∂xj ∂
∂ x̃i ∂ x j
(6)
re
that is, the transformation coefficients are the other way up compared to (2). Now
we can generalize this transformation rule, so that each vector that transforms
ef
according to (6) will be called a Covariant vector:
in
Ãi ∂xj
Aj (7)
nl
∂x̃i
This provides the reason for using lower and upper indexes in a general
llo
tensor notation.
.a
be denoted as Ai1 im . Each index of a tensor changes between 1 and n. For ex-
ample, in a 3-dimensional space (n=3) a second order tensor will be represented
w
by 32 9 components.
Each index of a tensor should comply to one of the two transformation rules:
(3) or (7). An index that complies to the rule (7) is called a covariant index and is
denoted as a sub-index, and an index complying to the transformation rule (3) is
called a contravariant index and is denoted as a super-index.
5
From this relation and the independence of coordinates (9) it follows that aij bk
j
j
bij ak δik , namely:
aij bk
j
∂ x̃i ∂ x j
∂ x j ∂ x̃k
∂ x j ∂ x̃i
∂ x j ∂ x̃k
∂ x̃i
∂ x̃k
δik (13)
m
2 Cartesian Tensors
co
Cartesian tensors are a sub-set of general tensors for which the transformation
e.
matrix (4) satisfies the following relation:
∂ x̃i
∂ xk
nl
(15)
∂ xk ∂ x̃i
llo
(see Problem 4.3), which means that both (5) and (6) are transformed with the
same matrix aik . This in turn means that the difference between the covariant and
.a
Remark 2.1 Tensor rules Tensor rules guarantee that if an expression follows
these rules it represents a tensor according to Definition 1.1.
7
Tensors are usually functions of space and time:
A i1 A
x x t
im i1 im
1 n
which defines a tensor field, i.e. for every point xi and time t there are a set of mn
nubers Ai1 im .
m
transformed as (5). Transformation law for the coordinates is actually given by (1).
Nevertheless, we shall use the upper (contravariant) indexes for the coordinates.
co
Definition 1.3 Kronecker delta tensor
e.
Second order delta tensor, δi j is defined as
j δi j re
ef
i 1
i j δi j 0 (8)
in
From this definition and since coordinates xi are independent of each other
nl
it follows that:
llo
∂ xi
∂xj
δi j (9)
.a
From the definition (1.3) and the summation convention (21), follows that
w
δi j A j Ai (10)
w
Assume that there exists the transformation inverse to (5), which we call bij :
bij ∂ xi
∂ x̃ j
(12)
6
Thus, following tensor rules, one can build tensor expressions that will pre-
serve tensor properties of coordinate transformations (Definition 1.1) and coordi-
nate invariance (Section 3).
Tensor rules are based on the following definitions and propositions.
m
For example:
co
Ai jk B jkC pq Eq Fp (16)
e.
Definition 2.3 Tensor expression
re
Tensor expression is a sum of tensor terms. For example:
ef
Ai jk B jk Ci D pq Eq Fp (17)
in
Generally the terms in the expression may come with plus or minus sign.
nl
The only allowed algebraic operations in tensor expressions are the addi-
tion, subtraction and multiplication. Divisions are only allowed for constants, like
.a
redefined as: Bi 1 Ai .
w
w
For example:
8
Definition 2.6 Free indexes
A free index is any index that occurs only once in a tensor term. For exam-
ple, index i is a free index in the term (16).
For example, if index i is a free index in any term of tensor equality, such as
m
(18), it should be the free index in all other terms. For example
co
Ai j B j C jD j
is not a valid tensor equality since index i is a free index in the term on the
e.
RHS but not in the LHS.
It follows from (2.7) that ranks of all the terms in a valid tensor expression
should be the same. Note, that the difference between the order and the rank is
llo
that the order is equal to the number of indexes of a tensor, and the rank is equal
to the number of free indexes in a tensor term.
.a
Any free index in a tensor expression can be named by any symbol as long
as this symbol does not already occur in the tensor expression.
w
w
Ai j B j Ci D j E j (19)
is equivalent to
Ak j B j Ck D j E j (20)
9
Definition 2.10 Dummy indexes
A dummy index is any index that occurs twice in a tensor term.
For example, indexes j k p q in (16) are dummy indexes.
m
n
Ai Bi ∑ Ai Bi (21)
co
i
e.
over the repeated indices, it can be indicated by enclosing such indices in paren-
theses.
notation as Ai Bi .
w
10
Proposition 2.16 Renaming of dummy indexes
Any dummy index in a tensor term can be renamed to any symbol as long
as this symbol does not already occur in this term.
m
Note that while the dummy index renaming rule (2.16) is applied to each
tensor term separately, the free index naming rule (2.9) should apply to the whole
co
tensor expression. For example, the equality (19) above
Ai j B j Ci D j E j
e.
can also be rewritten as
Akp B p re
Ck D j E j (22)
ef
without changing its meaning.
in
nl
equal to 0 when any index is equal to any other index; equal to 1 when the set of
indexes can be obtained by cyclic permutation of 123; and -1 when the indexes
w
j i k j k ε
w
i 0
i jk PG 123 ε
i jk
i jk PG 132 ε
i jk 1
i jk 1 (23)
where PG abc is a permutation group of a triple of indexes abc, i.e. PG abc
abc bca cab . For example, the permutation group of 123 will consist of three
combinations: 123, 231 and 312, and the permutation group of 123 consists of
132, 321 and 213.
11
Corollary 2.19 Permutation of the permutation tensor indexes
From the definition of the permutation tensor it follows that the permutation
of any of its two indexes changes its sign:
m
A vector product (cross-product) of two vectors in vector notation is ex-
co
pressed as
B!
e.
A C (25)
re
ef
Ai εi jk B jCk (26)
in
Tensor expression (26) is more accurate than its vector counterpart (25),
since it explicitly shows how to compute each component of a vector product.
llo
εi jk A jk 0 (27)
w
Proof:
w
εi jk A jk εi jk Ak j (28)
Let’s rename index j into k and k into j in the RHS of this expression, according
to rule (2.16):
εi jk Ak j εik j A jk
12
Using (24) we finally obtain:
εik j A jk εi jk A jk
εi jk A jk εi jk A jk
m
Theorem 2.23 Tensor identity
co
The following tensor identity is true:
e.
εi jk εipq δ j p δkq δ jq δkp (29)
Proof
re
ef
This identity can be proved by examining the components of equality (29)
component-by-component.
in
Using the tensor identity (29) it is possible to prove the following important
vector identity:
llo
A ! B ! C B A C C A B (30)
.a
w
Ȧ ∂A
∂t
13
Definition 2.26 Spatial derivative of a tensor
A partial derivative of a tensor A over one or its spacial components is de-
noted as A i :
Ai ∂A
∂ xi
(31)
that is, the index of the spatial component that the derivation is done over is
delimited by a comma (’,’) from other indexes. For example, Ai j k is a derivative of
m
a second order tensor Ai j .
co
Definition 2.27 Nabla
Nabla operator acting on a tensor A is defined as
e.
A
∇i A
re i (32)
ef
Even though the notation in (31) is sufficient to define the derivative, In some
instances it is convenient to introduce the nabla operator as defined above.
in
dent derivative will have a different form from (31). See the chapter on covariant
differentiation in [1].
.a
The derivative of a zero order tensor (scalar) as given by (31) forms a first
w
the derivative will be lower than that of the original tensor. For example, the rank
of the derivative Ai j j is one, since there is only one free index in this term.
∇A #" A i
14
Corollary 2.31 Derivative of a coordinate
From (9) it follows that:
xi
j δi j (33)
x x x 1 1 1
xi i 11 22 33 3 (34)
m
co
Remark 2.32 Divergence operator
A divergence operator in a vector notation is represented in a tensor notation
as Ai i :
e.
∇ A #"
re Ai i
ef
Remark 2.33 Laplace operator
in
The Laplace operator in vector notation is represented in tensor notation as
A ii :
nl
#" A
llo
∆A ii
.a
concise and accurate than vector notation, since it explicitly shows how each
component should be computed. It is also more general since it covers cases
w
3 Curvilinear coordinates
In this section 3 we introduce the idea of tensor invariance and introduce the rules
for constructing invariant forms.
3
In this section we reinstall the difference between covariant and contravariant indexes.
15
3.1 Tensor invariance
m
dl 2 gi j dxi dx j (35)
co
where gi j is called the metric tensor.
e.
Thus, if we know the metric tensor in a given curvilinear coordinate system then
the distance element is computed by (35). The metric tensor is defined as a
re
tensor since we need to preserve the invariance of distance in different coordinate
systems, that is, the distance should be independent of the coordinate system,
ef
thus:
in
dl 2 gi j dxi dx j g̃i j d x̃i d x̃ j (36)
nl
where we first swapped places of dxi and dx j , and then renamed index i into j
w
g g dx dx
w
gi j dxi dx j g ji dxi dx j ij ji
i j
0
w
Since the equality above should hold for any dxi dx j , we get:
gi j g ji (37)
The metric tensor is also called the fundamental tensor. The inverse of the
metric tensor is also called the conjugate metric tensor, gi j , which satisfies the
relation:
16
gik gk j δi j (38)
dl 2 dxi dxi ∂ xi j ∂ xi k
∂x̃ j
d x̃ k d x̃
∂x̃
∂ xi ∂ xi j k
∂x̃ j ∂x̃k
d x̃ d x̃ (39)
m
When we transform from a Cartesian to curvilinear coordinates the metric
tensor in curvilinear coordinate system, g̃i j can be determined by comparing re-
co
lations (39) and (35):
∂ xk ∂ xk
e.
g̃i j (40)
∂ x̃i ∂ x̃ j
Using (38) we can also find its inverse as:
re
ef
g̃i j ∂x̃i ∂x̃ j
∂ xk ∂ xk
(41)
in
Using these expression one can compute gi j and gi j in various curvilinear coordi-
nl
Ai gi j A j (42)
w
Ai gi j A j (43)
w
Conjugate tensor is also called the associate tensor. Relations (42), (43)
are also called as operations of raising/lowering of indexes.
17
Not all the expressions constructed from tensor terms in curvilinear coordi-
nates will be tensors themselves. For example, if vectors Ai and Bi are tensors,
then Ai Bi is not generally a tensor4 . However, if we consider the same operation
on a contravariant tensor Ai and a covariant tenso Bi then the product will form an
invariant:
m
product (Corollary 2.13) or the index contraction operation to make it invariant
(Problem 4.12).
co
Definition 3.4 Invariant Scalar Product
The invariant form of the scalar product between two covariant vectors Ai
e.
and Bi is gi j Ai B j . Similarly, the invariant form of a scalar product between two
contravariant vectors Ai and Bi is gi j Ai B j , where gi j is the metric tensor (40) and
gi j is its conjugate (38).
re
ef
Corollary 3.5 Two forms of a scalar product
According to (42), (43) the scalar product can be represented by two invari-
in
ant forms: Ai Bi and Ai Bi . It can be easily shown that these two forms have the
nl
1. Each free index should keep its vertical position in every term, i.e. if the
w
index is covariant in one term it should be covariant in every other term, and
w
vise versa.
2. Every pair of dummy indexes should be complementary, that is one should
w
4 For Cartesian tensors any product of tensors will always be a tensor, but this is not so for general tensors
18
The invariant form of this equation is:
m
A simple scalar value, S, is invariant under coordinate transformations. A partial
co
derivative of an invariant is a first order covariant tensor (vector):
S
e.
∂S
Ai i
∂ xi
However, a partial derivative of a tensor of the order one and greater is not
generally an invariant under coordinate transformations of type (7) and (3). re
ef
In curvilinear coordinate system we should use more complex differentiation
in
rules to preserve the invariance of the derivative. These rules are called the rules
of covariant differentiation and they guarantee that the derivative itself is a tensor.
nl
According to these rules the derivatives for covariant and contravariant indices
will be slightly different. They are expressed as follows:
llo
$
∂ Ai
%A
.a
k
Ai (46)
$
j ij k
∂xj
A %A
∂ Ai
w
i i k
j kj (47)
∂xj
$
w
ij
$ & ∂∂gx
k
ij % 1 kl
2
g
il
j
∂ g jl
∂ xi
∂ gi j
∂ xl '
and is also known in tensor calculus as Christoffel’s symbol of the second kind
[1]. Tensor gi j represents the inverse of the metric tensor gi j (38). As can be seen
differentiation of a single component of a vector will involve all other components
of this vector.
19
In differentiating higher order tensors each index should be treated inde-
pendently. Thus differentiating a second order tensor, Ai j , should be performed
as:
Ai j k ∂ Ai j
∂ xk
A A
m
ik mj
m
jk im
and as can be seen also involves all the components of this tensor. Likewise for
the contravariant second order tensor Ai j we have:
m
Ak
ij ∂ Ai j
∂ xk
A A
i
mk
mj j
mk
im
(48)
co
And for a general n-covariant, m-contravariant tensor we have:
e.
j
Ai11
∂∂x A
jm j1 jm
A
re
() A
*
in p p i1 in k
j1 q j 2 jm jm j1 jm 1 q
(( A
*
qp qp
A
i1 in i1 in
ef
q j1 jm q j1 jm
i1 p qi2 in in p i1 in 1 q (49)
in
Despite their seeming complexity, the relations of covariant differentiation
can be easily implemented algorithmically and used in numerical solutions on
nl
involve raising or lowering indexes (42), (43). However, since we did not intro-
duce the notation for contravariant derivative, the only way to raise the index of a
w
covariant derivative, say A i , it to use the relation (42) directly, that is: gi j A j .
w
u̇ i
k i
u uk ντ
gik P k ik
k (50)
ρ
where the index of the pressure term was raised by means of (42).
Using the invariance of the scalar product one can construct two important
differential operators in curvilinear coordinates: divergence of a vector div A Aii
(51) and Laplacian, ∆ A gik A ki (55).
20
Definition 3.8 Divergence
Divergence of a vector is defined as Aii :
div A A i
i (51)
From this definition and the rule of covariant differentiation (47) we have:
A ii
∂ Ai
∂ xi
A i
ki
k
(52)
m
this can be shown [2] to be equal to:
co
Ai
i ∂ Ai
∂ xi i
i
+ 1g ∂∂x , + gA -
e.
i
i
(53)
A ii gi j A j i
nl
(54)
∆A gik A ki (55)
w
The definitions (3.8), (3.9) of differential operators are invariant under coor-
w
21
Consider three unit vectors, ai bi ci , each directed along one of the coordi-
nate axis (tangential unit vectors), that is:
ai a 0 0 1
(56)
bi 0 b 0 2
(57)
ci 0 0 c 3
(58)
The condition of orthogonality means that the scalar product between any
m
two of these unit vectors should be zero. According to the definition of a scalar
product (Definition 3.4) it should be written in form (44), that is, a scalar product
co
between vectors ai and bi can be written as: ai bi or ai bi . Let’s use the first form for
definiteness. Then, applying the operation of rising indexes (42), we can express
e.
the scalar product in contravariant components only:
0
a i bi
re gi j ai b j
ef
1 1 2
g11 a 0 g12 a b g13 00
g21 a2 b1 g22 0b2 g23 00
g
in
12 (59)
llo
where we used the symmetry of gi j , (37). Since vectors a1 and b2 were chosen to
be non-zero, we have: g12 0. Applying the same reasoning for scalar products of
other vectors, we conclude that the metric tensor has only diagonal components
.a
non-zero5 :
w
gi j δi j g ii (60)
w
Let’s introduce stretching factors, hi , as the square roots of these diagonal com-
w
ponents of gi j :
h1 g .
11
1 2
; h2 g . 22
1 2
; h3 g .
33
1 2
; (61)
Now, consider the scalar product of each of the unit vectors (56)-(58) with
itself. Since all vectors are unit, the scalar product of each with itself should be
one:
5 We use parenthesis to preclude summation (Proposition 2.12)
22
ai ai bi bi ci ci 1
gi j ai a j gi j bi b j g i j ci c j 1
Now, consider the first term above and substitute the components of a from (56).
The only non-zero term will be:
h a
m
g11 a1 a1 1
2 1 2
1
co
and consequently:
e.
a1 0/ 1
h1
(62)
re
where the negative solution identifies a vector directed into the opposite direction,
and we can neglect it for definiteness. Applying the same reasoning for each of
ef
the tree unit vectors ai bi ci , we can rewrite (56), (57) and (58) as:
in
h1 0 0
nl
ai (63)
1
b 0 0
llo
i 1
(64)
h 2
c 0 0
1
.a
i
(65)
h 3
w
which means that the components of unit vectors in a curved space should be
scaled with coefficients hi . It follows from this that the expression for the element
w
dl 2 gi j d x̃i d x̃ j h dx̃
2
i
i 2
(66)
δ h gi j ij
i 2
(67)
Combining the latter with (38), we obtain: δ h h ij i
i δi j , from which it follows that
23
1 h
hi i
(68)
m
Ae g i j Ai e j
co
According to Corollary 3.5 the above can also be rewritten as:
e.
Ae A i ei Ai e i (69)
e 0 0 . From
(63) it follows that: re
Suppose the unit vector is directed along one of the axis: ei 1
ef
e1 1 h
in
1
Ah
llo
A1 1 1
.a
or, repeating the argument for other components, we have for the physical com-
ponents of a covariant vector:
w
w
A1 h 1 A2 h 2 A3 h 3 (70)
w
h 1 A1 h 2 A2 h 3 A3
24
∇i h1 ∂∂x i
i
(71)
where the parentheses indicate that there’s no summation with respect to index i.
In orthogonal coordinate system the general expressions for divergence (53)
and Laplacian (55)) operators can be expressed in terms of stretching factors only
[3]:
m
H1 ∂∂x 1 hH A 2
Aii
i
i (72)
co
i
∆A 2
1 ∂ H A
H ∂ x 1 h ∂ x
e.
i i i
H ∏h
n
re
i
i 1
nl
x1 r cos θ
llo
x2 r sin θ
x3 l
.a
According to (40) only few components of the metric tensor will survive
(Problem 4.5). Then we can compute nabla, divergence and Laplacian oper-
w
ators according to (71), (52) and (55), or using simplified relations (72)-(73):
w
div A
∂A 1 1 ∂A ∂A 1 2 3
A 1
∂ x̃
1 x̃ ∂ x̃ ∂ x̃
1 x̃ 2 3 1
Note, that instead of using the contravariant components as implied by the gen-
eral definition of the divergence operator (51) we are using the covariant compo-
nents as dictated by relation (70). The expression of the Laplacian becomes:
25
∆A x̃1 ∂∂x̃A
∂2 A
∂ x̃1 2
1 ∂2 A
x̃21 ∂ x̃2 2
∂2 A
∂ x̃3 2 1 1
m
of curvilinear coordinate transformations, not necessarily analytically defined, like
cylindrical (85) or spherical. Another advantage is that the equations above can
co
be easily produced automatically using symbolic manipulation packages, such
as Mathematica (wolfram.com) (Problems 4.6,4.7,4.9). For further reading see
[1, 2].
e.
re
ef
in
nl
llo
.a
w
w
w
26
4 Problems
Ai j B jk B pqCq Dk 0
E pqi Fk jC pk B p j D jq Gq Fkp
m
co
Ei jk A j Bk D i j Ai B j Fi j G jk Hk j
e.
Problem 4.2 Construct tensor expression
Construct a valid Cartesian tensor expression, consisting of three terms,
re
each including some of the four tensors: Ai jk Bi j Ci Di j . Term 1 should include
tensors A B C only, term 2 tensor B C D and term 3 tensors C D A. The ex-
ef
pression should have 2 free indexes, which should always come first among the
indexes of a tensor. The free indexes should be at A and B in the first term, at
in
B and C in the second term and C and D in the last term. How many different
tensor expressions can be constructed?
nl
llo
A ! B ! C B A C C A B
Problem 4.5 Metric tensor in cylindrical coordinates
Cylindrical coordinate system yi
r θ l (85) is given by the following trans-
formation rules to a Cartesian coordinate system, xi xyz :
27
x r cos θ
y r sin θ
z l
Obtain the components of the metric tensor (40) gi j and its inverse gi j (38)
in cylindrical coordinates.
m
Problem 4.6 Metric tensor in curvilinear coordinates
Using Mathematica Compute the metric tensor, g, (40) and its conjugate, ĝ,
co
(38) in spherical coordinate system (r φ θ):
e.
x r sin θ cos φ
y r sin θ sin φ
z r cos θ re (73)
ef
Problem 4.7 Christoffel’s symbols with Mathematica
in
Using the Mathematica package, write the routines for computing Christof-
nl
fel’s symbols.
llo
Using the Mathematica package and the solution of Problem 4.8, write the
routines for computing divergence of a vector in curvilinear coordinates.
w
28
Ai BijkCt k
j
Dt (74)
ij
A jk BipqC kq Fk j Gkp H j jq
H k Ak j Cti B pit q (75)
E i Bikp p
DkqC jq
j
Dki G p i (76)
m
Prove that Ai Bi is an invariant and Ai Bi is not.
co
e.
re
ef
in
nl
llo
.a
w
w
w
29
A Solutions to problems
Ai j B jk B pqCq Dk 0
m
Answer: term (1): ik = free, term (2): pk=free
co
E pqi Fk jC pk B p j D jq Gq Fkp
e.
Answer: (1): ijq=free (2): p=free (3): kp=free
Ei jk A j Bk D i j Ai B j
re Fi j G jk Hk j
ef
Answer: (1): i=free (2): none, (3): i=free, j = tripple occurrence
in
each including some of the four tensors: Ai jk Bi j Ci Di j . Term 1 should include
tensors A B C only, term 2 tensor B C D and term 3 tensors C D A. The ex-
pression should have 2 free indexes, which should always come first among the
.a
indexes of a tensor. The free indexes should be at A and B in the first term, at
B and C in the second term and C and D in the last term. How many different
w
Solution
w
Since there are four locations for dummy indexes in each term, there could
be three different combinations of dummies in each term. Thus, the total number
of different expression is 33 27
30
Problem 4.3: Cartesian identity
Prove identity (15).
Proof
Integrating (5) in the case of constant transformation marix coefficients, we
have:
m
where the transformation matrix is given by (4):
co
aik ∂ x̃i
∂ xk
(78)
e.
By the definition of the Cartesian coordinates (79) we have:
aij ∂xj
.a
∂x̃i
w
aik ∂ xk
∂x̃i
w
∂x̃i
∂xj
∂xj
∂x̃i
which proves (15).
31
Problem 4.4: Tensor identity
Using the tensor identity:
A ! B ! C B A C C A B (81)
m
Proof
co
Applying (26) twice to the RHS of (81), we have:
! !
e.
A B C
εi jk A j εkpq B pCq
εi jk εkpq A j B pCq
re
ef
From (24) it follows that εi jk εik j εki j . Then we have:
in
nl
ε ABC
δ ABC
i jk εipq
w
k p q
j p δkq δ jq δkp k p q
w
B j AqCq C j A pB p (84)
C A B
BA C
32
Problem 4.5: Metric tensor in cylindrical coordinates.
Cylindrical coordinate system x̃i
r θ l (85) is given by the following trans-
formation rules to a Cartesian coordinate system, xi xyz :
x r cos θ
y r sin θ
m
z l
co
Obtain the components of the metric tensor (40) gi j and its inverse gi j (38)
in cylindrical coordinates.
e.
Solution:
x y z r θ l :
First compute the derivatives of xi
r
∂x̃1 ∂r
∂x 1
∂x
x r sin θ
llo
θ
∂x̃2 ∂θ
∂x 2
∂y
y r cos θ
.a
θ
∂x̃ 2 ∂θ
∂x
∂z
z 1 3
(85)
w
l
∂x̃ ∂z 3
w
grr xr xr yr yr 1
gθ θ
xθ xθ yθ yθ r 2
gzz 1
grr 1
gθ θ
1
r2
g zz
1
33
Problem 4.6: Metric tensor in curvilinear coordinates
Using Mathematica, write a procedure to compute metric tensor in curvilin-
ear coordinate system, and use it to obtain the components of metric tensor, g,
(40) and its conjugate, ĝ, (38) in spherical coordinate system (r φ θ):
x r sin θ cos φ
m
y r sin θ sin φ
z r cos θ (86)
co
Solution with Mathematica
e.
NX = 3
X = Array[,NX]
X[[1]] = r Sin[th] Cos[phi];
.a
J = Array[,{NX,NX}]
Do[
w
J [[i,j]] = D[X[[i]],Y[[j]]],
{j,1,NX},{i,1,NX}
]
34
];
g=Simplify[g]
m
3 1 0 04) 0 r 04) 0 0 r sin θ 3
co
2 2 2
g
e.
r 2
Solution
nl
llo
*************************************)
w
DIM = 3
(*
w
35
]
(*
Cylindrical coordinates
*)
Z=Array[,DIM]
Z[[1]] = r
Z[[2]] = th
Z[[3]] = z
g [[1,1]] = 1
m
g [[2,2]] = rˆ2
g [[3,3]] = 1
g1[[1,1]] = 1
co
g1[[2,2]] = 1/rˆ2
g1[[3,3]] = 1
e.
(*
Christoffel symbols of the first and second type
*)
Cr1 = Array[,{DIM,DIM,DIM}]
re
ef
Cr2 = Array[,{DIM,DIM,DIM}]
Do[
in
Cr1[[i,j,k]] = 1/2
(
nl
D[ g [[i,k]], Z[[j]] ]
+ D[ g [[j,k]], Z[[i]] ]
llo
- D[ g [[i,j]], Z[[k]] ]
),
{k,DIM},{j,DIM},{i,DIM}
.a
]
Do[
w
Cr2[[l,i,j]] =
w
Sum[
g1[[l,k]] Cr1[[i,j,k]],
w
{k,DIM}
],
{j,DIM},{i,DIM},{l,DIM}
]
36
tion of tensors up to second order.
solution
********************************************)
m
(*
B.Spain
co
Tensor Calculus, 1965
Eq.(22.2)
*)
e.
D1[N_,A_,k_,X_,j_]:=
(*
Computes covariant derivative
of a mixed tensor of second order re
ef
with index k - covariant (upper)
*)
in
Module[
{i,s},
nl
s = Sum[Cr2[[k,i,j]] A[[i]],{i,N}];
D[A[[k]],X[[j]]] + s
llo
]
Dl1[N_,A_,l_,X_,t_]:=
.a
(*
Computes covariant derivative
w
*)
Module[
w
{s,r},
s =Sum[Cr2[[r,l,t]] A[[r]],{r,N}];
D[A[[l]],X[[t]]] - s
]
D1l1[N_,A_,m_,l_,X_,t_]:=
(*
Computes covariant derivative
of a mixed tensor of second order
with index m - contravariant (upper) and
37
index l - covariant (lower)
*)
Module[
{s1,s2,r},
s1 =Sum[Cr2[[m,r,t]] A[[r,l]],{r,N}];
s2 =Sum[Cr2[[r,l,t]] A[[m,r]],{r,N}];
D[A[[m,l]],X[[t]]] + s1 - s2
]
D2[N_,A_,i_,j_,X_,n_]:=
m
(*
Computes covariant derivative
of second order tensor with
co
both m and l contravariant (upper)
indexes
e.
B.Spain
Tensor Calculus, 1965
*)
Eq.(23.3)
re
ef
Module[
{s1,s2,k},
in
s1 =Sum[Cr2[[i,k,n]] A[[k,j]],{k,N}];
s2 =Sum[Cr2[[j,k,n]] A[[i,k]],{k,N}];
nl
D[A[[i,j]],X[[n]]] + s1 + s2
]
llo
D2l1[N_,A_,i_,j_,k_,X_,n_]:=
(*
Computes covariant derivative
.a
indexes
B.Spain
w
38
]
D4l1[N_,A_,i1_,i2_,i3_,i4_,i5,X_,i6_]:=
(*
Computes covariant derivative
of 5 order tensor with
4 first indexes contravariant (upper)
and the last one contravariant (lower)
B.Spain
Tensor Calculus, 1965
m
Eq.(23.3)
*)
Module[
co
{k,s1,s2,s3,s4,s5},
s1= Sum[Cr2[[i1,k,n]] A[[k,i2,i3,i4,i5]],{k,N}];
e.
s2= Sum[Cr2[[i2,k,n]] A[[i1,k,i3,i4,i5]],{k,N}];
s3= Sum[Cr2[[i3,k,n]] A[[i1,i2,k,i4,i5]],{k,N}];
re
s4= Sum[Cr2[[i4,k,n]] A[[i1,i2,i3,k,i5]],{k,N}];
s5=-Sum[Cr2[[k,i5,n]] A[[i1,i2,i3,i4,k]],{k,N}];
ef
D[A[[i1,i2,i3,i4,i5]],X[[i6]]]+s1+s2+s3+s4+s5
]
in
nl
llo
we have:
w
(* Variables: *)
NV = DIM
39
U = Array[,NV]
m
X[[3]] = z;
co
J = Array[,{DIM,DIM}]
Do[
e.
J [[i,j]] = D[X[[i]],Y[[j]]],
{j,1,DIM},{i,1,DIM}
]
J1=Simplify[Inverse[J]]
re
ef
(* Derivatives of a vector *)
in
V0 = Array[,NX]
nl
V0[[1]] = Vr[r,th,z];
V0[[2]] = Vt[r,th,z];
llo
V0[[3]] = Vz[r,th,z];
(*
.a
(\cite[5.102-5.110]{SyScTC69})
w
*)
V = Array[,NX]
w
Do[
V[[i]] = PowerExpand[V0[[i]]/g[[i,i]]ˆ(1/2)],
{i,1,NX}
]
(*
Transform vectors
as first order contravariant tensors
*)
40
U = Array[,NX]
SetAttributes[RV1,HoldAll]
RV1[NX,V,U]
(*
Compute first covariant derivatives
of vectors
*)
DV = Array[,{NX,NX}];
Do[
m
DV[[i,j]] = D1[NX,V,i,Y,j],
{j,1,NX},{i,1,NX}
]
co
(* Divergence *)
div=0
e.
Do[
div=div+DV[[i,i]],
]
{i,NX}
re
ef
div0 = div/.th->0
in
nl
Using the Mathematica package, write the routines for computing Laplacian
in curvilinear coordinates.
.a
solution
w
(* Variables: *)
NV = DIM
U = Array[,NV]
41
(* New coordinate system *)
Y = Array[,NX]
Y[[1]] = r;
Y[[2]] = th;
Y[[3]] = z;
X[[1]] = r Cos[th];
X[[2]] = r Sin[th];
X[[3]] = z;
m
(* Compute the Jacobian *)
J = Array[,{DIM,DIM}]
co
Do[
J [[i,j]] = D[X[[i]],Y[[j]]],
e.
{j,1,DIM},{i,1,DIM}
]
J1=Simplify[Inverse[J]]
re
ef
(* Derivative of a scalar *)
in
DP = Array[,NX];
Do[
nl
DP[[i]] = D[p[r,th,z],Y[[i]]],
{i,1,NX}
llo
]
DDP = Array[,{NX,NX}];
Do[
.a
DDP[[i,j]] = Dl1[NX,DP,i,Y,j],
{i,1,NX},{j,1,NX}
w
]
w
DDQ = Array[,{NX,NX}];
Do[
w
(* Laplacian *)
(*** lap=lap+Sum[g[[i,j]]*Dl1[NX,DS,j,Y,i],{i,1,NX},{j,1,NX}],*)
lap=Sum[DDQ[[i,i]],{i,NX}]
lap0=lap/.th->0
42
Problem 4.11: Invariant expressions
Check if any of these tensor expressions are invariant, and correct them if
not:
Ai BijkCt k
j
Dt (87)
m
ij jq
A jk BipqC kq Fk j Gkp H j H k Ak j Cti B pit q (88)
co
E i Bikp p
DkqC jq
j
Dki G p i (89)
e.
Answers:
A corrected form of (87) is:
Ai BikjCt k
j
re Dt
ef
Equality (89) requires no corrections. A corrected form of (89) is:
in
Ei Bikp jq
Dik G p i
nl
D pkqC j
Proof
w
Ai Bi gi j A j gik Bk gi j gik A j Bk δ jk A j Bk A jB j
which proves that both forms have the same values. If we now consider the first
form then:
43
which proves the point.
Consider now Ai Bi :
Āi B̄i ∂ x j ∂ xk
Aj
∂x̄i ∂x̄i
Bk
which can not be reduced further and, therefore is not invariant, since it has a
different form from the LHS.
m
co
e.
re
ef
in
nl
llo
.a
w
w
w
44