As explained in Section 4.1 the partial derivatives of a function of several variables represent the change of the function along a cross-section through its graph parallel to one of the coordinate axes. These directions are quite arbitrary as, at one stage, we made a choice of coordinates. It is therefore natural to look at cross-sections through the graph of a function in other directions, not just the coordinate directions. We want to derive a formula to compute such derivatives. To do so let \(\vect v\in\mathbb R^N\) be a unit vector, that is, a vector of length one. Given a real valued function \(f\) defined on a set \(D\subset\mathbb R^N\) and \(\vect a\in D\) the graph of the function
represents the cross-section through the graph of \(f\) at \(\vect a\) in the direction of \(\vect v\text{.}\) The situation is depicted in Figure 4.24.
Definition4.25.Directional derivative.
Suppose \(\vect v\) is a unit vector. If \(\vect a\) is an interior point of the domain \(D\subset\mathbb R^N\) of \(\vect f\) then, if the limit exists,
is called the directional derivative of \(f\) at \(\vect a\) in the direction of \(\vect v\).
Remark4.26.
Sometimes the notation
\begin{equation*}
\frac{\partial}{\partial\vect v}f(\vect a)
=\frac{\partial f}{\partial\vect v}(\vect a)
=f_{\vect v}(\vect a)
=\partial_{\vect v}f(\vect a)
\end{equation*}
is used for the directional derivative at \(\vect a\) in the direction of \(\vect v\text{.}\)
the \(i\)-th vector of the standard basis of \(\mathbb R^N\text{.}\) Clearly \(\|\vect e_i\|=1\text{,}\) so \(\vect e_i\) is a unit vector. By comparing the definitions we see that
\begin{equation*}
\frac{\partial}{\partial\vect e_i}f(\vect a)
=\frac{\partial}{\partial x_i}f(\vect a),
\end{equation*}
so that the notion of a directional derivative is a direct generalisation of the partial derivatives as motivated at the start of this section.
We next want to derive a formula to compute the directional derivatives of a function.
Proposition4.28.
Let \(\vect a\) be an interior point of the domain \(D\subset\mathbb R^N\) of \(f\text{.}\) If \(\vect v\) is a unit vector, and \(\grad f\) is continuous at \(\vect a\text{,}\) then
\begin{equation}
\frac{\partial}{\partial\vect v}f(\vect a)
=\bigl(\grad f(\vect a)\bigr)\cdot\vect v\text{.}\tag{4.3}
\end{equation}
We use the chain rule to prove the formula. To do so set \(\vect g(t):=\vect a+t\vect v\text{.}\) Then we have \(\vect g'(t)=\vect v\) for all \(t\text{.}\) Hence by the definition of directional derivatives and the chain rule (see Theorem 4.17) we have
\begin{equation*}
\frac{\partial}{\partial\vect v}f(\vect a)
=\frac{d}{dt}(f\circ\vect g)(0)
=\bigl(\grad f(\vect g(0))\bigr)\cdot\vect g'(0)
=\bigl(\grad f(\vect a)\bigr)\cdot\vect v
\end{equation*}
as required.
Remark4.29.
We saw in Remark 4.11 that the existence of the partial derivatives at a point does not imply that the function is continuous at that point. The same function as considered there shows that the existence of all directional derivatives is not in general enough to guarantee the continuity of a function! As an exercise show that the function (3.4) has directional derivatives in every direction at \((0,0)\text{.}\) From Example 3.30 we know that \(f\) is not continuous at \((0,0)\text{.}\)