Calculus, Early Transcendentals by Stewart, Section 14.6.
Introduction.
It is natural to ask about the rate of change of a function \(f(x,y)\) as the arguments change in any direction around a point \((x_0,y_0)\) not just along the coordinate axes, and to ask questions like in which direction is change the fastest.
The cautionary Example 4.4.5 of the "uncomfortable saddle" in Section 4.4 shows that the partial derivatives do not always answer this question.
On the other hand, when a function is differentiableat the point, it is well approximated by the tangent plane there, and then this linear approximation becomes a good candidate for giving information about the rate of change in any direction, from the partial derivatives alone.
Directional Derivatives.
A direction of change in the plane can be specified by a unit vector \(\vec{u} = \vector{u_1,u_2}\text{,}\) and we can consider how \(f(x,y)\) changes in this direction near \((x_0,y_0)\) looking at a "slice" of the function, along the line \(\vector{x_0,y_0}+t\vec{u}\text{.}\) The value of the function along this line is \(f(x_0+t u_1,y_0+t u_2)\) and its rate of change is given by the Chain Rule as
This is the directional derivative of \(f\) at \((x_0,y_0)\), denoted \(D_{\vec{u}}f(x_0,y_0)\text{,}\) and it does indeed depend only on the partial derivatives at the point.
Note that its value is the same as if one used the linear approximation \(T\) at that point in place of \(f\text{.}\)
Directional Derivatives Defined With Limits.
Equivalently, the directional derivative can be defined in terms of limits as
This exists when \(f\) is differentiable at the point \((x_0,y_0)\text{.}\)
To summarize, for any unit vector \(\vec{u} = \vector{u_1,u_2}\) (or indeed any non-zero vector) and any function \(f\) differentiable at \((x_0,y_0)\text{,}\) the directional derivative of \(f\) at \((x_0,y_0)\) in direction \(\vec{u}\) is
The vector \(\vector{f_x(x_0,y_0),f_y(x_0,y_0)}\) appearing in the formula for the directional derivative encapsulates all information about directional and partial derivatives of \(f\) at \((x_0,y_0)\) in a way that has a nice geometrical meaning.
It is called the gradient vector of \(f\) at \((x_0,y_0)\), and denoted \(\text{grad} f\) or \(\nabla f\text{,}\) the latter sometimes pronounced "del f".
so the gradient contains all information about directional derivatives.
Tangent Lines to Level Curves.
If \(\ds\frac{\partial F}{\partial y} \neq 0\) at point \((x_0,y_0)\text{,}\) the implicit function theorem says that the level curve \(C\) of \(F(x,y)\) for value \(k=F(x_0,y_0)\) is described nearby by a function \(y=f(x)\text{.}\)
Then Chain Rule differentiation of \(k=F(x,f(x))\) gives
Thus the tangent line to the level curve through this point has this slope, and \(\vector{-\frac{\partial F}{\partial y}(x_0,y_0),\frac{\partial F}{\partial x}(x_0,y_0)}\) is a tangent vector to the curve. This is perpendicular to the gradient vector \(\vector{\frac{\partial F}{\partial x}(x_0,y_0),\frac{\partial F}{\partial y}(x_0,y_0)}\text{,}\) so the gradient at such a point on the curve is normal to the tangent line to the level curve at that point, and can be considered normal to the level curve \(C\text{.}\)
Similarly, if \({\partial F}/{\partial x} \neq 0\) at any point, swapping \(x\) and \(y\) above shows that part of the described by an implicit function \(x=g(y)\text{,}\) and again the gradient vector is normal to the level curve. Hence,
Theorem4.6.1.The Gradient is Normal to Level Curves.
At any point \((x_0,y_0)\) where \(F(x,y)\) is differentiable and its gradient \(\nabla F(x_0,y_0)\) is non-zero, this gradient vector is normal to the level curve of \(F\) through that point, in that it is normal to the line tangent to the level curve at that point.
Maximizing the Directional Derivative.
The gradient gives the direction in which the directional derivative is greatest, and is thus the direction of most rapid increase of the value of the function.
One physical interpretation is that if the function value is altitude, the gradient vector indicates the direction "straight up-hill". To see this, recall that if the angle between \(\nabla F\) at \((x_0,y_0)\) and a unit vector \(\vec{u}\) is \(\theta\text{,}\)
and this has maximum value when \(\cos \theta = 1\text{,}\) which is when \(\theta=0\text{,}\) so \(\vec{u}\) is a positive multiple of \(\nabla F\text{.}\) Thus \(\vec{u} = {\nabla F}/{|\nabla F|}\) gives the direction in which \(D_{\vec{u}}F\) is greatest and so \(F\) is increasing the fastest. Further, the maximum value of the directional derivative is then \(|\nabla F|\text{,}\) because \(|\vec{u}|=1.\)
Aside: the Directions of Fastest Decrease and of No Change.
The opposite direction \(-\nabla F\) gives fastest decrease of \(F\text{.}\)
In between, moving perpendicular to \(\nabla F\) is moving tangent to the level curve, which is what happens at that point if movement is along the level curve. Thus moving perpendicular to the direction of fastest increase or decrease in \(F\) is moving in the "direction of no change in \(F\)", given by moving along a level curve.
The Implicit Function Theorem in Terms of The Gradient.
Theorem4.6.2.
If at a point \(P(x_0,y_0)\) on a level set \(F(x,y)=k\) the gradient is non-zero (\(\nabla f(x_0,y_0) \neq \vec{0}\)) then there is a differentiable parametric curve \(x=f(t), y=g(t)\) which passes through the point \((x_0,y_0)\) and lies in the level set \(F(x,y)=k\text{:}\)\(F(f(t), g(t))=k\text{.}\)
Also, the parameter can be chosen to be one of \(x\) or \(y\) and so one can ensure than \(\frac{d}{dt}\vector{x(t),y(t)}\) is a multiple of \(\vector{F_y, -F_x}\) (a normal to \(\nabla F\)), ensuring that this part of the level set near the point \(P\) is a smooth curve.
Thus, if the gradient of \(F\) is non-zero everywhere on this level set, the whole level set is a collection of smooth curves. Even if \(\nabla F\) is zero at some points, the rest of the level set is a collection of smooth curves.
Proof.
(Sketch)
At least one of the components \(F_x(x_0,y_0)\) and \(F_y(x_0,y_0)\) of the gradient is non-zero, so at least one option in Theorem 4.5.5 in Section 4.5 applies, and the parameter \(t\) can always be chosen to be one of \(x\) or \(y\text{.}\) Then either \(dx/dt = 1\) or \(dy/dt = 1\text{,}\) so the velocity is non-zero, ensuring smoothness.
Exercise4.6.3.
Consider the level sets \(F(x,y) = x^2 - y^2 = k\text{.}\) Break it up into the three cases
\(\displaystyle k \gt 0\)
\(\displaystyle k \lt 0\)
and the exceptional case \(k = 0\)
Functions of Three Variables.
For a differentiable function \(f\) of three variables one can likewise define the directional derivative of in direction \(\vec{u}=\vector{u_1,u_2,u_3}\)
and again the directional derivative is greatest in the direction of the gradient.
Theorem4.6.4.The Implicit Function Theorem in 3D.
If at a point \(P(x_0,y_0,z_0)\) on a level set \(F(x,y,z)=k\) the gradient is non-zero then there is a differentiable parametric surface \(x=f(t,s), y=g(t,s), z=h(t,s)\) which passes through the point \((x_0,y_0,z_0)\) and lies in the level set \(F(x,y,z)=k\text{:}\)\(F(f(t,s), g(t,s), h(t,s))=k\text{.}\)
Further, the parameters can be chosen to be one of the pairs \((x,y)\text{,}\)\((x,z)\) or \((y,z)\text{,}\) which ensures that this part of the level set near the point \(P\) is a smooth surface approximated well by a tangent plane.
Tangent Planes to Level Surfaces.
For a function \(F\text{,}\) consider the level surface \(S\) given by \(F(x,y,z)=k\) through a point \(P(x_0,y_0,z_0)\text{,}\) consider and any curve \(\vec{r}(t) = \vector{x(t),y(t),z(t)}\) that lies in this level surface and passes through this point when \(t=t_0\text{.}\) The composition of \(F\) with these three component functions give the constant function \(F(x(t),y(t),z(t))=k\text{,}\) and by the Chain Rule, its zero derivative is also
In particular \(\nabla F(x_0,y_0,z_0) \cdot \vec{r}'(t_0) = 0\text{.}\)
The possible directions \(\vec{r}'(t_0)\) for a curve passing through this point and staying in the level curve are thus all orthogonal to \(\nabla F(x_0,y_0,z_0)\) and thus are directions in the plane:
Thus it is natural to call this plane the tangent plane to this level surface \(S\) at point \(P\) and to say that the direction of \(\nabla F(x_0,y_0,z_0)\) is normal to \(S\) at \(P\text{.}\)
Normal Lines to Level Surfaces.
The line through this point normal to the surface is called the normal line to \(S\) through \(P\), and has symmetric equations
An important special case is the tangent plane to the graph of a function of two variables, \(z=f(x,y)\text{.}\) This is given as a level surface by \(F(x,y,z)=f(x,y)-z=0\text{,}\) so \(F_z(x,y,z)=-1\text{,}\) leading to the equation