What is the difference between the gradient and the directional derivative?

The gradient is a vector; it points in the direction of steepest ascent.

The directional derivative is a number; it is the rate of change when your point in $\Bbb R^3$ moves in that direction. (You can imagine "reducing" your function to a function of a single variable, say $t$, by "slicing" the curve in that direction; the directional derivative is just then the 1-D derivative of that "sliced" function.)


Be careful that directional derivative of a function is a scalar while gradient is a vector.

The only difference between derivative and directional derivative is the definition of those terms. Remember:

  • Directional derivative is the instantaneous rate of change (which is a scalar) of $f(x,y)$ in the direction of the unit vector $u$.
  • Derivative is the rate of change of $f(x,y)$, which can be thought of the slope of the function at a point $(x_0,y_0)$.

Yes, the gradient is given by the row vector whose elements are the partial derivatives of $g$ with respect to $x$, $y$, and $z$, respectively. In your case the gradient at $(x,y,z)$ is hence $[-3x^2,9y^2,2z+2]$. The gradient at $(2,1,-1)$ is therefore $[-12,9,0]$.

The directional derivative at a point $(x,y,z)$ in direction $(u,v,w)$ is the gradient multiplied by the direction divided by its length. So if $u^2+v^2+w^2=1$ then the directional derivative at $(x,y,z)$ in direction $(u,v,w)$ is just $-3x^2 u + 9y^2v + (2z+2)w$.

If $u^2+v^2+w^2\neq 1$ then you should divide the number above by $\sqrt{u^2+v^2+w^2}$.

In sum, the gradient is a vector with the slope of the function along each of the coordinate axes whereas the directional derivative is the slope in an arbitrary specified direction.