Skip to main content

Section 9.4 Gradients

Subsection 9.4.1 Definition of the Gradient

After partial derivatives, I want to proceed to define several other generalizations of the derivative. The first is the gradient.

Definition 9.4.1.

The gradient of a function \(f: \RR^n \rightarrow \RR\) is written \(\nabla f\) and defined as

\begin{equation*} \nabla f = \left( \frac{\del f}{\del x_1}, \frac{\del f}{\del x_2}, \ldots, \frac{\del f}{\del x_n} \right) \end{equation*}

The gradient is a new function \(\RR^n \rightarrow \RR^n\text{.}\) It ouputs the vector of partial derivatives of \(f\) at any point in its domin. Note that the gradient is a local direction vector in the domain.

Subsection 9.4.2 Interpretation of the Gradient

The best interpretation of the gradient comes from contour plots. Like the gradient, countour plots live in \(\RR^n\text{,}\) the domain, and show the level (hyper)surfaces of the function. If, as in \(\RR^2\text{,}\) I interpret the function as a height function and the countour plot as a topographical map, the gradient shows direction of greatest increase.

If we draw topographical lines on a countour plot, the gradient will always be locally perpendicular to those lines and will point in the direction of greatest increase. Rephrased, this is a useful result: \(\nabla f\) is always the normal to the level sets of \(f\text{.}\) If those level sets are hypersurfaces, their tangent (hyper)planes can be determined by the normal \(\nabla f\text{.}\)

Subsection 9.4.3 Gradient Examples

A central example of gradients is found by considering the gravitational potential energy function caused by a mass \(M\) at the the origin. Another object of mass \(m\) and position \((x,y,z)\) has potential gravitational energy of

\begin{equation*} P = \frac{-GmM}{\sqrt{x^2 + y^2 +z^2}}\text{.} \end{equation*}

By convention, this potential energy is negative. It approaches \(-\infty\) in the limit at the origin, and approaches \(0\) as the distance from the origin grows to \(\infty\text{.}\) I'll writ the gradient of this potential energy; I seperate it into two pieces, one of magnitude and one of diection (where direction is given by a unit vector).

\begin{equation*} \nabla P = \frac{GmM}{\sqrt{(x^2 + y^2 +z^2)^3}} (x, y, z) = \frac{GmM}{x^2 + y^2 + z^2} \frac{1}{\sqrt{x^2 + y^2 + z^2}} (x,y,z)\text{.} \end{equation*}

This is precisely the force of gravity. The gradient points in the direction of maximum increase in potential energy (directly outward from the origin) with magnitude \(\frac{GmM}{r^2}\) where \(r\) is the distance between the two objects. This is a common situation we will discuss in Calculus IV: many forces are the result of gradients of potential energy functions. These forces are called conservative forces. Gravity, like these other forces, can be thought of as the tendency for objects to lower their potential energy as efficiently as possible.

In another example, consider a function \(p(x,y,z)\) which measures the pressure in a rotating cylindrial drum. (Think of a centrifuge). With bounds \(z \in [0,5]\) and \(x,y \in [0, \sqrt{3}]\text{,}\) the function is

\begin{equation*} p(x,y,z) = \frac{1}{z+1} (x^2 + y^2) \end{equation*}

The gradient is

\begin{equation*} \nabla p(x,y,z) = \left( \frac{2x}{z+1}, \frac{2y}{z+1}, \frac{-(x^2 + y^2)}{(z+1)^2} \right) \end{equation*}

This points in the direction of greatest increase in pressure. It is perpendicular to the surfaces of constant pressure. If there is a difference in media in the drum, the lighter medium will be force towards the edges of the drum in the direction of this gradient.

Subsection 9.4.4 Extensions of the Gradient

In addition to the gradient, \(\nabla\) itself is the following differential operator.

\begin{equation*} \nabla = \left( \frac{\del}{\del x_1}, \frac{\del}{\del x_2}, \frac{\del}{\del x_3}, \ldots, \frac{\del}{\del x_n} \right) \end{equation*}

This is a vector-valued differential operator: it outputs the vector of partial derivatives \(\nabla f\text{.}\) Now that I have defined this operator, there are other operations I can use it for. Most of those operations come in Calculus IV, but I can define one such operation here.

Definition 9.4.4.

If \(f: \RR^n \rightarrow R\) is a scalar function, the Laplacian of \(f\) is given by applying \(\nabla\) twice. Since \(\nabla\) outputs a vector, the second application uses the dot product to output a scalar.

\begin{align*} \nabla^2 f \amp = \nabla \cdot \nabla f = \left( \frac{\del}{\del x_1}, \frac{\del}{\del x_2}, \frac{\del}{\del x_3}, \ldots, \frac{\del}{\del x_n} \right) \cdot \left( \frac{\del f}{\del x_1}, \frac{\del f}{\del x_2}, \frac{\del f}{\del x_3}, \ldots, \frac{\del f}{\del x_n} \right)\\ \amp = \frac{\del^2 f}{\del^2 x_1} + \frac{\del^2 f}{\del^2 x_2} + \frac{\del^2 f}{\del^2 x_3} + \ldots \frac{\del^2 f}{\del^2 x_n} \end{align*}

The Laplacian, as a second derivative, measure some kind of multi-dimensional concavity. I considered the heat equation in one dimension; in that equation, concavity measured local displacement from equilibrium. The Laplacian does the same in multiple dimensions. The general Heat Equation is

\begin{equation*} \frac{\del u}{\del t} = \alpha \nabla^2 u\text{.} \end{equation*}

Similarly, the general Wave Equation is

\begin{equation*} \frac{\del^2 u}{\del t^2} = \alpha \nabla^2 u\text{.} \end{equation*}