TITLE: Divergence as transpose of gradient?
QUESTION [35 upvotes]: In his online lectures on Computational Science, Prof. Gilbert Strang often interprets divergence as the "transpose" of the gradient, for example here (at 32:30), however he does not explain the reason.
How is it that the divergence can be interpreted as the transpose of the gradient?

REPLY [35 votes]: Here is a considerably less sophisticated point of view than some of the other answers.  Recall that the dot product of vectors can be obtained by transposing the first vector.  That is,
$$
\textbf{v}^T \textbf{w} \;=\; \begin{bmatrix}v_x & v_y & v_z\end{bmatrix}\begin{bmatrix}w_x \\ \\ w_y \\  \\w_z\end{bmatrix} \;=\; v_x w_x + v_y w_y + v_z w_z \;=\; \textbf{v}\cdot \textbf{w}.
$$
(Here we are thinking of column vectors as being the "standard" vectors.)
In the same way, divergence can be thought of as involving the transpose of the $\nabla$ operator.  First recall that, if $g$ is a real-valued function, then the gradient of $g$ is given by the formula
$$
\nabla g \;=\; \begin{bmatrix}\partial_x \\ \\ \partial_y \\ \\ \partial_z \end{bmatrix}g \;=\; \begin{bmatrix}\partial_xg \\ \\ \partial_yg \\ \\ \partial_zg \end{bmatrix}
$$
Similarly, if $F=(F_x,F_y,F_z)$ is a vector field, then the divergence of $F$ is given by the formula
$$
\nabla^T F \;=\; \begin{bmatrix}\partial_x & \partial_y & \partial_z\end{bmatrix}\begin{bmatrix}F_x \\ \\ F_y \\ \\ F_z\end{bmatrix} \;=\; \partial_xF_x + \partial_yF_y + \partial_zF_z.
$$
Thus, the divergence corresponds to the transpose $\nabla^T$ of the $\nabla$ operator.
This transpose notation is often advantageous.  For example, the formula
$$
\nabla^T (gF) \;=\; (\nabla^T g)F \,+\, g(\nabla^T F)
$$
(where $\nabla^T g$ is the transpose of the gradient of $g$) seems much more obvious than
$$
\text{div} (gF) \;=\; (\text{grad } g)\cdot F \,+\, g\;\text{div } F.
$$
Indeed, this is the formula that leads to the integration by parts used in the video:
$$
\int\!\!\int g (\nabla^T F)\,dx\,dy \;=\; -\int\!\!\int (\nabla g)^T F \,dx\,dy.
$$