In the previous section, we found that if a surface is described by z=f(x,y), the partial derivatives ∂z/∂x and ∂z/∂y describe the rate of change of z when we travel parallel to the x axis and parallel to the y axis, respectively. The question now is, what if we travel in a different direction, say along an arbitrary vector v⃗? The answer is that we need to use the directional derivative. This is nothing more than a weighted average of the partial derivatives, where the weights are the components of the direction vector (for which we'll need to use a unit vector; this is important).
Definition
If f(x,y) is a differentiable function, then the directional derivative of f in the direction of a unit vector v^=⟨v1,v2⟩ is given by
Dvf(x,y)=fx(x,y)v1+fy(x,y)v2.
At a point (a,b,f(a,b)):
Dvf(a,b)=fx(a,b)v1+fy(a,b)v2
Find the directional derivative of f(x,y)=4x2+9y2 at (2,3,2) in the direction of v=⟨3,4⟩.
Solution
First, find the unit vector in the direction of v⃗:
v^=5⟨3,4⟩=⟨53,54⟩
Next, find the partial derivatives:
fxfy=2x⟶fx(2,3)=1=92y⟶fy(2,3)=32
Finally, plug these into the directional derivative formula:
Dv=1(53)+32(54)=1517
The interpretation of this is that for every unit you travel in the direction of this vector, z increases by 17/15.
Find the directional derivative of f(x,y)=41(x2+2y2)+2 at (3,2) in the direction of u⃗=⟨1,1⟩ and v⃗=⟨1,−3⟩.
DuDv=227≈2.47=43−3≈−0.98
Find the directional derivative of f(x,y)=3x2+y3 at (3,2) in the direction of u=⟨5,12⟩.
Du=18
Gradient
The gradient of f(x,y), denoted by the "del" operator ∇, is a vector that points in the direction of steepest ascent on the surface z=f(x,y). The magnitude of this vector is the slope in that direction (i.e. the largest slope at that point).
Definition
The gradient of f(x,y) is
∇f(x,y)=⟨fx(x,y),fy(x,y)⟩=fx(x,y)ı^+fy(x,y)ȷ^
At a point (a,b,f(a,b)):
∇f(a,b)=fx(a,b)ı^+fy(a,b)ȷ^
Note
Dvf(x,y)=∇f(x,y)⋅v^
Find the gradient of f(x,y)=4x2+9y2 at (2,3,2).
Solution
∇f(x,y)∇f(a,b)=2xı^+92yȷ^=ı^+32ȷ^
A hill has a shape given by f(x,y)=1000−0.01x2−0.02y2.
In which direction should you travel from (60,100,764) to reach the top the fastest?
What is the slope in that direction?
Solution
Find the gradient:
∇f(x,y)∇f(60,100)=−0.02xı^−0.04yȷ^=−1.2ı^−4ȷ^
Thus, to reach the top the fastest, you should travel in the direction of ⟨−1.2,−4⟩.
The slope in that direction is the magnitude of the gradient:
∣∇f(60,100)∣=1.22+42=4.18
Note that if you traveled in the opposite direction (⟨1.2,4⟩), the slope would be −4.18.
Note
∇f(x,y) points to the steepest ascent, −∇f(x,y) points to the steepest descent, and the directional derivative is zero in any direction orthogonal to ∇f(x,y).
For instance, using the hill from the previous example, if you travel in the direction of ⟨−4,−1.2⟩ from (60,100,764), you'll keep the same elevation.
Consider the function f(x,y)=3x2−2y2.
Compute ∇f(x,y) and ∇f(2,3).
Consider the unit vector u^=⟨cosθ,sinθ⟩. At (2,3), for what values of θ between 0 and 2π does the directional derivative have its maximum and minimum values?
Solution
Find the gradient:
∇f(x,y)∇f(2,3)=6xı^−4yȷ^=12ı^−12ȷ^
Find the directional derivative in the direction of u^:
Duf(x,y)=∇f(x,y)⋅u^⟶Duf(2,3)=12cosθ−12sinθ
To find the maximum and minimum values for this, take its derivative with respect to θ and set the derivative to 0 to find critical points:
Du′f(2,3)=−12sinθ−12cosθ=0⟶sinθ=−cosθ⟶θ=43π,47π
Note that the slope is zero if θ=4π,45π.
The gradient of a function of three variables is similar, with a third component: fz(x,y,z)k^.
Consider the function f(x,y,z)=x2+2y2+4z2−1.
Find the gradient of f at (2,0,0).
Find the directional derivative of f at (2,0,0) in the direction of u^=⟨31,31,31⟩.
Solution
Find the gradient:
∇f(x,y,z)∇f(2,0,0)=fx(x,y,z)ı^+fy(x,y,z)ȷ^+fz(x,y,z)k^=2xı^+4yȷ^+8zk^=4ı^=⟨4,0,0⟩
Find the directional derivative in the direction of u^:
Duf(2,0,0)=∇f(2,0,0)⋅⟨31,31,31⟩=343
Find the gradient of f(x,y)=4x2−2xy+y2.
∇f(x,y)=⟨8x−2y,−2x+2y⟩
Find the gradient of f(x,y)=12−4x2−y2.
∇f(x,y)=212−4x2−y21⟨−8x,−2y⟩
Find the gradient of f(x,y)=xe2xy.
∇f(x,y)=⟨e2xy+2xye2xy,2x2e2xy⟩
Find the unit vector that gives the direction of steepest ascent for the surface z=x2+4xy−y2 at (2,1).