# Divergence and directional derivative

I found the divergence formula:

\begin{align} \nabla \cdot \boldsymbol{u} = \left(\frac{\partial}{\partial x},\frac{\partial}{\partial y}\right) \cdot (u_1,u_2) = \frac{\partial u_1}{\partial x} + \frac{\partial u_2}{\partial y} \end{align} while the formula of directional derivative of a scalar field $f$ in the direction of $\boldsymbol{u}$ is:

\begin{align} \nabla f \cdot \boldsymbol{u} = \left(\frac{\partial f}{\partial x},\frac{\partial f}{\partial y}\right) \cdot (u_1,u_2) = u_1\frac{\partial f}{\partial x} + u_2\frac{\partial f}{\partial y} \end{align} My question is, why don't we have, in the second formula,

\begin{align} \nabla f \cdot \boldsymbol{u} = \left(\frac{\partial f}{\partial x},\frac{\partial f}{\partial y}\right) \cdot (u_1,u_2) = \frac{\partial (fu_1)}{\partial x} + \frac{\partial (fu_2)}{\partial y}? \end{align} Is it because the direction vector $\boldsymbol{u}=(u_1,u_2)$ in the latter is constant?

Usually $\nabla$ only acts on the object immediately to its right. Another indication that that can't be the correct interpretation is that "$\cdot$" is an operation on two vectors, and $f$ is a scalar, while $\nabla f$ is a vector, so $f \cdot u$ doesn't make sense.
Yes, the convention with $\nabla$ can be a bit confusing, so you may prefer to write the directional derivative as $\mathbf{u} \cdot \nabla f$, or $(\nabla f) \cdot \mathbf{u}$. (You also find it written as $(\mathbf{u} \cdot \nabla)f$ to emphasise that $\mathbf{u} \cdot \nabla$ is the directional derivative operator, which sends scalar fields to scalar fields.) If you think an expression can be ambiguous, it's always best to bracket it carefully, just as $\sin{x}y$ could mean either $(\sin{x})y$ or $\sin{(xy)}$.
(The object you have written on the right-hand side of the last displayed equation is actually the divergence of the vector field $f\mathbf{u}$, i.e. $\nabla \cdot (f\mathbf{u})$.)
• Thanks for your answer. So, as for the last displayed equation, can we also write it as $(\nabla f) \cdot \boldsymbol{u}$? Does it make sense? This is because, I found somewhere $(\nabla f) \cdot (f\boldsymbol{u})$ which I don't really understand. – mohd Jun 1 '18 at 1:47
• $$(\nabla f) \cdot \mathbf{u} = \frac{\partial f}{\partial x} u_1 + \frac{\partial f}{\partial y} u_2,$$ while $$(\nabla f) \cdot (f\mathbf{u})= f((\nabla f) \cdot \mathbf{u})$$ by linearity. You might find it easier to write out the differentiation operators as grad and div, since there will be fewer issues with what is actually a dot product and what is an operator. – Chappers Jun 1 '18 at 1:57