<<

A Primer on Calculus

David A. Clarke

Saint Mary’s University, Halifax NS, Canada

[email protected]

June, 2011 Copyright c David A. Clarke, 2011

Contents

Preface ii

1 Introduction 1

2 Definition of a tensor 3

3 The 9 3.1 Physical components and vectors ...... 11 3.2 The and inner products ...... 14 3.3 Invariance of tensor expressions ...... 17 3.4 The permutation ...... 18

4 Tensor 21 4.1 “Christ-awful symbols” ...... 21 4.2 Covariant ...... 25

5 Connexion to 30 5.1 of a scalar ...... 30 5.2 of a vector ...... 30 5.3 Divergence of a tensor ...... 32 5.4 The Laplacian of a scalar ...... 33 5.5 of a vector ...... 34 5.6 The Laplacian of a vector ...... 35 5.7 Gradient of a vector ...... 35 5.8 Summary ...... 36 5.9 A tensor-vector identity ...... 37

6 Cartesian, cylindrical, and spherical polar coordinates 39 6.1 Cartesian coordinates ...... 40 6.2 Cylindrical coordinates ...... 40 6.3 Spherical polar coordinates ...... 40

7 An application to viscosity 42

i Preface

These notes stem from my own need to refresh my memory on the fundamentals of , having seriously considered them last some 25 years ago in grad school. Since then, while I have had ample opportunity to teach, use, and even program numerous ideas from vector calculus, tensor analysis has faded from my consciousness. How much it had faded became clear recently when I tried to program the viscosity tensor into my fluids code, and couldn’t account for, much less derive, the myriad of “strange terms” (ultimately from the dreaded “Christ-awful” symbols) that arise when programming a tensor quantity valid in . My goal here is to reconstruct my understanding of tensor analysis enough to make the connexion between covarient, contravariant, and physical vector components, to understand the usual vector derivative constructs ( , , ) in terms of tensor differentiation, to put ∇ ∇· ∇× dyads (e.g., ~v) into proper context, to understand how to derive certain identities involving tensors, and∇ finally, the true test, how to program a realistic viscous tensor to endow a fluid with the non-isotropic stresses associated with Newtonian viscosity in curvilinear coordinates. Inasmuch as these notes may help others, the reader is free to use, distribute, and modify them as needed so long as they remain in the public domain and are passed on to others free of charge.

David Clarke Saint Mary’s University June, 2011

Primers by David Clarke:

1. A FORTRAN Primer

2. A UNIX Primer

3. A DBX (debugger) Primer

4. A Primer on Tensor Calculus

I also give a link to David R. Wilkins’ excellent primer Getting Started with LATEX, in which I have added a few sections on adding figures, colour, and HTML links.

ii A Primer on Tensor Calculus

1 Introduction

In , there is an overwhelming need to formulate the basic laws in a so-called form; that is, one that does not depend on the chosen . As a start, the freshman university physics student learns that in ordinary Cartesian coordinates, Newton’s ~ Second Law, i Fi = m~a, has the identical form regardless of which inertial (not accelerating with respect to the background stars) one chooses. Thus two observers takingP independent measures of the forces and accelerations would agree on each measurement made, regardless of how rapidly one observer is moving relative to the other so long as neither observer is accelerating. However, the sophomore student soon learns that if one chooses to examine Newton’s Second Law in a curvilinear coordinate system, such as right-cylindrical or spherical polar coordinates, new terms arise that stem from the fact that the of some coordinate unit vectors change with . Once these terms, which resemble the centrifugal and Coriolis terms appearing in a rotating frame of reference, have been properly accounted for, physical laws involving vector quantities can once again be made to “look” the same as they do in Cartesian coordinates, restoring their “invariance”. Alas, once the student reaches their junior year, the complexity of the problems has forced the introduction of rank 2 constructs such as matrices to describe certain physical quantities (e.g., , viscosity, spin) and in the senior year, Riemannian ge- ometry and require mathematical entities of still higher rank. The tools of vector analysis are simply incapable of allowing one to write down the governing laws in an invariant form, and one has to adopt a different mathematics from the vector analysis taught in the freshman and sophomore years. Tensor calculus is that mathematics. Clues that tensor-like entities are ultimately needed exist even in a first year physics course. Consider the task of expressing a velocity as a vector quantity. In Cartesian coordinates, the task is rather trivial and no ambiguities arise. Each component of the vector is given by the rate of change of the object’s coordinates as a function of time: ~v = (x, ˙ y,˙ z˙) =x ˙ eˆx +y ˙ eˆy +z ˙ eˆz, (1) where I use the standard notation of an “over-dot” for time differentiation, and wheree ˆx is the in the x-direction, etc. Each component has the unambiguous units of m s−1, the unit vectors in the same direction no matter where the object may be, and the velocity is completely well-defined. Ambiguities start when one wishes to express the velocity in spherical-polar coordinates, for example. If, following (1), we write the velocity components as the time- derivatives of the coordinates, we might write

~v = (r, ˙ ϑ,˙ ϕ˙). (2)

1 Introduction 2

z dy z r sinθdφ dx rdθ dz

dr y y

x x Figure 1: (left) A differential in Cartesian coordinates, and (right) a differential volume in spherical polar coordinates, both with their edge-lengths indicated.

An immediate “cause for pause” is that the three components do not share the same “units”, and thus we cannot expand this ordered triple into a series involving the respective unit vectors as was done in equation (1). A little reflection might lead us to examine a differential “box” in each of the coordinate systems as shown in Fig. 1. The sides of the Cartesian box have length dx, dy, and dz, while the spherical polar box has sides of length dr, r dϑ, and r sin ϑdϕ. We might argue that the components of a physical velocity vector should be the lengths of the differential box divided by dt, and thus:

~v = (r,r ˙ ϑ,˙ r sin ϑ ϕ˙) =r ˙ eˆr + r ϑ˙ eˆϑ + r sin ϑ ϕ˙ eˆϕ, (3) which addresses the concern about units. So which is the “correct” form? In the pages that follow, we shall see that a tensor may be designated as contravariant, covariant, or mixed, and that the velocity expressed in equation (2) is in its contravariant form. The velocity vector in equation (3) corresponds to neither the covariant nor contravari- ant form, but is in its so-called physical form that we would measure with a speedometer. Each form has a purpose, no form is any more fundamental than the other, and all are linked via a very fundamental tensor called the metric. Understanding the role of the metric in linking the various forms of tensors1 and, more importantly, in differentiating tensors is the basis of tensor calculus, and the subject of this primer.

1Examples of tensors the reader is already familiar with include scalars (rank 0 tensors) and vectors (rank 1 tensors). 2 Definition of a tensor

As mentioned, the need for a mathematical construct such as tensors stems from the need to know how the functional dependence of a physical quantity on the position coordinates changes with a change in coordinates. Further, we wish to render the fundamental laws of physics relating these quantities invariant under coordinate transformations. Thus, while the functional form of the acceleration vector may change from one coordinate system to another, the functional changes to F~ and m will be such that F~ will always be equal to m~a, and not some other function of m, ~a, and/or some other variables or constants depending on the coordinate system chosen. Consider two coordinate systems, xi andx ˜i, in an n-dimensional space where i = 2 1, 2,...,n . xi andx ˜i could be two Cartesian coordinate systems, one moving at a con- stant velocity relative to the other, or xi could be Cartesian coordinates andx ˜i spherical polar coordinates whose origins are coincident and in relative rest. Regardless, one should be able, in principle, to write down the coordinate transformations in the following form:

x˜i =x ˜i(x1, x2,...,xn), (4)

one for each i, and their inverse transformations:

xi = xi(˜x1, x˜2,..., x˜n). (5)

Note that which of (4) and (5) is referred to as the “transformation”, and which as the “inverse” is completely arbitrary. Thus, in the first example where the Cartesian coordinate systemx ˜i = (˜x, y,˜ z˜) is moving with velocity v along the +x axis of the Cartesian coordinate system xi =(x, y, z), the transformation relations and their inverses are:

x˜ = x vt, x =x ˜ + vt, − y˜ = y, y =y, ˜ (6) z˜ = z, z =z. ˜

For the second example, the coordinate transformations and their inverses between Cartesian, xi =(x, y, z), and spherical polar,x ˜i =(r, ϑ, ϕ) coordinates are:

r = x2 + y2 + z2, x = r sin ϑ cos ϕ, p x2 + y2 ϑ = tan−1 , y = r sin ϑ sin ϕ, (7) z p  y ϕ = tan−1 , z = r cos ϑ. x   Now, let f be some function of the coordinates that represents a physical quantity of interest. Consider again two generic coordinate systems, xi andx ˜i, and assume their transformation relations, equations (4)and (5), are known. If the components of the gradient

2In physics, n is normally 3 or 4 depending on whether the discussion is non-relativistic or relativistic, though our discussion matters little on a specific value of n. Only when we are speaking of the curl and cross-products in general will we deliberately restrict our discussion to 3-space.

3 Definition of a tensor 4

of f in xj, namely ∂f/∂xj , are known, then we can find the components of the gradient in x˜i, namely ∂f/∂x˜i, by the chain rule:

∂f ∂f ∂x ∂f ∂x ∂f ∂x n ∂x ∂f = 1 + 2 + + n = j . (8) ∂x˜ ∂x ∂x˜ ∂x ∂x˜ ··· ∂x ∂x˜ ∂x˜ ∂x i 1 i 2 i n i j=1 i j X Note that the coordinate transformation information appears as partial derivatives of the old coordinates, xj, with respect to the new coordinates,x ˜i. Next, let us ask how a differential of one of the new coordinates, dx˜i, is related to differentials of the old coordinates, dxi. Again, an invocation of the chain rule yields:

∂x˜ ∂x˜ ∂x˜ n ∂x˜ dx˜ = dx i + dx i + + dx i = i dx . (9) i 1 ∂x 2 ∂x ··· n ∂x ∂x j 1 2 n j=1 j X This time, the coordinate transformation information appears as partial derivatives of the new coordinates,x ˜i, with respect to the old coordinates, xj, and the inverse of equation (8). We now redefine what it means to be a vector (equally, a rank 1 tensor).

Definition 2.1. The components of a covariant vector transform like a gra- dient and obey the transformation law:

n ∂xj A˜ = A . (10) i ∂x˜i j j=1 X Definition 2.2. The components of a contravariant vector transform like a coordinate differential and obey the transformation law:

n ∂x˜i A˜i = Aj. (11) ∂xj j=1 X

It is customary, as illustrated in equations (10) and (11), to leave the indices of covariant tensors as subscripts, and to raise the indices of contravariant tensors to superscripts: “co- low, contra-high”. In this convention, dx dxi. As a practical modification to this rule, i → because of the difference between the definitions of covariant and contravariant components (equations 10 and 11), a contravariant index in the denominator is equivalent to a covarient index in the numerator, and vice versa. Thus, in the construct ∂xj /∂x˜i, j is contravariant while i is considered to be covariant. Superscripts indicating raising a variable to some power will generally be clear by con- text, but where there is any ambiguity, indices representing powers will be enclosed in square . Thus, A2 will normally be, from now on, the “2-component of the contravariant vector A”, whereas A[2] will be “A-squared” when A2 could be ambiguous. Finally, we shall adopt here, as is done most everywhere else, the Einstein convention in which a covariant index followed by the identical contravariant index (or vice Definition of a tensor 5

versa) is implicitly summed over the index, rendering the repeated index a dummy index. On rare occasions where a sum is to be taken over two repeated covariant or two repeated contravariant indices, a summation sign will be given explicitly. Conversely, if properly repeated indices (e.g., one covariant, one contravariant) are not to be summed, a note to that effect will be given. Further, any indices enclosed in parentheses [e.g., (i)] will not be i i i (i) summed. Thus, AiB is normally summed while AiBi, A B , and A(i)B are not. To the uninitiated who may think at first blush that this convention may be fraught with exceptions, it turns out to be remarkably robust and rarely will it pose any ambiguities. In tensor analysis, it is rare that two properly repeated indices should not, in fact, be summed. It is equally rare that two repeated covariant (or contravariant) indices should be summed, and rarer still that an index appears more than twice in any given term. As a first illustration, applying the Einstein summation convention changes equations (10) and (11) to: ∂xj ∂x˜i A˜ = A , and A˜i = Aj, i ∂x˜i j ∂xj respectively, where summation is implicit over the index j in both cases. Remark 2.1. While dxi is the prototypical rank 1 contravariant tensor (e.g., equation 9), xi is not a tensor as its transformation follows neither equations (10) nor (11). Still, we will follow the up-down convention for coordinates indices as it serves a purpose to distinguish between covariant-like and contravariant-like coordinates. It will usually be the case anyway that xi will appear as part of dxi or ∂/∂xi. Tensors of higher rank are defined in an entirely analogous way. A tensor of m (each index varies from 1 to m) and rank n ( of indices) is an entity that, under an arbitrary coordinate transformation, transforms as:

j1 jp k1 kq k1...kq ∂x ∂x ∂x˜ ∂x˜ ˜ l1...lq Ti1...i = ...... Tj1...j , (12) p ∂x˜i1 ∂x˜ip ∂xl1 ∂xlq p

where p + q = n, and where the indices i1,...,ip and j1,...,jp are covariant indices and k1,...,kq and l1,...,lq are contravariant indices. Indices that appear just once in a term (e.g., i1,...,ip and k1,...,kq in equation 12) are called free indices, while indices appearing twice—one covariant and one contravariant—(e.g., j1,...,jp and l1,...,lq in equation 12), are called dummy indices as they disappear after the implied sum is carried forth. In a valid tensor relationship, each term, whether on the left or right side of the equation, must have the same free indices each in the same position. If a certain free index is covariant (contravariant) in one term, it must be covariant (contravariant) in all terms. If q =0(p = 0), then all indices are covariant (contravariant) and the tensor is said to be covariant (contravariant). Otherwise, if the tensor has both covariant and contravariant indices, it is said to be mixed. In general, the order of the indices is important, and we l1...lq l1...lq deliberately write the tensor as Tj1...jp , and not Tj1...jp . However, there is no reason to expect all contravariant indices to follow the covariant indices, nor for all covariant indices j m to be listed contiguously. Thus and for example, one could have Ti kl if, indeed, the first, third, and fourth indices were covariant, and the second and fifth indices were contravariant. Definition of a tensor 6

Remark 2.2. Rank 2 tensors of dimension m can be represented by m m square matrices. A that is an element of a is a rank 2 tensor. Rank 3× tensors of dimension m would be represented by an m m m cube of values, etc. × × Remark 2.3. In traditional vector analysis, one is forever moving back and forth between considering vectors as a whole (e.g., ~v), or in terms of its components relative to some coordinate system (e.g., vx). This, then, leads one to worry whether a given relationship is true for all coordinate systems (e.g., vector “identities” such as: fA~ = f A~ + A~ f), ∇· ∇· · ∇ or whether it is true only in certain coordinate systems [e.g., (A~B~ )=( B A,~ B A,~ ∇· ∇· x ∇· y ∇· BzA~) is true in Cartesian coordinates only]. The formalism of tensor analysis eliminates both of these concerns by writing everything down in terms of a “typical tensor component” where all “geometric factors”, which have yet to be discussed, have been safely accounted for in the notation. As such, all equations are written in terms of tensor components, and rarely is a tensor written down without its indices. As we shall see, this both simplifies the notation and renders unambiguous the invariance of certain relationships under arbitrary coordinate transformations. In the remainder of this , we make a few definitions and prove a few theorems that will be useful throughout the rest of this primer.

Theorem 2.1. The sum (or difference) of two like-tensors is a tensor of the same type.

Proof. This is a simple application of equation (12). Consider two like-tensors (i.e., identical indices), S and T, each transforming according to equation (12). Adding the LHS and the RHS of these transformation equations (and defining R = S + T), one gets:

k1...k k1...k k1...k R˜ q S˜ q + T˜ q i1...ip ≡ i1...ip i1...ip j1 jp k1 kq ∂x ∂x ∂x˜ ∂x˜ l1...lq = ...... Sj1...j ∂x˜i1 ∂x˜ip ∂xl1 ∂xlq p j1 jp k1 kq ∂x ∂x ∂x˜ ∂x˜ l1...lq + ...... Tj1...j ∂x˜i1 ∂x˜ip ∂xl1 ∂xlq p

j1 jp k1 kq ∂x ∂x ∂x˜ ∂x˜ l1...lq l1...lq = ...... (Sj1...j + Tj1...j ) ∂x˜i1 ∂x˜ip ∂xl1 ∂xlq p p

j1 jp k1 kq ∂x ∂x ∂x˜ ∂x˜ l1...lq = ...... Rj1...j . ∂x˜i1 ∂x˜ip ∂xl1 ∂xlq p

Definition 2.3. A rank 2 dyad, D, results from taking the dyadic of two vectors (rank 1 tensors), A~ and B~ , as follows:

j j i i ij i j Dij = AiBj,Di = AiB ,D j = A Bj,D = A B , (13)

th th where the ij component of D, namely AiBj, is just the ordinary product of the i element of A~ with the jth element of B~ . Definition of a tensor 7

The dyadic product of two covariant (contravariant) vectors yields a covariant (con- travariant) dyad (first and fourth of equations 13), while the dyadic product of a covariant vector and a contravariant vector yields a mixed dyad (second and third of equations 13). Indeed, dyadic products of three or more vectors can be taken to create a dyad of rank 3 or j j higher (e.g., Di k = AiB Ck, etc). Theorem 2.2. A rank 2 dyad is a rank 2 tensor. Proof. We need only show that a rank 2 dyad transforms as equation (12). Consider a mixed ˜ l ˜ ˜l l dyad, Dk = AkB , in a coordinate systemx ˜ . Since we know how the vectors transform to a different coordinate system, xi, we can write: ∂xi ∂x˜l ∂xi ∂x˜l ∂xi ∂x˜l D˜ l = A˜ B˜l = A Bj = A Bj = D j. k k ∂x˜k i ∂xj ∂x˜k ∂xj i ∂x˜k ∂xj i    Thus, from equation (12), D transforms as a of rank 2. A similar argument can be made for a purely covariant (contravariant) dyad of rank 2 and, by extension, of arbitrary rank. Remark 2.4. By dealing with only a typical component of a tensor (and thus a real or ), all arithmetic is ordinary multiplication and addition, and everything commutes: j j AiB = B Ai, for example. Conversely, in vector and matrix algebra when one is dealing with the entire vector or matrix, multiplication does not follow the usual rules of scalar multiplication and, in particular, is not commutative. In many ways, this renders much simpler than vector and matrix algebra. kl Definition 2.4. If Aij is a rank 2 covariant tensor and B is a rank 2 contravariant tensor, then they are each other’s inverse if:

jk k AijB = δi . j k k i j i In a similar vein, Ai Bj = δi and A jB k = δ k are examples of inverses for mixed rank e ej j 2 tensors. One can even have “inverses” of rank 1 tensors: i = δi , though this property is usually referred to as . Note that the concepts of invertibility and orthogonality take the place of “division” in tensor algebra. Thus, one would never see a tensor element in the denominator of a fraction k k and something like Ci = Aij/Bjk is never written. Instead, one would write Ci Bjk = Aij k −1 jk and, if it were critical that C be isolated, one would write Ci = Aij(Bjk) = AijD if jk D were, in fact, the inverse of Bjk. A tensor element could appear in the numerator of a fraction where the demonimator is a scalar (e.g., Aij/2) or a physical component of a vector (as introduced in the next section), but never in the denominator. I note in haste that while a derivative, ∂xi/∂x˜j, may look like an exception to this rule, it is a notational exception only. In taking a derivative, one is not really taking a fraction. And while dxi is a tensor, ∆xi is not and thus the actual fraction ∆xi/∆˜xj is allowed in tensor algebra since the denominator is not a tensor element. Theorem 2.3. The derivatives ∂xi/∂x˜k and ∂x˜k/∂xj are each other’s inverse. That is, ∂xi ∂x˜k = δi . ∂x˜k ∂xj j Definition of a tensor 8

Proof. This is a simple application of the chain rule. Thus,

∂xi ∂x˜k ∂xi = = δi , (14) ∂x˜k ∂xj ∂xj j where the last equality is true by virtue of the independence of the coordinates xi. Remark 2.5. If one considers ∂xi/∂x˜k and ∂x˜k/∂xj as, respectively, the (i, k)th and (k, j)th elements of m m matrices then, with the implied summation, the LHS of equation (14) is × simply following ordinary , while the RHS is the (i, j)th element of the identity matrix. It is in this way that ∂xi/∂x˜k and ∂x˜k/∂xj are each other’s inverse.

Definition 2.5. A occurs when one of a tensor’s free covarient indices is set equal to one of its free contravariant indices. In this case, a sum is performed on the now repeated indices, and the result is a tensor with two fewer free indices.

j Thus, and for example, Tij is a contraction on the second and third indices of the rank k 3 tensor Tij . Once the sum is performed over the repeated indices, the result is a rank 1 tensor (vector). Thus, if we use T to designate the contracted tensor as well (something we are not obliged to do, but certainly may), we would write:

j Tij = Ti.

Remark 2.6. Contractions are only ever done between one covariant index and one con- travariant index, never between two covariant indices nor two contravariant indices.

Theorem 2.4. A contraction of a rank 2 tensor (its ) is a scalar whose value is inde- pendent of the coordinate system chosen. Such a scalar is referred to as a rank 0 tensor.

i T ˜ l k Proof. Let T = Ti be the trace of the tensor, . If Tk is a tensor in coordinate systemx ˜ , then its trace transforms to coordinate system xi according to:

∂xi ∂x˜k T˜ k = T j = δi T j = T i = T. k ∂x˜k ∂xj i j i i ˜ l It is important to note the role played by the fact that Tk is a tensor, and how this gave rise to the Kronicker delta (Theorem 2.3) which was needed in proving the invariance of the trace (i.e., that the trace has the same value regardless of coordinate system). 3 The metric

In an arbitrary m-dimensional coordinate system, xi, the differential displacement vector is: m 1 2 m i d~r = (h(1)dx , h(2)dx ,...,h(m)dx ) = h(i)dx eˆ(i), (15) i=1 X 1 m wheree ˆ(i) are the physical (not covariant) unit vectors, and where h(i) = h(i)(x ,...,x ) are scale factors (not tensors) that depend, in general, on the coordinates and endow each component with the appropriate units of length. The subscript on the unit vector is enclosed in parentheses since it is a vector label (to distinguish it from the other unit vectors spanning the vector space), and not an indicator of a component of a covariant tensor. Subscripts on h are enclosed in parentheses since they, too, do not indicate components of a covariant tensor. In both cases, the parentheses prevent them from triggering an application of the Einstein summation convention should they be repeated. For the three most common orthogonal coordinate systems, the coordinates, unit vectors, and scale factors are:

i system x eˆ(i) (h(1), h(2), h(3))

Cartesian (x, y, z) eˆx, eˆy, eˆz (1, 1, 1)

cylindrical (z,̺,ϕ) eˆz, eˆ̺, eˆϕ (1, 1, ̺)

spherical polar (r, ϑ, ϕ) eˆr, eˆϑ, eˆϕ (1,r,r sin ϑ) Table 1: Nomenclature for the most common coordinate systems.

In “vector-speak”, the length of the vector d~r, given by equation (15), is obtained by taking the “” of d~r with itself. Thus, m m (dr)2 = h h eˆ eˆ dxidxj, (16) (i) (j) (i) · (j) i=1 j=1 X X wheree ˆ eˆ cos θ are the directional cosines which are 1 when i = j. For orthogonal (i) · (j) ≡ (ij) coordinate systems, cos θ(ij) = 0 for i = j, thus eliminating the “cross terms”. For non- orthoginal systems, the off-diagonal directional6 cosines are not, in general, zero and the cross-terms remain.

Definition 3.1. The metric, gij, is given by: g = h h eˆ eˆ , (17) ij (i) (j) (i) · (j) which, by inspection, is symmetric under the interchange of its indices; gij = gji.

Remark 3.1. For an orthogonal coordinate system, the metric is given by: gij = h(i)h(j)δij, which reduces further to δij for Cartesian coordinates. Thus equation (16) becomes:

2 i j (dr) = gijdx dx , (18) where the summation on i and j is now implicit, presupposing the following theorem:

9 The metric 10

Theorem 3.1. The metric is a rank 2 covariant tensor. Proof. Because (dr)2 is a between two physical points, it must be invariant under coordinate transformations. Thus, consider (dr)2 in the coordinate systemsx ˜k and xi: ∂xi ∂xj ∂xi ∂xj (dr)2 =g ˜ dx˜kdx˜l = g dxidxj = g dx˜k dx˜l = g dx˜kdx˜l, kl ij ij ∂x˜k ∂x˜l ∂x˜k ∂x˜l ij ∂xi ∂xj g˜ g dx˜kdx˜l = 0, ⇒ kl − ∂x˜k ∂x˜l ij   which must be true dx˜kdx˜l. This can be true only if, ∀ ∂xi ∂xj g˜ = g , (19) kl ∂x˜k ∂x˜l ij

and, by equation (12), gij transforms as a rank 2 covariant tensor. Definition 3.2. The conjugate metric, gkl, is the inverse to the , and therefore satisfies: kp kp k g gip = gipg = δi . (20) It is left as an exercise to show that the conjugate metric is a rank 2 contravariant tensor. (Hint: use the invariance of the Kronicker delta.) Definition 3.3. A conjugate tensor is the result of multiplying a tensor with the metric, then contracting one of the indices of the metric with one of the indices of the tensor.

j1...jq Thus, two examples of conjugates for the rank n tensor Ti1...ip , p + q = n, include:

T k j1...jq = gkir T j1...jq , 1 r p; (21) i1...ir−1 ir+1...ip i1...ip ≤ ≤ T j1...js−1 js+1...jq = g T j1...jq , 1 s q. (22) i1...ip l ljs i1...ip ≤ ≤

An operation like equation (21) is known as raising an index (covariant index ir is replaced with contravariant index k) while equation (22) is known as lowering an index (contravariant index js is replaced with covariant index l). For a tensor with p covariant and q contravariant indices, one could write down p conjugate tensors with a single index raised and q conjugate tensors with a single index lowered. Contracting a tensor with the metric several times will raise or lower several indices, each representing a conjugate tensor to the original. Associated with every rank n tensor are 2n−1 conjugate tensors all with rank n. The attempt to write equations (21) and (22) for a general rank n tensor has made them rather opaque, so it is useful to examine the simpler and special case of raising and lowering the index of a rank 1 tensor. Thus,

j ij j A = g Ai; Ai = gijA . (23) Rank 2 tensors can be similarly examined. As a first example, we define the covariant coordinate differential, dxi, to be:

j ij j dx = g dxi; dxi = gijdx . The metric 11

We can find convenient expressions for the metric components of any coordinate system, xi, if we know how xi and Cartesian coordinates depend on each other. Thus, if χk represent the Cartesian coordinates (x, y, z), and if we know χk = χk(xi), then using Remark 3.1 we can write: ∂χk ∂χl ∂χk ∂χl (dr)2 = δ dχkdχl = δ dxi dxj = δ dxidxj. kl kl ∂xi ∂xj kl ∂xi ∂xj       Therefore, by equations (18) and (20), the metric and its inverse are given by:

∂χk ∂χl ∂xi ∂xj g = δ and gij = δkl . (24) ij kl ∂xi ∂xj ∂χk ∂χl

3.1 Physical components and basis vectors Consider an m-dimensional space, Rm, spanned by an arbitrary basis of unit vectors (not necessarily orthogonal),e ˆ(i), i = 1, 2,...,m. A theorem of first-year states that for every A~ Rm, there is a unique set of , A , such that: ∈ (i)

A~ = A(i)eˆ(i). (25) i X

Definition 3.4. The values A(i) in equation (25) are the physical components of A~ relative to the basis sete ˆ(i). A physical component of a vector field has the same units as the field. Thus, a physical component of velocity has units m s−1, electric field V m−1, force N, etc. As it turns out, a physical component is neither covariant nor contravariant, and thus the subscripts of physical components are surrounded with parentheses lest they trigger an unwanted application of the summation convention which only applies to a covariant-contravariant index pair. As will be shown in this subsection, all three types of vector components are distinct yet related. It is a straight-forward, if not tedious, task to find the physical components of a given 3 vector, A~, with respect to a given basis set,e ˆ(i) . Suppose A~c ande ˆi,c are “m-tuples” of the 4 components of vectors A~ ande ˆ(i) relative to “Cartesian-like ” coordinates (or any coordinate

system, for that matter). To find the m-tuple, A~x, of the components of A~ relative to the new basis,e ˆ(i), one does the following calculation:

eˆ1,c eˆ2,c . . . eˆm,c A~c A~x . . .  ↓ ↓ ↓ ↓  row−→ reduce  I ↓  . (26)             th th The i element of the m-tuple A~x will be A(i), the i component of A~ relative toe ˆ(i), and the coefficient for equation (25). Shoulde ˆ(i) form an set, the problem of finding

3See, for example, 2.7 of Bradley’s A primer of Linear Algebra; ISBN 0-13-700328-5 4I use the qualifier§ “like” since Cartesian coordinates are, strictly speaking, 3-D. The metric 12

A(i) is much simpler. Taking the dot product of equation (25) withe ˆ(j), then replacing the surviving index j with i, one gets:

A = A~ eˆ , (27) (i) · (i) where, as a matter of practicality, one may perform the dot product using the Cartesian-like components of the vectors, A~c ande ˆi,c. It must be emphasised that what many readers may think as the general expression, equation (27), works only whene ˆ(i) form an orthogonal set. Otherwise, equation (26) must be used. Equation (15) expresses the prototypical vector, d~r, in terms of the unit (physical) basis i vectors,e ˆ(i), and its contravariant components, dx [the naked differentials of the coordinates, such as (dr,dϑ,dϕ) in spherical polar coordinates]. Thus, by analogy, we write for any vector A~: m i A~ = h(i)A eˆ(i). (28) i=1 X On comparing equations (25) and (28), and given the uniqueness of the physical compo- nents, we can immediately write down a relation between the physical and contravariant components: i i 1 A(i) = h(i)A ; A = A(i), (29) h(i) i ij where, as a reminder, there is no sum on i. By substituting A = g Aj in the first of equations (29) and multiplying through the second equation by gij (and thus triggering a sum on i on both sides of the equation), we get the relationship between the physical and covariant components: g A = h gijA ; A = ij A . (30) (i) (i) j j h (i) i (i) X ij ij For , g = δ /h(i)h(j), gij = δijh(i)h(j), and equations (30) reduce to: 1 A(i) = Ai; Aj = h(j)A(j). (31) h(i)

By analogy, we can also write down the relationships between physical components of higher rank tensors and their contravariant, mixed, and covariant forms. For rank 2 tensors, these are:

ij ik j jl i ik jl T(ij) = h(i)h(j)T = h(i)h(j)g Tk = h(i)h(j)g T l = h(i)h(j)g g Tkl, (32)

(sums on k and l only) which, for orthogonal coordinates, reduce to:

ij h(j) j h(i) i 1 T(ij) = h(i)h(j)T = Ti = T j = Tij. (33) h(i) h(j) h(i)h(j)

Just as there are covariant, physical, and contravariant tensor components, there are also covariant, physical (e.g., unit), and contravariant basis vectors. The metric 13

Definition 3.5. Let ~rx be a displacement vector whose components are expressed in terms i of the coordinate system x . Then the covariant basis vector, ei, is defined to be: d~r e x . i ≡ dxi

Remark 3.2. Just like the unit basis vectore ˆ(i), the index on ei serves to distinguish one basis vector from another, and does not represent a single tensor element as, for example, the subscript in the covariant vector Ai does.

It is easy to see that ei is a covariant vector, by considering its transformation to a new coordinate system,x ˜j: d~r ∂xi d~r ∂xi e˜ = x˜ = x = e , j dx˜j ∂x˜j dxi ∂x˜j i confirming its covariant character. From equation (15) and the fact that the xi are linearly independent, it follows from definition 3.5 that: 1 ei = h(i)eˆ(i);e ˆ(i) = ei. (34) h(i) The contravariant basis vector, ej, is obtained by multiplying the first of equations (34) by ij g (triggering a sum over i on the LHS, and thus on the RHS as well), and replacing ei in j the second with gije : g gije = ej = gijh eˆ ;e ˆ = ij ej (35) i (i) (i) (i) h i (i) X Remark 3.3. Only the physical basis vectors are actually unit vectors and thus unitless, and therefore only they are designated by a “hat” (ˆe). The covariant basis vector, ei, has units j h(i) while the contravariant basis vector, e , has units 1/h(i) and are designated in bold-italic (e).

Theorem 3.2. Regardless of whether the coordinate system is orthogonal, e ej = δ j. i · i Proof.

e ej = h eˆ gkjh eˆ = gkj h h eˆ eˆ = gkjg = δ j. i · (i) (i) · (k) (k) (i) (k) (i) · (k) ik i k k n X X gik (eq 17) | {z } Remark 3.4. Note that by equation (17), e e = g and thus ei ej = gij. i · j ij · Now, substituting the first of equations (29) and the second of equations (34) into equation (25), we find: 1 A~ = A eˆ = h✚Ai e = Aie , (36) (i) (i) ✚(i) h✚ i i i i ✚(i) X X The metric 14

where the sum on i is now implied. Similarly, by substituting the first of equations (30) and the second of equations (35) into equation (25), we find:

~ ✚ ij gik ek ij ek ej A = A(i)eˆ(i) = ✚h(i)g Aj ✚ = g gik Aj = Aj . (37) ✚h(i) i i j X X δ k | {z } Thus, we can find the ith covariant component of a vector by calculating:

A~ e = A ej e = A . (38) · i j · i i j δ i | {z } using Theorem 3.2. Because we have used the covariant and contravariant basis vectors instead of the physical unit vectors, equation (38) is true regardless of whether the basis is orthogonal, and thus appears to give us a simpler prescription for finding vector components in a general basis than the algorithm outlined in equation (26). Alas, nothing is for free; computing the covariant and contravariant basis vectors from the physical unit vectors can consist of similar operations as row-reducing a matrix. Finally, let us re-establish contact with the introductory remarks, and remind the reader that equation (2) is the velocity vector in its contravariant form whereas equation (3) is in its physical form, reproduced here for reference: ˙ ~vcon = (r, ˙ ϑ, ϕ˙);

~vphys = (r,r ˙ ϑ,˙ r sin ϑ ϕ˙).

Given equation (31), the covarient form of the velocity vector in spherical polar coordinates is evidently: 2 2 2 ~vcov = (r,r ˙ ϑ,r˙ sin ϑ ϕ˙). (39)

3.2 The scalar and inner products Definition 3.6. The covariant and contravariant scalar products of two rank 1 tensors, A ij i j and B, are defined as g AiBj and gijA B respectively. The covariant and contravariant scalar products actually have the same value, as seen by: ij j i j i j i g AiBj = A Bj and gijA B = A gijB = A Bi, i using equation (23). Similarly, one could show that the common value is AiB . Therefore, the covariant and contravariant scalar product are referred to as simply the scalar product. To find the scalar product in physical components, we start with equations (29) and (30) to write:

A g B g AiB = (i) ij (j) = A B ij = A eˆ B eˆ i h h (i) (j) h h (i) (i) · (j) (j) i (i) j (j) ij (i) (j) i j X X X  X   X  eˆ eˆ (i) · (j) | {z } The metric 15

= A~ B~ = A B (last equality for orthogonal coordinates only), (40) · i i i X using equations (17) and (25). Thus, the scalar product of two rank 1 tensors is just the ordinary dot product between two physical vectors in vector algebra. Remark 3.5. The scalar product of two rank 1 tensors is really the contraction of the dyadic j AiB and thus, from Theorem 2.4, the scalar product is invariant under coordinate trans- formations. j Note that while both AiB and AiBj are rank 2 tensors (the first mixed, the second i covariant), only AiB is invariant. To see that i AiBi is not invariant, write: ∂xi ∂xj P ∂xi ∂xj A˜ B˜ = A B = A B = A B . k k ∂x˜k i ∂x˜k j ∂x˜k ∂x˜k i j 6 i i i Xk Xk Xk X Unlike the proof to Theorem 2.4, ∂xi/∂x˜k and ∂xj /∂x˜k are not each other’s inverse and there is no Kronicker delta δij to be extracted, whence the inequality. Note that the middle two terms are actually triple sums, including the implicit sums on each of i and j.

Definition 3.7. The covariant and contravariant scalar products of two rank 2 tensors, S ik jl ij kl and T, are defined as g g SklTij and gikgjlS T respectively. Similar to the scalar product of two rank 1 tensors, these operations result in a scalar:

ik jl ij ik jl kl ij kl g g SklTij = S Tij = Sklg g Tij = SklT = gikgjlS T .

Thus, the covariant and contravariant scalar products of two rank 2 tensors give the same value and are collectively referred to simply as the scalar product. In terms of the physical components, use equation 32 to write: S g g T g g SijT = (ij) ik jl (kl) = S T ik jl (41) ij h h h h (ij) (kl) h h h h ij (i) (j) (k) (l) (i) (k) (j) (l) X Xk l ijklX eˆ eˆ eˆ eˆ (i) · (k) (j) · (l) S : T = S T (last equality for orthogonal| {z } | coordinates{z } only), ≡ (ij) (ij) ij X Here, I use the “colon product” notation frequently used in vector algebra. If S and T are matrices relative to an orthogonal basis, the colon product is simply the sum of the products of the (i, j)th element of S with the (i, j)th element of T, all “cross-terms” being zero. Note that if S (T) is the dyadic product of rank 1 tensors A and B (C and D), and thus Sij = AiBj (Tij = CiDj), then we can rewrite equation (41) as:

SijT = AiBjC D = (AiC )(BjD ) = (A~ C~ )(B~ D~ ) = S : T, ij i j i j · · and, in “vector-speak”, the colon product is sometimes referred to as the double dot product. Now, scalar products are operations on two tensors of the same rank that yield a scalar. Similar operations on tensors of unequal rank yield a tensor of non-zero rank, the simplest The metric 16

example being the contraction of a rank 2 tensor, T, with a rank 1 tensor, A (or vice versa). ij In tensor notation, there are sixteen ways such a contraction can be represented: T Aj, i j j j ij i j i i T jA , Ti Aj, TijA , AiT , A Ti , AiT j, A Tij plus eight more with the factors reversed ij ij (e.g., T Aj = AjT ). Fortunately, these can be arranged naturally in two groups:

T ijA = T i Aj = gikT jA = gikT Aj (T A~)i; (42) j j k j kj ≡ · A T ij = AiT j = gjkA T i = gjkAiT (A~ T)j. (43) i i i k ik ≡ · where, by example, we have defined the contravariant inner product between tensors of rank 1 and 2.

Definition 3.8. The inner product between two tensors of any rank is the contraction of the inner indices, namely the last index of the first tensor and the first index of the last tensor.

j i Thus, to know how to write A T j as an inner product, one first notices that, as written, it is the last index of the last tensor (T) that is involved in the contraction, not the first index. i j By commuting the tensors to get T jA (which doesn’t change its value), the last index of the first tensor is now contracted with the first index of the last tensor and, with the tensors now in their “proper” order, we write down T i Aj =(T A~)i. Note that (A~ T)i = A T ji = A T ij j · · j 6 j unless T is symmetric. Thus, the inner product does not generally commute: A~ T = T A~. · 6 · In vector/matrix notation, T A~ is the right dot product of the matrix T with the vector · A~, and is equivalent to the matrix multiplication of the m m matrix T on the left with the 1 m column vector A~ on the right, yielding another 1 ×m column vector, call it B~ . In × × “bra-ket” notation, this is represented as T A = B . Conversely, the left dot product, A~ T, is the matrix multiplication of the m 1 row| i vector| i on the left with the m m matrix· on × × the right, yielding another m 1 row vector. In “bra-ket” notation, this is represented as A T = B . × h | Theh inner| products defined in equations (42) and (43) are rank 1 contravariant tensors. In terms of the physical components, we have from equations (29) and (32):

ij i j T ~ i 1 T ~ ik j T Aj = T jA = ( A) = ( A)(i) = gjkT A (44) · h(i) ·

T(ik) A(j) 1 gjk 1 = gjk = T(ik)A(j) = T(ik)A(j)eˆ(j) eˆ(k) h(i)h(k) h(j) h(i) h(j)h(k) h(i) · Xjk Xjk Xjk

(T A~) = T A eˆ eˆ = T A , (45) ⇒ · (i) (ik) (j) (j) · (k) (ij) (j) j Xjk  X 

ji j i ~ T i 1 ~ T j ki AjT = A Tj = (A ) = (A )(i) = A gjkT (46) · h(i) ·

A(j) T(ki) 1 gjk 1 = gjk = A(j)T(ki) = A(j)T(ki)eˆ(j) eˆ(k) h(j) h(k)h(i) h(i) h(j)h(k) h(i) · Xjk Xjk Xjk The metric 17

(A~ T) = T A eˆ eˆ = T A , (47) ⇒ · (i) (ki) (j) (j) · (k) (ji) (j) j Xjk  X  where the equalities in parentheses are true for orthogonal coordinates only. Note that the only difference between equations (45) and (47) is the order of the indices on T.

3.3 Invariance of tensor expressions The most important property of tensors is their ability to render an equation invariant under coordinate transformations. As indicated after equation (12), each term in a valid tensor expression must have the same free indices in the same positions. Thus, for example, k Uij = Vi is invalid since each term does not have the same number of indices, though this j equation could be rendered valid by contracting on two of the indices in U: Uij = Vi. Asa further example, j j mj Ti kl = Ai Bkl + Cm Dikl, (48) is a valid tensor expression, whereas,

jk j mj Si l = Ai Bkl + Cm Dikl, (49) is not valid because k is contravariant in S but covariant in the two terms on the RHS. Given the role of metrics in raising and lowering indices, we could “rescue” equation (49) by renaming the index k in S to n, say, and then multiplying the LHS by gkn. Thus,

jn j mj gknSi l = Ai Bkl + Cm Dikl, (50) is now a valid tensor expression. And so it goes. An immediate consequence of the rules for assembling a valid tensor expression is that it must have the same form in every coordinate system. Thus and for example, in transforming ′ equation (48) from coordinate system xi to coordinate systemx ˜i , we would write:

i′ j k′ l′ i′ j k′ l′ ∂x˜ ∂x ∂x˜ ∂x˜ j′ ∂x˜ ∂x j′ ∂x˜ ∂x˜ ′ ′ ′ T˜ ′ ′ ′ = ′ A ′ B ∂xi ∂x˜j ∂xk ∂xl i k l ∂xi ∂x˜j i ∂xk ∂xl k l m′ m j i′ k′ l′ ∂x˜ ∂x ∂x m′j′ ∂x˜ ∂x˜ ∂x˜ + ′ ′ C ′ D ′ ′ ′ ∂xm ∂x˜m ∂x˜j m ∂xi ∂xk ∂xl i k l 1 i′ j k′ l′ ∂x˜ ∂x ∂x˜ ∂x˜ |j′ {z }j′ m′j′ ′ T˜ ′ ′ ′ A ′ B ′ ′ C ′ D ′ ′ ′ = 0. ⇒ ∂xi ∂x˜j ∂xk ∂xl i k l − i k l − m i k l Since no assumptions were made of the coordinate transformation factors (the derivatives) in front, this equation must be true for all possible factors, and thus can be true only if the quantity in parentheses is zero. Thus,

j′ j′ m′j′ ˜ ′ ′ ′ ′ ′ Ti′ k′l′ = Ai′ Bk l + Cm′ Di k l . (51) The fact that equation (51) has the identical form as equation (48) is what is meant by a tensor expression being invariant under coordinate transformations. Note that equation (49) The metric 18

would not transform in an invariant fashion, since the LHS would have different coordinate transformation factors than the RHS. Note further that the invariance of a tensor expression like equation (48) doesn’t mean that each term remains unchanged under the coordinate transformation. Indeed, the components of most tensors will change under coordinate trans- formations. What doesn’t change in a valid tensor expression is how the tensors are related to each other, with the changes to each tensor “cancelling out” from each term. Finally, courses in tensor analysis often include some mention of the quotient rule, which has nothing to do with the quotient rule of single-variable calculus. Instead, it is an inverted restatement, of sorts, of what it means to be an invariant tensor expression for particularly simple expressions.

Theorem 3.3. (Quotient Rule) If A and B are tensors, and if the expression A = BT is invariant under coordinate transformation, then T is a tensor.

Proof. Here we look at the special case:

j Ai = BjT i. (52)

The proof for tensors of general rank is more cumbersome and no more enlightening. Since equation (52) is invariant under coordinate transformations, we can write:

∂xi ∂xi ∂xi ∂x˜l B˜ T˜l = A˜ = A = B T j = B˜ T j l k k ∂x˜k i ∂x˜k j i ∂x˜k ∂xj l i ∂xi ∂x˜l B˜ T˜l T j = 0, ⇒ l k − ∂x˜k ∂xj i   which must be true B˜ . This is possible only if the contents of the parentheses is zero, ∀ l whence: ∂xi ∂x˜l T˜l = T j , k ∂x˜k ∂xj i j and T i transforms as a rank 2 mixed tensor.

3.4 The permutation tensors Definition 3.9. The Levi-Civita symbol, εijk, also known as the three-dimensional permu- tation parameter, is given by:

1 for i, j, k an even permutation of 1, 2, 3; ijk εijk = ε = 1 for i, j, k an odd permutation of 1, 2, 3; (53) − 0 ifanyof i, j, k are the same.

As it turns out, εijk is nota tensor5, though its indices will still participate in Einstein summation conventions where applicable and unless otherwise noted. As written in equation (53), there are two “flavours” of the Levi-Civita symbol—one with covariant-like indices,

5Technically, εijk is a , a distinction we will not need to make in this primer. The metric 19

one with contravariant-like indices—which are used as convenient. Numerically, the two are equal. There are two very common uses for εijk. First, it is used to represent vector cross- products: C = (A~ B~ ) = ε AiBj. (54) k × k ijk In a similar vein, we shall see in 5.5 how it, or at least the closely related permutation tensor § defined below, is used in the definition of the tensor curl. Second, and most importantly, ε is used to represent determinants. If A is a 3 3 ijk × matrix, then its determinant, A, is given by:

ijk A = ε A1iA2jA3k, (55) which can be verified by direct application of equation (53). Indeed, determinants of higher dimensioned matrices may be represented by permutation parameters of higher rank and dimension. Thus, the determinant of an m m matrix, B, is given by: ×

i1i2...im B = ε B1i1 B2i2 ...Bmim ,

where both the rank and dimension of εi1i2...im is m (though the rank of matrix B is still 2).

6 i i′ Theorem 3.4. Consider two 3-dimensional coordinate systems , x and x˜ , and let x,x˜ be the Jacobian determinant, namely: J

∂x1 ∂x1 ∂x1 ∂x˜1 ∂x˜2 ∂x˜3 i ∂x ∂x2 ∂x2 ∂x2 = ′ = 1 2 3 Jx,x˜ ∂x˜i ∂x˜ ∂x˜ ∂x˜ ∂x3 ∂x3 ∂x3 1 2 3 ∂x˜ ∂x˜ ∂x˜

If A and A˜ are the same rank 2, 3-dimensional tensor in each of the two coordinate systems, and if A and A˜ are their respective determinants, then

= A/A.˜ (56) Jx,x˜ q Proof. We start with the observation that:

ijk εpqrA = ε ApiAqjArk, (57) is logically equivalent to equation (55). This can be verified by direct substitution of all possible cases. Thus, if (p,q,r) is an even permutation of (1, 2, 3), εpqr = 1 on the LHS while the matrix A on the RHS effectively undergoes an even number of row swaps, leaving the determinant unchanged. If (p,q,r) is an odd permutation of (1, 2, 3), ε = 1 while A pqr − undergoes an odd number of row swaps, negating the determinant. In both cases, equation (57) is equivalent to equation (55). Finally, if any two of (p,q,r) are equal, εpqr = 0 and the determinant, now of a matrix with two identical rows, would also be zero.

6The extension to m is straight-forward. The metric 20

Rewriting equation (57) in thex ˜ coordinate system, we get:

i′j′k′ εp′q′r′ A˜ = ε A˜p′i′ A˜q′j′ A˜r′k′

p i q j r k i′j′k′ ∂x ∂x ∂x ∂x ∂x ∂x = ε ′ ′ A ′ ′ A ′ ′ A ∂x˜p ∂x˜i pi ∂x˜q ∂x˜j qj ∂x˜r ∂x˜k rk i j k p q r i′j′k′ ∂x ∂x ∂x ∂x ∂x ∂x = ε ′ ′ ′ A A A ′ ′ ′ ∂x˜i ∂x˜j ∂x˜k pi qj rk ∂x˜p ∂x˜q ∂x˜r εijk Jx,x˜ | {z } where the underbrace is a direct application of equation (57). Continuing. . . ∂xp ∂xq ∂xr ′ ′ ′ ijk ε A˜ = ε A A A ′ ′ ′ ⇒ p q r pi qj rk ∂x˜p ∂x˜q ∂x˜r Jx,x˜ εpqrA | ∂x{zp ∂xq }∂xr = ε ′ ′ ′ A pqr ∂x˜p ∂x˜q ∂x˜r Jx,x˜ ε ′ ′ ′ p q r Jx,x˜ 2 = |ε ′ ′ ′ ( {z ) A } p q r Jx,x˜ 2 ε ′ ′ ′ A˜ ( ) A = 0 = A/A.˜ ⇒ p q r − Jx,x˜ ⇒ Jx,x˜  q Theorem 3.5. If g = det gij is the determinant of the metric tensor, then the entities:

ijk 1 ijk ǫ = ε ; ǫijk = √gεijk, (58) √g

ijk are rank 3 tensors. ǫ and ǫijk are known, respectively, as the contravariant and covariant permutation tensors.

′ ′ ′ ′ Proof. Considerǫ ˜i j k in thex ˜i coordinate system. In transforming it to the xi coordinate system, we would write:

i j k i j k i′j′k′ ∂x ∂x ∂x 1 i′j′k′ ∂x ∂x ∂x 1 ijk g˜ 1 ijk ijk ǫ˜ ′ ′ ′ = ε ′ ′ ′ = ε = ε = ǫ , ∂x˜i ∂x˜j ∂x˜k √g˜ ∂x˜i ∂x˜j ∂x˜k √g˜ sg √g εijk Jx,x˜ | {z } ijk using first equation (57), then equation (56) with Aij = gij. Thus, ǫ transforms like a rank 3 contravariant tensor. Further, its covariant conjugate is given by:

ijk 1 ijk ǫpqr = gpigqjgrkǫ = ε gpigqjgrk = √gεpqr, √g εpqrg

and √gεpqr is a rank 3 covariant tensor. | {z } 4 Tensor derivatives

While the of a scalar, ∂f/∂xi, is the prototypical covariant rank 1 tensor (equation 8), we get into trouble as soon as we try taking the derivative of a tensor of any higher rank. Consider the transformation of ∂Ai/∂xj from the xi coordinate system tox ˜p:

∂A˜p ∂xj ∂ ∂x˜p ∂xj ∂x˜p ∂Ai ∂xj ∂2x˜p = Ai = + Ai. (59) ∂x˜q ∂x˜q ∂xj ∂xi ∂x˜q ∂xi ∂xj ∂x˜q ∂xj ∂xi   Now, if ∂Ai/∂xj transformed as a tensor, we would have expected only the first term on the RHS. The presence of the second term means that ∂Ai/∂xj is not a tensor, and we therefore need to generalise our definition of tensor differentiation if we want equations involving tensor derivatives to maintain their tensor invariance.

Before proceeding, however, let us consider an alternate and, as it turns out, incorrect approach. One might be tempted to write, as was I in preparing this primer:

∂A˜p ∂ ∂x˜p ∂x˜p ∂Ai ∂ ∂x˜p ∂x˜p ∂xj ∂Ai ∂ ∂x˜p = Ai = + Ai = + Ai . ∂x˜q ∂x˜q ∂xi ∂xi ∂x˜q ∂x˜q ∂xi ∂xi ∂x˜q ∂xj ∂xi ∂x˜q   p q p p i As written, the last term would be zero since ∂x˜ /∂x˜ = δ q, and ∂δ q/∂x = 0. This clearly disagrees with the last term in equation (59), so what gives? Sincex ˜q and xi are not linearly independent of each other, their order of differentiation may not be swapped, and the second term on the RHS is bogus.

Returning to equation (59), rather than taking the derivative of a single vector compo- i nent, take instead the derivative of the full vector A~ = A ei (equation 36):

∂A~ ∂(Aie ) ∂Ai ∂e = i = e + i Ai. (60) ∂xj ∂xj ∂xj i ∂xj The first term accounts for the rate of change of the vector component, Ai, from point to point, while the second term accounts for the rate of change of the basis vector, ei. Both terms are of equal importance and thus, to make progress in differentiating a general vector, we need to understand how to differentiate a basis vector.

4.1 “Christ-awful symbols”

j If ei is one of m covariant basis vectors spanning an m-dimensional space, then ∂ei/∂x is a vector within that same m-dimensional space and therefore can be expressed as a linear combination of the m basis vectors:

k Definition 4.1. The Christoffel symbols of the second kind, Γij, are the components of the j vector ∂ei/∂x relative to the basis ek. Thus, ∂e i = Γk e (61) ∂xj ij k

21 Tensor derivatives 22

l el To get an expression for Γij by itself, we take the dot product of equation (61) with (cf., equation 38) to get: ∂e i el = Γk e el = Γl . (62) ∂xj · ij k · ij l δk | {z } Theorem 4.1. The Christoffel symbol of the second kind is symmetric in its lower indices.

Proof. Recalling definition 3.5, we write: ∂e ∂ ∂~r ∂ ∂~r ∂e Γl = i el = x el = x el = j el = Γl . ij ∂xj · ∂xj ∂xi · ∂xi ∂xj · ∂xi · ji

Definition 4.2. The Christoffel symbols of the first kind, Γij k, are given by:

l l lk Γij k = glkΓij; Γij = g Γij k. (63)

Remark 4.1. It is easy to show that Γij k is symmetric in its first two indices. A note on notation. For Christoffel symbols of the first kind, most authors use [ij, k] l l instead of Γij k, and for the second kind many use ij instead of Γij. While the Christoffel symbols are not tensors (as will be shown later) and thus up/down indices do not indicate  contravariance/covariance, I prefer the Γ notation because, by definition, the two kinds of Christoffel symbols are related through the metric just like conjugate tensors. While it is only the non-symmetric index that can be raised or lowered on a Christoffel symbol, this still makes this notation useful. Further, we shall find that it is practical to allow Christoffel symbols to participate in the Einstein summation convention, and thus we do not enclose their indices in parentheses. For the cognoscenti, it is acknowledged that the Γ notation is normally reserved for a quantity called the affine connexion, a concept from differential geometry and theory. It plays an important role in General Relativity, where one can show that the l l affine connexion, Γij, is equal to the Christoffel symbol of the second kind, ij (Weinberg, and Cosmology, ISBN 0-471-92567-5, pp. 100–101), whence my inclination to  borrow the Γ notation for Christoffel symbols. Using equations (62) and (63), we can write:

∂e ∂e Γ = g Γl = g el i = e i . (64) ij k lk ij lk · ∂xj k · ∂xj Now from remark 3.4, we have g = e e , and thus, ij i · j ∂g ∂e ∂e ij = e j + e i = Γ +Γ , (65) ∂xk i · ∂xk j · ∂xk jk i ik j using equation (64). Permuting the indices on equation (65) twice, we get:

∂g ∂g ki = Γ +Γ ; and jk = Γ +Γ . (66) ∂xj ij k kj i ∂xi kij jik Tensor derivatives 23

1 2 3 (x , x , x ) Γ22 1 Γ33 1 Γ12 2 Γ21 2 Γ33 2 Γ13 3 Γ23 3 Γ31 3 Γ32 3 (z,̺,ϕ) 0 0 00 ̺ 0 ̺ 0 ̺ − r2 r2 r2 (r, ϑ, ϕ) r r sin2ϑr r sin 2ϑ r sin2ϑ sin 2ϑ r sin2ϑ sin 2ϑ − − − 2 2 2

1 1 2 2 2 3 3 3 3 Γ22 Γ33 Γ12 Γ21 Γ33 Γ13 Γ23 Γ31 Γ32 1 1 (z,̺,ϕ) 0 0 00 ̺ 0 0 − ̺ ̺ 1 1 1 1 (r, ϑ, ϕ) r r sin2ϑ 1 sin 2ϑ cot ϑ cot ϑ − − r r − 2 r r

Table 2: Christoffel symbols for cylindrical and spherical polar coordinates, as given by equation (68). All Christoffel symbols not listed are zero.

By combining equations (65) and (66), and exploiting the of the first two indices on the Christoffel symbols, one can easily show that: 1 ∂g ∂g ∂g glk ∂g ∂g ∂g Γ = jk + ki ij Γl = jk + ki ij . (67) ij k 2 ∂xi ∂xj − ∂xk ⇒ ij 2 ∂xi ∂xj − ∂xk     For a general 3-D coordinate system, there are 27 Christoffel symbols of each kind (15 of which are independent), each with as many as nine terms, whence the title of this subsection. However, for orthogonal coordinates where g δ and g = h2 =1/gii, things ij ∝ ij ii (i) get much simpler. In this case, Christoffel symbols fall into three categories as follows (no sum convention): 1 ∂g Γ = g Γi = ii for i, j =1, 2, 3 (15 components) ij i ii ij 2 ∂xj 1 ∂g Γ = g Γj = ii for i = j (6 components) (68) ii j jj ii −2 ∂xj 6

Γ = g Γk =0 for i = j = k (6 components) ij k kk ij 6 6 In this primer, our examples are restricted to the most common orthogonal coordinate systems in 3-space, namely Cartesian, cylindrical, and spherical polar where the Christoffel symbols aren’t so bad to deal with. For Cartesian coordinates, all Christoffel symbols are zero, while those for cylindrical and spherical polar coordinates are given in Table 2. To determine how Christoffel symbols transform under coordinate transformations, we first consider how the metric derivative transforms from coordinate system xi tox ˜p. Thus, ∂g˜ ∂ ∂xi ∂xj ∂g ∂xk ∂xi ∂xj ∂2xi ∂xj ∂xi ∂2xj pq = g = ij + g + g . (69) ∂x˜r ∂x˜r ij ∂x˜p ∂x˜q ∂xk ∂x˜r ∂x˜p ∂x˜q ij ∂x˜r∂x˜p ∂x˜q ij ∂x˜p ∂x˜r∂x˜q   Permute indices (p,q,r) (q,r,p) (r, p, q) and (i, j, k) (j, k, i) (k, i, j) to get: → → → → Tensor derivatives 24

∂g˜ ∂g ∂xi ∂xj ∂xk ∂2xj ∂xk ∂xj ∂2xk qr = jk + g + g ; (70) ∂x˜p ∂xi ∂x˜p ∂x˜q ∂x˜r jk ∂x˜p∂x˜q ∂x˜r jk ∂x˜q ∂x˜p∂x˜r ∂g˜ ∂g ∂xj ∂xk ∂xi ∂2xk ∂xi ∂xk ∂2xi rp = ki + g + g , (71) ∂x˜q ∂xj ∂x˜q ∂x˜r ∂x˜p ki ∂x˜q∂x˜r ∂x˜p ki ∂x˜r ∂x˜q∂x˜p

Using equations (69)–(71), we construct Γpqr according to the first of equations (67) to get:

1 ∂g ∂xi ∂xj ∂xk ∂2xi ∂xj ∂xi ∂2xj Γ˜ = jk + g + g pqr 2 ∂xi ∂x˜p ∂x˜q ∂x˜r ij ∂x˜p∂x˜q ∂x˜r ij ∂x˜q ∂x˜p∂x˜r  ∂g ∂xj ∂xk ∂xi ∂2xi ∂xj ∂xi ∂2xj + ki + g + g (72) ∂xj ∂x˜q ∂x˜r ∂x˜p ij ∂x˜q∂x˜r ∂x˜p ij ∂x˜r ∂x˜q∂x˜p ∂g ∂xk ∂xi ∂xj ∂2xi ∂xj ∂xi ∂2xj ij g g , − ∂xk ∂x˜r ∂x˜p ∂x˜q − ij ∂x˜r∂x˜p ∂x˜q − ij ∂x˜p ∂x˜r∂x˜q  where the indices in the terms proportional to metric derivatives have been left unaltered, and where the dummy indices in the terms proportional to the metric have been renamed i and j. Now, since the metric is symmetric, gij = gji, we can write the third term on the RHS of equation (72) as: ∂xi ∂2xj ∂xi ∂2xj ∂xj ∂2xi g = g = g , ij ∂x˜q ∂x˜p∂x˜r ji ∂x˜q ∂x˜p∂x˜r ij ∂x˜q ∂x˜p∂x˜r where the dummy indices were once again renamed after the second equal sign. Performing the same manipulations to the sixth and ninth terms on the RHS of equation (72), one finds that the third and eighth terms cancel, the fifth and ninth terms cancel, and the second and sixth terms are the same. Thus, equation (72) simplifies mercifully to: 1 ∂g ∂g ∂g ∂xi ∂xj ∂xk ∂xj ∂2xi Γ˜ = jk + ki ij + g pqr 2 ∂xi ∂xj − ∂xk ∂x˜p ∂x˜q ∂x˜r ij ∂x˜r ∂x˜p∂x˜q   ∂xi ∂xj ∂xk ∂xj ∂2xi = Γ + g , (73) ij k ∂x˜p ∂x˜q ∂x˜r ij ∂x˜r ∂x˜p∂x˜q and the Christoffel symbol of the first kind does not transform like a tensor because of the second term on the right hand side. Like the ordinary derivative of a first rank tensor (equation 59), what prevents Γij k from transforming like a tensor is a term proportional to the second derivative of the coordinates. This important coincidence will be exploited when we define the in the next subsection. Finally, to determine how the Christoffel symbol of the second kind transforms, we need only multiply equation (73) by: ∂x˜r ∂x˜s g˜rs = gkl , ∂xk ∂xl to get: ∂xi ∂xj ∂xk ∂x˜r ∂x˜s ∂xj ∂x˜r ∂x˜s ∂2xi Γ˜s = Γl + gkl g pq ij ∂x˜p ∂x˜q ∂x˜r ∂xk ∂xl ij ∂x˜r ∂xk ∂xl ∂x˜p∂x˜q 1 j δ k

| {z } |gik{z }

l | δ i{z } | {z } Tensor derivatives 25

∂xi ∂xj ∂x˜s ∂x˜s ∂2xl Γ˜s = Γl + . (74) ⇒ pq ij ∂x˜p ∂x˜q ∂xl ∂xl ∂x˜p∂x˜q

l Once again, all that stops Γij from transforming like a tensor is the second term proportional to the second derivative.

4.2 Covariant derivative Substituting equation (61) into equation (60), we get:

∂A~ ∂Ai ∂Ai = e +Γk e Ai = +Γi Ak e , (75) ∂xj ∂xj i ij k ∂xj jk i   where the names of the dummy indices i and k are swapped after the second equality.

Definition 4.3. The covarient derivative of a contravariant vector, Ai, is given by:

∂Ai Ai +Γi Ak, (76) ∇j ≡ ∂xj jk where the adjective covariant refers to the fact that the index on the differentiation operator (j) is in the covariant (lower) position.

Thus, equation (75) becomes:

∂A~ = Aie . (77) ∂xj ∇j i

Thus, the ith contravariant component of the vector ∂A/∂x~ j relative to the covariant basis th i ei is the covariant derivative of the i contravariant component of the vector, A , with respect to the coordinate xj. In general, covariant derivatives are much more cumbersome than partial derivatives as the covariant derivative of any one tensor component involves all tensor components for non-zero Christoffel symbols. Only for Cartesian coordinates— where all Christoffel symbols are zero—do covariant derivatives reduce to ordinary partial derivatives. Consider now the transformation of the covariant derivative of a contravariant vector from the coordinate system xi tox ˜p. Thus, using equations (59) and (74), we have:

∂A˜p ˜ A˜p = + Γ˜p A˜r ∇q ∂x˜q qr ∂xj ∂x˜p ∂Ai ∂xj ∂2x˜p ∂xj ∂xk ∂x˜p ∂x˜p ∂2xi ∂x˜r = + Ai + Γi + Al ∂x˜q ∂xi ∂xj ∂x˜q ∂xj∂xi jk ∂x˜q ∂x˜r ∂xi ∂xi ∂x˜q∂x˜r ∂xl   ∂xj ∂x˜p ∂Ai ∂xj ∂x˜p ∂xk ∂x˜r ∂xj ∂2x˜p ∂x˜p ∂2xi ∂x˜r = +Γi Al + Ai + Al. (78) ∂x˜q ∂xi ∂xj jk ∂x˜q ∂xi ∂x˜r ∂xl ∂x˜q ∂xj ∂xi ∂xi ∂x˜q∂x˜r ∂xl k δ l | {z } Tensor derivatives 26

Now for some fun. Remembering we can swap the order of differentiation between linearly independent quantities, and exploiting our freedom to rename dummy indices at whim, we rewrite the last term of equation (78) as: ∂x˜p ∂x˜r ∂ ∂xi ∂x˜p ∂ ∂xi ∂ ∂x˜p ∂xi ∂xi ∂ ∂x˜p Al = Al = Al ∂xi ∂xl ∂x˜r ∂x˜q ∂xi ∂xl ∂x˜q ∂xl ∂xi ∂x˜q − ∂x˜q ∂xl ∂xi 0     ✚✚❃p i 2 p j 2 p ∂ ∂✚x˜ ∂x ∂ x˜ l ∂x ∂ x˜ i = ✚ A = A , ✚∂xl ∂x˜q − ∂x˜q ∂xl∂xi −∂x˜q ∂xj ∂xi   p q p where the term set to zero is zero because ∂x˜ /∂x˜ = δ q whose derivative is zero. Thus, the last two terms in equation (78) cancel, which then becomes: ∂xj ∂x˜p ∂Ai ∂xj ∂x˜p ˜ A˜p = +Γi Ak = Ai, ∇q ∂x˜q ∂xi ∂xj jk ∂x˜q ∂xi ∇j   and the covariant derivative of a contravariant vector is a mixed rank 2 tensor. Our results are for a contravariant vector because we chose to represent the vector i i A~ = A ei in equation (60). If, instead, we chose A~ = Aie , we would have found that: ∂ei = Γi ek (79) ∂xj − jk instead of equation (61), and this would have lead to:

Definition 4.4. The covarient derivative of a covariant vector, Ai, is given by: ∂A A i Γk A . (80) ∇j i ≡ ∂xj − ij k i In the same way we proved jA is a rank 2 mixed tensor, one can show that jAi is a rank 2 covariant tensor. Notice∇ the minus sign in equation (80), which distinguishes∇ covariant derivatives of covariant vectors from covariant derivatives of contravariant vec- tors. In principle, contravariant derivatives ( j) can also be defined for both covariant and contravariant vectors, though these are rarely∇ used in practise. A note on notation. While most branches of mathematics have managed to converge to a prevailing nomenclature for its primary constructs, tensor calculus is not one of them. To wit, A = A = A = A , ∇k i i;k i/k j|k are all frequently-used notations for covariant derivatives of covariant vectors. Some authors even use Ai,k (comma, not a semi-colon), which can be very confusing since other authors use the comma notation for partial derivatives: ∂A ∂ A = A = i . k i i,k ∂xk

In this primer, I shall use exclusively the nabla notation ( kAi) for covariant derivatives, ∇ k and either the full Leibniz notation for partial derivatives(∂Ai/∂x ) as I have been doing so far, or the abbreviated Leibniz notation (∂kAi) when convenient. In particular, I avoid like the plague the semi-colon (Ai;k) and comma (Ai,k) conventions. Tensor derivatives 27

Theorem 4.2. The covariant derivatives of the contravariant and covariant basis vectors are zero.

Proof. Starting with equation (76),

ei = ∂ ei +Γi ek = 0, ∇j j jk from equation (79). Similarly, starting with equation (80),

e = ∂ e Γk e = 0, ∇j i j i − ij k from equation (61). Covariant derivatives of higher rank tensors are often required, and are listed below without proof. Covariant derivatives of all three types of rank 2 tensors are:

T ij = ∂ T ij +Γi T αj +Γj T iα (T contravariant); (81) ∇k k kα kα T i = ∂ T i +Γi T α Γα T i (T mixed); (82) ∇k j k j kα j − kj α T j = ∂ T j Γα T j +Γj T α (T mixed); (83) ∇k i k i − ki α kα i T = ∂ T Γα T Γα T (T covariant). (84) ∇k ij k ij − ki αj − kj iα More generally, the covariant derivative of a mixed tensor of rank p + q = n is given by:

j1...jq j1...jq α j1...jq α j1...jq kTi1...ip = ∂kTi1...ip Γki1 Tα,i2...ip . . . Γkip Ti1...ip−1α ∇ − − − (85) j1 α,j2...jq jq j1...jq−1α + ΓkαTi1...ip + . . . + ΓkαTi1...ip .

In general, a covariant derivative of a rank n tensor with p covariant indices and q contravari- ant indices will itself be a rank n + 1 tensor with p + 1 covariant indices and q contravariant indices.

Theorem 4.3. Summation rule: If A and B are two tensors of the same rank, dimension- ality, and type, then i(A + B) = iA + iB, where the indices have been omitted for generality. ∇ ∇ ∇

Proof. The proof for a general tensor is awkward, and no more illuminating than for the special case of two rank 1 contravariant tensors:

(Aj + Bj) = ∂ (Aj + Bj)+Γj (Ak + Bk) = (∂ Aj +Γj Ak)+(∂ Bj +Γj Bk) ∇i i ik i ik i ik = Aj + Bj. ∇i ∇i Theorem 4.4. : If A and B are two tensors of possibly different rank, dimen- sionality, and type, then (AB)= A B + B A. ∇i ∇i ∇i Tensor derivatives 28

jk Proof. Consider a rank 2 contravariant tensor, A and a rank 1 covariant tensor, Bl. The jk product A Bl is a mixed rank 3 tensor and its covariant derivative is given by an application of equation (85):

(AjkB ) = ∂ (AjkB )+Γj AαkB +Γk AjαB ΓαAjkB ∇i l i l iα l iα l − il α = Ajk∂ B + B ∂ Ajk + B Γj Aαk + B Γk Ajα AjkΓαB i l l i l iα l iα − il α = Ajk(∂ B ΓαB )+ B (∂ Ajk +Γj Aαk +Γk Ajα) i l − il α l i iα iα = Ajk B + B Ajk. ∇i l l∇i The proof for tensors of general rank follows the same lines, though is much more cumbersome to write down.

Theorem 4.5. Ricci’s Theorem: The covariant derivative of the metric and its inverse vanish.

Proof. From equation (84), we have:

g = ∂ g Γα g Γα g = ∂ g Γ Γ ∇k ij k ij − ki αj − kj iα k ij − kij − kj i 1 1 = ∂ g (∂ g + ∂ g ∂ g ) (∂ g + ∂ g ∂ g ) = 0, k ij − 2 k ij i jk − j ki − 2 k ji j ik − i kj owing to the symmetry of the metric tensor. As for its inverse, gij, we first note from equation (83) that: δ j = ∂ δ j Γα δ j +Γj δ α = 0 Γj +Γj = 0, ∇k i k i − ki α kα i − ki ki

αj j k(giαg ) = kδi = 0 ⇒ ∇ ∇ ✟✟✯ 0 = g gαj + gαj ✟g = g gαj, iα∇k ✟∇k iα iα∇k αj using the product rule (Theorem 4.4). We can’t conclude directly from this that kg = 0 since we are not allowed to “divide through” by a tensor component, particularly∇ one implicated in a summation. We can, however, multiply through by the tensor’s inverse to get: gβig gαj = gβi(0) = 0 gβj = 0. ⇒ iα ∇k ⇒ ∇k β δ α This is not to say that| {z } the metric is a constant function of the coordinates. Indeed, except for Cartesian coordinates, ∂kgij will, in general, not be zero. The covariant derivative not only measures how functions change from point to point, it also takes into account how the basis vectors themselves change (in magnitude, direction, or both) as a function of position, and it is the sum of these two changes that is zero for the metric tensor.

Corollary 4.1. The metric “passes through” a covariant derivative operator. That is:

T i = g T iα = g T iα. ∇k j ∇k αj αj∇k Tensor derivatives 29

Proof. From the product rule for covariant derivatives (Theorem 4.4), ✟✟✯ 0 g T iα = g T iα + T iα ✟g = g T iα, ∇k αj jα∇k ✟∇k αj αj∇k as desired. The same can be shown for the metric inverse, gij. Now if one can take a covariant derivative once, second order and higher covariant derivatives must also be possible. Thus and for example, taking the covariant derivative of equation (76), we get:

Ai Ai = (∂ Ai +Γi Aα) B i ∇k∇j ≡ ∇jk ∇k j jα ≡ ∇k j = ∂ B i Γβ B i +Γi B β k j − kj β kβ j = ∂ ∂ Ai + ∂ (Γi Aα) Γβ (∂ Ai +Γi Aα)+Γi (∂ Aβ +Γβ Aα) k j k jα − kj β βα kβ j jα = ∂ Ai +Γi ∂ Aα Γα ∂ Ai +Γi ∂ Aα + Aα(∂ Γi Γβ Γi +Γi Γβ ), (86) jk jα k − kj α kα j k jα − kj βα kβ jα not a pretty sight. Again, for Cartesian coordinates, all but the first term disappears. For other coordinate systems, it can get ugly fast. Four of the seven terms are single sums, two are double sums and there can be as many as 31 terms to calculate for every one of 27 components in 3-space! Aggravating the situation is the fact that the order of covariant i i j differentiation cannot, in general, be swapped. Thus, while ∂jkA = ∂kjA so long as x and k i i x are independent, jkA = kjA because the last term on the RHS of equation (86) is not, in general, symmetric∇ in6 the∇ interchange of j and k7.

7Note, however, that all other terms are symmetric (second and fourth together), including the fifth term which can be shown to be symmetric in j and k with the aid of equation 62. 5 Connexion to vector calculus

For many applications, it is useful to apply the ideas of tensor analysis to three-dimensional vector analysis. For starters, this gives us another way to see how the metric factors arise in the definitions of the gradient of a scalar, and the divergence and curl of a vector. More im- portantly, it allows us to write down covariant expressions for more complicated derivatives, such as the gradient of a vector, and to prove certain tensor identities.

5.1 Gradient of a scalar

The prototypical covariant tensor of rank 1, ∂if whose transformation properties are given by equation (8), was referred to as the “gradient”, though it is not the physical gradient we would measure. The physical gradient, f, is related to the covariant gradient, ∂if, by equation (31), namely ( f) =(∂ f)/h for∇ orthogonal coordinates. Thus, ∇ (i) i (i) 1 1 1 f = ∂ f, ∂ f, ∂ f . (87) ∇ h 1 h 2 h 3  (1) (2) (3)  For non-orthogonal coordinates, one would use equation (30) which would yield a somewhat more complicated expression for the gradient where each component becomes a sum.

5.2 Divergence of a vector Consider the contraction of the covariant derivative of a contravariant vector,

Ai = ∂ Ai +Γi Aj. (88) ∇i i ij Now, from the second of equations (67),

Γi = 1 gki(∂ g + ∂ g ∂ g ) = 1 (gki∂ g + gki∂ g gki∂ g ) ij 2 i jk j ki − k ij 2 i jk j ki − k ij = 1 (gki∂ g + gki∂ g gik∂ g ) (swap dummy indices in 3rd term) 2 i jk j ki − i kj = 1 (gki∂ g + gki∂ g gki∂ g ) (symmetry of metric in 3rd term) 2 i jk j ki − i jk 1 ki = 2 g ∂jgki.

Thus, equation (88) becomes:

Ai Ai = ∂ Ai + gjk∂ g , (89) ∇i i 2 i jk where the dummy indices have been renamed in the last term, which is a triple sum. We will simplify this triple sum considerably by what may seem to be a rather circuitous route.

Theorem 5.1. (Jacobi’s Formula) Let Qij be a rank 2 covariant tensor of dimension m (and thus can be represented by an m m matrix), and let Q = det(Q ) be its determinant. × ij

30 Connexion to vector calculus 31

ji 8 ji Let be the cofactor of Qij , and thus as a matrix, is the of the cofactors of 9Q Q Qij . Then, ∂ Q = ji∂ Q Jacobi’s formula, (90) k Q k ij where the double sum yields the trace of the product of the matrices ji and ∂ Q . Q k ij

Proof. Q can be thought of as a function of the matrix elements, Qij, and thus we have by the chain rule: ∂Q ∂kQ = ∂kQij, (91) ∂Qij a double sum. Now, Laplace’s formula for computing the determinant is:

m Q = Q ki for any i =1,...,m (no sum on i) ikQ Xk=1 m m ki ∂Q ∂ ki ∂Qik ki ∂ = Qik = + Qik Q . (92) ⇒ ∂Qij ∂Qij Q ∂Qij Q ∂Qij Xk=1 Xk=1   j Now, ∂Qik/∂Qij = δk since the matrix elements are independent of each other. Further, ki ki ∂ /∂Qij = 0 since the cofactor includes all matrix elements other than those in column Q Q th i and row k and must therefore be independent of Qij which is an element in the i column. Thus, equation (92) simplifies to:

m ∂Q j ki ji = δk = . ∂Qij Q Q Xk=1 Substituting this result into equation (91) gives us our desired result.

Now, if Qij = gij, the metric, equation (90) becomes:

∂ g = ji∂ g , (93) k G k ij where ji is the cofactor of g . By a variation of Cramer’s rule, the inverse of g , let us G ij ij write it as gji (equation 20), is given by: 1 gji = ji ji = ggij g G ⇒ G

since gij is symmetric. Substituting this into equation (93) gives us: 1 ∂ g = ggij∂ g gjk∂ g = ∂ g, k k ij ⇒ i jk g i

8In matrix algebra, the cofactor of the ijth matrix element is what one gets when the ith column and jth row are struck out, and the resulting m 1 m 1 matrix is multiplied by 1i+j. 9 ji − × − − is known as the adjugate of Qij . Q Connexion to vector calculus 32

taking the liberty once again to rename the indices. We substitute this result into equation (89) to get:

i i i 1 i i 1 1 i iA = ∂iA + A ∂ig = ∂iA + A ∂i√g = ∂i(√gA ). (94) ∇ 2g √g √g The final equality is known as the Voss-Weyl formula, and finally brings us to the purpose of this subsection. For orthogonal coordinates only, gij is diagonal and √g = h(1)h(2)h(3). Thus, with the aid of equation (29), equation (94) becomes:

i 1 i iA = ∂i(h(1)h(2)h(3)A ) ∇ h(1)h(2)h(3) (95) 1 3 h h h = ∂ (1) (2) (3) A = A,~ h h h i h (i) ∇· (1) (2) (3) i=1 (i) X   recovering the vector calculus definition of the vector divergence in orthogonal coordinates.

5.3 Divergence of a tensor Definition 5.1. The divergence of a contravariant tensor, T, is the contraction of the co- variant derivative with the first index of the tensor, and is itself a contravariant tensor of rank one less than T. Specifically, for a rank 2 tensor, we have:

( T)j T ij, (96) ∇· ≡ ∇i with similar expressions applying for tensors of higher rank.10 Thus, the physical component of the tensor divergence is, by equation (29),

( T) = h ( T)j = h T ij. (97) ∇· (j) (j) ∇· (j)∇i Now, by equation (81), we have:

ij ij i kj j ik 1 ij j ik iT = ∂iT +Γ T +Γ T = ∂i(√gT )+Γ T , (98) ∇ ik ik √g ik using the Voss-Weyl formula (equation 94) on the first two terms of the middle expression. For the last term, we start by examining the j = 1 component:

1 ik 1 11 1 12 1 13 1 21 1 22 1 23 1 31 ΓikT = Γ11T +Γ12T +Γ13T + Γ21 T +Γ22T +Γ23T + Γ31 T 1 32 1 33 Γ1 Γ1 + Γ32T +Γ33T 12 13 |{z} |{z} 10The definition in equation (96) agrees with Weinberg (Gravitation and Cosmology, ISBN 0-471-92567-5, page 107, equation 4.7.9) and disagrees with Stone & Norman, 1992, ApJS, vol. 80, page 788, where they i ij define ( T) = j T . Thus, Weinberg contracts on the first index of T (in keeping with the ordinary rules of matrix∇· multiplication)∇ while SN contract on the second, and these are the same only if T is symmetric. Further, SN seem to have a sign error on the leading term of the second of their equation (130), and similarly the second/third leading term of the second line of their equation (131)/(132). Connexion to vector calculus 33

given the symmetry of the first two indices on the Christoffel symbols. Now from equation ik (32), we have T(ik) = h(i)h(k)T . Further, if we assume orthogonal coordinates (as we do for the remainder of this section), we can use equation (68) and remark 3.1 to write:

j 1 j h(k) j Γjk = ∂kh(j), j,k =1, 2, 3; Γkk = 2 ∂jh(k), j = k; Γik = 0, i = j = k. h(j) − h(j) 6 6 6

Whence, 1 ik ∂1h(1) T(11) ∂2h(1) T(12) ∂3h(1) T(13) ∂2h(1) T(21) ΓikT = 2 + + + h(1) h(1) h(1) h(1)h(2) h(1) h(1)h(3) h(1) h(2)h(1)

h(2) T(22) ∂3h(1) T(31) h(3) T(33) 2 ∂1h(2) 2 + 2 ∂1h(3) 2 − h(1) h(2) h(1) h(3)h(1) − h(1) h(3) 1 T T T = (11) ∂ h (22) ∂ h (33) ∂ h h2 h 1 (1) − h 1 (2) − h 1 (3) (1)  (1) (2) (3) T + T T + T + (12) (21) ∂ h + (13) (31) ∂ h , h 2 (1) h 3 (1) (2) (3)  which, for any j, may be written: 1 Γj T ik = T + T ∂ h T ∂ h . (99) ik h2 h (ji) (ij) i (j) − (ii) j (i) i (j) (i) X    T j This is identically zero if is antisymmetric, as expected since Γik is symmetric in i and k. Note that the dummy indices i on each side of equation (99) are unrelated. Next, in analogy to equation (95), we write:

1 1 h(1)h(2)h(3) ∂ (√gT ij) = ∂ T , (100) g i h h h i h h (ij) √ (1) (2) (3) i (i) (j) X   again using equation (32). Substituting equations (99) and (100) into equation (98), and then substituting that result into equation (97), we get our final expression for the physical component of the divergence of a rank 2 contravariant tensor:

h h h h ( T) = (j) ∂ (1) (2) (3) T ∇· (j) h h h i h h (ij) (1) (2) (3) i (i) (j) X   (101) 1 + T + T ∂ h T ∂ h . h h (ji) (ij) i (j) − (ii) j (i) i (j) (i) X    5.4 The Laplacian of a scalar In vector notation, the Laplacian of a scalar, f, is given by:

2f = f, ∇ ∇ · ∇ Connexion to vector calculus 34

and thus the Laplacian is the divergence of the vector f. Now, 5.2 defines the tensor divergence as an operator acting on a contravariant vector,∇ V i, whereas§ 5.1 defines the § gradiant as a covariant vector, ∂if. Thus, to turn the tensor gradient into a contavariant vector, we need to multiply it by gij, whence:

2 ij 1 ij f = i(g ∂jf) = ∂i(√gg ∂jf). (102) ∇ ∇ √g

ij −1 −1 ij Once again, for orthogonal coordinates, g = h(i) h(j)δ and √g = h(1)h(2)h(3). Thus, equation (102) becomes:

1 3 h h h 2f = ∂ (1) (2) (3) ∂ f . (103) ∇ h h h i h2 i (1) (2) (3) i=1 (i) X   5.5 Curl of a vector Consider the following difference of covariant derivatives of a covariant vector:

A A = ∂ A Γk A ∂ A +Γk A = ∂ A ∂ A , ∇j i − ∇i j j i − ij k − i j ji k j i − i j

because of the symmetry of the lower indices on the Christoffel symbol. Thus, ∂jAi ∂iAj forms a tensor. By contrast, note that in −

Ai Aj = ∂ Ai +Γi Ak ∂ Aj Γj Ak, ∇j − ∇i j jk − i − ik the Christoffel symbols do not cancel, and thus ∂ Ai ∂ Aj does not form a tensor. j − i Now, while the construct ∂jAi ∂iAj is highly reminiscent of a curl, it cannot be what we seek since the curl is a vector (rank− 1 tensor) with just one index, while ∂ A ∂ A is j i − i j a rank 2 tensor with two indices. To form the tensor curl, we use the permutation tensor (equation 58) in a similar manner to how cross products are constructed from the Levi-Civita symbol (equation 54).

Definition 5.2. Given a rank 1 covariant tensor, Aj,

k ijk 1 ijk C ǫ ∂iAj = ε ∂iAj, (104) ≡ √g is the contravariant rank 1 tensor curl. By inspection, one can easily verify that in the implied double sum, all partial derivatives of Aj appear in differences, each being the component of a tensor by the opening argument. Since ǫijk is a component of a rank 3 contravariant tensor, then Ck must be a tensor too. Thus, tensor curls are rank 1 contravariant vectors created from rank 1 covariant vectors. k To get the physical curl, we use equation (29) to get C = C(k)/h(k) (valid for all coordinate systems) and equation (31) to get Aj = A(j)h(j) (valid for orthogonal coordinates only), and substitute these into equation (104) to get: h C = (k) εijk∂ (h A ) (k) g i (j) (j) √ ij X Connexion to vector calculus 35

1 C~ = ∂ (h A ) ∂ (h A ) , ⇒ h h 2 (3) (3) − 3 (2) (2)  (2) (3) 1  ∂3(h(1)A(1)) ∂1(h(3)A(3)) , (105) h(3)h(1) −   1 ∂1(h(2)A(2)) ∂2(h(1)A(1)) = A,~ h(1)h(2) − ∇ ×   the vector calculus definition of the curl for orthogonal coordinates.

5.6 The Laplacian of a vector The Laplacian of a vector, 2A~, can be most easily written down in invariant form by using the identity: ∇ 2A~ = ( A~) ( A~), (106) ∇ ∇ ∇· − ∇ × ∇ × and using the invariant expansions for each of the gradient of a scalar (equation 87), diver- gence of a vector (equation 95), and the curl (equation 105).

5.7 Gradient of a vector The covariant derivative of a covariant vector, known in vector calculus as the vector gradient, is given by equation (80), reproduced below for convenience:

A = ∂ A Γk A G , ∇i j i j − ij k ≡ ij where Gij is a rank 2 covariant tensor. To express this in terms of physical components, we restrict ourselves once again to orthogonal coordinates, where equation (31) A = h A ⇒ j (j) (j) and equation (33) G = h h G . Substituting these into equation (80), we have: ⇒ ij (i) (j) (ij)

1 k ~ G(ij) = ∂i(h(j)A(j)) Γijh(k)A(k) ( A)(ij). (107) h(i)h(j) − ≡ ∇  Xk  Now, for orthogonal coordinates, the Christoffel symbols simplify considerably. Substituting the results of equation (68) into equation (107), we get for the (11) component:

~ 1 1 2 3 ( A)(11) = 2 ∂1(h(1)A(1)) Γ11h(1)A(1) Γ11h(2)A(2) Γ11h(3)A(3) ∇ h(1) − − −  1 = h ∂ A + A ∂ h h2 (1) 1 (1) (1) 1 (1) (1)  1 1 1 A h ∂ g + A h ∂ g + A h ∂ g − (1) (1) 2g 1 11 (2) (2) 2g 2 11 (3) (3) 2g 3 11 11 22 33  1 h h = h ∂ A + A ∂ h A ∂ h + A (1) ∂ h + A (1) ∂ h h2 (1) 1 (1) (1) 1 (1) − (1) 1 (1) (2) h 2 (1) (3) h 3 (1) (1)  (2) (3)  h ∂ A A ∂ h 1 A A A = (1) 1 (1) − (1) 1 (1) + (1) ∂ h + (2) ∂ h + (3) ∂ h h2 h h 1 (1) h 2 (1) h 3 (1) (1) (1)  (1) (2) (3)  Connexion to vector calculus 36

A 1 = ∂ (1) + A~ h . 1 h h · ∇ (1)  (1)  (1) For the (12) component, we get:

~ 1 1 2 3 ( A)(12) = ∂1(h(2)A(2)) Γ12h(1)A(1) Γ12h(2)A(2) Γ12h(3)A(3) ∇ h(1)h(2) − − − 1 1  1 = h ∂ A + A ∂ h A h ∂ g A h ∂ g h h (2) 1 (2) (2) 1 (2) − (1) (1) 2g 2 11 − (2) (2) 2g 1 22 (1) (2)  11 22  ✘ ✘ 1 ✘✘✘ ✘✘✘ = h(2)∂1A(2) + ✘A(2)✘∂1h(2) A(1)∂2h(1) ✘A(2)✘∂1h(2) h(1)h(2) − − 1 A  = ∂ A (1) ∂ h , h 1 (2) − h 2 (1) (1)  (2)  Evidently, all components of A~ may be written as: ∇ A(i) 1 ∂i + A~ h(i), i = j; h(i) h(i) · ∇ ( A~)(ij) =    (108) ∇  1 A(i)  ∂ A ∂ h , i = j. h i (j) − h j (i) 6 (i)  (j)    5.8 Summary  For ease of reference, the main results of this section are gathered with their equation num- bers. If f, A~, and T are arbitrary scalar, vector, and contravariant rank 2 tensor functions of the orthogonal coordinates, we have found:

1 1 1 f = ∂ f, ∂ f, ∂ f ; (87) ∇ h 1 h 2 h 3  (1) (2) (3)  1 h h h 2f = ∂ (1) (2) (3) ∂ f ; (103) ∇ h h h i h2 i (1) (2) (3) i (i) X   1 h h h A~ = ∂ (1) (2) (3) A ; (95) ∇· h h h i h (i) (1) (2) (3) i (i) X   1 1 A~ = ∂ (h A ) ∂ (h A ) , ∂ (h A ) ∂ (h A ) , ∇ × h h 2 (3) (3) − 3 (2) (2) h h 3 (1) (1) − 1 (3) (3)  (2) (3) (3) (1)  1    ∂1(h(2)A(2)) ∂2(h(1)A(1)) ; (105) h(1)h(2) −  

A(i) 1 ∂i + A~ h(i), i = j, h(i) h(i) · ∇ ( A~)(ij) =    (108) ∇  1 A(i)  ∂ A ∂ h , i = j; h i (j) − h j (i) 6 (i)  (j)    Connexion to vector calculus 37

h h h h ( T) = (j) ∂ (1) (2) (3) T ∇· (j) h h h i h h (ij) (1) (2) (3) i (i) (j) X   (101) 1 + T + T ∂ h T ∂ h . h h (ji) (ij) i (j) − (ii) j (i) i (j) (i) X    For non-orthogonal coordinates, these expressions become rather more cumbersome.

5.9 A tensor-vector identity A useful relation in vector calculus, particularly for extending the ideal fluid equations to include viscous stresses, is the following:

Theorem 5.2. If T is a rank 2 tensor and A~ is a vector (rank 1 tensor), then, in terms of their physical components:

(T A~) = T : A~ +( T) A.~ (109) ∇· · ∇ ∇· · Implicit in this identity are the definitions of the “dot” product between two vectors, the “dot” product between a vector and a rank 2 tensor, and the “colon” product between two rank 2 tensors ( 3.2). With these in hand, the proof of the theorem is a simple matter of § bringing together the relevant bits from this primer. Proof. Start with Theorem 4.4, the product rule for covariant differentiation. Thus, if Bi = ij T Aj, then, Bi = (T ijA ) = T ij A + A T ij. (110) ∇i ∇i j ∇i j j∇i Now, from equation (95), Bi = B~ , where B~ is the ordered triple of physical components. ∇i ∇· From equation (42), we have Bi = T ijA =(T A~)i (the right dot product), and thus: j · Bi = (T A~). (111) ∇i ∇· · ij Next, T is a rank 2 contravariant tensor, iAj is a rank 2 covariant tensor and, according to equation (41), ∇ T ij( A ) = T : A.~ (112) ∇i j ∇ Finally, according to equation (96), T ij = ( T )j and, by equation (40), A ( T )j = ∇i ∇· j ∇· A~ ( T). Thus, · ∇· A T ij = A~ ( T). (113) j∇i · ∇· Note the right hand sides of equations (111), (112), and (113) are all in terms of physical components. Substituting these equations into equation (110) proves the theorem. For orthogonal coordinates, we can confirm this identity directly using the results from 5.8. Start with the LHS of equation (109) by substituting equation (45) into equation (95): § 1 h h h 1 h h h (T A~) = ∂ 1 2 3 T A = ∂ 1 2 3 T A . (114) ∇· · h h h i h ij j h h h i h ij j 1 2 3 i i j 1 2 3 ij i X  X  X   Connexion to vector calculus 38

With the understanding that all components are physical components, we drop the paren- theses on the subscripts for convenience. Now, using equation (41) we write:

T : A~ = T ( A~) = T ( A~) + T ( A~) ∇ ij ∇ ij ii ∇ ii ij ∇ ij ij i 6 X X Xi=j A T A T T A = T ∂ i + ii j ∂ h + ij ∂ A ij i ∂ h , ii i h h h j i h i j − h h j i i i i j j ! 6 i i j X   X Xi=j   using equation (108). Then, from equation (101) we have: A h h h h A ( T) A~ = j j ∂ 1 2 3 T + j T + T ∂ h T ∂ h . ∇· · h h h i h h ij h h ji ij i j − ii j i j 1 2 3 i  i j  ij j i X X X    Thus, the RHS of equation (109) becomes: ✟ Tii TiiAi TiiAj ✟ Tij T : A~ +( T) A~ = ∂ A ∂ h + ✟✟∂ h + ∂ A ∇ ∇· · h i i − h2 i i ✟h h j i h i j i i i i ij✟ i j 6 i X X ✟X Xi=j TijAi Ajhj h1h2h3 AjTji ∂jhi + ∂i Tij + ∂ihj − hihj h1h2h3 hihj hjhi i=6 j ij   ij X X ✟ X AjTij AjT✟ii ✟ swap i and j + ∂ h ✟ ∂ h h h i j − ✟h h j i ij j i ij✟ j i | {z } X ✟X T T T A T A = ii ∂ A + ij ∂ A ii i ∂ h ij i ∂ h h i i h i j − h2 i i − h h j i i i 6 i i i 6 i j X Xi=j X Xi=j ✟ Tij TijA✟i ✟ ∂iAj ∂ h ✟✟ j i | h{zi } | − h{zihj } ij ✟ij✟ X X ✟ Ajhj h1h2h3 AiTij ✟ AjTij + ∂ T + ✟✟∂ h + ∂ h h h h i h h ij ✟h h j i h h i j ij 1 2 3 i j ij✟ i j ij j i X   ✟X X A h h h h T A T = j j ∂ 1 2 3 T + ij ∂ A + j ij ∂ h h h h i h h ij h i j h h i j ij 1 2 3 i j i j i X     Tij ∂i(Ajhj) | hihj {z } 1 h h h h h h = A h ∂ 1 2 3 T + 1 2 3 T ∂ (A h ) h h h j j i h h ij h h ij i j j 1 2 3 ij i j i j X     1 h h h = ∂ 1 2 3 T A h = LHS (equation 114). h h h i h h ij j j 1 2 3 ij i j X   6 Cartesian, cylindrical, and spherical polar coordi- nates

Table 1 in the beginning of 3 gives the scale factors, h , for each of Cartesian, (x, y, z), § (i) cylindrical, (z,̺,ϕ), and spherical polar, (r, ϑ, ϕ), coordinates. Restricted to these coordi- nate systems, h is a separable function of its arguments, and we can write h (x , x ) 3 3 1 2 ≡ h31(x1)h32(x2), dropping the parentheses from all subscripts now that everything is being expressed in terms of the physical components. The scaling factors then become:

h1 = 1, all; 1, Cartesian and cylindrical, h (x ) = h (x ) = 2 1 31 1 x = r, spherical polar;  1 1, Cartesian, h (x ) = x = ̺, cylindrical, 32 2  2  sin x2 = sin ϑ, spherical polar. With this, the six tensor constructs in 5.8 can then be written in their full gory detail as: § 1 1 f = ∂ f, ∂ f, ∂ f ; ∇ 1 h 2 h 3  2 3 

2 1 1 1 2 f = ∂1(h2h31∂1f)+ 2 ∂2(h32∂2f)+ 2 ∂3 f; ∇ h2h31 h2h32 h3 1 1 1 A~ = ∂1(h2h31A1)+ ∂2(h32A2)+ ∂3A3; ∇· h2h31 h2h32 h3 1 1 1 1 1 A~ = ∂ (h A ) ∂ A , ∂ A ∂ (h A ), ∂ (h A ) ∂ A ; ∇ × h h 2 32 3 − h 3 2 h 3 1 − h 1 31 3 h 1 2 2 − 2 1  2 32 3 3 31 2   ∂1A1 ∂1A2 ∂1A3 1 1 1   ~ ∂2A1 A2∂1h2 ∂2A2 + A1∂1h2 ∂2A3 A = h2 − h2 h2 ; ∇    1 A  1 A  1 A A   3 3 1 2   ∂3A1 ∂1h31 ∂3A2 ∂2h32 ∂3A3 + ∂1h31 + ∂2h32 h3 − h31 h3 − h2h32 h3 h31 h2h32    1 1 1 T T T = ∂ (h h T )+ ∂ (h T )+ ∂ T 22 ∂ h 33 ∂ h , ∇· h h 1 2 31 11 h h 2 32 21 h 3 31 − h 1 2 − h 1 31  2 31 2 32 3 2 31 1 1 1 T21 + T12 T33 ∂1(h31T12)+ ∂2(h32T22)+ ∂3T32 + ∂1h2 ∂2h32, h31 h2h32 h3 h2 − h2h32 1 1 1 T + T T + T ∂ (h T )+ ∂ T + ∂ T + 31 13 ∂ h + 32 23 ∂ h . h 1 2 13 h 2 23 h 3 33 h 1 31 h h 2 32 2 2 3 31 2 32 

39 Cartesian, cylindrical, and spherical polar coordinates 40

6.1 Cartesian coordinates

f = ∂ f, ∂ f, ∂ f ∇ x y z 2f = ∂2f + ∂2f + ∂2f ∇ x y z A~ = ∂ A + ∂ A + ∂ A ∇· x x y y z z A~ = ∂ A ∂ A , ∂ A ∂ A , ∂ A ∂ A ∇ × y z − z y z x − x z x y − y x

∂xAx ∂xAy ∂xAz  A~ = ∂ A ∂ A ∂ A ∇  y x y y y z ∂ A ∂ A ∂ A  z x z y z z    T = ∂ T + ∂ T + ∂ T , ∂ T + ∂ T + ∂ T , ∂ T + ∂ T + ∂ T ∇· x xx y yx z zx x xy y yy z zy x xz y yz z zz  6.2 Cylindrical coordinates

1 f = ∂ f, ∂ f, ∂ f ∇ z ̺ ̺ ϕ   1 1 2f = ∂2f + ∂ (̺∂ f)+ ∂2 f ∇ z ̺ ̺ ̺ ̺2 ϕ 1 1 A~ = ∂ A + ∂ (̺A )+ ∂ A ∇· z z ̺ ̺ ̺ ̺ ϕ ϕ 1 1 A~ = ∂ (̺A ) ∂ A , ∂ A ∂ A , ∂ A ∂ A ∇ × ̺ ̺ ϕ − ϕ ̺ ̺ ϕ z − z ϕ z ̺ − ̺ z    ∂zAz ∂zA̺ ∂zAϕ ∂ A ∂ A ∂ A A~ =  ̺ z ̺ ̺ ̺ ϕ  ∇ 1 1 1  ∂ϕAz ∂ϕA̺ Aϕ ∂ϕAϕ + A̺  ̺ ̺ − ̺     1 1 1 1 T T = ∂ T + ∂ (̺T )+ ∂ T , ∂ T + ∂ (̺T )+ ∂ T ϕϕ , ∇· z zz ̺ ̺ ̺z ̺ ϕ ϕz z z̺ ̺ ̺ ̺̺ ̺ ϕ ϕ̺ − ̺  1 T + T ∂ T + ∂ T + ∂ T + ϕ̺ ̺ϕ z zϕ ̺ ̺ϕ ̺ ϕ ϕϕ ̺  6.3 Spherical polar coordinates

1 1 f = ∂ f, ∂ f, ∂ f ∇ r r ϑ r sin ϑ ϕ   1 1 1 2f = ∂ (r2∂ f)+ ∂ (sin ϑ ∂ f)+ ∂2 f ∇ r2 r r r2 sin ϑ ϑ ϑ r2 sin2ϑ ϕ Cartesian, cylindrical, and spherical polar coordinates 41

1 1 1 A~ = ∂ (r2A )+ ∂ (sin ϑA )+ ∂ A ∇· r2 r r r sin ϑ ϑ ϑ r sin ϑ ϕ ϕ 1 1 1 1 A~ = ∂ (sin ϑA ) ∂ A , ∂ A ∂ (rA ), ∂ (rA ) ∂ A ∇ × r sin ϑ ϑ ϕ − ϕ ϑ r sin ϑ ϕ r − r r ϕ r r ϑ − ϑ r    ∂rAr ∂rAϑ ∂rAϕ 1 1 1   A~ = ∂ϑAr Aϑ ∂ϑAϑ + Ar ∂ϑAϕ ∇ r − r r  1 A 1 A 1 A A   ϕ ϕ r ϑ   ∂ϕAr ∂ϕAϑ ∂ϕAϕ + +  r sin ϑ − r r sin ϑ − r tan ϑ r sin ϑ r r tan ϑ   1 1 1 T + T T = ∂ (r2T )+ ∂ (sin ϑ T )+ ∂ T ϑϑ ϕϕ , ∇· r2 r rr r sin ϑ ϑ ϑr r sin ϑ ϕ ϕr − r  1 1 1 T + T T ∂ (rT )+ ∂ (sin ϑ T )+ ∂ T + ϑr rϑ ϕϕ , r r rϑ r sin ϑ ϑ ϑϑ r sin ϑ ϕ ϕϑ r − r tan ϑ 1 1 1 T + T T + T ∂ (rT )+ ∂ T + ∂ T + ϕr rϕ + ϕϑ ϑϕ r r rϕ r ϑ ϑϕ r sin ϑ ϕ ϕϕ r r tan ϑ  1 1 2T T T T = ∂ T + ∂ T + ∂ T + rr − ϑϑ − ϕϕ + ϑr , r rr r ϑ ϑr r sin ϑ ϕ ϕr r r tan ϑ  1 1 2T + T T T ∂ T + ∂ T + ∂ T + rϑ ϑr + ϑϑ − ϕϕ , r rϑ r ϑ ϑϑ r sin ϑ ϕ ϕϑ r r tan ϑ 1 1 2T + T T + T ∂ T + ∂ T + ∂ T + rϕ ϕr + ϑϕ ϕϑ r rϕ r ϑ ϑϕ r sin ϑ ϕ ϕϕ r r tan ϑ  7 An application to viscosity

The equations of viscid hydrodynamics may be written as:

∂ρ + (ρ~v) = 0; continuity ∂t ∇· ∂~s + (~s~v) = p + T; momentum equation ∂t ∇· −∇ ∇· ∂~v 1  +(~v )~v = p + T ; Euler equation  (115) ∂t · ∇ ρ −∇ ∇·  ∂e  T + (e + p) ~v = (T ~v); total energy equation  ∂t ∇· T ∇· · ∂e   + (e~v) = p ~v + T : ~v, internal energy equation  ∂t ∇· − ∇· ∇  where one uses one of the momentum and Euler equations, and one of the total and internal energy equations. Here, ρ is the density, ~v is the velocity, ~s = ρ~v is the momentum density (and ~s~v is the dyadic product of ~s and ~v; definition 2.3, equation 13), e is the internal energy density, p =(γ 1)e (ideal equation of state) is the thermal pressure, and e = 1 ρv2 + e is − T 2 the total energy density. As for the viscid variables, T is the total viscous tensor (units N m−2), given by:

T = (µ + µ + µ ) S; S = ~v +( ~v)T 2 ~v I, (116) l q ∇ ∇ − 3 ∇· where I is the identity tensor, the superscript T indicates the transpose, and µ is the coefficient of physical shear viscosity (units N m−2 s). For numerical applications, most (M)HD codes are designed with an artificial viscosity, which helps stabilise the flow in stagnant regions and at discontinuities (shocks). These are respectively mediated by the linear and quadratic coefficients µl and µq given by:

µ = q lρc ; µ = q l2ρ min 0, ~v , (117) l 1 s q − 2 ∇· 1 1 ZEUS  where q1 and q2 (corresponding to 2 qlin and 2 qcon in ) are unitless parameters (typically 0.1 and 1 respectively), l is the zone size (maximum of the three dimensions), and cs = γp/ρ is the adiabatic sound speed. Note that the “min” function means µq is positive and that the quadratic viscosity is applied only in regions of compression (e.g., shocks). p This form of the artificial viscosity (identical to the physical viscosity other than the coefficients) is called the tensor artificial viscosity and is due to W.-M. Tscharnuter & K.-H. Winkler (1979, Comput. Phys. Comm., 18, 171; TW). It differs from the more often-followed approach by J. von Neumann & R. D. Richtmyer (1950, J. Appl. Phys., 21, 232; vNR) who set S = ~v, ignore all off-diagonal terms, and replace ~v with ∂ v in the i-direction for ∇ ∇· i i µq (equation 117). Using the expression for A~ at the beginning of 6, the diagonal physical components of S, in Cartesian, cylindrical,∇ or spherical polar coordinate§ s, are given by:

42 An application to viscosity 43

S 1 11 + ~v = v = ∂ v ; (118) 2 3∇· ∇1 1 1 1

S22 1 1 v1 + ~v = 2v2 = ∂2v2 + ∂1h2; (119) 2 3∇· ∇ h2 h2

S33 1 1 v1 v2 + ~v = 3v3 = ∂3v3 + ∂1h31 + ∂2h32. (120) 2 3∇· ∇ h3 h31 h2h32 Note that S = Tr(S) =0, v = ~v, and that each of S are zone-centred (with i ii i ∇i i ∇· ii a 1-average of v1 needed in equations 119 and 120 and a 2-average of v2 needed in equation 120). Meanwhile,P the off-diagonalP components are given by:

v2 1 S12 = S21 = 1v2 + 2v1 = ∂1v2 ∂1h2 + ∂2v1 ∇ ∇ − h2 h2 v 1 = h ∂ 2 + ∂ v ; (121) 2 1 h h 2 1  2  2 v 1 S = S = v + v = h ∂ 3 + ∂ v ; (122) 13 31 ∇1 3 ∇3 1 31 1 h h 3 1  31  3 h v 1 S = S = v + v = 32 ∂ 3 + ∂ v . (123) 23 32 ∇2 3 ∇3 2 h 2 h h 3 2 2  32  3

Note that Sij are naturally centred on the k-edges (i = j = k) with no averages required. We now write down covariant expressions for the6 physical6 components of the vector constructs in equations (115) involving T using the formulæ at the top of 6. Starting with § T, we use the facts that T is traceless (e.g., T = T T ) and symmetric (e.g., ∇· 33 − 11 − 22 T21 = T12), and that h2 = h31 for Cartesian, cylindrical and spherical polar coordinates to get:

1 1 1 T22 T33 ( T)1 = ∂1(h2h31T11)+ ∂2(h32T21)+ ∂3T31 ∂1h2 ∂1h31 ∇· h2h31 h2h32 h3 − h2 − h31

1 3 1 1 = 3 ∂1(h2T11)+ ∂2(h32T21)+ ∂3T31; (124) h2 h2h32 h3

1 1 1 2T12 T33 ( T)2 = ∂1(h31T12)+ ∂2(h32T22)+ ∂3T32 + ∂1h2 ∂2h32, ∇· h31 h2h32 h3 h2 − h2h32

1 3 1 2 T11 1 = 3 ∂1(h2T12)+ 2 ∂2(h32T22)+ ∂2h32 + ∂3T32; (125) h2 h2h32 h2h32 h3

1 1 1 2T13 2T23 ( T)3 = ∂1(h2T13)+ ∂2T23 + ∂3T33 + ∂1h31 + ∂2h32 ∇· h2 h2 h3 h31 h2h32

1 3 1 2 1 = 3 ∂1(h2T13)+ 2 ∂2(h32T23)+ ∂3T33, (126) h2 h2h32 h3 Because of the centring of T S , ( T) is naturally centred at the k-face right where ij ∝ ij ∇· k they are needed (e.g., to accelerate vk), with the exception of the T11 term in equation (125), which must be averaged in the 2-direction. An application to viscosity 44

Next, from equation (114), we have: 1 (T ~v) = ∂ h h T v +T v +T v ∇· · h h 1 2 31 11 1 12 2 13 3 2 31 (127) 1   1 + ∂2 h32 T12v1 +T22v2 +T23v3 + ∂3 T13v1 +T23v2 +T33v3 . h2h32 h3    Finally, from equation (41), we have:

T : ~v = T ( ~v) ∇ ij ∇ ij ij X = T v + T v + T v 11∇1 1 22∇2 2 33∇3 3 + T ( v + v )+ T ( v + v )+ T ( v + v ) 12 ∇1 2 ∇2 1 13 ∇1 3 ∇3 1 23 ∇2 3 ∇3 2 = T 1 S + T 1 S + T 1 S + 1 T + T + T ~v 11 2 11 22 2 22 33 2 33 3 11 22 33 ∇· = Tr(T)=0 + T12S12 + T13S13 + T23S23,  | {z } exploiting the symmetry of T and using equations (118)–(123). Thus,

1 µ∗ T : ~v = T S = S2 , (128) ∇ 2 ij ij 2 ij ij ij X X where µ∗ µ + µ + µ . Alternately, we can write: ≡ l q T : ~v = T ( ~v) = µ∗ S v + µ∗ S v ∇ ij ∇ ij ii∇i i ij∇i j ij i 6 X X Xi=j = µ∗ 2 v 2 ~v v + µ∗ v + v v ∇i i − 3 ∇· ∇i i ∇i j ∇j i ∇i j i i=6 j X  X  2µ∗ µ∗ = 2µ∗ ( v )2 ~v v + v + v 2 ∇i i − 3 ∇· ∇i i 2 ∇i j ∇j i i P ∇ v i i=6 j X j j j X X  2µ∗ = 3( v )2 + 3( |v{z)2}+ 3( v )2 ( v )2 ( v )2 ( v )2 3 ∇1 1 ∇2 2 ∇3 3 − ∇1 1 − ∇2 2 − ∇3 3 ∗  µ 2 2 v v 2 v v 2 v v + v + v − ∇1 1∇2 2 − ∇2 2∇3 3 − ∇3 3∇1 1 2 ∇i j ∇j i i=6 j  X  2µ∗ = ( v )2 2 v v +( v )2 +( v )2 2 v v +( v )2 3 ∇1 1 − ∇1 1∇2 2 ∇2 2 ∇2 2 − ∇2 2∇3 3 ∇3 3 ∗  µ 2 +( v )2 2 v v +( v )2 + v + v ∇3 3 − ∇3 3∇1 1 ∇1 1 2 ∇i j ∇j i i=6 j  X  ∗ 2µ 2 2 2 T : ~v = 1v1 2v2 + 2v2 3v3 + 3v3 1v1 ⇒ ∇ 3 ∇ − ∇ ∇ − ∇ ∇ − ∇ (129)  2 2 2  + µ∗ v + v  + v + v  + v + v  ∇1 2 ∇2 1 ∇2 3 ∇3 2 ∇3 1 ∇1 3      An application to viscosity 45

Stone and Norman (1992, ApJS, 80, p. 789) state that TW claim that in the context of a numerical algorithm, representing the viscous energy generation term as a sum of squares as in equation (129) is an absolute necessity, because all other formulations eventually lead to instabilities. Since equations (128) and (129) are algebraically equivalent and thus, in a computer code, identical to machine round-off error, I cannot understand why such a claim would be made and why, for example, equation (128) wouldn’t have the same stability properties as equation (129). Centring equation (127) is awkward since Tij is zone centred for i = j and edge-centred for i = j, while vj are face-centred. Thus, numerous and seemingly unnatural 2- and 4-point averaging6 would be necessary to evaluate all products in (T ~v) using equation (127). Still, it is this form that the term is a perfect divergence and∇· thus most· useful in representing the total energy equation in a conservative fashion. Alternately, using the identity:

(T ~v) = T : ~v +( T) ~v, (130) ∇· · ∇ ∇· · (Theorem 5.2, 5.9) quantities in all products are now co-spatial, while 2- and 4-point are § still needed to bring some—not all—of the terms to the zone centres. While the centring of the RHS of equation (130) may seem more natural than the LHS, the RHS is not in conservative form, and this deficit may trump the centring advantage. This can determined only by direct experimentation. Finally, note that in Cartesian coordinates, ignoring all diagonal components, dropping the ~v terms in equations (118)–(120), and letting ~v in equation (117) ∂ivi in the i direction,∇· equations (124)–(126) reduce to: ∇· →

T = 2 ∂ (µ∗∂ v ), ∂ (µ∗∂ v ), ∂ (µ∗∂ v ) , (131) ∇· x x x y y y z z z equation (127) reduces to: 

(T ~v) = 2 ∂ (v µ∗∂ v )+ ∂ (v µ∗∂ v )+ ∂ (v µ∗∂ v ) , (132) ∇· · x x x x y y y y z z z z while equation (128) reduces to: 

T : ~v = 2µ∗ (∂ v )2 +(∂ v )2 +(∂ v )2 . (133) ∇ x x y y z z Equations (131)–(133) are the vNR expressions for the artificial viscosity in the subroutine viscous in ZEUS, when µ = 0 and µ∗ is taken to be (equation 117):

µ + µ = 2q lρc 2q l2ρ min 0, ∂ v . l q 1 s − 2 i i qlin qcon  |{z} |{z}