B.1. Vector calculus¶
Many quantities in the study of galaxies are scalar or vector functions of vectors and working with these requires a good knowledge of vector calculus. For example, the gravitational potential \(\Phi(\vec{x})\) is a scalar-valued function of a three-dimensional position vector, the gravitational field \(\vec{g}(\vec{x})\) is a vector-valued function of the position vector, and a distribution function \(f(\vec{w},t)\) is a scalar-valued function of the six-dimensional phase-space vector \(\vec{w}\) and scalar time. Because these quantities are often related through differential equations, we briefly summarize important concepts and relations in the study of vector calculus in this section.
One of the simplest vector-calculus operations is the gradient \(\nabla f(\vec{x})\) of a scalar function \(f(\vec{x})\). The gradient is a vector-valued function that in Cartesian coordinates with unit vectors \((\vec{\hat{e}}_x,\vec{\hat{e}}_y,\vec{\hat{e}}_z)\) is given by \begin{equation}\label{eq-math-veccalc-gradient-cartesian} \nabla f = \vec{\hat{e}}_x\,\frac{\partial f}{\partial x} + \vec{\hat{e}}_y\,\frac{\partial f}{\partial y}+\vec{\hat{e}}_z\,\frac{\partial f}{\partial z}\,. \end{equation} In other coordinate systems, the gradient takes a different form. For example, in spherical coordinates, the gradient is given by Equation (A.7) and in cylindrical coordinates the gradient is given by Equation (A.13). In galactic dynamics, the gravitational field is equal to minus the gradient of the gravitational potential: \(\vec{g}(\vec{x}) = - \nabla \Phi(\vec{x})\) (see Chapter 2.1) .
Given a vector-valued function \(\vec{g}(\vec{x})\), the divergence \(\nabla \cdot \vec{g}(\vec{x})\) is a scalar-valued function that in Cartesian coordinates is given by \begin{equation}\label{eq-math-veccalc-divergence-cartesian} \nabla \cdot \vec{g} (\vec{x}) = {\partial g_x \over \partial x} + {\partial g_y \over \partial y} + {\partial g_z \over \partial z} \,, \end{equation} where \((g_x,g_y,g_z)\) are the components of \(\vec{g}(\vec{x})\). The Laplacian \(\nabla^2 f(\vec{x})\) of a scalar-valued function is the divergence of the gradient of that function, that is, \begin{equation}\label{eq-math-veccalc-laplacian-definition} \nabla^2 f = \nabla \cdot \left(\nabla f\right)\,. \end{equation} In Cartesian coordinates, the Laplacian is given by \begin{equation}\label{eq-math-veccalc-laplacian-cartesian} \nabla^2 f = {\partial^2 f \over \partial x^2} + {\partial^2 f \over \partial y^2} + {\partial^2 f \over \partial z^2} \,. \end{equation} In spherical and cylindrical coordinates, the Laplacian is given by Equation (A.8) and (A.14), respectively. The Laplacian appears in the Poisson equation relating the gravitational potential to the density (Equation 2.2).
The curl \(\nabla \times \vec{g}\) of a vector field describes the amount of circulation present in the field and we need it in this book when discussing the growth of primordial density fluctuations. The formula for the components of the curl in Cartesian coordinates simply follows that of the usual cross product applied to the gradient \(\nabla\) and the vector field. So, for example, \((\nabla \times \vec{g})_x = \left(\partial g_z / \partial y - \partial g_y / \partial z\right)\). A curl-free vector-field is one without any circulation. One important property of the curl is that vector fields obtained as the gradient of a scalar are curl-free, that is, \(\nabla \times (\nabla f) = 0\), where \(f(\vec{x})\) is a scalar-valued function. This is straightforward to show in Cartesian coordinates.
In various places in this book, we need the divergence theorem to convert volume integrals over the divergence of a vector field into surface integrals of the vector field projected onto the surface’s normal (where the volume can be either the three-dimensional spatial volume or the six-dimensional phase-space volume). The divergence theorem states that these integrals are related as \begin{equation}\label{eq-math-veccalc-divergencetheorem} \int_V\mathrm{d}V\,\nabla \cdot \vec{g} = \int_S\mathrm{d}S\,\vec{\hat{n}}\,\cdot \vec{g}\,, \end{equation} where \(V\) is a volume and \(S\) is its surface area and \(\vec{\hat{n}}\) is the outward-pointing unit vector perpendicular to the surface. The two-dimensional version of the divergence theorem, where we use a two-dimensional version of the divergence from Equation (B.2), is known as Green’s theorem. In particular, setting \(\vec{g} = (x,-y)\), we can derive that \begin{equation}\label{eq-math-veccalc-greenstheorem-specialcase} \int_S\mathrm{d}x\,\mathrm{d}y = \oint_\gamma\mathrm{d}y\,x\,, \end{equation} where \(\gamma\) is the boundary of the area \(S\).
In Chapter 3.1, we need the gradient theorem, which states that for any line \(\gamma\) connecting a point \(\vec{x_1}\) to a point \(\vec{x_2}\) we have that \begin{equation}\label{eq-math-veccalc-gradienttheorem} \int_\gamma \mathrm{d}\vec{x}\,\nabla f(\vec{x}) = f(\vec{x}_2) - f(\vec{x}_1)\,, \end{equation} where \(f\) is a scalar function of \(\vec{x}\). Thus, line integrals of gradient fields are path independent.