# 13.2: Fundamentals of Vector Calculus

- Page ID
- 7844

In order to develop continuous ﬁeld models, you need to know some basic mathematical concepts developed and used in vector calculus. A minimalistic quick review of those concepts is given in the following.

Definition: Contour

A *contour* is a set of spatial positions \(x\) that satisfy

\[f(x) = C\label{(13.2)}\]

for a scalar ﬁeld \(f\), where \(C\) is a constant (see an example in Figure \(\PageIndex{1}\)). Contours are also called level curves or surfaces.

Definition: Gradient

A *gradient* of a scalar ﬁeld \(f\) is a vector locally deﬁned as

\[∇f = \begin{pmatrix} \dfrac{\partial{f}}{\partial{x_{1}}} \\ \dfrac{\partial{f}}{\partial{x_{2}}} \\ \vdots \\ \dfrac{\partial{f}}{\partial{x_{n}}} \end{pmatrix} \label{(13.3)} \]

Here, \(n\) is the number of dimensions of the space.

The symbol \(∇\) is called “*del*” or “*nabla*,” which can be considered the following “vector” of differential operators:

\[\nabla =\begin{pmatrix} \dfrac{\partial}{\partial{x_{1}}} \\\dfrac{\partial}{\partial{x_{2}}}\\ \vdots \\ \dfrac{\partial}{\partial{x_{n}}} \end{pmatrix}\label{(13.4)}\]

A gradient of \(f\) at position \(x\) is a vector pointing toward the direction of the steepest ascending slope of \(f\) at \(x\). The length of the vector represents how steep the slope is. A vector ﬁeld of gradient \(∇f\) deﬁned over a scalar ﬁeld \(f\) is often called a *gradient ﬁeld* (See an example in Figure \(\PageIndex{2}\)). The gradient is always perpendicular to the contour that goes through \(x\) (unless the gradient is a zero vector; compare Figs. 13.2.1 and 13.2.2).

Definition: Divergence

A *divergence* of a vector ﬁeld \(v\) is a scalar ﬁeld deﬁned as

\[\nabla \cdot v = \left( \begin{array} { c } { \frac { \partial } { \partial x _ { 1 } } } \\ { \frac { \partial ^ { 1 } } { \partial x _ { 2 } } } \\ { \frac { \vdots } { \partial x _ { n } } } \end{array} \right) ^ { T } \left( \begin{array} { c } { v _ { 1 } } \\ { v _ { 2 } } \\ { \vdots } \\ { v _ { n } } \end{array} \right) = \frac { \partial v _ { 1 } } { \partial x _ { 1 } } + \frac { \partial v _ { 2 } } { \partial x _ { 2 } } + \ldots + \frac { \partial v _ { n } } { \partial x _ { n } }. \label{(13.5)}\]

Note the tiny dot between \(∇\) and \(v\), which indicates that this is an “inner product” of them. Don’t confuse this divergence with the gradient discussed above!

The physical meaning of divergence is not so straightforward to understand, but anyway, it literally quantiﬁes how much the vector ﬁeld \(v\) is “diverging” from the location \(x\). Let’s go through an example for a 2-D space. Assume that \(v\) is representing ﬂows of some “stuff” moving around in a 2-D space. The stuff is made of a large number of particles (like a gas made of molecules), and the ﬂow \(v = (v_x,v_y)\) means how many particles are going through a cross-section of the space per area per unit of time. In this 2-D example, a cross-section means a line segment in the space, and the total area of the section is just the length of the line segment.

Then, consider a temporal change of the number of particles, say \(N\), within a very small spatial area around (\(x\),\(y\)) Figure \(\PageIndex{3}\). The temporal change of \(N\) can be calculated by counting how many particles are coming into/going out of the area through each edge per unit of time, as

\[\frac{\partial{N}}{\partial{t}} =2hv_{x}(x-h,y) +2hv_{y}(x, y-h) -2hv_{x} (x+h,y) -2hv_{y}(x, y+h), \label{(13.6)}\]

where \(h\) is the distance from (\(x\),\(y\)) to each edge, and therefore the length of each edge is \(2h\).

Actually, Figure \(\PageIndex{3}\) may be a bit misleading; the particles can go in and out through any edge in both directions. But we use the \(+\) sign for \(v_{x}(x−h,y)\) and \(v_{y}(x,y−h)\) and the \(−\) sign for \(v_{x}(x + h,y)\) and \(v_{y}(x,y + h)\) in Eq. (\ref{(13.6)}), because the velocities are measured using the coordinate system where the rightward and upward directions are considered positive.

Since \(N\) depends on the size of the area, we can divide it by the area (\((2h)^{2}\) in this case) to calculate the change in terms of the concentration of the particles, \(c = N/(2h)^{2}\), which won’t depend on \(h\):

\[ \begin{align} \frac{\partial{c}}{\partial{t}} &= \frac{2hv_{x}(x-h, y) + 2hv_{y}(x, y-h) -2hv_{x}(x+h, y) -2hv_{y}(x, y+h)}{(2h)^{2}} \label{(13.7)} \\[4pt] &=\frac{v_{x} (x-h,y) +v_{y} (x, y-h) -v_{x}(x+h, y) -v_{y}(x, y+h)}{2h} \label{(13.8)} \end{align} \]

If we make the size of the area really small \((h → 0)\), this becomes the following:

\[ \begin{align} \frac{\partial{c}}{\partial{t}} &=\lim_{h \rightarrow{0}} \frac{v_{x}(x-h, y) +v_{y}(x, y-h) -v_{x}(x+h, y) -v_{x}(x+h, y) -v_{y}(x, y+h)}{2h}\label{(13.9)} \\[4pt] &=\lim_{h\rightarrow{0}} \begin{Bmatrix}(-\frac{ v_{x}(x+h, y)-v_{x}(x-h, y)}{2h}) +(-\frac{v_{y} (x, y+h) -v_{y} (x, y -h)}{2h}) \end{Bmatrix} \label{(13.10)} \\[4pt] &= -\frac{\partial{v_{x}}}{\partial{x}} -\frac{\partial{v_{y}}}{\partial{y}} \label{(13.11)} \\[4pt] &=−∇ \cdot{v}\label{(13.12)} \end{align} \]

In natural words, this means that the temporal change of a concentration of the stuff is given by a negative divergence of the vector ﬁeld \(v\) that describes its movement. If the divergence is positive, that means that the stuff is escaping from the local area. If the divergence is negative, the stuff is ﬂowing into the local area. The mathematical derivation above conﬁrms this intuitive understanding of divergence

Exercise \(\PageIndex{1}\)

Conﬁrm that the interpretation of divergence above also applies to 3-D cases.

Definition: Laplacian

A *Laplacian *of a scalar ﬁeld \(f\) is a scalar ﬁeld deﬁned as

\[∇^{2}f =∇ \cdot{∇f} ={\begin{pmatrix} \frac{\partial}{\partial{x_{1}}} \\ \frac{\partial}{\partial{x_{2}}} \\ \vdots \\ \frac{\partial}{\partial{x_{n}}} \end{pmatrix}}^{T} \begin{pmatrix} \frac{\partial}{\partial{x_{1}}} \\ \frac{\partial}{\partial{x_{2}}} \\ \vdots \\ \frac{\partial}{\partial{x_{n}}} \end{pmatrix} f = \frac{\partial^{2}{f}} {\partial{x^{2}_{1}}} +\frac{\partial^{2}{f}}{\partial{x^{2}_{2}}} +...+ \frac{\partial^{2}{f}} {\partial{x^{2}_{n}}}. \label{(13.13)} \]

Sometimes the Laplacian operator is denoted by a right side up triangle \(∆\) instead of \(∇^2\). This is so confusing, I know, but blame the people who invented this notation. In this textbook, we use \(∇^2\) instead of \(∆\) to denote Laplacians, because \(∇^2\) is more intuitive to show it is a second-order differential operator, and also because \(∆\) is already used to represent small quantities (e.g., \(∆x\)).

The gradient ﬁeld of \(f\) shows a diverging pattern where the scalar ﬁeld \(f\) is concave like a dip or a valley, or a converging pattern where \(f\) is convex like a hump or a ridge. Therefore, the Laplacian of \(f\), which is the divergence of the gradient ﬁeld of\(f\), has a positive value where \(f\) is concave, or a negative value where \(f\) is convex. This is similar to the second-order derivative of a mathematical function; a concave function has a positive second-order derivative while a convex function has a negative one. The Laplacian is a generalization of the same concept, applicable to functions deﬁned over a multidimensional domain.

Exercise \(\PageIndex{2}\)

Which of the following surface plots correctly illustrates the shape of a scalar ﬁeld \(f(x,y) = xy(x−1)\)?

Exercise \(\PageIndex{3}\)

Which of the following vector ﬁeld plots correctly illustrates the ﬂows given by a vector ﬁeld \(v(x,y) = (−xy,x−y)\)?

Exercise \(\PageIndex{4}\)

Calculate the gradient ﬁeld and the Laplacian of each of the following:

- \(f(x, y) =x^{2} +xy\)
- \(f(x,y) =e^{x+y}\)
- \(f(x, y, z) =\frac{x+y}{z}\)

Exercise \(\PageIndex{5}\)

Explain where in the \(x-y\) space the surface deﬁned by \(f(x,y) = 3x^{2} −xy^{3}\) switches between concave and convex.

Exercise \(\PageIndex{6}\)

So far, the gradient is deﬁned only for a scalar ﬁeld, but it is natural to deﬁne a gradient for a vector ﬁeld too. Propose a meaningful deﬁnition of \(∇v\) and discuss its physical meaning.