Yao Yao on June 7, 2018
$\newcommand{\icol}[1]{ \bigl[ \begin{smallmatrix} #1 \end{smallmatrix} \bigr] }$

## Gradient Field: a better way to interpret

Gradient and Directional Derivative 举了 $z = f(x,y) = 4x^2 + y^2$ 这个例子，但是举得并不好，因为它混淆了 function 的 gradient 和图形的 gradient，虽然它后面是用 level set 去解释的，相当于用平行于 $x \text{-} y$ 平面的平面去切这个椭圆抛物面，但是理解起来还是有点麻烦。

$\nabla f(x,y) = \langle 8x,2y \rangle = \icol{8x \newline 2y}$ 其实是这么一个 vector field (以下都是 Wolfram 代码)：

VectorPlot[{8x, 2y}, {x, -3, 3}, {y, -3, 3}]


VectorPlot3D[{8x, 2y, 0}, {x, -3, 3}, {y, -3, 3}, {z, -3, 3}]


# Wolfram 类似 IPython Notebook，%2表示第二个 cell 的 output，即上图
Show[%2,ViewPoint->{0,0,\[Infinity]}]


## Clairaut’s Test

Given a vector field $\vec F(x, y) = \langle P(x, y), Q(x, y) \rangle$, how do you tell whether it’s a gradient field, i.e. $\exists G(x,y)$ such that $\nabla G = \vec F$?

Clairaut Test: if $P_y(x, y) = Q_x(x, y)$ always holds, then $\vec F(x, y) = \langle P(x, y), Q(x, y) \rangle$ is a gradient field.

Note that $P_y(x, y) = \frac{\partial P(x, y)}{\partial y}, Q_x(x, y) = \frac{\partial Q(x, y)}{\partial x}$, just a different set of notations.

Clairaut’s Test orginates from Clairaut’s theorem on equality of mixed partials:

Suppose $f$ is a real-valued function of two variables $x,y$ and $f(x,y)$ is defined on an open subset $U$ of $\mathbb{R}^2$. Suppose further that both the second-order mixed partial derivatives $f_{xy}(x,y)$ and $f_{yx}(x,y)$ exist and are continuous on $U$. Then, we have $f_{xy} = f_{yx}$ on all of $U$.

## Hamiltonian Vector Field

If $H(x, y)$ is a function of two variables, then $\langle H_y(x, y), −H_x(x, y) \rangle$ is called a Hamiltonian Vector Field.

An example is the harmonic oscillator $H(x, y) = x^2 + y^2$. Its vector field $\langle Hy(x, y), − Hx(x, y) \rangle = \langle y, −x \rangle$.

The flow lines of a Hamiltonian vector fields are located on the level curves of $H$